From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 00:30:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EAC71065672; Sun, 6 Mar 2011 00:30:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D00E8FC13; Sun, 6 Mar 2011 00:30:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p260Ui48080938; Sun, 6 Mar 2011 00:30:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p260Uifd080935; Sun, 6 Mar 2011 00:30:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103060030.p260Uifd080935@svn.freebsd.org> From: Adrian Chadd Date: Sun, 6 Mar 2011 00:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219318 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 00:30:44 -0000 Author: adrian Date: Sun Mar 6 00:30:43 2011 New Revision: 219318 URL: http://svn.freebsd.org/changeset/base/219318 Log: Add an EEPROM op that extracts out the power table offset. It defaults to -5 dBm for eeproms earlier than v21. This apparently only applies to Merlin (AR9280) or later, earlier 11n chipsets have a power table offset of 0. All the code in ath9k which checks the power table offset and takes it into account first ensures the chip is Merlin or later. Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom.h Sat Mar 5 22:31:03 2011 (r219317) +++ head/sys/dev/ath/ath_hal/ah_eeprom.h Sun Mar 6 00:30:43 2011 (r219318) @@ -100,6 +100,7 @@ enum { AR_EEP_ANTGAINMAX_5, /* int8_t* */ AR_EEP_ANTGAINMAX_2, /* int8_t* */ AR_EEP_WRITEPROTECT, /* use ath_hal_eepromGetFlag */ + AR_EEP_PWR_TABLE_OFFSET /* int8_t* */ }; typedef struct { Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat Mar 5 22:31:03 2011 (r219317) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sun Mar 6 00:30:43 2011 (r219318) @@ -126,6 +126,13 @@ v14EepromGet(struct ath_hal *ah, int par case AR_EEP_ANTGAINMAX_5: *(int8_t *) val = ee->ee_antennaGainMax[0]; return HAL_OK; + case AR_EEP_PWR_TABLE_OFFSET: + if (IS_VERS(>=, AR5416_EEP_MINOR_VER_21)) + *(int8_t *) val = pBase->pwr_table_offset; + else + *(int8_t *) val = AR5416_PWR_TABLE_OFFSET_DB; + return HAL_OK; + default: HALASSERT(0); return HAL_EINVAL; From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 00:57:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D500B1065672; Sun, 6 Mar 2011 00:57:08 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3AC48FC13; Sun, 6 Mar 2011 00:57: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 p260v8Rg081530; Sun, 6 Mar 2011 00:57:08 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p260v8N5081528; Sun, 6 Mar 2011 00:57:08 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201103060057.p260v8N5081528@svn.freebsd.org> From: Steve Kargl Date: Sun, 6 Mar 2011 00:57: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: r219319 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 00:57:08 -0000 Author: kargl Date: Sun Mar 6 00:57:08 2011 New Revision: 219319 URL: http://svn.freebsd.org/changeset/base/219319 Log: Obligatory first commit to the include myself in the list of committers list. Approved by: das Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Mar 6 00:30:43 2011 (r219318) +++ head/share/misc/committers-src.dot Sun Mar 6 00:57:08 2011 (r219319) @@ -164,6 +164,7 @@ jonathan [label="Jonathan Anderson\njona julian [label="Julian Elischer\njulian@FreeBSD.org\n1993/??/??"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] kan [label="Alexander Kabaev\nkan@FreeBSD.org\n2002/07/21"] +kargl [label="Steven G. Kargl\nkargl@FreeBSD.org\n2011/01/17"] kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"] kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"] kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] @@ -300,6 +301,8 @@ cperciva -> simon csjp -> bushman +das -> kargl + delphij -> gabor delphij -> rafan From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 01:22:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F25B106566B; Sun, 6 Mar 2011 01:22: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 437418FC12; Sun, 6 Mar 2011 01:22: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 p261MFTv082043; Sun, 6 Mar 2011 01:22:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p261MFnt082039; Sun, 6 Mar 2011 01:22:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103060122.p261MFnt082039@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 6 Mar 2011 01:22: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: r219320 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 01:22:15 -0000 Author: pjd Date: Sun Mar 6 01:22:14 2011 New Revision: 219320 URL: http://svn.freebsd.org/changeset/base/219320 Log: Fix libzpool build. MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Mar 6 00:57:08 2011 (r219319) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Mar 6 01:22:14 2011 (r219320) @@ -2336,7 +2336,9 @@ dsl_dataset_snapshot_rename_sync(void *a ds->ds_snapname, 8, 1, &ds->ds_object, tx); ASSERT3U(err, ==, 0); dsl_dataset_name(ds, newname); +#ifdef _KERNEL zvol_rename_minors(oldname, newname); +#endif spa_history_log_internal(LOG_DS_RENAME, dd->dd_pool->dp_spa, tx, "dataset = %llu", ds->ds_object); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Sun Mar 6 00:57:08 2011 (r219319) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Sun Mar 6 01:22:14 2011 (r219320) @@ -1344,7 +1344,9 @@ dsl_dir_rename_sync(void *arg1, void *ar dd->dd_myname, 8, 1, &dd->dd_object, tx); ASSERT3U(err, ==, 0); dsl_dir_name(dd, newname); +#ifdef _KERNEL zvol_rename_minors(oldname, newname); +#endif spa_history_log_internal(LOG_DS_RENAME, dd->dd_pool->dp_spa, tx, "dataset = %llu", dd->dd_phys->dd_head_dataset_obj); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h Sun Mar 6 00:57:08 2011 (r219319) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h Sun Mar 6 01:22:14 2011 (r219320) @@ -76,7 +76,7 @@ extern int zvol_create_minors(const char extern void zvol_rename_minors(const char *oldname, const char *newname); #endif -#endif +#endif /* _KERNEL */ #ifdef __cplusplus } From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 08:35:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEAFB1065674; Sun, 6 Mar 2011 08:35:50 +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 AC5B48FC0A; Sun, 6 Mar 2011 08:35: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 p268ZoZw090984; Sun, 6 Mar 2011 08:35:50 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p268Zois090981; Sun, 6 Mar 2011 08:35:50 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201103060835.p268Zois090981@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 6 Mar 2011 08:35: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: r219322 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 08:35:50 -0000 Author: trasz Date: Sun Mar 6 08:35:50 2011 New Revision: 219322 URL: http://svn.freebsd.org/changeset/base/219322 Log: Add manual page for getloginclass(2) and setloginclass(2). Added: head/lib/libc/sys/getloginclass.2 (contents, props changed) Modified: head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Sun Mar 6 03:12:45 2011 (r219321) +++ head/lib/libc/sys/Makefile.inc Sun Mar 6 08:35:50 2011 (r219322) @@ -80,8 +80,8 @@ MAN+= abort2.2 accept.2 access.2 acct.2 extattr_get_file.2 fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \ getdirentries.2 getdtablesize.2 \ getfh.2 getfsstat.2 getgid.2 getgroups.2 getitimer.2 getlogin.2 \ - getpeername.2 getpgrp.2 getpid.2 getpriority.2 getrlimit.2 \ - getrusage.2 getsid.2 getsockname.2 \ + getloginclass.2 getpeername.2 getpgrp.2 getpid.2 getpriority.2 \ + getrlimit.2 getrusage.2 getsid.2 getsockname.2 \ getsockopt.2 gettimeofday.2 getuid.2 \ intro.2 ioctl.2 issetugid.2 jail.2 kenv.2 kill.2 \ kldfind.2 kldfirstmod.2 kldload.2 kldnext.2 kldstat.2 kldsym.2 \ @@ -144,6 +144,7 @@ MLINKS+=getgid.2 getegid.2 MLINKS+=getitimer.2 setitimer.2 MLINKS+=getlogin.2 getlogin_r.3 MLINKS+=getlogin.2 setlogin.2 +MLINKS+=getloginclass.2 setloginclass.2 MLINKS+=getpgrp.2 getpgid.2 MLINKS+=getpid.2 getppid.2 MLINKS+=getpriority.2 setpriority.2 Added: head/lib/libc/sys/getloginclass.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/getloginclass.2 Sun Mar 6 08:35:50 2011 (r219322) @@ -0,0 +1,97 @@ +.\"- +.\" Copyright (c) 2011 Edward Tomasz Napierala +.\" 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 March 6, 2011 +.Dt GETLOGINCLASS 2 +.Os +.Sh NAME +.Nm getloginclass , +.Nm setloginclass +.Nd get/set login class +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft int +.Fn getloginclass "char *name" "size_t len" +.Ft int +.Fn setloginclass "const char *name" +.Sh DESCRIPTION +The +.Fn getloginclass +routine returns the login class name associated with the calling process, +as previously set by +.Fn setloginclass . +The caller must provide the buffer +.Fa name +with length +.Fa len +bytes to hold the result. +The buffer should be at least +.Dv MAXLOGNAME +bytes in length. +.Pp +The +.Fn setloginclass +system call sets the login class of the calling process to +.Fa name . +This system call is restricted to the super-user, and is normally used +only when a new session is being created on behalf of the named user +(for example, at login time, or when a remote shell is invoked). +Processes inherit login class from their parents. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +The following errors may be returned by these calls: +.Bl -tag -width Er +.It Bq Er EFAULT +The +.Fa name +argument gave an invalid address. +.It Bq Er EINVAL +The +.Fa name +argument pointed to a string that was too long. +Login class names are limited to +.Dv MAXLOGNAME +(from +.In sys/param.h ) +characters, currently 17 including null. +.It Bq Er EPERM +The caller tried to set the login class and was not the super-user. +.It Bq Er ENAMETOOLONG +The size of the buffer is smaller than the result to be returned. +.El +.Sh SEE ALSO +.Xr setusercontext 3 +.Sh HISTORY +The +.Fn getloginclass +and +.Fn setloginclass +system calls first appeared in +.Fx 9.0 . From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 08:49:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2CE7106566C; Sun, 6 Mar 2011 08:49:44 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1398FC12; Sun, 6 Mar 2011 08:49: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 p268niGU091301; Sun, 6 Mar 2011 08:49:44 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p268nitH091290; Sun, 6 Mar 2011 08:49:44 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103060849.p268nitH091290@svn.freebsd.org> From: David Schultz Date: Sun, 6 Mar 2011 08:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219323 - in stable/8/lib/msun: . man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 08:49:44 -0000 Author: das Date: Sun Mar 6 08:49:44 2011 New Revision: 219323 URL: http://svn.freebsd.org/changeset/base/219323 Log: MFC r216210: refactor log(3) r216211: add log2(3) and log2f(3) Added: stable/8/lib/msun/src/e_log2.c - copied unchanged from r216211, head/lib/msun/src/e_log2.c stable/8/lib/msun/src/e_log2f.c - copied unchanged from r216211, head/lib/msun/src/e_log2f.c stable/8/lib/msun/src/k_log.h - copied unchanged from r216210, head/lib/msun/src/k_log.h stable/8/lib/msun/src/k_logf.h - copied unchanged from r216210, head/lib/msun/src/k_logf.h Modified: stable/8/lib/msun/Makefile stable/8/lib/msun/Symbol.map stable/8/lib/msun/man/log.3 stable/8/lib/msun/man/math.3 stable/8/lib/msun/src/math.h stable/8/lib/msun/src/math_private.h Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/8/lib/msun/Makefile ============================================================================== --- stable/8/lib/msun/Makefile Sun Mar 6 08:35:50 2011 (r219322) +++ stable/8/lib/msun/Makefile Sun Mar 6 08:49:44 2011 (r219323) @@ -45,7 +45,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c e_expf.c e_fmod.c e_fmodf.c e_gamma.c e_gamma_r.c e_gammaf.c \ e_gammaf_r.c e_hypot.c e_hypotf.c e_j0.c e_j0f.c e_j1.c e_j1f.c \ e_jn.c e_jnf.c e_lgamma.c e_lgamma_r.c e_lgammaf.c e_lgammaf_r.c \ - e_log.c e_log10.c e_log10f.c e_logf.c e_pow.c e_powf.c e_rem_pio2.c \ + e_log.c e_log10.c e_log10f.c e_log2.c e_log2f.c e_logf.c \ + e_pow.c e_powf.c e_rem_pio2.c \ e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \ e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c fenv.c \ k_cos.c k_cosf.c k_rem_pio2.c k_sin.c k_sinf.c \ @@ -164,7 +165,7 @@ MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0 MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3 MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 \ lgamma.3 tgamma.3 lgamma.3 tgammaf.3 -MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 logf.3 +MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 logf.3 log.3 log2.3 log.3 log2f.3 MLINKS+=lrint.3 llrint.3 lrint.3 llrintf.3 lrint.3 llrintl.3 \ lrint.3 lrintf.3 lrint.3 lrintl.3 MLINKS+=lround.3 llround.3 lround.3 llroundf.3 lround.3 llroundl.3 \ Modified: stable/8/lib/msun/Symbol.map ============================================================================== --- stable/8/lib/msun/Symbol.map Sun Mar 6 08:35:50 2011 (r219322) +++ stable/8/lib/msun/Symbol.map Sun Mar 6 08:49:44 2011 (r219323) @@ -218,3 +218,10 @@ FBSD_1.1 { cprojf; cprojl; }; + +/* First added in 9.0-CURRENT */ +FBSD_1.2 { + __isnanf; + log2; + log2f; +}; Modified: stable/8/lib/msun/man/log.3 ============================================================================== --- stable/8/lib/msun/man/log.3 Sun Mar 6 08:35:50 2011 (r219322) +++ stable/8/lib/msun/man/log.3 Sun Mar 6 08:49:44 2011 (r219323) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2008 David Schultz +.\" Copyright (c) 2008-2010 David Schultz .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2008 +.Dd December 5, 2010 .Dt LOG 3 .Os .Sh NAME @@ -33,6 +33,8 @@ .Nm logl , .Nm log10 , .Nm log10f , +.Nm log2 , +.Nm log2f , .Nm log1p , .Nm log1pf .Nd logarithm functions @@ -49,6 +51,10 @@ .Ft float .Fn log10f "float x" .Ft double +.Fn log2 "double x" +.Ft float +.Fn log2f "float x" +.Ft double .Fn log1p "double x" .Ft float .Fn log1pf "float x" @@ -65,6 +71,12 @@ The and .Fn log10f functions compute the logarithm base 10 of +.Fa x , +while +.Fn log2 +and +.Fn log2f +compute the logarithm base 2 of .Fa x . .Pp The @@ -97,6 +109,8 @@ The .Fn logf , .Fn log10 , .Fn log10f , +.Fn log2 , +.Fn log2f , .Fn log1p , and .Fn log1pf Modified: stable/8/lib/msun/man/math.3 ============================================================================== --- stable/8/lib/msun/man/math.3 Sun Mar 6 08:35:50 2011 (r219322) +++ stable/8/lib/msun/man/math.3 Sun Mar 6 08:49:44 2011 (r219323) @@ -28,7 +28,7 @@ .\" from: @(#)math.3 6.10 (Berkeley) 5/6/91 .\" $FreeBSD$ .\" -.Dd December 16, 2007 +.Dd December 5, 2010 .Dt MATH 3 .Os .if n \{\ @@ -185,7 +185,7 @@ lgamma log gamma function log natural logarithm log10 logarithm to base 10 log1p log(1+x) -.\" log2 base 2 logarithm +log2 base 2 logarithm pow exponential x**y sin trigonometric function sinh hyperbolic function @@ -197,7 +197,7 @@ y1 Bessel function of the second kind of yn Bessel function of the second kind of the order n .El .Pp -Unlike the algebraic functions listed earlier, the routines +The routines in this section may not produce a result that is correctly rounded, so reproducible results cannot be guaranteed across platforms. For most of these functions, however, incorrect rounding occurs @@ -224,18 +224,20 @@ and values, were written for or imported into subsequent versions of FreeBSD. .Sh BUGS The -.Fn log2 -function is missing, and many functions are not available in their +.Fn cbrt +function and many of the transcendental functions +are not available in their .Vt "long double" variants. .Pp Many of the routines to compute transcendental functions produce inaccurate results in other than the default rounding mode. .Pp -On some architectures, trigonometric argument reduction is not -performed accurately, resulting in errors greater than 1 +On the i386 platform, trigonometric argument reduction is not +performed accurately for very large arguments, resulting in errors +greater than 1 .Em ulp -for large arguments to +for such arguments to .Fn cos , .Fn sin , and Copied: stable/8/lib/msun/src/e_log2.c (from r216211, head/lib/msun/src/e_log2.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/msun/src/e_log2.c Sun Mar 6 08:49:44 2011 (r219323, copy of r216211, head/lib/msun/src/e_log2.c) @@ -0,0 +1,60 @@ + +/* @(#)e_log10.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +__FBSDID("$FreeBSD$"); + +/* log2(x) + * Return the base 2 logarithm of x. + */ + +#include "math.h" +#include "math_private.h" +#include "k_log.h" + +static const double +two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ +ivln2hi = 0x1.71547652000p+0, +ivln2lo = 0x1.705fc2eefa2p-33; + +static const double zero = 0.0; + +double +__ieee754_log2(double x) +{ + double f,hi,lo; + int32_t i,k,hx; + u_int32_t lx; + + EXTRACT_WORDS(hx,lx,x); + + k=0; + if (hx < 0x00100000) { /* x < 2**-1022 */ + if (((hx&0x7fffffff)|lx)==0) + return -two54/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 54; x *= two54; /* subnormal number, scale up x */ + GET_HIGH_WORD(hx,x); + } + if (hx >= 0x7ff00000) return x+x; + k += (hx>>20)-1023; + hx &= 0x000fffff; + i = (hx+0x95f64)&0x100000; + SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ + k += (i>>20); + f = __kernel_log(x); + hi = x = x - 1; + SET_LOW_WORD(hi,0); + lo = x - hi; + return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; +} Copied: stable/8/lib/msun/src/e_log2f.c (from r216211, head/lib/msun/src/e_log2f.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/msun/src/e_log2f.c Sun Mar 6 08:49:44 2011 (r219323, copy of r216211, head/lib/msun/src/e_log2f.c) @@ -0,0 +1,54 @@ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "math.h" +#include "math_private.h" +#include "k_logf.h" + +static const float +two25 = 3.3554432000e+07, /* 0x4c000000 */ +ivln2hi = 0x1.716p+0f, +ivln2lo = -0x1.7135a8fa03d11p-13; + +static const float zero = 0.0; + +float +__ieee754_log2f(float x) +{ + float f,hi,lo; + int32_t i,k,hx; + + GET_FLOAT_WORD(hx,x); + + k=0; + if (hx < 0x00800000) { /* x < 2**-126 */ + if ((hx&0x7fffffff)==0) + return -two25/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 25; x *= two25; /* subnormal number, scale up x */ + GET_FLOAT_WORD(hx,x); + } + if (hx >= 0x7f800000) return x+x; + k += (hx>>23)-127; + hx &= 0x007fffff; + i = (hx+(0x4afb0d))&0x800000; + SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ + k += (i>>23); + f = __kernel_logf(x); + x = x - 1; + GET_FLOAT_WORD(hx,x); + SET_FLOAT_WORD(hi,hx&0xfffff000); + lo = x - hi; + return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; +} Copied: stable/8/lib/msun/src/k_log.h (from r216210, head/lib/msun/src/k_log.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/msun/src/k_log.h Sun Mar 6 08:49:44 2011 (r219323, copy of r216210, head/lib/msun/src/k_log.h) @@ -0,0 +1,116 @@ + +/* @(#)e_log.c 1.3 95/01/18 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunSoft, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +__FBSDID("$FreeBSD$"); + +/* __kernel_log(x) + * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. + * + * The following describes the overall strategy for computing + * logarithms in base e. The argument reduction and adding the final + * term of the polynomial are done by the caller for increased accuracy + * when different bases are used. + * + * Method : + * 1. Argument Reduction: find k and f such that + * x = 2^k * (1+f), + * where sqrt(2)/2 < 1+f < sqrt(2) . + * + * 2. Approximation of log(1+f). + * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) + * = 2s + 2/3 s**3 + 2/5 s**5 + ....., + * = 2s + s*R + * We use a special Reme algorithm on [0,0.1716] to generate + * a polynomial of degree 14 to approximate R The maximum error + * of this polynomial approximation is bounded by 2**-58.45. In + * other words, + * 2 4 6 8 10 12 14 + * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s + * (the values of Lg1 to Lg7 are listed in the program) + * and + * | 2 14 | -58.45 + * | Lg1*s +...+Lg7*s - R(z) | <= 2 + * | | + * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. + * In order to guarantee error in log below 1ulp, we compute log + * by + * log(1+f) = f - s*(f - R) (if f is not too large) + * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy) + * + * 3. Finally, log(x) = k*ln2 + log(1+f). + * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) + * Here ln2 is split into two floating point number: + * ln2_hi + ln2_lo, + * where n*ln2_hi is always exact for |n| < 2000. + * + * Special cases: + * log(x) is NaN with signal if x < 0 (including -INF) ; + * log(+INF) is +INF; log(0) is -INF with signal; + * log(NaN) is that NaN with no signal. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 1 ulp (unit in the last place). + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +static const double +Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ +Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ +Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */ +Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */ +Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */ +Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ +Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ + +/* + * We always inline __kernel_log(), since doing so produces a + * substantial performance improvement (~40% on amd64). + */ +static inline double +__kernel_log(double x) +{ + double hfsq,f,s,z,R,w,t1,t2; + int32_t hx,i,j; + u_int32_t lx; + + EXTRACT_WORDS(hx,lx,x); + + f = x-1.0; + if((0x000fffff&(2+hx))<3) { /* -2**-20 <= f < 2**-20 */ + if(f==0.0) return 0.0; + return f*f*(0.33333333333333333*f-0.5); + } + s = f/(2.0+f); + z = s*s; + hx &= 0x000fffff; + i = hx-0x6147a; + w = z*z; + j = 0x6b851-hx; + t1= w*(Lg2+w*(Lg4+w*Lg6)); + t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); + i |= j; + R = t2+t1; + if (i>0) { + hfsq=0.5*f*f; + return s*(hfsq+R) - hfsq; + } else { + return s*(R-f); + } +} Copied: stable/8/lib/msun/src/k_logf.h (from r216210, head/lib/msun/src/k_logf.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/msun/src/k_logf.h Sun Mar 6 08:49:44 2011 (r219323, copy of r216210, head/lib/msun/src/k_logf.h) @@ -0,0 +1,55 @@ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include +__FBSDID("$FreeBSD$"); + +/* __kernel_logf(x) + * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. + */ + +static const float +/* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */ +Lg1 = 0xaaaaaa.0p-24, /* 0.66666662693 */ +Lg2 = 0xccce13.0p-25, /* 0.40000972152 */ +Lg3 = 0x91e9ee.0p-25, /* 0.28498786688 */ +Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ + +static inline float +__kernel_logf(float x) +{ + float hfsq,f,s,z,R,w,t1,t2; + int32_t ix,i,j; + + GET_FLOAT_WORD(ix,x); + + f = x-(float)1.0; + if((0x007fffff&(0x8000+ix))<0xc000) { /* -2**-9 <= f < 2**-9 */ + if(f==0.0) return 0.0; + return f*f*((float)0.33333333333333333*f-(float)0.5); + } + s = f/((float)2.0+f); + z = s*s; + ix &= 0x007fffff; + i = ix-(0x6147a<<3); + w = z*z; + j = (0x6b851<<3)-ix; + t1= w*(Lg2+w*Lg4); + t2= z*(Lg1+w*Lg3); + i |= j; + R = t2+t1; + if(i>0) { + hfsq=(float)0.5*f*f; + return s*(hfsq+R) - hfsq; + } else { + return s*(R-f); + } +} Modified: stable/8/lib/msun/src/math.h ============================================================================== --- stable/8/lib/msun/src/math.h Sun Mar 6 08:35:50 2011 (r219322) +++ stable/8/lib/msun/src/math.h Sun Mar 6 08:49:44 2011 (r219323) @@ -235,6 +235,7 @@ double lgamma(double); long long llrint(double); long long llround(double); double log1p(double); +double log2(double); double logb(double); long lrint(double); long lround(double); @@ -318,6 +319,7 @@ int ilogbf(float) __pure2; float ldexpf(float, int); float log10f(float); float log1pf(float); +float log2f(float); float logf(float); float modff(float, float *); /* fundamentally !__pure2 */ Modified: stable/8/lib/msun/src/math_private.h ============================================================================== --- stable/8/lib/msun/src/math_private.h Sun Mar 6 08:35:50 2011 (r219322) +++ stable/8/lib/msun/src/math_private.h Sun Mar 6 08:49:44 2011 (r219323) @@ -292,6 +292,7 @@ irint(double x) #define __ieee754_acos acos #define __ieee754_acosh acosh #define __ieee754_log log +#define __ieee754_log2 log2 #define __ieee754_atanh atanh #define __ieee754_asin asin #define __ieee754_atan2 atan2 @@ -330,6 +331,7 @@ irint(double x) #define __ieee754_lgammaf_r lgammaf_r #define __ieee754_gammaf_r gammaf_r #define __ieee754_log10f log10f +#define __ieee754_log2f log2f #define __ieee754_sinhf sinhf #define __ieee754_hypotf hypotf #define __ieee754_j0f j0f From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 08:50:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ED3E1065741; Sun, 6 Mar 2011 08:50:16 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2EF8FC1C; Sun, 6 Mar 2011 08:50: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 p268oGr5091355; Sun, 6 Mar 2011 08:50:16 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p268oFm3091353; Sun, 6 Mar 2011 08:50:16 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103060850.p268oFm3091353@svn.freebsd.org> From: David Schultz Date: Sun, 6 Mar 2011 08:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219324 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 08:50:16 -0000 Author: das Date: Sun Mar 6 08:50:15 2011 New Revision: 219324 URL: http://svn.freebsd.org/changeset/base/219324 Log: Bump __FreeBSD_version for the MFC of log2(), for the benefit of ports such as opencity and inkscape that have workarounds for the lack of a log2() in the base system. Modified: stable/8/sys/sys/param.h Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Sun Mar 6 08:49:44 2011 (r219323) +++ stable/8/sys/sys/param.h Sun Mar 6 08:50:15 2011 (r219324) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 802501 /* Master, propagated to newvers */ +#define __FreeBSD_version 802502 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 08:52:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5765D106568B; Sun, 6 Mar 2011 08:52:23 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45CE88FC1C; Sun, 6 Mar 2011 08:52: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 p268qN1F091455; Sun, 6 Mar 2011 08:52:23 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p268qNsj091453; Sun, 6 Mar 2011 08:52:23 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103060852.p268qNsj091453@svn.freebsd.org> From: David Schultz Date: Sun, 6 Mar 2011 08:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219325 - stable/8/lib/msun X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 08:52:23 -0000 Author: das Date: Sun Mar 6 08:52:23 2011 New Revision: 219325 URL: http://svn.freebsd.org/changeset/base/219325 Log: MFC r216137: Disable gcc's built-in rint() function when compiling s_nearbyint.c. It results in incorrect optimizations that break nearbyint(). Modified: stable/8/lib/msun/Makefile Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/8/lib/msun/Makefile ============================================================================== --- stable/8/lib/msun/Makefile Sun Mar 6 08:50:15 2011 (r219324) +++ stable/8/lib/msun/Makefile Sun Mar 6 08:52:23 2011 (r219325) @@ -109,6 +109,12 @@ COMMON_SRCS:= ${COMMON_SRCS:N${i:R}.c} .endfor .endif +# Some files need certain gcc built-in functions to be disabled, since gcc's +# model of the functions bogusly assumes -fno-trapping-math. +XRINT_CFLAGS= -fno-builtin-rint -fno-builtin-rintf -fno-builtin-rintl +CFLAGS+= ${XRINT_CFLAGS} +XRINT_CFLAGS:= ${.IMPSRC:M*/s_nearbyint.c:C/^.+$/${XRINT_CFLAGS}/:C/^$//} + SRCS= ${COMMON_SRCS} ${ARCH_SRCS} INCS= fenv.h math.h From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 08:52:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D51AE1065678; Sun, 6 Mar 2011 08:52: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 C3DC78FC1F; Sun, 6 Mar 2011 08:52: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 p268qxjx091500; Sun, 6 Mar 2011 08:52:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p268qxKX091498; Sun, 6 Mar 2011 08:52:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201103060852.p268qxKX091498@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 6 Mar 2011 08:52: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: r219326 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 08:52:59 -0000 Author: trasz Date: Sun Mar 6 08:52:59 2011 New Revision: 219326 URL: http://svn.freebsd.org/changeset/base/219326 Log: Add FBSD_1.2; syscalls added in 9-CURRENT are supposed to go there. Suggested by: kib Modified: head/lib/libc/sys/Symbol.map Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Sun Mar 6 08:52:23 2011 (r219325) +++ head/lib/libc/sys/Symbol.map Sun Mar 6 08:52:59 2011 (r219326) @@ -364,6 +364,9 @@ FBSD_1.1 { unlinkat; }; +FBSD_1.2 { +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 08:55:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19F171065676; Sun, 6 Mar 2011 08:55:37 +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 0486A8FC22; Sun, 6 Mar 2011 08:55: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 p268taiF091605; Sun, 6 Mar 2011 08:55:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p268taaG091603; Sun, 6 Mar 2011 08:55:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201103060855.p268taaG091603@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 6 Mar 2011 08:55: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: r219327 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 08:55:37 -0000 Author: trasz Date: Sun Mar 6 08:55:36 2011 New Revision: 219327 URL: http://svn.freebsd.org/changeset/base/219327 Log: Move getloginclass(2) and setloginclass(2) to FBSD_1.2, where they should've been added in the first place. Modified: head/lib/libc/sys/Symbol.map Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Sun Mar 6 08:52:59 2011 (r219326) +++ head/lib/libc/sys/Symbol.map Sun Mar 6 08:55:36 2011 (r219327) @@ -344,7 +344,6 @@ FBSD_1.1 { fexecve; fstatat; futimesat; - getloginclass; jail_get; jail_set; jail_remove; @@ -358,13 +357,14 @@ FBSD_1.1 { readlinkat; renameat; setfib; - setloginclass; shmctl; symlinkat; unlinkat; }; FBSD_1.2 { + getloginclass; + setloginclass; }; FBSDprivate_1.0 { From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 08:56:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A686A106566B; Sun, 6 Mar 2011 08:56:44 +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 951CE8FC22; Sun, 6 Mar 2011 08:56: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 p268uiGr091664; Sun, 6 Mar 2011 08:56:44 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p268uis4091662; Sun, 6 Mar 2011 08:56:44 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201103060856.p268uis4091662@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 6 Mar 2011 08:56: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: r219328 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 08:56:44 -0000 Author: trasz Date: Sun Mar 6 08:56:44 2011 New Revision: 219328 URL: http://svn.freebsd.org/changeset/base/219328 Log: Mention setloginclass(2) in login_class(3). Modified: head/lib/libutil/login_class.3 Modified: head/lib/libutil/login_class.3 ============================================================================== --- head/lib/libutil/login_class.3 Sun Mar 6 08:55:36 2011 (r219327) +++ head/lib/libutil/login_class.3 Sun Mar 6 08:56:44 2011 (r219328) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2008 +.Dd March 6, 2011 .Dt LOGIN_CLASS 3 .Os .Sh NAME @@ -75,7 +75,7 @@ Each of these actions is selectable via in the .Ar flags parameter, which is comprised of one or more of the following: -.Bl -tag -width LOGIN_SETRESOURCES +.Bl -tag -width LOGIN_SETLOGINCLASS .It LOGIN_SETLOGIN Set the login associated with the current session to the user specified in the passwd structure using @@ -170,6 +170,9 @@ utility or the case-insensitive string If the string is .Ql default no action will be taken. +.It LOGIN_SETLOGINCLASS +Set the login class of the current process using +.Xr setloginclass 2 . .It LOGIN_SETALL Enables all of the above settings. .El @@ -203,9 +206,11 @@ or resources, a message is reported to with LOG_ERR priority and directed to the currently active facility. .Sh SEE ALSO .Xr cpuset 1 , +.Xr ps 1 , .Xr cpuset 2 , .Xr setgid 2 , .Xr setlogin 2 , +.Xr setloginclass 2 , .Xr setuid 2 , .Xr getcap 3 , .Xr initgroups 3 , From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 09:01:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A45221065672; Sun, 6 Mar 2011 09:01:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 917DE8FC1E; Sun, 6 Mar 2011 09:01: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 p2691Uhp091863; Sun, 6 Mar 2011 09:01:30 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2691UQF091859; Sun, 6 Mar 2011 09:01:30 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201103060901.p2691UQF091859@svn.freebsd.org> From: Martin Matuska Date: Sun, 6 Mar 2011 09:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219329 - in stable/8/contrib/gcc: config/i386 doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 09:01:30 -0000 Author: mm Date: Sun Mar 6 09:01:29 2011 New Revision: 219329 URL: http://svn.freebsd.org/changeset/base/219329 Log: MFC r218895: Backport svn r124339 from gcc 4.3 and add opteron-sse3, athlon64-sse3 and k8-sse3 cpu-types for -march=/-mtune= gcc options. These new cpu-types include the SSE3 instruction set that is supported by all newer AMD Athlon 64 and Opteron processors. All three cpu-types are supported by clang and all gcc versions starting with 4.3 SVN rev 124339 (at that time GPLv2 licensed). PR: gnu/154906 Discussed with: kib, kan, dim Obtained from: gcc 4.3 (r124339, GPLv2 licensed) Modified: stable/8/contrib/gcc/config/i386/i386.c stable/8/contrib/gcc/doc/gcc.1 stable/8/contrib/gcc/doc/invoke.texi Directory Properties: stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/config/i386/i386.c ============================================================================== --- stable/8/contrib/gcc/config/i386/i386.c Sun Mar 6 08:56:44 2011 (r219328) +++ stable/8/contrib/gcc/config/i386/i386.c Sun Mar 6 09:01:29 2011 (r219329) @@ -1523,10 +1523,19 @@ override_options (void) | PTA_SSE | PTA_SSE2 }, {"k8", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT | PTA_3DNOW_A | PTA_SSE | PTA_SSE2}, + {"k8-sse3", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT + | PTA_3DNOW_A | PTA_SSE | PTA_SSE2 + | PTA_SSE3 }, {"opteron", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT | PTA_3DNOW_A | PTA_SSE | PTA_SSE2}, + {"opteron-sse3", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT + | PTA_3DNOW_A | PTA_SSE | PTA_SSE2 + | PTA_SSE3 }, {"athlon64", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT | PTA_3DNOW_A | PTA_SSE | PTA_SSE2}, + {"athlon64-sse3", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT + | PTA_3DNOW_A | PTA_SSE | PTA_SSE2 + | PTA_SSE3 }, {"athlon-fx", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT | PTA_3DNOW_A | PTA_SSE | PTA_SSE2}, {"generic32", PROCESSOR_GENERIC32, 0 /* flags are only used for -march switch. */ }, Modified: stable/8/contrib/gcc/doc/gcc.1 ============================================================================== --- stable/8/contrib/gcc/doc/gcc.1 Sun Mar 6 08:56:44 2011 (r219328) +++ stable/8/contrib/gcc/doc/gcc.1 Sun Mar 6 09:01:29 2011 (r219329) @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "GCC 1" -.TH GCC 1 "2007-07-19" "gcc-4.2.1" "GNU" +.TH GCC 1 "2011-02-20" "gcc-4.2.1" "GNU" .SH "NAME" gcc \- GNU project C and C++ compiler .SH "SYNOPSIS" @@ -8751,6 +8751,9 @@ instruction set support. .IX Item "k8, opteron, athlon64, athlon-fx" \&\s-1AMD\s0 K8 core based CPUs with x86\-64 instruction set support. (This supersets \&\s-1MMX\s0, \s-1SSE\s0, \s-1SSE2\s0, 3dNOW!, enhanced 3dNOW! and 64\-bit instruction set extensions.) +.IP "\fIk8-sse3, opteron-sse3, athlon64-sse3\fR" 4 +.IX Item "k8-sse3, opteron-sse3, athlon64-sse3" +Improved versions of k8, opteron and athlon64 with \s-1SSE3\s0 instruction set support. .IP "\fIwinchip\-c6\fR" 4 .IX Item "winchip-c6" \&\s-1IDT\s0 Winchip C6 \s-1CPU\s0, dealt in same way as i486 with additional \s-1MMX\s0 instruction Modified: stable/8/contrib/gcc/doc/invoke.texi ============================================================================== --- stable/8/contrib/gcc/doc/invoke.texi Sun Mar 6 08:56:44 2011 (r219328) +++ stable/8/contrib/gcc/doc/invoke.texi Sun Mar 6 09:01:29 2011 (r219329) @@ -9382,6 +9382,8 @@ instruction set support. @item k8, opteron, athlon64, athlon-fx AMD K8 core based CPUs with x86-64 instruction set support. (This supersets MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.) +@item k8-sse3, opteron-sse3, athlon64-sse3 +Improved versions of k8, opteron and athlon64 with SSE3 instruction set support. @item winchip-c6 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction set support. From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 09:02:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4F97106566B; Sun, 6 Mar 2011 09:02:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9CCE8FC14; Sun, 6 Mar 2011 09:02: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 p2692ZCe091923; Sun, 6 Mar 2011 09:02:35 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2692Z0G091921; Sun, 6 Mar 2011 09:02:35 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201103060902.p2692Z0G091921@svn.freebsd.org> From: Martin Matuska Date: Sun, 6 Mar 2011 09:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219330 - stable/8/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 09:02:35 -0000 Author: mm Date: Sun Mar 6 09:02:35 2011 New Revision: 219330 URL: http://svn.freebsd.org/changeset/base/219330 Log: MFC r218896: Add opteron-sse3, athlon64-sse3 and k8-sse3 cpu types to bsd.cpu.mk. - add "sse3" to MACHINE_CPU for the new cpu types - for i386, default to CPUTYPE=prescott for the new cpu types PR: gnu/154906 Discussed with: kib, kan, dim Modified: stable/8/share/mk/bsd.cpu.mk Directory Properties: stable/8/share/mk/ (props changed) Modified: stable/8/share/mk/bsd.cpu.mk ============================================================================== --- stable/8/share/mk/bsd.cpu.mk Sun Mar 6 09:01:29 2011 (r219329) +++ stable/8/share/mk/bsd.cpu.mk Sun Mar 6 09:02:35 2011 (r219330) @@ -49,6 +49,9 @@ CPUTYPE = pentiumpro CPUTYPE = pentium-mmx . elif ${CPUTYPE} == "i586" CPUTYPE = pentium +. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ + ${CPUTYPE} == "k8-sse3" +CPUTYPE = prescott . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ ${CPUTYPE} == "k8" CPUTYPE = athlon-mp @@ -156,7 +159,9 @@ _CPUCFLAGS = -mcpu=ultrasparc3 # presence of a CPU feature. . if ${MACHINE_ARCH} == "i386" -. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" +. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" +MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 i486 i386 +. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386 . elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ ${CPUTYPE} == "athlon-4" @@ -195,7 +200,9 @@ MACHINE_CPU = i486 i386 MACHINE_CPU = i386 . endif . elif ${MACHINE_ARCH} == "amd64" -. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" +. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || ${CPUTYPE} == "k8-sse3" +MACHINE_CPU = k8 3dnow sse3 +. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow . elif ${CPUTYPE} == "nocona" MACHINE_CPU = sse3 From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 10:32:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21EC106566B; Sun, 6 Mar 2011 10:32:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 903D88FC0C; Sun, 6 Mar 2011 10:32: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 p26AWwNW095214; Sun, 6 Mar 2011 10:32:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26AWwn8095212; Sun, 6 Mar 2011 10:32:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201103061032.p26AWwn8095212@svn.freebsd.org> From: Martin Matuska Date: Sun, 6 Mar 2011 10:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219331 - stable/8/share/examples/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 10:32:58 -0000 Author: mm Date: Sun Mar 6 10:32:58 2011 New Revision: 219331 URL: http://svn.freebsd.org/changeset/base/219331 Log: MFC r218896 (share/examples part): Add opteron-sse3, athlon64-sse3 and k8-sse3 cpu types to bsd.cpu.mk. - add "sse3" to MACHINE_CPU for the new cpu types - for i386, default to CPUTYPE=prescott for the new cpu types PR: gnu/154906 Discussed with: kib, kan, dim Modified: stable/8/share/examples/etc/make.conf Directory Properties: stable/8/share/examples/ (props changed) stable/8/share/examples/etc/ (props changed) stable/8/share/examples/kld/syscall/ (props changed) Modified: stable/8/share/examples/etc/make.conf ============================================================================== --- stable/8/share/examples/etc/make.conf Sun Mar 6 09:02:35 2011 (r219330) +++ stable/8/share/examples/etc/make.conf Sun Mar 6 10:32:58 2011 (r219331) @@ -30,8 +30,9 @@ # NO_CPU_CFLAGS variable below. # Currently the following CPU types are recognized: # Intel x86 architecture: -# (AMD CPUs) opteron athlon64 athlon-mp athlon-xp athlon-4 -# athlon-tbird athlon k8 k6-3 k6-2 k6 k5 +# (AMD CPUs) opteron-sse3 opteron athlon64-sse3 athlon64 athlon-mp +# athlon-xp athlon-4 athlon-tbird athlon k8-sse3 k8 +# k6-3 k6-2 k6 k5 # (Intel CPUs) core2 core nocona pentium4m pentium4 prescott # pentium3m pentium3 pentium-m pentium2 # pentiumpro pentium-mmx pentium i486 i386 From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 11:43:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A12A81065675; Sun, 6 Mar 2011 11:43:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DA918FC19; Sun, 6 Mar 2011 11:43: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 p26Bh2UH096904; Sun, 6 Mar 2011 11:43:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26Bh2od096896; Sun, 6 Mar 2011 11:43:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061143.p26Bh2od096896@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 11:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219332 - stable/8/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 11:43:02 -0000 Author: marius Date: Sun Mar 6 11:43:02 2011 New Revision: 219332 URL: http://svn.freebsd.org/changeset/base/219332 Log: - Use the correct DMA tag/map pair for synchronize the FC scratch area. - Allocate coherent DMA memory for the request/response queue area and and the FC scratch area. These changes allow isp(4) to work properly on sparc64 with usage of the IOMMU streaming buffers enabled. Approved by: mjacob Modified: stable/8/sys/dev/isp/isp.c stable/8/sys/dev/isp/isp_freebsd.c stable/8/sys/dev/isp/isp_freebsd.h stable/8/sys/dev/isp/isp_library.c stable/8/sys/dev/isp/isp_pci.c stable/8/sys/dev/isp/isp_sbus.c stable/8/sys/dev/isp/ispvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/isp/isp.c ============================================================================== --- stable/8/sys/dev/isp/isp.c Sun Mar 6 10:32:58 2011 (r219331) +++ stable/8/sys/dev/isp/isp.c Sun Mar 6 11:43:02 2011 (r219332) @@ -777,7 +777,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_IOXPUT_32(isp, ptr[wi++], &cp[i]); wl--; } - MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); + MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); ISP_MEMZERO(&mbs, sizeof (mbs)); if (la < 0x10000 && nw < 0x10000) { mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; @@ -846,7 +846,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_IOXPUT_16(isp, ptr[wi++], &cp[i]); wl--; } - MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); + MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); ISP_MEMZERO(&mbs, sizeof (mbs)); if (la < 0x10000) { mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; @@ -1716,7 +1716,7 @@ isp_fibre_init(ispsoftc_t *isp) isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %p (%08x%08x)", fcp->isp_scratch, (uint32_t) ((uint64_t)fcp->isp_scdma >> 32), (uint32_t) fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp)); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0); isp_mboxcmd(isp, &mbs); FC_SCRATCH_RELEASE(isp, 0); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { @@ -2008,7 +2008,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %04x%04x%04x%04x", DMA_WD3(fcp->isp_scdma), DMA_WD2(fcp->isp_scdma), DMA_WD1(fcp->isp_scdma), DMA_WD0(fcp->isp_scdma)); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp)); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0); isp_mboxcmd(isp, &mbs); FC_SCRATCH_RELEASE(isp, 0); @@ -2125,13 +2125,13 @@ isp_plogx(ispsoftc_t *isp, int chan, uin mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { rval = mbs.param[0]; goto out; } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); scp += QENTRY_LEN; isp_get_plogx(isp, (isp_plogx_t *) scp, plp); if (isp->isp_dblev & ISP_LOGDEBUG1) { @@ -2324,7 +2324,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui return (-1); } } - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un)); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un), chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { if (dolock) { @@ -3215,7 +3215,7 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan rq->snscb_fc4_type = FC4_SCSI; isp_put_gid_ft_request(isp, rq, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE, chan); MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 10000000); mbs.param[0] = MBOX_SEND_SNS; @@ -3310,12 +3310,12 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); pt = &un.plocal; isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); if (isp->isp_dblev & ISP_LOGDEBUG1) { @@ -3328,7 +3328,7 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, chan, pt->ctp_status); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN + 16); + MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN + 16, chan); if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "CT response", GIDLEN+16, &scp[IGPOFF]); } @@ -3414,7 +3414,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha return (0); } - MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN, chan); rs0 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+IGPOFF); rs1 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+OGPOFF); isp_get_gid_ft_response(isp, rs0, rs1, NGENT); @@ -4008,7 +4008,7 @@ isp_register_fc4_type(ispsoftc_t *isp, i mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_RFT_ID_REQ_SIZE); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_RFT_ID_REQ_SIZE, chan); isp_mboxcmd(isp, &mbs); FC_SCRATCH_RELEASE(isp, chan); if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { @@ -4094,13 +4094,13 @@ isp_register_fc4_type_24xx(ispsoftc_t *i mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); - MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN, chan); pt = &un.plocal; isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); if (isp->isp_dblev & ISP_LOGDEBUG1) { @@ -4552,7 +4552,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; } isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); fcp->sendmarker = 1; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { @@ -4560,7 +4560,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct break; } MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, - QENTRY_LEN); + QENTRY_LEN, chan); sp = (isp24xx_statusreq_t *) local; isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); @@ -4656,14 +4656,14 @@ isp_control(ispsoftc_t *isp, ispctl_t ct ab2 = (isp24xx_abrt_t *) &((uint8_t *)fcp->isp_scratch)[QENTRY_LEN]; ab2->abrt_nphdl = 0xdeaf; - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); break; } MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, - QENTRY_LEN); + QENTRY_LEN, chan); isp_get_24xx_abrt(isp, ab2, ab); FC_SCRATCH_RELEASE(isp, chan); if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) { @@ -4936,7 +4936,7 @@ again: void *addr; oop = optr; - MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_ATIOQ, oop, QENTRY_LEN, -1); addr = ISP_QUEUE_ENTRY(isp->isp_atioq, oop); isp_get_hdr(isp, addr, (isphdr_t *)qe); hp = (isphdr_t *)qe; @@ -5053,7 +5053,7 @@ again: /* * Synchronize our view of this response queue entry. */ - MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN, -1); isp_get_hdr(isp, hp, &sp->req_header); etype = sp->req_header.rqs_entry_type; Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Sun Mar 6 10:32:58 2011 (r219331) +++ stable/8/sys/dev/isp/isp_freebsd.c Sun Mar 6 11:43:02 2011 (r219332) @@ -604,11 +604,11 @@ ispioctl(struct cdev *dev, u_long c, cad break; } isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); sp = (isp24xx_statusreq_t *) local; sp->req_completion_status = 1; retval = isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); FC_SCRATCH_RELEASE(isp, chan); if (retval || sp->req_completion_status != 0) { Modified: stable/8/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.h Sun Mar 6 10:32:58 2011 (r219331) +++ stable/8/sys/dev/isp/isp_freebsd.h Sun Mar 6 11:43:02 2011 (r219332) @@ -338,15 +338,27 @@ struct isposinfo { #define MAXISPREQUEST(isp) ((IS_FC(isp) || IS_ULTRA2(isp))? 1024 : 256) -#define MEMORYBARRIER(isp, type, offset, size) \ +#define MEMORYBARRIER(isp, type, offset, size, chan) \ switch (type) { \ case SYNC_SFORDEV: \ +{ \ + struct isp_fc *fc = ISP_FC_PC(isp, chan); \ + bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ + break; \ +} \ case SYNC_REQUEST: \ bus_dmamap_sync(isp->isp_osinfo.cdmat, \ isp->isp_osinfo.cdmap, \ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ break; \ case SYNC_SFORCPU: \ +{ \ + struct isp_fc *fc = ISP_FC_PC(isp, chan); \ + bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \ + break; \ +} \ case SYNC_RESULT: \ bus_dmamap_sync(isp->isp_osinfo.cdmat, \ isp->isp_osinfo.cdmap, \ Modified: stable/8/sys/dev/isp/isp_library.c ============================================================================== --- stable/8/sys/dev/isp/isp_library.c Sun Mar 6 10:32:58 2011 (r219331) +++ stable/8/sys/dev/isp/isp_library.c Sun Mar 6 11:43:02 2011 (r219332) @@ -591,13 +591,13 @@ isp_fc_change_role(ispsoftc_t *isp, int mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); return (EIO); } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN); + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); #ifdef ISP_TARGET_MODE Modified: stable/8/sys/dev/isp/isp_pci.c ============================================================================== --- stable/8/sys/dev/isp/isp_pci.c Sun Mar 6 10:32:58 2011 (r219331) +++ stable/8/sys/dev/isp/isp_pci.c Sun Mar 6 11:43:02 2011 (r219332) @@ -1180,12 +1180,12 @@ isp_pci_rd_reg(ispsoftc_t *isp, int rego */ oldconf = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf | BIU_PCI_CONF1_SXP); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } rv = BXR2(isp, IspVirt2Off(isp, regoff)); if ((regoff & _BLK_REG_MASK) == SXP_BLOCK) { BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } return (rv); } @@ -1202,13 +1202,13 @@ isp_pci_wr_reg(ispsoftc_t *isp, int rego oldconf = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf | BIU_PCI_CONF1_SXP); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } BXW2(isp, IspVirt2Off(isp, regoff), val); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2, -1); if ((regoff & _BLK_REG_MASK) == SXP_BLOCK) { BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oldconf); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } } @@ -1231,17 +1231,17 @@ isp_pci_rd_reg_1080(ispsoftc_t *isp, int else tc |= BIU_PCI1080_CONF1_SXP0; BXW2(isp, IspVirt2Off(isp, BIU_CONF1), tc); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } else if ((regoff & _BLK_REG_MASK) == DMA_BLOCK) { oc = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oc | BIU_PCI1080_CONF1_DMA); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } rv = BXR2(isp, IspVirt2Off(isp, regoff)); if (oc) { BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oc); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } return (rv); } @@ -1264,18 +1264,18 @@ isp_pci_wr_reg_1080(ispsoftc_t *isp, int else tc |= BIU_PCI1080_CONF1_SXP0; BXW2(isp, IspVirt2Off(isp, BIU_CONF1), tc); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } else if ((regoff & _BLK_REG_MASK) == DMA_BLOCK) { oc = BXR2(isp, IspVirt2Off(isp, BIU_CONF1)); BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oc | BIU_PCI1080_CONF1_DMA); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } BXW2(isp, IspVirt2Off(isp, regoff), val); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2, -1); if (oc) { BXW2(isp, IspVirt2Off(isp, BIU_CONF1), oc); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, BIU_CONF1), 2, -1); } } @@ -1350,7 +1350,7 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int break; case MBOX_BLOCK: BXW2(isp, IspVirt2Off(isp, regoff), val); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2, -1); return; case SXP_BLOCK: isp_prt(isp, ISP_LOGWARN, "SXP_BLOCK write at 0x%x", regoff); @@ -1386,7 +1386,7 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int case BIU2400_GPIOE: case BIU2400_HSEMA: BXW4(isp, IspVirt2Off(isp, regoff), val); - MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 4); + MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 4, -1); break; default: isp_prt(isp, ISP_LOGERR, @@ -1574,7 +1574,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) return (1); } - if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT, &isp->isp_osinfo.cdmap) != 0) { + if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &isp->isp_osinfo.cdmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate %d bytes of CCB memory", len); bus_dma_tag_destroy(isp->isp_osinfo.cdmat); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); @@ -1603,7 +1603,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, ISP_FC_SCRLEN, 1, slim, 0, &fc->tdmat)) { goto bad; } - if (bus_dmamem_alloc(fc->tdmat, (void **)&base, BUS_DMA_NOWAIT, &fc->tdmap) != 0) { + if (bus_dmamem_alloc(fc->tdmat, (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &fc->tdmap) != 0) { bus_dma_tag_destroy(fc->tdmat); goto bad; } Modified: stable/8/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/8/sys/dev/isp/isp_sbus.c Sun Mar 6 10:32:58 2011 (r219331) +++ stable/8/sys/dev/isp/isp_sbus.c Sun Mar 6 11:43:02 2011 (r219332) @@ -401,7 +401,7 @@ isp_sbus_wr_reg(ispsoftc_t *isp, int reg isp_prt(isp, ISP_LOGDEBUG3, "isp_sbus_wr_reg(off %x) = %x", regoff, val); bus_space_write_2(isp->isp_bus_tag, isp->isp_bus_handle, offset, val); - MEMORYBARRIER(isp, SYNC_REG, offset, 2); + MEMORYBARRIER(isp, SYNC_REG, offset, 2, -1); } struct imush { @@ -496,7 +496,7 @@ isp_sbus_mbxdma(ispsoftc_t *isp) return (1); } - if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT, + if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &isp->isp_osinfo.cdmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate %d bytes of CCB memory", len); Modified: stable/8/sys/dev/isp/ispvar.h ============================================================================== --- stable/8/sys/dev/isp/ispvar.h Sun Mar 6 10:32:58 2011 (r219331) +++ stable/8/sys/dev/isp/ispvar.h Sun Mar 6 11:43:02 2011 (r219332) @@ -154,13 +154,13 @@ struct ispmdvec { #define ISP_QAVAIL(isp) \ ISP_QFREE(isp->isp_reqidx, isp->isp_reqodx, RQUEST_QUEUE_LEN(isp)) -#define ISP_ADD_REQUEST(isp, nxti) \ - MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN); \ - ISP_WRITE(isp, isp->isp_rqstinrp, nxti); \ +#define ISP_ADD_REQUEST(isp, nxti) \ + MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN, -1); \ + ISP_WRITE(isp, isp->isp_rqstinrp, nxti); \ isp->isp_reqidx = nxti #define ISP_SYNC_REQUEST(isp) \ - MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN); \ + MEMORYBARRIER(isp, SYNC_REQUEST, isp->isp_reqidx, QENTRY_LEN, -1); \ isp->isp_reqidx = ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp)); \ ISP_WRITE(isp, isp->isp_rqstinrp, isp->isp_reqidx) @@ -1010,7 +1010,7 @@ void isp_async(ispsoftc_t *, ispasync_t, * MAXISPREQUEST(ispsoftc_t *) maximum request queue size * for this particular board type * - * MEMORYBARRIER(ispsoftc_t *, barrier_type, offset, size) + * MEMORYBARRIER(ispsoftc_t *, barrier_type, offset, size, chan) * * Function/Macro the provides memory synchronization on * various objects so that the ISP's and the system's view From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 11:51:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 797C9106566B; Sun, 6 Mar 2011 11:51:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 663BC8FC12; Sun, 6 Mar 2011 11:51: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 p26BpdY5097150; Sun, 6 Mar 2011 11:51:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26Bpd12097140; Sun, 6 Mar 2011 11:51:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061151.p26Bpd12097140@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 11:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219333 - in stable/8/sys: dev/ata dev/ata/chipsets powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 11:51:39 -0000 Author: marius Date: Sun Mar 6 11:51:39 2011 New Revision: 219333 URL: http://svn.freebsd.org/changeset/base/219333 Log: MFC: r216013, r216083 Several chipset drivers alter parameters relevant for the DMA tag creation, i.e. alignment, max_address, max_iosize and segsize (only max_address is thought to have an negative impact regarding this issue though), after calling ata_dmainit() either directly or indirectly so these values have no effect or at least no effect on the DMA tags and the defaults are used for the latter instead. So change the drivers to set these parameters up-front and ata_dmainit() to honor them. Reviewd by: mav Modified: stable/8/sys/dev/ata/ata-dma.c stable/8/sys/dev/ata/chipsets/ata-ahci.c stable/8/sys/dev/ata/chipsets/ata-cyrix.c stable/8/sys/dev/ata/chipsets/ata-marvell.c stable/8/sys/dev/ata/chipsets/ata-national.c stable/8/sys/dev/ata/chipsets/ata-promise.c stable/8/sys/dev/ata/chipsets/ata-serverworks.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c stable/8/sys/powerpc/powermac/ata_dbdma.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ata/ata-dma.c ============================================================================== --- stable/8/sys/dev/ata/ata-dma.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/dev/ata/ata-dma.c Sun Mar 6 11:51:39 2011 (r219333) @@ -68,17 +68,28 @@ ata_dmainit(device_t dev) struct ata_channel *ch = device_get_softc(dev); struct ata_dc_cb_args dcba; - ch->dma.alloc = ata_dmaalloc; - ch->dma.free = ata_dmafree; - ch->dma.setprd = ata_dmasetprd; - ch->dma.load = ata_dmaload; - ch->dma.unload = ata_dmaunload; - ch->dma.alignment = 2; - ch->dma.boundary = 65536; - ch->dma.segsize = 65536; - ch->dma.max_iosize = MIN((ATA_DMA_ENTRIES - 1) * PAGE_SIZE, MAXPHYS); - ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; - ch->dma.dma_slots = 1; + if (ch->dma.alloc == NULL) + ch->dma.alloc = ata_dmaalloc; + if (ch->dma.free == NULL) + ch->dma.free = ata_dmafree; + if (ch->dma.setprd == NULL) + ch->dma.setprd = ata_dmasetprd; + if (ch->dma.load == NULL) + ch->dma.load = ata_dmaload; + if (ch->dma.unload == NULL) + ch->dma.unload = ata_dmaunload; + if (ch->dma.alignment == 0) + ch->dma.alignment = 2; + if (ch->dma.boundary == 0) + ch->dma.boundary = 65536; + if (ch->dma.segsize == 0) + ch->dma.segsize = 65536; + if (ch->dma.max_iosize == 0) + ch->dma.max_iosize = MIN((ATA_DMA_ENTRIES - 1) * PAGE_SIZE, MAXPHYS); + if (ch->dma.max_address == 0) + ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; + if (ch->dma.dma_slots == 0) + ch->dma.dma_slots = 1; if (bus_dma_tag_create(bus_get_dma_tag(dev), ch->dma.alignment, 0, ch->dma.max_address, BUS_SPACE_MAXADDR, Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ahci.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/dev/ata/chipsets/ata-ahci.c Sun Mar 6 11:51:39 2011 (r219333) @@ -1005,12 +1005,12 @@ ata_ahci_dmainit(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_ahci_dmasetprd; ch->dma.max_iosize = (ATA_AHCI_DMA_ENTRIES - 1) * PAGE_SIZE; if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_64BIT) ch->dma.max_address = BUS_SPACE_MAXADDR; + ata_dmainit(dev); } static int Modified: stable/8/sys/dev/ata/chipsets/ata-cyrix.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-cyrix.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/dev/ata/chipsets/ata-cyrix.c Sun Mar 6 11:51:39 2011 (r219333) @@ -56,7 +56,6 @@ static int ata_cyrix_chipinit(device_t d static int ata_cyrix_ch_attach(device_t dev); static int ata_cyrix_setmode(device_t dev, int target, int mode); - /* * Cyrix chipset support functions */ @@ -89,15 +88,12 @@ static int ata_cyrix_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - int error; - error = ata_pci_ch_attach(dev); ch->dma.alignment = 16; ch->dma.max_iosize = 64 * DEV_BSIZE; - return (error); + return (ata_pci_ch_attach(dev)); } - static int ata_cyrix_setmode(device_t dev, int target, int mode) { Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-marvell.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/dev/ata/chipsets/ata-marvell.c Sun Mar 6 11:51:39 2011 (r219333) @@ -614,7 +614,6 @@ ata_marvell_edma_dmainit(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_marvell_edma_dmasetprd; @@ -625,6 +624,7 @@ ata_marvell_edma_dmainit(device_t dev) /* chip does not reliably do 64K DMA transfers */ if (ctlr->chip->cfg2 == MV_50XX || ctlr->chip->cfg2 == MV_60XX) ch->dma.max_iosize = 64 * DEV_BSIZE; + ata_dmainit(dev); } ATA_DECLARE_DRIVER(ata_marvell); Modified: stable/8/sys/dev/ata/chipsets/ata-national.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-national.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/dev/ata/chipsets/ata-national.c Sun Mar 6 11:51:39 2011 (r219333) @@ -90,12 +90,10 @@ static int ata_national_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - int error; - error = ata_pci_ch_attach(dev); ch->dma.alignment = 16; ch->dma.max_iosize = 64 * DEV_BSIZE; - return (error); + return (ata_pci_ch_attach(dev)); } static int Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-promise.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/dev/ata/chipsets/ata-promise.c Sun Mar 6 11:51:39 2011 (r219333) @@ -979,13 +979,12 @@ ata_promise_mio_dmainit(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_promise_mio_setprd; ch->dma.max_iosize = 65536; + ata_dmainit(dev); } - #define MAXLASTSGSIZE (32 * sizeof(u_int32_t)) static void ata_promise_mio_setprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-serverworks.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/dev/ata/chipsets/ata-serverworks.c Sun Mar 6 11:51:39 2011 (r219333) @@ -182,8 +182,6 @@ ata_serverworks_ch_attach(device_t dev) int ch_offset; int i; - ata_pci_dmainit(dev); - ch_offset = ch->unit * 0x100; for (i = ATA_DATA; i < ATA_MAX_RES; i++) @@ -253,6 +251,8 @@ ata_serverworks_ch_attach(device_t dev) /* chip does not reliably do 64K DMA transfers */ ch->dma.max_iosize = 64 * DEV_BSIZE; + ata_pci_dmainit(dev); + return 0; } Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Sun Mar 6 11:51:39 2011 (r219333) @@ -289,8 +289,6 @@ ata_sii_ch_attach(device_t dev) int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2); int i; - ata_pci_dmainit(dev); - for (i = ATA_DATA; i <= ATA_COMMAND; i++) { ch->r_io[i].res = ctlr->r_res2; ch->r_io[i].offset = 0x80 + i + (unit01 << 6) + (unit10 << 8); @@ -332,6 +330,9 @@ ata_sii_ch_attach(device_t dev) ch->hw.status = ata_sii_status; if (ctlr->chip->cfg2 & SII_SETCLK) ch->flags |= ATA_CHECKS_CABLE; + + ata_pci_dmainit(dev); + return 0; } @@ -915,11 +916,11 @@ ata_siiprb_dmainit(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_siiprb_dmasetprd; ch->dma.max_address = BUS_SPACE_MAXADDR; ch->dma.max_iosize = (ATA_SIIPRB_DMA_ENTRIES - 1) * PAGE_SIZE; + ata_dmainit(dev); } ATA_DECLARE_DRIVER(ata_sii); Modified: stable/8/sys/powerpc/powermac/ata_dbdma.c ============================================================================== --- stable/8/sys/powerpc/powermac/ata_dbdma.c Sun Mar 6 11:43:02 2011 (r219332) +++ stable/8/sys/powerpc/powermac/ata_dbdma.c Sun Mar 6 11:51:39 2011 (r219333) @@ -268,7 +268,6 @@ ata_dbdma_dmainit(device_t dev) dbdma_insert_stop(sc->dbdma,0); sc->next_dma_slot=1; - ata_dmainit(dev); sc->sc_ch.dma.start = ata_dbdma_start; sc->sc_ch.dma.stop = ata_dbdma_stop; sc->sc_ch.dma.load = ata_dbdma_load; @@ -279,9 +278,9 @@ ata_dbdma_dmainit(device_t dev) * if we try to do a 64K transfer, so stop short of 64K. */ sc->sc_ch.dma.segsize = 126 * DEV_BSIZE; + ata_dmainit(dev); sc->sc_ch.hw.status = ata_dbdma_status; mtx_init(&sc->dbdma_mtx, "ATA DBDMA", NULL, MTX_DEF); } - From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 11:56:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA528106566B; Sun, 6 Mar 2011 11:56:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D86148FC16; Sun, 6 Mar 2011 11:56: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 p26Bu7tu097300; Sun, 6 Mar 2011 11:56:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26Bu7Vc097298; Sun, 6 Mar 2011 11:56:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061156.p26Bu7Vc097298@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 11:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219334 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 11:56:08 -0000 Author: marius Date: Sun Mar 6 11:56:07 2011 New Revision: 219334 URL: http://svn.freebsd.org/changeset/base/219334 Log: MFC: r218468 Set td_kstack_pages for thread0. Modified: stable/8/sys/sparc64/sparc64/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Sun Mar 6 11:51:39 2011 (r219333) +++ stable/8/sys/sparc64/sparc64/machdep.c Sun Mar 6 11:56:07 2011 (r219334) @@ -548,6 +548,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l proc0.p_md.md_sigtramp = NULL; proc0.p_md.md_utrap = NULL; thread0.td_kstack = kstack0; + thread0.td_kstack_pages = KSTACK_PAGES; thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; frame0.tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_PRIV; From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 12:48:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 266DB1065670; Sun, 6 Mar 2011 12:48:16 +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 143D88FC16; Sun, 6 Mar 2011 12:48: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 p26CmFR4098478; Sun, 6 Mar 2011 12:48:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26CmFwA098474; Sun, 6 Mar 2011 12:48:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061248.p26CmFwA098474@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 12:48: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: r219335 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 12:48:16 -0000 Author: marius Date: Sun Mar 6 12:48:15 2011 New Revision: 219335 URL: http://svn.freebsd.org/changeset/base/219335 Log: - Allocate the DMA memory shared between the host and the controller as coherent. - Add some missing bus_dmamap_sync() calls. This includes putting such calls before calling reply handlers instead of calling bus_dmamap_sync() for the request queue from individual reply handlers as these handlers generally read back updates by the controller. Tested on amd64 and sparc64. MFC after: 2 weeks Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_user.c Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Sun Mar 6 11:56:07 2011 (r219334) +++ head/sys/dev/mpt/mpt.c Sun Mar 6 12:48:15 2011 (r219335) @@ -718,15 +718,16 @@ mpt_intr(void *arg) uint32_t ctxt_idx; u_int cb_index; u_int req_index; + u_int offset; int free_rf; req = NULL; reply_frame = NULL; reply_baddr = 0; + offset = 0; if ((reply_desc & MPI_ADDRESS_REPLY_A_BIT) != 0) { - u_int offset; /* - * Insure that the reply frame is coherent. + * Ensure that the reply frame is coherent. */ reply_baddr = MPT_REPLY_BADDR(reply_desc); offset = reply_baddr - (mpt->reply_phys & 0xFFFFFFFF); @@ -808,10 +809,15 @@ mpt_intr(void *arg) " 0x%x)\n", req_index, reply_desc); } + bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); free_rf = mpt_reply_handlers[cb_index](mpt, req, reply_desc, reply_frame); if (reply_frame != NULL && free_rf) { + bus_dmamap_sync_range(mpt->reply_dmat, + mpt->reply_dmap, offset, MPT_REPLY_SIZE, + BUS_DMASYNC_PREREAD); mpt_free_reply(mpt, reply_baddr); } @@ -844,6 +850,8 @@ mpt_complete_request_chain(struct mpt_so MSG_REQUEST_HEADER *msg_hdr; u_int cb_index; + bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf; ioc_status_frame.Function = msg_hdr->Function; ioc_status_frame.MsgContext = msg_hdr->MsgContext; @@ -1167,7 +1175,7 @@ mpt_free_request(struct mpt_softc *mpt, { request_t *nxt; struct mpt_evtf_record *record; - uint32_t reply_baddr; + uint32_t offset, reply_baddr; if (req == NULL || req != &mpt->request_pool[req->index]) { panic("mpt_free_request bad req ptr\n"); @@ -1216,8 +1224,10 @@ mpt_free_request(struct mpt_softc *mpt, req->state = REQ_STATE_ALLOCATED; mpt_assign_serno(mpt, req); mpt_send_event_ack(mpt, req, &record->reply, record->context); - reply_baddr = (uint32_t)((uint8_t *)record - mpt->reply) - + (mpt->reply_phys & 0xFFFFFFFF); + offset = (uint32_t)((uint8_t *)record - mpt->reply); + reply_baddr = offset + (mpt->reply_phys & 0xFFFFFFFF); + bus_dmamap_sync_range(mpt->reply_dmat, mpt->reply_dmap, offset, + MPT_REPLY_SIZE, BUS_DMASYNC_PREREAD); mpt_free_reply(mpt, reply_baddr); } @@ -1257,7 +1267,7 @@ mpt_send_cmd(struct mpt_softc *mpt, requ mpt_dump_request(mpt, req); } bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); req->state |= REQ_STATE_QUEUED; KASSERT(mpt_req_on_free_list(mpt, req) == 0, ("req %p:%u func %x on freelist list in mpt_send_cmd", @@ -1696,8 +1706,6 @@ mpt_read_extcfg_page(struct mpt_softc *m mpt_free_request(mpt, req); return (-1); } - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); memcpy(buf, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); mpt_free_request(mpt, req); return (0); @@ -1795,8 +1803,6 @@ mpt_read_cfg_page(struct mpt_softc *mpt, mpt_free_request(mpt, req); return (-1); } - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); memcpy(hdr, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); mpt_free_request(mpt, req); return (0); @@ -2383,10 +2389,12 @@ mpt_upload_fw(struct mpt_softc *mpt) flags <<= MPI_SGE_FLAGS_SHIFT; sge->FlagsLength = htole32(flags | mpt->fw_image_size); sge->Address = htole32(mpt->fw_phys); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREREAD); error = mpt_send_handshake_cmd(mpt, sizeof(fw_req_buf), &fw_req_buf); if (error) return(error); error = mpt_recv_handshake_reply(mpt, sizeof(fw_reply), &fw_reply); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTREAD); return (error); } @@ -2431,8 +2439,10 @@ mpt_download_fw(struct mpt_softc *mpt) MPI_DIAG_RW_ENABLE|MPI_DIAG_DISABLE_ARM); fw_hdr = (MpiFwHeader_t *)mpt->fw_image; + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREWRITE); mpt_diag_outsl(mpt, fw_hdr->LoadStartAddress, (uint32_t*)fw_hdr, fw_hdr->ImageSize); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTWRITE); ext_offset = fw_hdr->NextImageHeaderOffset; while (ext_offset != 0) { @@ -2440,9 +2450,12 @@ mpt_download_fw(struct mpt_softc *mpt) ext = (MpiExtImageHeader_t *)((uintptr_t)fw_hdr + ext_offset); ext_offset = ext->NextImageHeaderOffset; - + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, + BUS_DMASYNC_PREWRITE); mpt_diag_outsl(mpt, ext->LoadStartAddress, (uint32_t*)ext, ext->ImageSize); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, + BUS_DMASYNC_POSTWRITE); } if (mpt->is_sas) { @@ -2506,7 +2519,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) /* Allocate some DMA accessable memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, - BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", MPT_REQ_MEM_SIZE(mpt)); return (1); @@ -2714,11 +2727,12 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->fw_image_size, 1, mpt->fw_image_size, 0, &mpt->fw_dmat); if (error != 0) { - mpt_prt(mpt, "cannot create firmwarew dma tag\n"); + mpt_prt(mpt, "cannot create firmware dma tag\n"); return (ENOMEM); } error = bus_dmamem_alloc(mpt->fw_dmat, - (void **)&mpt->fw_image, BUS_DMA_NOWAIT, &mpt->fw_dmap); + (void **)&mpt->fw_image, BUS_DMA_NOWAIT | + BUS_DMA_COHERENT, &mpt->fw_dmap); if (error != 0) { mpt_prt(mpt, "cannot allocate firmware memory\n"); bus_dma_tag_destroy(mpt->fw_dmat); Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Sun Mar 6 11:56:07 2011 (r219334) +++ head/sys/dev/mpt/mpt_cam.c Sun Mar 6 12:48:15 2011 (r219335) @@ -5023,15 +5023,6 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, uint8_t *cdbp; /* - * First, DMA sync the received command- - * which is in the *request* * phys area. - * - * XXX: We could optimize this for a range - */ - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); - - /* * Stash info for the current command where we can get at it later. */ vbuf = req->req_vbuf; Modified: head/sys/dev/mpt/mpt_user.c ============================================================================== --- head/sys/dev/mpt/mpt_user.c Sun Mar 6 11:56:07 2011 (r219334) +++ head/sys/dev/mpt/mpt_user.c Sun Mar 6 12:48:15 2011 (r219335) @@ -204,7 +204,7 @@ mpt_alloc_buffer(struct mpt_softc *mpt, if (error) return (error); error = bus_dmamem_alloc(page_mem->tag, &page_mem->vaddr, - BUS_DMA_NOWAIT, &page_mem->map); + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &page_mem->map); if (error) { bus_dma_tag_destroy(page_mem->tag); return (error); @@ -302,6 +302,8 @@ mpt_user_read_cfg_page(struct mpt_softc params.PageNumber = hdr->PageNumber; params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK; params.PageAddress = le32toh(page_req->page_address); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, le32toh(page_req->len), TRUE, 5000); if (error != 0) { @@ -312,7 +314,7 @@ mpt_user_read_cfg_page(struct mpt_softc page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -390,6 +392,8 @@ mpt_user_read_extcfg_page(struct mpt_sof params.PageAddress = le32toh(ext_page_req->page_address); params.ExtPageType = hdr->ExtPageType; params.ExtPageLength = hdr->ExtPageLength; + bus_dmamap_sync(mpt_page->tag, mpt_page->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, le32toh(ext_page_req->len), TRUE, 5000); if (error != 0) { @@ -400,7 +404,7 @@ mpt_user_read_extcfg_page(struct mpt_sof ext_page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -435,7 +439,8 @@ mpt_user_write_cfg_page(struct mpt_softc if (req == NULL) return (ENOMEM); - bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); /* * There isn't any point in restoring stripped out attributes @@ -462,6 +467,8 @@ mpt_user_write_cfg_page(struct mpt_softc } page_req->ioc_status = htole16(req->IOCStatus); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_POSTREAD | + BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -477,8 +484,6 @@ mpt_user_reply_handler(struct mpt_softc return (TRUE); if (reply_frame != NULL) { - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); reply = (MSG_RAID_ACTION_REPLY *)reply_frame; req->IOCStatus = le16toh(reply->IOCStatus); res = (struct mpt_user_raid_action_result *) @@ -535,7 +540,7 @@ mpt_user_raid_action(struct mpt_softc *m se = (SGE_SIMPLE32 *)&rap->ActionDataSGE; if (mpt_page->vaddr != NULL && raid_act->len != 0) { bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); se->Address = htole32(mpt_page->paddr); MPI_pSGE_SET_LENGTH(se, le32toh(raid_act->len)); MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | @@ -574,7 +579,7 @@ mpt_user_raid_action(struct mpt_softc *m sizeof(res->action_data)); if (mpt_page->vaddr != NULL) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 12:54:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34D0A1065674; Sun, 6 Mar 2011 12:54:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23BE18FC22; Sun, 6 Mar 2011 12:54:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p26Cs1HI098632; Sun, 6 Mar 2011 12:54:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26Cs113098630; Sun, 6 Mar 2011 12:54:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061254.p26Cs113098630@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 12:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219336 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 12:54:01 -0000 Author: marius Date: Sun Mar 6 12:54:00 2011 New Revision: 219336 URL: http://svn.freebsd.org/changeset/base/219336 Log: - Allocate the DMA memory used for the work area as coherent as at least the ataahci(4) and atamarvell(4) drivers share it between the host and the controller. - Spell some zeros as BUS_DMA_WAITOK when used as bus_dmamem_alloc() flags. MFC after: 2 weeks Modified: head/sys/dev/ata/ata-dma.c Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Sun Mar 6 12:48:15 2011 (r219335) +++ head/sys/dev/ata/ata-dma.c Sun Mar 6 12:54:00 2011 (r219336) @@ -104,7 +104,8 @@ ata_dmainit(device_t dev) 0, NULL, NULL, &ch->dma.work_tag)) goto error; - if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work, 0, + if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work, + BUS_DMA_WAITOK | BUS_DMA_COHERENT, &ch->dma.work_map)) goto error; @@ -173,8 +174,8 @@ ata_dmaalloc(device_t dev) goto error; } - if (bus_dmamem_alloc(slot->sg_tag, (void **)&slot->sg, - 0, &slot->sg_map)) { + if (bus_dmamem_alloc(slot->sg_tag, (void **)&slot->sg, BUS_DMA_WAITOK, + &slot->sg_map)) { device_printf(ch->dev, "FAILURE - alloc sg_map\n"); goto error; } From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 13:06:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B792B1065676; Sun, 6 Mar 2011 13:06: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 8D41C8FC0C; Sun, 6 Mar 2011 13:06: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 p26D6f3C098966; Sun, 6 Mar 2011 13:06:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26D6ffj098964; Sun, 6 Mar 2011 13:06:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061306.p26D6ffj098964@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 13:06: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: r219337 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 13:06:41 -0000 Author: marius Date: Sun Mar 6 13:06:41 2011 New Revision: 219337 URL: http://svn.freebsd.org/changeset/base/219337 Log: Add missing bus_dmamap_sync() calls for the work DMA map. MFC after: 2 weeks Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sun Mar 6 12:54:00 2011 (r219336) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sun Mar 6 13:06:41 2011 (r219337) @@ -320,7 +320,11 @@ ata_ahci_ch_attach(device_t dev) static int ata_ahci_ch_detach(device_t dev) { - + struct ata_channel *ch = device_get_softc(dev); + + if (ch->dma.work_tag && ch->dma.work_map) + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); ata_ahci_ch_suspend(dev); ata_dmafini(dev); return (0); @@ -495,6 +499,9 @@ ata_ahci_begin_transaction(struct ata_re ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) & ~ATA_AHCI_P_CMD_ATAPI); + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* issue command to controller */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, 1); @@ -537,6 +544,9 @@ ata_ahci_end_transaction(struct ata_requ /* kill the timeout */ callout_stop(&request->callout); + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + /* get status */ tf_data = ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset); request->status = tf_data; @@ -590,6 +600,9 @@ ata_ahci_issue_cmd(device_t dev, u_int16 clp->bytecount = 0; clp->cmd_table_phys = htole64(ch->dma.work_bus + ATA_AHCI_CT_OFFSET); + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* issue command to controller */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, 1); @@ -600,6 +613,9 @@ ata_ahci_issue_cmd(device_t dev, u_int16 break; } + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + /* clear interrupts */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IS + offset, ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset)); From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 13:08:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF6D81065670; Sun, 6 Mar 2011 13:08:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A50478FC12; Sun, 6 Mar 2011 13:08: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 p26D8PCU099033; Sun, 6 Mar 2011 13:08:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26D8PRB099031; Sun, 6 Mar 2011 13:08:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061308.p26D8PRB099031@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 13:08: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: r219338 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 13:08:25 -0000 Author: marius Date: Sun Mar 6 13:08:25 2011 New Revision: 219338 URL: http://svn.freebsd.org/changeset/base/219338 Log: Add missing bus_dmamap_sync() calls for the work DMA map. MFC after: 2 weeks Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Sun Mar 6 13:06:41 2011 (r219337) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Sun Mar 6 13:08:25 2011 (r219338) @@ -494,7 +494,11 @@ ata_siiprb_ch_attach(device_t dev) static int ata_siiprb_ch_detach(device_t dev) { + struct ata_channel *ch = device_get_softc(dev); + if (ch->dma.work_tag && ch->dma.work_map) + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, + BUS_DMASYNC_POSTWRITE); ata_dmafini(dev); return 0; } @@ -576,6 +580,8 @@ ata_siiprb_begin_transaction(struct ata_ } } + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_PREWRITE); + /* activate the prb */ prb_bus = ch->dma.work_bus; ATA_OUTL(ctlr->r_res2, 0x1c00 + offset, prb_bus); @@ -598,7 +604,9 @@ ata_siiprb_end_transaction(struct ata_re /* kill the timeout */ callout_stop(&request->callout); - + + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_POSTWRITE); + prb = (struct ata_siiprb_command *) ((u_int8_t *)rman_get_virtual(ctlr->r_res2) + offset); @@ -671,6 +679,8 @@ ata_siiprb_issue_cmd(device_t dev) int offset = ch->unit * 0x2000; int timeout; + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_PREWRITE); + /* issue command to chip */ ATA_OUTL(ctlr->r_res2, 0x1c00 + offset, prb_bus); ATA_OUTL(ctlr->r_res2, 0x1c04 + offset, prb_bus >> 32); @@ -681,6 +691,9 @@ ata_siiprb_issue_cmd(device_t dev) if ((status = ATA_INL(ctlr->r_res2, 0x1008 + offset)) & 0x00010000) break; } + + bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_POSTWRITE); + // SOS XXX ATA_OUTL(ctlr->r_res2, 0x1008 + offset, 0x00010000); ATA_OUTL(ctlr->r_res2, 0x1008 + offset, 0x08ff08ff); From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 13:25:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 192B8106566C; Sun, 6 Mar 2011 13:25:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 065328FC17; Sun, 6 Mar 2011 13:25: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 p26DPkBm099415; Sun, 6 Mar 2011 13:25:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26DPkbX099412; Sun, 6 Mar 2011 13:25:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061325.p26DPkbX099412@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 13:25: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: r219339 - in head: libexec/rtld-elf/sparc64 sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 13:25:47 -0000 Author: marius Date: Sun Mar 6 13:25:46 2011 New Revision: 219339 URL: http://svn.freebsd.org/changeset/base/219339 Log: - Consistently abbreviate the names of the relocations. - End sentences with dots. - Fix whitespace. Modified: head/libexec/rtld-elf/sparc64/reloc.c head/sys/sparc64/sparc64/elf_machdep.c Modified: head/libexec/rtld-elf/sparc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/sparc64/reloc.c Sun Mar 6 13:08:25 2011 (r219338) +++ head/libexec/rtld-elf/sparc64/reloc.c Sun Mar 6 13:25:46 2011 (r219339) @@ -161,29 +161,36 @@ static const char *reloc_names[] = { static const long reloc_target_bitmask[] = { #define _BM(x) (~(-(1ULL << (x)))) 0, /* NONE */ - _BM(8), _BM(16), _BM(32), /* RELOC_8, _16, _32 */ + _BM(8), _BM(16), _BM(32), /* RELOC_8, 16, 32 */ _BM(8), _BM(16), _BM(32), /* DISP8, DISP16, DISP32 */ _BM(30), _BM(22), /* WDISP30, WDISP22 */ - _BM(22), _BM(22), /* HI22, _22 */ - _BM(13), _BM(10), /* RELOC_13, _LO10 */ + _BM(22), _BM(22), /* HI22, 22 */ + _BM(13), _BM(10), /* RELOC_13, LO10 */ _BM(10), _BM(13), _BM(22), /* GOT10, GOT13, GOT22 */ - _BM(10), _BM(22), /* _PC10, _PC22 */ - _BM(30), 0, /* _WPLT30, _COPY */ - _BM(32), _BM(32), _BM(32), /* _GLOB_DAT, JMP_SLOT, _RELATIVE */ - _BM(32), _BM(32), /* _UA32, PLT32 */ - _BM(22), _BM(10), /* _HIPLT22, LOPLT10 */ - _BM(32), _BM(22), _BM(10), /* _PCPLT32, _PCPLT22, _PCPLT10 */ - _BM(10), _BM(11), -1, /* _10, _11, _64 */ - _BM(13), _BM(22), /* _OLO10, _HH22 */ - _BM(10), _BM(22), /* _HM10, _LM22 */ - _BM(22), _BM(10), _BM(22), /* _PC_HH22, _PC_HM10, _PC_LM22 */ - _BM(16), _BM(19), /* _WDISP16, _WDISP19 */ + _BM(10), _BM(22), /* PC10, PC22 */ + _BM(30), 0, /* WPLT30, COPY */ + _BM(32), _BM(32), _BM(32), /* GLOB_DAT, JMP_SLOT, RELATIVE */ + _BM(32), _BM(32), /* UA32, PLT32 */ + _BM(22), _BM(10), /* HIPLT22, LOPLT10 */ + _BM(32), _BM(22), _BM(10), /* PCPLT32, PCPLT22, PCPLT10 */ + _BM(10), _BM(11), -1, /* 10, 11, 64 */ + _BM(13), _BM(22), /* OLO10, HH22 */ + _BM(10), _BM(22), /* HM10, LM22 */ + _BM(22), _BM(10), _BM(22), /* PC_HH22, PC_HM10, PC_LM22 */ + _BM(16), _BM(19), /* WDISP16, WDISP19 */ -1, /* GLOB_JMP */ - _BM(7), _BM(5), _BM(6), /* _7, _5, _6 */ + _BM(7), _BM(5), _BM(6), /* 7, 5, 6 */ -1, -1, /* DISP64, PLT64 */ _BM(22), _BM(13), /* HIX22, LOX10 */ _BM(22), _BM(10), _BM(13), /* H44, M44, L44 */ -1, -1, _BM(16), /* REGISTER, UA64, UA16 */ + _BM(22), _BM(10), 0, _BM(30), /* GD_HI22, GD_LO10, GD_ADD, GD_CALL */ + _BM(22), _BM(10), 0, /* LDM_HI22, LDMO10, LDM_ADD */ + _BM(30), /* LDM_CALL */ + _BM(22), _BM(10), 0, /* LDO_HIX22, LDO_LOX10, LDO_ADD */ + _BM(22), _BM(10), 0, 0, /* IE_HI22, IE_LO10, IE_LD, IE_LDX */ + 0, /* IE_ADD */ + _BM(22), _BM(13), /* LE_HIX22, LE_LOX10 */ #undef _BM }; #define RELOC_VALUE_BITMASK(t) (reloc_target_bitmask[t]) @@ -228,7 +235,7 @@ do_copy_relocations(Obj_Entry *dstobj) ELF_R_SYM(rela->r_info)); for (srcobj = dstobj->next; srcobj != NULL; - srcobj = srcobj->next) { + srcobj = srcobj->next) { res = symlook_obj(&req, srcobj); if (res == 0) { srcsym = req.sym_out; @@ -303,11 +310,11 @@ reloc_nonplt_object(Obj_Entry *obj, cons if (type == R_SPARC_NONE) return (0); - /* We do JMP_SLOTs below */ + /* We do JMP_SLOTs below. */ if (type == R_SPARC_JMP_SLOT) return (0); - /* COPY relocs are also handled elsewhere */ + /* COPY relocs are also handled elsewhere. */ if (type == R_SPARC_COPY) return (0); @@ -321,11 +328,11 @@ reloc_nonplt_object(Obj_Entry *obj, cons value = rela->r_addend; /* - * Handle relative relocs here, because we might not - * be able to access globals yet. + * Handle relative relocs here, because we might not be able to access + * globals yet. */ if (type == R_SPARC_RELATIVE) { - /* XXXX -- apparently we ignore the preexisting value */ + /* XXXX -- apparently we ignore the preexisting value. */ *where = (Elf_Addr)(obj->relocbase + value); return (0); } @@ -335,14 +342,13 @@ reloc_nonplt_object(Obj_Entry *obj, cons * a non-local variable is accessed. */ if (RELOC_RESOLVE_SYMBOL(type)) { - - /* Find the symbol */ + /* Find the symbol. */ def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, false, cache, lockstate); if (def == NULL) return (-1); - /* Add in the symbol's absolute address */ + /* Add in the symbol's absolute address. */ value += (Elf_Addr)(defobj->relocbase + def->st_value); } @@ -445,7 +451,6 @@ reloc_plt(Obj_Entry *obj) #define SETHIG5 0x0b000000 /* sethi %hi(0), %g5 */ #define ORG5 0x82804005 /* or %g1, %g5, %g1 */ - /* %hi(v) with variable shift */ #define HIVAL(v, s) (((v) >> (s)) & 0x003fffff) #define LOVAL(v) ((v) & 0x000003ff) @@ -477,7 +482,7 @@ reloc_jmpslots(Obj_Entry *obj, RtldLockS Elf_Addr reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *obj, - const Obj_Entry *refobj, const Elf_Rel *rel) + const Obj_Entry *refobj, const Elf_Rel *rel) { const Elf_Rela *rela = (const Elf_Rela *)rel; Elf_Addr offset; @@ -734,21 +739,21 @@ install_plt(Elf_Word *pltgot, Elf_Addr p void allocate_initial_tls(Obj_Entry *objs) { - Elf_Addr* tpval; + Elf_Addr* tpval; - /* - * Fix the size of the static TLS block by using the maximum - * offset allocated so far and adding a bit for dynamic modules to - * use. - */ - tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; - tpval = allocate_tls(objs, NULL, 3*sizeof(Elf_Addr), sizeof(Elf_Addr)); - __asm __volatile("mov %0, %%g7" : : "r" (tpval)); + /* + * Fix the size of the static TLS block by using the maximum offset + * allocated so far and adding a bit for dynamic modules to use. + */ + tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; + tpval = allocate_tls(objs, NULL, 3 * sizeof(Elf_Addr), + sizeof(Elf_Addr)); + __asm __volatile("mov %0, %%g7" : : "r" (tpval)); } void *__tls_get_addr(tls_index *ti) { - register Elf_Addr** tp __asm__("%g7"); + register Elf_Addr** tp __asm__("%g7"); - return tls_get_addr_common(tp, ti->ti_module, ti->ti_offset); + return (tls_get_addr_common(tp, ti->ti_module, ti->ti_offset)); } Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Sun Mar 6 13:08:25 2011 (r219338) +++ head/sys/sparc64/sparc64/elf_machdep.c Sun Mar 6 13:25:46 2011 (r219339) @@ -227,9 +227,9 @@ static const char *const reloc_names[] = "GLOB_DAT", "JMP_SLOT", "RELATIVE", "UA_32", "PLT32", "HIPLT22", "LOPLT10", "LOPLT10", "PCPLT22", "PCPLT32", "10", "11", "64", "OLO10", "HH22", - "HM10", "LM22", "PC_HH22", "PC_HM10", "PC_LM22", + "HM10", "LM22", "PC_HH22", "PC_HM10", "PC_LM22", "WDISP16", "WDISP19", "GLOB_JMP", "7", "5", "6", - "DISP64", "PLT64", "HIX22", "LOX10", "H44", "M44", + "DISP64", "PLT64", "HIX22", "LOX10", "H44", "M44", "L44", "REGISTER", "UA64", "UA16" }; #endif @@ -252,19 +252,19 @@ static const long reloc_target_bitmask[] _BM(22), _BM(22), /* HI22, _22 */ _BM(13), _BM(10), /* RELOC_13, _LO10 */ _BM(10), _BM(13), _BM(22), /* GOT10, GOT13, GOT22 */ - _BM(10), _BM(22), /* _PC10, _PC22 */ - _BM(30), 0, /* _WPLT30, _COPY */ - _BM(32), _BM(32), _BM(32), /* _GLOB_DAT, JMP_SLOT, _RELATIVE */ - _BM(32), _BM(32), /* _UA32, PLT32 */ - _BM(22), _BM(10), /* _HIPLT22, LOPLT10 */ - _BM(32), _BM(22), _BM(10), /* _PCPLT32, _PCPLT22, _PCPLT10 */ - _BM(10), _BM(11), -1, /* _10, _11, _64 */ - _BM(13), _BM(22), /* _OLO10, _HH22 */ - _BM(10), _BM(22), /* _HM10, _LM22 */ - _BM(22), _BM(10), _BM(22), /* _PC_HH22, _PC_HM10, _PC_LM22 */ - _BM(16), _BM(19), /* _WDISP16, _WDISP19 */ + _BM(10), _BM(22), /* PC10, PC22 */ + _BM(30), 0, /* WPLT30, COPY */ + _BM(32), _BM(32), _BM(32), /* GLOB_DAT, JMP_SLOT, RELATIVE */ + _BM(32), _BM(32), /* UA32, PLT32 */ + _BM(22), _BM(10), /* HIPLT22, LOPLT10 */ + _BM(32), _BM(22), _BM(10), /* PCPLT32, _PCPLT22, _PCPLT10 */ + _BM(10), _BM(11), -1, /* 10, 11, 64 */ + _BM(13), _BM(22), /* OLO10, HH22 */ + _BM(10), _BM(22), /* HM10, LM22 */ + _BM(22), _BM(10), _BM(22), /* PC_HH22, PC_HM10, PC_LM22 */ + _BM(16), _BM(19), /* WDISP16, WDISP19 */ -1, /* GLOB_JMP */ - _BM(7), _BM(5), _BM(6) /* _7, _5, _6 */ + _BM(7), _BM(5), _BM(6) /* 7, 5, 6 */ -1, -1, /* DISP64, PLT64 */ _BM(22), _BM(13), /* HIX22, LOX10 */ _BM(22), _BM(10), _BM(13), /* H44, M44, L44 */ From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 15:20:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AFDD1065674; Sun, 6 Mar 2011 15:20:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FFA88FC12; Sun, 6 Mar 2011 15:20: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 p26FKB1Y002100; Sun, 6 Mar 2011 15:20:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26FKBiQ002097; Sun, 6 Mar 2011 15:20:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201103061520.p26FKBiQ002097@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Mar 2011 15:20: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: r219340 - in head: libexec/rtld-elf/sparc64 sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 15:20:12 -0000 Author: marius Date: Sun Mar 6 15:20:11 2011 New Revision: 219340 URL: http://svn.freebsd.org/changeset/base/219340 Log: - With the addition of TLS support binutils started to make the addend values for resolved symbols relative to relocbase instead of sections so detect this case and handle as appropriate, which allows using kernel modules linked with affected versions of binutils. Actually I think this is a bug in binutils but given that apparently nobody complained for nearly six years and powerpc has basically the same workaround I decided to put it in for the sparc64 kernel, too. - Fix R_SPARC_HIX22 relocations. Apparently these are hardly ever used. Modified: head/libexec/rtld-elf/sparc64/reloc.c head/sys/sparc64/sparc64/elf_machdep.c Modified: head/libexec/rtld-elf/sparc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/sparc64/reloc.c Sun Mar 6 13:25:46 2011 (r219339) +++ head/libexec/rtld-elf/sparc64/reloc.c Sun Mar 6 15:20:11 2011 (r219340) @@ -355,6 +355,9 @@ reloc_nonplt_object(Obj_Entry *obj, cons if (type == R_SPARC_OLO10) value = (value & 0x3ff) + ELF64_R_TYPE_DATA(rela->r_info); + if (type == R_SPARC_HIX22) + value ^= 0xffffffffffffffff; + if (RELOC_PC_RELATIVE(type)) value -= (Elf_Addr)where; Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Sun Mar 6 13:25:46 2011 (r219339) +++ head/sys/sparc64/sparc64/elf_machdep.c Sun Mar 6 15:20:11 2011 (r219340) @@ -332,7 +332,14 @@ elf_reloc(linker_file_t lf, Elf_Addr rel addr = lookup(lf, symidx, 1); if (addr == 0) return (-1); - value += addr; + /* + * With the addition of TLS support binutils started to make + * addend values relative to relocbase instead of sections. + */ + if (addr > relocbase && addr <= relocbase + value) + value += relocbase; + else + value += addr; if (RELOC_BARE_SYMBOL(rtype)) value = elf_relocaddr(lf, value); } @@ -340,6 +347,9 @@ elf_reloc(linker_file_t lf, Elf_Addr rel if (rtype == R_SPARC_OLO10) value = (value & 0x3ff) + ELF64_R_TYPE_DATA(rela->r_info); + if (rtype == R_SPARC_HIX22) + value ^= 0xffffffffffffffff; + if (RELOC_PC_RELATIVE(rtype)) value -= (Elf_Addr)where; From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 16:10:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB25106564A; Sun, 6 Mar 2011 16:10:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 496998FC18; Sun, 6 Mar 2011 16:10: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 p26GAdTS003145; Sun, 6 Mar 2011 16:10:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26GAd58003143; Sun, 6 Mar 2011 16:10:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201103061610.p26GAd58003143@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 Mar 2011 16:10: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: r219341 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 16:10:39 -0000 Author: mav Date: Sun Mar 6 16:10:39 2011 New Revision: 219341 URL: http://svn.freebsd.org/changeset/base/219341 Log: Add some more IDs of HighPoint RocketRAID 64x. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Mar 6 15:20:11 2011 (r219340) +++ head/sys/dev/ahci/ahci.c Sun Mar 6 16:10:39 2011 (r219341) @@ -186,7 +186,9 @@ static struct { {0x06221103, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, {0x06221b4b, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, {0x06401103, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, + {0x06401b4b, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, {0x06441103, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, + {0x06441b4b, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 17:43:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 524F9106566B; Sun, 6 Mar 2011 17:43:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 409998FC16; Sun, 6 Mar 2011 17:43: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 p26HhXnt005137; Sun, 6 Mar 2011 17:43:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26HhXIt005135; Sun, 6 Mar 2011 17:43:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103061743.p26HhXIt005135@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 6 Mar 2011 17:43: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: r219342 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 17:43:33 -0000 Author: pjd Date: Sun Mar 6 17:43:32 2011 New Revision: 219342 URL: http://svn.freebsd.org/changeset/base/219342 Log: Fix various issues in how %#T is handled: - If precision is 0, don't print period followed by no digits. - If precision is 0 stop printing units as soon as possible (eg. if we have three years and five days and precision is 0 print only 3y5d). - If precision is not 0, print all units (eg. 3y0d0h0m0s.00). MFC after: 2 weeks Modified: head/lib/libc/stdio/xprintf_time.c Modified: head/lib/libc/stdio/xprintf_time.c ============================================================================== --- head/lib/libc/stdio/xprintf_time.c Sun Mar 6 16:10:39 2011 (r219341) +++ head/lib/libc/stdio/xprintf_time.c Sun Mar 6 17:43:32 2011 (r219342) @@ -80,6 +80,12 @@ __printf_render_time(struct __printf_io nsec = 0; prec = 0; } + if (pi->is_long || pi->is_long_double) { + if (pi->prec >= 0) + prec = pi->prec; + if (prec == 0) + nsec = 0; + } p = buf; if (pi->alt) { @@ -88,26 +94,24 @@ __printf_render_time(struct __printf_io p += sprintf(p, "%jdy", t / YEAR); t %= YEAR; } - if (t >= DAY && t != 0) { + if (tx >= DAY && (t != 0 || prec != 0)) { p += sprintf(p, "%jdd", t / DAY); t %= DAY; } - if (t >= HOUR && t != 0) { + if (tx >= HOUR && (t != 0 || prec != 0)) { p += sprintf(p, "%jdh", t / HOUR); t %= HOUR; } - if (t >= MINUTE && t != 0) { + if (tx >= MINUTE && (t != 0 || prec != 0)) { p += sprintf(p, "%jdm", t / MINUTE); t %= MINUTE; } - if (t != 0 || tx == 0) + if (t != 0 || tx == 0 || prec != 0) p += sprintf(p, "%jds", t); } else { p += sprintf(p, "%jd", (intmax_t)t); } - if (pi->is_long || pi->is_long_double) { - if (pi->prec >= 0) - prec = pi->prec; + if (prec != 0) { for (i = prec; i < 9; i++) nsec /= 10; p += sprintf(p, ".%.*d", prec, nsec); From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 17:45:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B28551065672; Sun, 6 Mar 2011 17:45:37 +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 87B178FC0C; Sun, 6 Mar 2011 17:45: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 p26Hjb79005227; Sun, 6 Mar 2011 17:45:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26Hjbln005225; Sun, 6 Mar 2011 17:45:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103061745.p26Hjbln005225@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 6 Mar 2011 17:45: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: r219343 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 17:45:37 -0000 Author: pjd Date: Sun Mar 6 17:45:37 2011 New Revision: 219343 URL: http://svn.freebsd.org/changeset/base/219343 Log: Include stdio.h, so we can include printf.h in any order, as it needs FILE. MFC after: 2 weeks Modified: head/include/printf.h Modified: head/include/printf.h ============================================================================== --- head/include/printf.h Sun Mar 6 17:43:32 2011 (r219342) +++ head/include/printf.h Sun Mar 6 17:45:37 2011 (r219343) @@ -29,6 +29,7 @@ #ifndef _PRINTF_H_ #define _PRINTF_H_ +#include #include /* From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 17:46:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44C5A106566B; Sun, 6 Mar 2011 17:46: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 337A38FC24; Sun, 6 Mar 2011 17:46: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 p26Hk7Cn005274; Sun, 6 Mar 2011 17:46:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26Hk7N8005272; Sun, 6 Mar 2011 17:46:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103061746.p26Hk7N8005272@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 6 Mar 2011 17:46: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: r219344 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 17:46:07 -0000 Author: pjd Date: Sun Mar 6 17:46:06 2011 New Revision: 219344 URL: http://svn.freebsd.org/changeset/base/219344 Log: expand_number() needs uint64_t, declare it here if not already declared. MFC after: 3 days Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Sun Mar 6 17:45:37 2011 (r219343) +++ head/lib/libutil/libutil.h Sun Mar 6 17:46:06 2011 (r219344) @@ -52,6 +52,11 @@ typedef __int64_t int64_t; #define _INT64_T_DECLARED #endif +#ifndef _UINT64_T_DECLARED +typedef __uint64_t uint64_t; +#define _UINT64_T_DECLARED +#endif + #ifndef _PID_T_DECLARED typedef __pid_t pid_t; #define _PID_T_DECLARED From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 18:06:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0B48106564A; Sun, 6 Mar 2011 18:06:55 +0000 (UTC) (envelope-from lwindschuh@googlemail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 61F1C8FC18; Sun, 6 Mar 2011 18:06:55 +0000 (UTC) Received: by iwn33 with SMTP id 33so3896953iwn.13 for ; Sun, 06 Mar 2011 10:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=PYdk1SRFFDbzExi7n4HDx80L4Ygl0X7yfJEi3n6syQ4=; b=udBzB7rpILFqpI1X9AGuNbj6YdE1LeDvxRHQr8UZY7WoTVkO08aJG5Pe0jaUkHyCKx QyfbdKlcmJbhFxRxcENpOW0VZ67Fv98NbPWnRN5QsPvtSdim/LdgmXGuGmSP6v+n0DYj NxLyN24F68AnrQUSWhjAPMX7bcw4h2MrJQrNE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=DJLRGALAXtMUgndHChNHzsu+dU7uX6CAGxwNbA99hW/dIkUK2/gJlZTKQp0tus6Mf8 w7V7+KyiIMVbmEVhwoRmoG9fqLQ1d5Tohb6lPyS3dIoZH/ljCXwzXWbsDFhPioxaUlKK bih2Mzdm/lwuKpTGhGj7+EQM8zIOdfJjWZfBQ= MIME-Version: 1.0 Received: by 10.42.151.131 with SMTP id e3mr1639295icw.157.1299434814659; Sun, 06 Mar 2011 10:06:54 -0800 (PST) Received: by 10.231.46.16 with HTTP; Sun, 6 Mar 2011 10:06:54 -0800 (PST) In-Reply-To: <20110305194528.GA3892@dchagin.static.corbina.ru> References: <201102231323.p1NDNSVH061525@svn.freebsd.org> <20110305194528.GA3892@dchagin.static.corbina.ru> Date: Sun, 6 Mar 2011 19:06:54 +0100 Message-ID: From: Lucius Windschuh To: Chagin Dmitry Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r218970 - in head/sys: compat/linux sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 18:06:55 -0000 2011/3/5 Chagin Dmitry : > try r219242. kdump now (in HEAD) decode linux syscalls. also see ktr(4). Oh, forgot the first rule: "svn up" before posting. It works again, thank you. :-D Lucius From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 18:43:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73D4D1065673; Sun, 6 Mar 2011 18:43:59 +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 618158FC17; Sun, 6 Mar 2011 18:43: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 p26Ihx1w006517; Sun, 6 Mar 2011 18:43:59 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26Ihx8S006515; Sun, 6 Mar 2011 18:43:59 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201103061843.p26Ihx8S006515@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 6 Mar 2011 18:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219345 - stable/8/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 18:43:59 -0000 Author: jh Date: Sun Mar 6 18:43:59 2011 New Revision: 219345 URL: http://svn.freebsd.org/changeset/base/219345 Log: MFC r208927 by mjacob: Try and narrow the gap in which you act on an event that has been canceled. Modified: stable/8/sys/geom/geom_event.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/geom_event.c ============================================================================== --- stable/8/sys/geom/geom_event.c Sun Mar 6 17:46:06 2011 (r219344) +++ stable/8/sys/geom/geom_event.c Sun Mar 6 18:43:59 2011 (r219345) @@ -76,6 +76,7 @@ struct g_event { #define EV_DONE 0x80000 #define EV_WAKEUP 0x40000 #define EV_CANCELED 0x20000 +#define EV_INPROGRESS 0x10000 void g_waitidle(void) @@ -206,12 +207,19 @@ one_event(void) g_topology_unlock(); return (0); } + if (ep->flag & EV_INPROGRESS) { + mtx_unlock(&g_eventlock); + g_topology_unlock(); + return (1); + } + ep->flag |= EV_INPROGRESS; mtx_unlock(&g_eventlock); g_topology_assert(); ep->func(ep->arg, 0); g_topology_assert(); mtx_lock(&g_eventlock); TAILQ_REMOVE(&g_events, ep, events); + ep->flag &= ~EV_INPROGRESS; if (ep->flag & EV_WAKEUP) { ep->flag |= EV_DONE; mtx_unlock(&g_eventlock); @@ -256,6 +264,8 @@ g_cancel_event(void *ref) break; } TAILQ_FOREACH_SAFE(ep, &g_events, events, epn) { + if (ep->flag & EV_INPROGRESS) + continue; for (n = 0; n < G_N_EVENTREFS; n++) { if (ep->ref[n] == NULL) break; From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 19:47:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ADDE106564A; Sun, 6 Mar 2011 19:47:46 +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 88FD18FC1D; Sun, 6 Mar 2011 19:47: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 p26JlkBI007855; Sun, 6 Mar 2011 19:47:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26JlkDH007853; Sun, 6 Mar 2011 19:47:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103061947.p26JlkDH007853@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 6 Mar 2011 19:47: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: r219346 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 19:47:46 -0000 Author: pjd Date: Sun Mar 6 19:47:46 2011 New Revision: 219346 URL: http://svn.freebsd.org/changeset/base/219346 Log: Because we call __printf_out() with a on-stack buffer, also call __printf_flush() so we are sure it won't be referenced after we return. MFC after: 2 weeks Modified: head/lib/libc/stdio/xprintf_time.c Modified: head/lib/libc/stdio/xprintf_time.c ============================================================================== --- head/lib/libc/stdio/xprintf_time.c Sun Mar 6 18:43:59 2011 (r219345) +++ head/lib/libc/stdio/xprintf_time.c Sun Mar 6 19:47:46 2011 (r219346) @@ -62,7 +62,7 @@ __printf_render_time(struct __printf_io struct timespec *ts; time_t *tp; intmax_t t, tx; - int i, prec, nsec; + int i, prec, nsec, ret; if (pi->is_long) { tv = *((struct timeval **)arg[0]); @@ -116,5 +116,7 @@ __printf_render_time(struct __printf_io nsec /= 10; p += sprintf(p, ".%.*d", prec, nsec); } - return(__printf_out(io, pi, buf, p - buf)); + ret = __printf_out(io, pi, buf, p - buf); + __printf_flush(io); + return (ret); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 19:50:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E13531065674; Sun, 6 Mar 2011 19:50:47 +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 B5C7D8FC20; Sun, 6 Mar 2011 19:50: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 p26JolQN007955; Sun, 6 Mar 2011 19:50:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26Jolbt007952; Sun, 6 Mar 2011 19:50:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103061950.p26Jolbt007952@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 6 Mar 2011 19:50: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: r219347 - in head/usr.bin: killall truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 19:50:48 -0000 Author: jilles Date: Sun Mar 6 19:50:47 2011 New Revision: 219347 URL: http://svn.freebsd.org/changeset/base/219347 Log: Simplify various code that allowed for sys_signame being lower case. This was changed in r218285. Modified: head/usr.bin/killall/killall.c head/usr.bin/truss/main.c Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sun Mar 6 19:47:46 2011 (r219346) +++ head/usr.bin/killall/killall.c Sun Mar 6 19:50:47 2011 (r219347) @@ -60,18 +60,6 @@ usage(void) exit(1); } -static char * -upper(const char *str) -{ - static char buf[80]; - char *s; - - strlcpy(buf, str, sizeof(buf)); - for (s = buf; *s; s++) - *s = toupper((unsigned char)*s); - return buf; -} - static void printsig(FILE *fp) @@ -81,7 +69,7 @@ printsig(FILE *fp) int offset = 0; for (cnt = NSIG, p = sys_signame + 1; --cnt; ++p) { - offset += fprintf(fp, "%s ", upper(*p)); + offset += fprintf(fp, "%s ", *p); if (offset >= 75 && cnt > 1) { offset = 0; fprintf(fp, "\n"); @@ -401,14 +389,13 @@ main(int ac, char **av) thiscmd, thispid, thistdev, thisuid); if (vflag || sflag) - printf("kill -%s %d\n", upper(sys_signame[sig]), - thispid); + printf("kill -%s %d\n", sys_signame[sig], thispid); killed++; if (!dflag && !sflag) { if (kill(thispid, sig) < 0 /* && errno != ESRCH */ ) { warn("warning: kill -%s %d", - upper(sys_signame[sig]), thispid); + sys_signame[sig], thispid); errors = 1; } } Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Sun Mar 6 19:47:46 2011 (r219346) +++ head/usr.bin/truss/main.c Sun Mar 6 19:50:47 2011 (r219347) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -154,12 +153,9 @@ strsig(int sig) ret = NULL; if (sig > 0 && sig < NSIG) { - int i; asprintf(&ret, "SIG%s", sys_signame[sig]); if (ret == NULL) return (NULL); - for (i = 0; ret[i] != '\0'; ++i) - ret[i] = toupper(ret[i]); } return (ret); } From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 20:12:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DA7C106566B; Sun, 6 Mar 2011 20:12:10 +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 EFCD08FC08; Sun, 6 Mar 2011 20:12: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 p26KC9Hl008503; Sun, 6 Mar 2011 20:12:09 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26KC9IG008501; Sun, 6 Mar 2011 20:12:09 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201103062012.p26KC9IG008501@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 6 Mar 2011 20:12: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: r219348 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 20:12:10 -0000 Author: trasz Date: Sun Mar 6 20:12:09 2011 New Revision: 219348 URL: http://svn.freebsd.org/changeset/base/219348 Log: Temporarily revert r219272; it breaks acl_is_trivial_np(3). Modified: head/sys/kern/subr_acl_nfs4.c Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Sun Mar 6 19:50:47 2011 (r219347) +++ head/sys/kern/subr_acl_nfs4.c Sun Mar 6 20:12:09 2011 (r219348) @@ -55,12 +55,12 @@ void acl_nfs4_trivial_from_mode(struct #endif /* !_KERNEL */ -static int acl_nfs4_old_semantics = 0; +static int acl_nfs4_old_semantics = 1; #ifdef _KERNEL SYSCTL_INT(_vfs, OID_AUTO, acl_nfs4_old_semantics, CTLFLAG_RW, - &acl_nfs4_old_semantics, 0, "Use pre-PSARC/2010/029 NFSv4 ACL semantics"); + &acl_nfs4_old_semantics, 1, "Use pre-PSARC/2010/029 NFSv4 ACL semantics"); static struct { accmode_t accmode; From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 21:19:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E567E1065675; Sun, 6 Mar 2011 21:19:33 +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 D2BD88FC15; Sun, 6 Mar 2011 21:19: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 p26LJX7t009923; Sun, 6 Mar 2011 21:19:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26LJXXR009921; Sun, 6 Mar 2011 21:19:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103062119.p26LJXXR009921@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 6 Mar 2011 21:19: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: r219349 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 21:19:34 -0000 Author: nwhitehorn Date: Sun Mar 6 21:19:33 2011 New Revision: 219349 URL: http://svn.freebsd.org/changeset/base/219349 Log: Make this makefile a little more make-like (e.g. build only things that need to be rebuilt) and add an FTP-area target. Next will be docs and memstick builds. Modified: head/release/Makefile.bsdinstall Modified: head/release/Makefile.bsdinstall ============================================================================== --- head/release/Makefile.bsdinstall Sun Mar 6 20:12:09 2011 (r219348) +++ head/release/Makefile.bsdinstall Sun Mar 6 21:19:33 2011 (r219349) @@ -1,7 +1,22 @@ # $FreeBSD$ +# +# Makefile for building releases and release media. +# +# User-driven targets: +# cdrom: Builds release CD-ROM media (release.iso) +# ftp: Sets up FTP distribution area (ftp) +# release: Build all media and FTP distribution area +# +# Variables affecting the build process: +# WORLDDIR: location of src tree -- must have built world and default kernel +# (by default, the directory above this one) +# PORTSDIR: location of ports tree to distribute (default: /usr/ports) +# NOPORTS: if set, do not distribute ports tree +# NOSRC: if set, do not distribute source tree +# TARGET/TARGET_ARCH: architecture of built release +# WORLDDIR?= ${.CURDIR}/.. -DISTDIR?= ${DESTDIR}/usr/freebsd-dist PORTSDIR?= /usr/ports TARGET_ARCH?= ${MACHINE_ARCH} @@ -11,43 +26,79 @@ TARGET?= ${MACHINE} TARGET?= ${TARGET_ARCH} .endif IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} +DISTDIR= ${.OBJDIR}/dist -packagesystem: - -mkdir -p ${DISTDIR} - cd ${WORLDDIR} && ${IMAKE} distributeworld distributekernel DISTDIR=${DISTDIR} +EXTRA_PACKAGES= +.if !defined(NOPORTS) +EXTRA_PACKAGES+= ports.txz +.endif +.if !defined(NOSRC) +EXTRA_PACKAGES+= src.txz +.endif + +.include + +base.txz: + -mkdir ${DISTDIR} + cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${DISTDIR} # Set up mergemaster root database sh ${.CURDIR}/scripts/mm-mtree.sh -F "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${DISTDIR}/base" - cd ${WORLDDIR} && ${IMAKE} packageworld packagekernel DISTDIR=${DISTDIR} + cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${DISTDIR} + mv ${DISTDIR}/*.txz ${.OBJDIR} + +kernel.txz: + -mkdir ${DISTDIR} + cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${DISTDIR} + mv ${DISTDIR}/kernel.txz ${.OBJDIR} + +src.txz: -mkdir -p ${DISTDIR}/usr -# Package up src and ports trees ln -fs ${WORLDDIR} ${DISTDIR}/usr/src + cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude CVS usr/src + +ports.txz: + -mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports -.if !defined(NOPORTS) - cd ${DISTDIR} && tar cLvJf ${DISTDIR}/ports.txz --exclude usr/ports/distfiles --exclude usr/ports/packages --exclude 'usr/ports/INDEX*' usr/ports -.endif -.if !defined(NOSRC) - cd ${DISTDIR} && tar cLvJf ${DISTDIR}/src.txz --exclude .svn --exclude CVS usr/src -.endif + cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz --exclude usr/ports/distfiles --exclude usr/ports/packages --exclude 'usr/ports/INDEX*' usr/ports -system: +system: packagesystem # Install system - -mkdir ${DISTDIR}/release - cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution DESTDIR=${DISTDIR}/release - -rm ${DISTDIR}/release/boot/kernel/*.symbols + -mkdir ${.OBJDIR}/release + cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution DESTDIR=${.OBJDIR}/release + -rm ${.OBJDIR}/release/boot/kernel/*.symbols # Copy distfiles - mkdir ${DISTDIR}/release/usr/freebsd-dist - cp ${DISTDIR}/*.txz ${DISTDIR}/release/usr/freebsd-dist + mkdir ${.OBJDIR}/release/usr/freebsd-dist + cp ${.OBJDIR}/*.txz ${.OBJDIR}/release/usr/freebsd-dist # Set up installation environment - ln -s /tmp/bsdinstall_etc/resolv.conf ${DISTDIR}/release/etc/resolv.conf - echo sendmail_enable=\"NONE\" > ${DISTDIR}/release/etc/rc.conf - echo hostid_enable=\"NO\" >> ${DISTDIR}/release/etc/rc.conf - touch ${DISTDIR}/release/etc/fstab - cp rc.local ${DISTDIR}/release/etc - -cdrom: - echo kernel_options=\"-C\" > ${DISTDIR}/release/boot/loader.conf - sh /usr/src/release/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${DISTDIR}/release.iso ${DISTDIR}/release - rm ${DISTDIR}/release/boot/loader.conf + ln -s /tmp/bsdinstall_etc/resolv.conf ${.OBJDIR}/release/etc/resolv.conf + echo sendmail_enable=\"NONE\" > ${.OBJDIR}/release/etc/rc.conf + echo hostid_enable=\"NO\" >> ${.OBJDIR}/release/etc/rc.conf + touch ${.OBJDIR}/release/etc/fstab + cp ${.CURDIR}/rc.local ${.OBJDIR}/release/etc + touch ${.OBJDIR}/${.TARGET} + +release.iso: system + echo kernel_options=\"-C\" > ${.OBJDIR}/release/boot/loader.conf + sh /usr/src/release/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.OBJDIR}/release.iso ${.OBJDIR}/release + rm ${.OBJDIR}/release/boot/loader.conf + +packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} + touch ${.OBJDIR}/${.TARGET} + +cdrom: release.iso +ftp: packagesystem + mkdir ${.OBJDIR}/ftp + cp ${.OBJDIR}/*.txz ${.OBJDIR}/ftp + +release: cdrom ftp + +clean: + chflags -R noschg ${.OBJDIR} + rm -rf ${.OBJDIR}/dist ${.OBJDIR}/ftp + rm -f packagesystem + rm -f ${.OBJDIR}/*.txz + rm -f system + rm -rf ${.OBJDIR}/release + rm -f ${.OBJDIR}/release.iso + rm -f ${.OBJDIR}/*.txz -release: packagesystem system cdrom - From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 21:20:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CCCA1065673; Sun, 6 Mar 2011 21:20:54 +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 EEF3C8FC18; Sun, 6 Mar 2011 21:20:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p26LKrc0009994; Sun, 6 Mar 2011 21:20:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26LKrKk009992; Sun, 6 Mar 2011 21:20:53 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103062120.p26LKrKk009992@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 6 Mar 2011 21:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219350 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 21:20:54 -0000 Author: jilles Date: Sun Mar 6 21:20:53 2011 New Revision: 219350 URL: http://svn.freebsd.org/changeset/base/219350 Log: sh(1): Reduce excessive semicolon-separated sentences. Reported by: Benjamin Kaduk Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Mar 6 21:19:33 2011 (r219349) +++ head/bin/sh/sh.1 Sun Mar 6 21:20:53 2011 (r219350) @@ -1837,13 +1837,13 @@ Terminate the shell process. If .Ar exitstatus is given -it is used as the exit status of the shell; -otherwise, if the shell is executing an +it is used as the exit status of the shell. +Otherwise, if the shell is executing an .Cm EXIT trap, the exit status of the last command before the trap is used; if the shell is executing a trap for a signal, -the shell exits by resending the signal to itself; -otherwise, the exit status of the preceding command is used. +the shell exits by resending the signal to itself. +Otherwise, the exit status of the preceding command is used. The exit status should be an integer between 0 and 255. .It Ic export Ar name ... .It Ic export Op Fl p From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 22:56:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09F21106566C; Sun, 6 Mar 2011 22:56: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 E9FAF8FC08; Sun, 6 Mar 2011 22:56: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 p26MuExf012008; Sun, 6 Mar 2011 22:56:14 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26MuE6E011992; Sun, 6 Mar 2011 22:56:14 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103062256.p26MuE6E011992@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 6 Mar 2011 22:56: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: r219351 - in head/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 22:56:15 -0000 Author: pjd Date: Sun Mar 6 22:56:14 2011 New Revision: 219351 URL: http://svn.freebsd.org/changeset/base/219351 Log: Allow to checksum on-the-wire data using either CRC32 or SHA256. MFC after: 2 weeks Added: head/sbin/hastd/crc32.c (contents, props changed) head/sbin/hastd/crc32.h (contents, props changed) head/sbin/hastd/hast_checksum.c (contents, props changed) head/sbin/hastd/hast_checksum.h (contents, props changed) Modified: head/sbin/hastctl/Makefile head/sbin/hastd/Makefile head/sbin/hastd/control.c head/sbin/hastd/hast.conf.5 head/sbin/hastd/hast.h head/sbin/hastd/hast_proto.c head/sbin/hastd/hastd.c head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/token.l Modified: head/sbin/hastctl/Makefile ============================================================================== --- head/sbin/hastctl/Makefile Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastctl/Makefile Sun Mar 6 22:56:14 2011 (r219351) @@ -6,8 +6,9 @@ PROG= hastctl SRCS= activemap.c +SRCS+= crc32.c SRCS+= ebuf.c -SRCS+= hast_proto.c hastctl.c +SRCS+= hast_checksum.c hast_proto.c hastctl.c SRCS+= metadata.c SRCS+= nv.c SRCS+= parse.y pjdlog.c Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/Makefile Sun Mar 6 22:56:14 2011 (r219351) @@ -4,9 +4,9 @@ PROG= hastd SRCS= activemap.c -SRCS+= control.c +SRCS+= control.c crc32.c SRCS+= ebuf.c event.c -SRCS+= hast_proto.c hastd.c hooks.c +SRCS+= hast_checksum.c hast_proto.c hastd.c hooks.c SRCS+= metadata.c SRCS+= nv.c SRCS+= secondary.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/control.c Sun Mar 6 22:56:14 2011 (r219351) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "hast.h" #include "hastd.h" +#include "hast_checksum.h" #include "hast_proto.h" #include "hooks.h" #include "nv.h" @@ -246,6 +247,8 @@ control_status(struct hastd_config *cfg, nv_add_string(nvout, "unknown", "replication%u", no); break; } + nv_add_string(nvout, checksum_name(res->hr_checksum), + "checksum%u", no); nv_add_string(nvout, role2str(res->hr_role), "role%u", no); switch (res->hr_role) { Added: head/sbin/hastd/crc32.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/crc32.c Sun Mar 6 22:56:14 2011 (r219351) @@ -0,0 +1,115 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + */ + +/* + * First, the polynomial itself and its table of feedback terms. The + * polynomial is + * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 + * + * Note that we take it "backwards" and put the highest-order term in + * the lowest-order bit. The X^32 term is "implied"; the LSB is the + * X^31 term, etc. The X^0 term (usually shown as "+1") results in + * the MSB being 1 + * + * Note that the usual hardware shift register implementation, which + * is what we're using (we're merely optimizing it by doing eight-bit + * chunks at a time) shifts bits into the lowest-order term. In our + * implementation, that means shifting towards the right. Why do we + * do it this way? Because the calculated CRC must be transmitted in + * order from highest-order term to lowest-order term. UARTs transmit + * characters in order from LSB to MSB. By storing the CRC this way + * we hand it to the UART in the order low-byte to high-byte; the UART + * sends each low-bit to hight-bit; and the result is transmission bit + * by bit from highest- to lowest-order term without requiring any bit + * shuffling on our part. Reception works similarly + * + * The feedback terms table consists of 256, 32-bit entries. Notes + * + * The table can be generated at runtime if desired; code to do so + * is shown later. It might not be obvious, but the feedback + * terms simply represent the results of eight shift/xor opera + * tions for all combinations of data and CRC register values + * + * The values must be right-shifted by eight bits by the "updcrc + * logic; the shift must be unsigned (bring in zeroes). On some + * hardware you could probably optimize the shift in assembler by + * using byte-swap instructions + * polynomial $edb88320 + * + * + * CRC32 code derived from work by Gary S. Brown. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +uint32_t crc32_tab[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +/* + * A function that calculates the CRC-32 based on the table above is + * given below for documentation purposes. An equivalent implementation + * of this function that's actually used in the kernel can be found + * in sys/libkern.h, where it can be inlined. + * + * uint32_t + * crc32(const void *buf, size_t size) + * { + * const uint8_t *p = buf; + * uint32_t crc; + * + * crc = ~0U; + * while (size--) + * crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + * return crc ^ ~0U; + * } + */ Added: head/sbin/hastd/crc32.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/crc32.h Sun Mar 6 22:56:14 2011 (r219351) @@ -0,0 +1,28 @@ +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * $FreeBSD$ + */ + +#ifndef _CRC32_H_ +#define _CRC32_H_ + +#include /* uint32_t */ +#include /* size_t */ + +extern uint32_t crc32_tab[]; + +static __inline uint32_t +crc32(const void *buf, size_t size) +{ + const uint8_t *p = buf; + uint32_t crc; + + crc = ~0U; + while (size--) + crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + return (crc ^ ~0U); +} + +#endif /* !_CRC32_H_ */ Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/hast.conf.5 Sun Mar 6 22:56:14 2011 (r219351) @@ -1,5 +1,5 @@ .\" Copyright (c) 2010 The FreeBSD Foundation -.\" Copyright (c) 2010 Pawel Jakub Dawidek +.\" Copyright (c) 2010-2011 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -59,6 +59,7 @@ file is following: control listen replication +checksum timeout exec @@ -77,6 +78,7 @@ on { resource { # Resource section replication + checksum name local timeout @@ -201,6 +203,18 @@ The .Ic async replication mode is currently not implemented. .El +.It Ic checksum Aq algorithm +.Pp +Checksum algorithm should be one of the following: +.Bl -tag -width ".Ic sha256" +.It Ic none +No checksum will be calculated for the data being send over the network. +This is the default setting. +.It Ic crc32 +CRC32 checksum will be calculated. +.It Ic sha256 +SHA256 checksum will be calculated. +.El .It Ic timeout Aq seconds .Pp Connection timeout in seconds. Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/hast.h Sun Mar 6 22:56:14 2011 (r219351) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -116,6 +117,10 @@ struct hastd_config { #define HAST_REPLICATION_MEMSYNC 1 #define HAST_REPLICATION_ASYNC 2 +#define HAST_CHECKSUM_NONE 0 +#define HAST_CHECKSUM_CRC32 1 +#define HAST_CHECKSUM_SHA256 2 + /* * Structure that describes single resource. */ @@ -132,6 +137,8 @@ struct hast_resource { int hr_keepdirty; /* Path to a program to execute on various events. */ char hr_exec[PATH_MAX]; + /* Checksum algorithm. */ + int hr_checksum; /* Path to local component. */ char hr_localpath[PATH_MAX]; Added: head/sbin/hastd/hast_checksum.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/hast_checksum.c Sun Mar 6 22:56:14 2011 (r219351) @@ -0,0 +1,169 @@ +/*- + * Copyright (c) 2011 Pawel Jakub Dawidek + * 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 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 + +#ifdef HAVE_CRYPTO +#include +#endif + +#include +#include +#include +#include + +#include "hast_checksum.h" + +#ifdef HAVE_CRYPTO +#define MAX_HASH_SIZE SHA256_DIGEST_LENGTH +#else +#define MAX_HASH_SIZE 4 +#endif + +static int +hast_crc32_checksum(const unsigned char *data, size_t size, + unsigned char *hash, size_t *hsizep) +{ + uint32_t crc; + + crc = crc32(data, size); + /* XXXPJD: Do we have to use htole32() on crc first? */ + bcopy(&crc, hash, sizeof(crc)); + *hsizep = sizeof(crc); + + return (0); +} + +#ifdef HAVE_CRYPTO +static int +hast_sha256_checksum(const unsigned char *data, size_t size, + unsigned char *hash, size_t *hsizep) +{ + SHA256_CTX ctx; + + SHA256_Init(&ctx); + SHA256_Update(&ctx, data, size); + SHA256_Final(hash, &ctx); + *hsizep = SHA256_DIGEST_LENGTH; + + return (0); +} +#endif /* HAVE_CRYPTO */ + +const char * +checksum_name(int num) +{ + + switch (num) { + case HAST_CHECKSUM_NONE: + return ("none"); + case HAST_CHECKSUM_CRC32: + return ("crc32"); + case HAST_CHECKSUM_SHA256: + return ("sha256"); + } + return ("unknown"); +} + +int +checksum_send(const struct hast_resource *res, struct nv *nv, void **datap, + size_t *sizep, bool *freedatap __unused) +{ + unsigned char hash[MAX_HASH_SIZE]; + size_t hsize; + int ret; + + switch (res->hr_checksum) { + case HAST_CHECKSUM_NONE: + return (0); + case HAST_CHECKSUM_CRC32: + ret = hast_crc32_checksum(*datap, *sizep, hash, &hsize); + break; +#ifdef HAVE_CRYPTO + case HAST_CHECKSUM_SHA256: + ret = hast_sha256_checksum(*datap, *sizep, hash, &hsize); + break; +#endif + default: + PJDLOG_ABORT("Invalid checksum: %d.", res->hr_checksum); + } + + if (ret != 0) + return (ret); + nv_add_string(nv, checksum_name(res->hr_checksum), "checksum"); + nv_add_uint8_array(nv, hash, hsize, "hash"); + if (nv_error(nv) != 0) { + errno = nv_error(nv); + return (-1); + } + return (0); +} + +int +checksum_recv(const struct hast_resource *res __unused, struct nv *nv, + void **datap, size_t *sizep, bool *freedatap __unused) +{ + unsigned char chash[MAX_HASH_SIZE]; + const unsigned char *rhash; + size_t chsize, rhsize; + const char *algo; + int ret; + + algo = nv_get_string(nv, "checksum"); + if (algo == NULL) + return (0); /* No checksum. */ + rhash = nv_get_uint8_array(nv, &rhsize, "hash"); + if (rhash == NULL) { + pjdlog_error("Hash is missing."); + return (-1); /* Hash not found. */ + } + if (strcmp(algo, "crc32") == 0) + ret = hast_crc32_checksum(*datap, *sizep, chash, &chsize); +#ifdef HAVE_CRYPTO + else if (strcmp(algo, "sha256") == 0) + ret = hast_sha256_checksum(*datap, *sizep, chash, &chsize); +#endif + else { + pjdlog_error("Unknown checksum algorithm '%s'.", algo); + return (-1); /* Unknown checksum algorithm. */ + } + if (rhsize != chsize) { + pjdlog_error("Invalid hash size (%zu) for %s, should be %zu.", + rhsize, algo, chsize); + return (-1); /* Different hash size. */ + } + if (bcmp(rhash, chash, chsize) != 0) { + pjdlog_error("Hash mismatch."); + return (-1); /* Hash mismatch. */ + } + + return (0); +} Added: head/sbin/hastd/hast_checksum.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/hast_checksum.h Sun Mar 6 22:56:14 2011 (r219351) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2011 Pawel Jakub Dawidek + * 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 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$ + */ + +#ifndef _HAST_CHECKSUM_H_ +#define _HAST_CHECKSUM_H_ + +#include /* size_t */ + +#include +#include + +const char *checksum_name(int num); + +int checksum_send(const struct hast_resource *res, struct nv *nv, + void **datap, size_t *sizep, bool *freedatap); +int checksum_recv(const struct hast_resource *res, struct nv *nv, + void **datap, size_t *sizep, bool *freedatap); + +#endif /* !_HAST_CHECKSUM_H_ */ Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/hast_proto.c Sun Mar 6 22:56:14 2011 (r219351) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -34,19 +35,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#ifdef HAVE_CRYPTO -#include -#endif - #include #include #include #include #include +#ifdef HAVE_CRYPTO +#include "hast_checksum.h" +#endif #include "hast_proto.h" struct hast_main_header { @@ -67,171 +66,10 @@ struct hast_pipe_stage { hps_recv_t *hps_recv; }; -static int compression_send(const struct hast_resource *res, struct nv *nv, - void **datap, size_t *sizep, bool *freedatap); -static int compression_recv(const struct hast_resource *res, struct nv *nv, - void **datap, size_t *sizep, bool *freedatap); -#ifdef HAVE_CRYPTO -static int checksum_send(const struct hast_resource *res, struct nv *nv, - void **datap, size_t *sizep, bool *freedatap); -static int checksum_recv(const struct hast_resource *res, struct nv *nv, - void **datap, size_t *sizep, bool *freedatap); -#endif - static struct hast_pipe_stage pipeline[] = { - { "compression", compression_send, compression_recv }, -#ifdef HAVE_CRYPTO { "checksum", checksum_send, checksum_recv } -#endif }; -static int -compression_send(const struct hast_resource *res, struct nv *nv, void **datap, - size_t *sizep, bool *freedatap) -{ - unsigned char *newbuf; - - res = res; /* TODO */ - - /* - * TODO: For now we emulate compression. - * At 80% probability we succeed to compress data, which means we - * allocate new buffer, copy the data over set *freedatap to true. - */ - - if (arc4random_uniform(100) < 80) { - uint32_t *origsize; - - /* - * Compression succeeded (but we will grow by 4 bytes, not - * shrink for now). - */ - newbuf = malloc(sizeof(uint32_t) + *sizep); - if (newbuf == NULL) - return (-1); - origsize = (void *)newbuf; - *origsize = htole32((uint32_t)*sizep); - nv_add_string(nv, "null", "compression"); - if (nv_error(nv) != 0) { - free(newbuf); - errno = nv_error(nv); - return (-1); - } - bcopy(*datap, newbuf + sizeof(uint32_t), *sizep); - if (*freedatap) - free(*datap); - *freedatap = true; - *datap = newbuf; - *sizep = sizeof(uint32_t) + *sizep; - } else { - /* - * Compression failed, so we leave everything as it was. - * It is not critical for compression to succeed. - */ - } - - return (0); -} - -static int -compression_recv(const struct hast_resource *res, struct nv *nv, void **datap, - size_t *sizep, bool *freedatap) -{ - unsigned char *newbuf; - const char *algo; - size_t origsize; - - res = res; /* TODO */ - - /* - * TODO: For now we emulate compression. - */ - - algo = nv_get_string(nv, "compression"); - if (algo == NULL) - return (0); /* No compression. */ - if (strcmp(algo, "null") != 0) { - pjdlog_error("Unknown compression algorithm '%s'.", algo); - return (-1); /* Unknown compression algorithm. */ - } - - origsize = le32toh(*(uint32_t *)*datap); - newbuf = malloc(origsize); - if (newbuf == NULL) - return (-1); - bcopy((unsigned char *)*datap + sizeof(uint32_t), newbuf, origsize); - if (*freedatap) - free(*datap); - *freedatap = true; - *datap = newbuf; - *sizep = origsize; - - return (0); -} - -#ifdef HAVE_CRYPTO -static int -checksum_send(const struct hast_resource *res, struct nv *nv, void **datap, - size_t *sizep, bool *freedatap __unused) -{ - unsigned char hash[SHA256_DIGEST_LENGTH]; - SHA256_CTX ctx; - - res = res; /* TODO */ - - SHA256_Init(&ctx); - SHA256_Update(&ctx, *datap, *sizep); - SHA256_Final(hash, &ctx); - - nv_add_string(nv, "sha256", "checksum"); - nv_add_uint8_array(nv, hash, sizeof(hash), "hash"); - - return (0); -} - -static int -checksum_recv(const struct hast_resource *res, struct nv *nv, void **datap, - size_t *sizep, bool *freedatap __unused) -{ - unsigned char chash[SHA256_DIGEST_LENGTH]; - const unsigned char *rhash; - SHA256_CTX ctx; - const char *algo; - size_t size; - - res = res; /* TODO */ - - algo = nv_get_string(nv, "checksum"); - if (algo == NULL) - return (0); /* No checksum. */ - if (strcmp(algo, "sha256") != 0) { - pjdlog_error("Unknown checksum algorithm '%s'.", algo); - return (-1); /* Unknown checksum algorithm. */ - } - rhash = nv_get_uint8_array(nv, &size, "hash"); - if (rhash == NULL) { - pjdlog_error("Checksum algorithm is present, but hash is missing."); - return (-1); /* Hash not found. */ - } - if (size != sizeof(chash)) { - pjdlog_error("Invalid hash size (%zu) for %s, should be %zu.", - size, algo, sizeof(chash)); - return (-1); /* Different hash size. */ - } - - SHA256_Init(&ctx); - SHA256_Update(&ctx, *datap, *sizep); - SHA256_Final(chash, &ctx); - - if (bcmp(rhash, chash, sizeof(chash)) != 0) { - pjdlog_error("Hash mismatch."); - return (-1); /* Hash mismatch. */ - } - - return (0); -} -#endif /* HAVE_CRYPTO */ - /* * Send the given nv structure via conn. * We keep headers in nv structure and pass data in separate argument. @@ -253,18 +91,13 @@ hast_proto_send(const struct hast_resour ret = -1; if (data != NULL) { -if (false) { unsigned int ii; for (ii = 0; ii < sizeof(pipeline) / sizeof(pipeline[0]); ii++) { - ret = pipeline[ii].hps_send(res, nv, &dptr, &size, + (void)pipeline[ii].hps_send(res, nv, &dptr, &size, &freedata); - if (ret == -1) - goto end; } - ret = -1; -} nv_add_uint32(nv, size, "size"); if (nv_error(nv) != 0) { errno = nv_error(nv); @@ -359,27 +192,24 @@ hast_proto_recv_data(const struct hast_r else { if (proto_recv(conn, data, dsize) < 0) goto end; -if (false) { for (ii = sizeof(pipeline) / sizeof(pipeline[0]); ii > 0; ii--) { - assert(!"to be verified"); ret = pipeline[ii - 1].hps_recv(res, nv, &dptr, &dsize, &freedata); if (ret == -1) goto end; } ret = -1; - if (dsize < size) + if (dsize > size) { + errno = EINVAL; goto end; - /* TODO: 'size' doesn't seem right here. It is maximum data size. */ + } if (dptr != data) bcopy(dptr, data, dsize); -} } ret = 0; end: -if (ret < 0) printf("%s:%u %s\n", __func__, __LINE__, strerror(errno)); if (freedata) free(dptr); return (ret); Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/hastd.c Sun Mar 6 22:56:14 2011 (r219351) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation - * Copyright (c) 2010-2011 Pawel Jakub Dawidek + * Copyright (c) 2010-2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -361,6 +361,8 @@ resource_needs_restart(const struct hast return (true); if (res0->hr_replication != res1->hr_replication) return (true); + if (res0->hr_checksum != res1->hr_checksum) + return (true); if (res0->hr_timeout != res1->hr_timeout) return (true); if (strcmp(res0->hr_exec, res1->hr_exec) != 0) @@ -385,6 +387,8 @@ resource_needs_reload(const struct hast_ return (true); if (res0->hr_replication != res1->hr_replication) return (true); + if (res0->hr_checksum != res1->hr_checksum) + return (true); if (res0->hr_timeout != res1->hr_timeout) return (true); if (strcmp(res0->hr_exec, res1->hr_exec) != 0) @@ -404,6 +408,7 @@ resource_reload(const struct hast_resour nv_add_uint8(nvout, HASTCTL_RELOAD, "cmd"); nv_add_string(nvout, res->hr_remoteaddr, "remoteaddr"); nv_add_int32(nvout, (int32_t)res->hr_replication, "replication"); + nv_add_int32(nvout, (int32_t)res->hr_checksum, "checksum"); nv_add_int32(nvout, (int32_t)res->hr_timeout, "timeout"); nv_add_string(nvout, res->hr_exec, "exec"); if (nv_error(nvout) != 0) { @@ -562,6 +567,7 @@ hastd_reload(void) strlcpy(cres->hr_remoteaddr, nres->hr_remoteaddr, sizeof(cres->hr_remoteaddr)); cres->hr_replication = nres->hr_replication; + cres->hr_checksum = nres->hr_checksum; cres->hr_timeout = nres->hr_timeout; strlcpy(cres->hr_exec, nres->hr_exec, sizeof(cres->hr_exec)); Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/parse.y Sun Mar 6 22:56:14 2011 (r219351) @@ -1,6 +1,7 @@ %{ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -60,6 +61,7 @@ static bool mynode, hadmynode; static char depth0_control[HAST_ADDRSIZE]; static char depth0_listen[HAST_ADDRSIZE]; static int depth0_replication; +static int depth0_checksum; static int depth0_timeout; static char depth0_exec[PATH_MAX]; @@ -167,6 +169,7 @@ yy_config_parse(const char *config, bool depth0_timeout = HAST_TIMEOUT; depth0_replication = HAST_REPLICATION_MEMSYNC; + depth0_checksum = HAST_CHECKSUM_NONE; strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); strlcpy(depth0_listen, HASTD_LISTEN, sizeof(depth0_listen)); depth0_exec[0] = '\0'; @@ -223,6 +226,13 @@ yy_config_parse(const char *config, bool */ curres->hr_replication = depth0_replication; } + if (curres->hr_checksum == -1) { + /* + * Checksum is not set at resource-level. + * Use global or default setting. + */ + curres->hr_checksum = depth0_checksum; + } if (curres->hr_timeout == -1) { /* * Timeout is not set at resource-level. @@ -256,11 +266,13 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL LISTEN PORT REPLICATION TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE ON -%token FULLSYNC MEMSYNC ASYNC +%token CONTROL LISTEN PORT REPLICATION CHECKSUM +%token TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE ON +%token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 %token NUM STR OB CB %type replication_type +%type checksum_type %union { @@ -285,6 +297,8 @@ statement: | replication_statement | + checksum_statement + | timeout_statement | exec_statement @@ -378,6 +392,30 @@ replication_type: ASYNC { $$ = HAST_REPLICATION_ASYNC; } ; +checksum_statement: CHECKSUM checksum_type + { + switch (depth) { + case 0: + depth0_checksum = $2; + break; + case 1: + if (curres != NULL) + curres->hr_checksum = $2; + break; + default: + assert(!"checksum at wrong depth level"); + } + } + ; + +checksum_type: + NONE { $$ = HAST_CHECKSUM_NONE; } + | + CRC32 { $$ = HAST_CHECKSUM_CRC32; } + | + SHA256 { $$ = HAST_CHECKSUM_SHA256; } + ; + timeout_statement: TIMEOUT NUM { switch (depth) { @@ -570,6 +608,7 @@ resource_start: STR curres->hr_role = HAST_ROLE_INIT; curres->hr_previous_role = HAST_ROLE_INIT; curres->hr_replication = -1; + curres->hr_checksum = -1; curres->hr_timeout = -1; curres->hr_exec[0] = '\0'; curres->hr_provname[0] = '\0'; @@ -588,6 +627,8 @@ resource_entries: resource_entry: replication_statement | + checksum_statement + | timeout_statement | exec_statement Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/primary.c Sun Mar 6 22:56:14 2011 (r219351) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2009 The FreeBSD Foundation - * Copyright (c) 2010 Pawel Jakub Dawidek + * Copyright (c) 2010-2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -1909,15 +1909,17 @@ primary_config_reload(struct hast_resour PJDLOG_ASSERT(gres == res); nv_assert(nv, "remoteaddr"); nv_assert(nv, "replication"); + nv_assert(nv, "checksum"); nv_assert(nv, "timeout"); nv_assert(nv, "exec"); ncomps = HAST_NCOMPONENTS; -#define MODIFIED_REMOTEADDR 0x1 -#define MODIFIED_REPLICATION 0x2 -#define MODIFIED_TIMEOUT 0x4 -#define MODIFIED_EXEC 0x8 +#define MODIFIED_REMOTEADDR 0x01 +#define MODIFIED_REPLICATION 0x02 +#define MODIFIED_CHECKSUM 0x04 +#define MODIFIED_TIMEOUT 0x10 +#define MODIFIED_EXEC 0x20 modified = 0; vstr = nv_get_string(nv, "remoteaddr"); @@ -1934,6 +1936,11 @@ primary_config_reload(struct hast_resour gres->hr_replication = vint; modified |= MODIFIED_REPLICATION; } + vint = nv_get_int32(nv, "checksum"); + if (gres->hr_checksum != vint) { + gres->hr_checksum = vint; + modified |= MODIFIED_CHECKSUM; + } vint = nv_get_int32(nv, "timeout"); if (gres->hr_timeout != vint) { gres->hr_timeout = vint; @@ -1946,10 +1953,11 @@ primary_config_reload(struct hast_resour } /* - * If only timeout was modified we only need to change it without - * reconnecting. + * Change timeout for connected sockets. + * Don't bother if we need to reconnect. */ - if (modified == MODIFIED_TIMEOUT) { + if ((modified & MODIFIED_TIMEOUT) != 0 && + (modified & (MODIFIED_REMOTEADDR | MODIFIED_REPLICATION)) == 0) { for (ii = 0; ii < ncomps; ii++) { if (!ISREMOTE(ii)) continue; @@ -1970,8 +1978,8 @@ primary_config_reload(struct hast_resour "Unable to set connection timeout"); } } - } else if ((modified & - (MODIFIED_REMOTEADDR | MODIFIED_REPLICATION)) != 0) { + } + if ((modified & (MODIFIED_REMOTEADDR | MODIFIED_REPLICATION)) != 0) { for (ii = 0; ii < ncomps; ii++) { if (!ISREMOTE(ii)) continue; @@ -1985,6 +1993,7 @@ primary_config_reload(struct hast_resour } #undef MODIFIED_REMOTEADDR #undef MODIFIED_REPLICATION +#undef MODIFIED_CHECKSUM #undef MODIFIED_TIMEOUT #undef MODIFIED_EXEC Modified: head/sbin/hastd/token.l ============================================================================== --- head/sbin/hastd/token.l Sun Mar 6 21:20:53 2011 (r219350) +++ head/sbin/hastd/token.l Sun Mar 6 22:56:14 2011 (r219351) @@ -1,6 +1,7 @@ %{ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -48,6 +49,7 @@ control { DP; return CONTROL; } listen { DP; return LISTEN; } port { DP; return PORT; } replication { DP; return REPLICATION; } +checksum { DP; return CHECKSUM; } timeout { DP; return TIMEOUT; } exec { DP; return EXEC; } resource { DP; return RESOURCE; } @@ -58,6 +60,9 @@ on { DP; return ON; } fullsync { DP; return FULLSYNC; } memsync { DP; return MEMSYNC; } async { DP; return ASYNC; } +none { DP; return NONE; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 22:59:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94B45106566B; Sun, 6 Mar 2011 22:59:30 +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 831918FC0C; Sun, 6 Mar 2011 22:59: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 p26MxUTk012105; Sun, 6 Mar 2011 22:59:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26MxUiw012103; Sun, 6 Mar 2011 22:59:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201103062259.p26MxUiw012103@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Mar 2011 22:59: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: r219352 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 22:59:30 -0000 Author: kib Date: Sun Mar 6 22:59:30 2011 New Revision: 219352 URL: http://svn.freebsd.org/changeset/base/219352 Log: The execution of the shebang script requires putting interpreter path, possible option and script path in the place of argv[0] supplied to execve(2). It is possible and valid for the substitution to be shorter then the argv[0]. Avoid signed underflow in this case. Submitted by: Devon H. O'Dell PR: kern/155321 MFC after: 1 week Modified: head/sys/kern/imgact_shell.c Modified: head/sys/kern/imgact_shell.c ============================================================================== --- head/sys/kern/imgact_shell.c Sun Mar 6 22:56:14 2011 (r219351) +++ head/sys/kern/imgact_shell.c Sun Mar 6 22:59:30 2011 (r219352) @@ -195,7 +195,7 @@ exec_shell_imgact(imgp) length = (imgp->args->argc == 0) ? 0 : strlen(imgp->args->begin_argv) + 1; /* bytes to delete */ - if (offset - length > imgp->args->stringspace) { + if (offset > imgp->args->stringspace + length) { if (sname != NULL) sbuf_delete(sname); return (E2BIG); From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 23:01:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAFA5106566B; Sun, 6 Mar 2011 23:01:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B93978FC15; Sun, 6 Mar 2011 23:01:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p26N12eM012196; Sun, 6 Mar 2011 23:01:02 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26N127s012193; Sun, 6 Mar 2011 23:01:02 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201103062301.p26N127s012193@svn.freebsd.org> From: Doug Barton Date: Sun, 6 Mar 2011 23:01: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: r219353 - head/share/examples/cvsup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 23:01:02 -0000 Author: dougb Date: Sun Mar 6 23:01:02 2011 New Revision: 219353 URL: http://svn.freebsd.org/changeset/base/219353 Log: mbone is no longer a physical category Submitted by: pav Modified: head/share/examples/cvsup/cvs-supfile head/share/examples/cvsup/ports-supfile Modified: head/share/examples/cvsup/cvs-supfile ============================================================================== --- head/share/examples/cvsup/cvs-supfile Sun Mar 6 22:59:30 2011 (r219352) +++ head/share/examples/cvsup/cvs-supfile Sun Mar 6 23:01:02 2011 (r219353) @@ -140,7 +140,6 @@ ports-all #ports-lang #ports-mail #ports-math -#ports-mbone #ports-misc #ports-multimedia #ports-net Modified: head/share/examples/cvsup/ports-supfile ============================================================================== --- head/share/examples/cvsup/ports-supfile Sun Mar 6 22:59:30 2011 (r219352) +++ head/share/examples/cvsup/ports-supfile Sun Mar 6 23:01:02 2011 (r219353) @@ -104,7 +104,6 @@ ports-all #ports-lang #ports-mail #ports-math -#ports-mbone #ports-misc #ports-multimedia #ports-net From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 23:09:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F30CE106566B; Sun, 6 Mar 2011 23:09:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9AD8FC1A; Sun, 6 Mar 2011 23:09: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 p26N9Xcc012419; Sun, 6 Mar 2011 23:09:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26N9XCH012406; Sun, 6 Mar 2011 23:09:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103062309.p26N9XCH012406@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 6 Mar 2011 23:09: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: r219354 - in head/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 23:09:34 -0000 Author: pjd Date: Sun Mar 6 23:09:33 2011 New Revision: 219354 URL: http://svn.freebsd.org/changeset/base/219354 Log: Allow to compress on-the-wire data using two algorithms: - HOLE - it simply turns all-zero blocks into few bytes header; it is extremely fast, so it is turned on by default; it is mostly intended to speed up initial synchronization where we expect many zeros; - LZF - very fast algorithm by Marc Alexander Lehmann, which shows very decent compression ratio and has BSD license. MFC after: 2 weeks Added: head/sbin/hastd/hast_compression.c (contents, props changed) head/sbin/hastd/hast_compression.h (contents, props changed) head/sbin/hastd/lzf.c (contents, props changed) head/sbin/hastd/lzf.h (contents, props changed) Modified: head/sbin/hastctl/Makefile head/sbin/hastd/Makefile head/sbin/hastd/control.c head/sbin/hastd/hast.conf.5 head/sbin/hastd/hast.h head/sbin/hastd/hast_proto.c head/sbin/hastd/hastd.c head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/token.l Modified: head/sbin/hastctl/Makefile ============================================================================== --- head/sbin/hastctl/Makefile Sun Mar 6 23:01:02 2011 (r219353) +++ head/sbin/hastctl/Makefile Sun Mar 6 23:09:33 2011 (r219354) @@ -8,7 +8,8 @@ PROG= hastctl SRCS= activemap.c SRCS+= crc32.c SRCS+= ebuf.c -SRCS+= hast_checksum.c hast_proto.c hastctl.c +SRCS+= hast_checksum.c hast_compression.c hast_proto.c hastctl.c +SRCS+= lzf.c SRCS+= metadata.c SRCS+= nv.c SRCS+= parse.y pjdlog.c Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Sun Mar 6 23:01:02 2011 (r219353) +++ head/sbin/hastd/Makefile Sun Mar 6 23:09:33 2011 (r219354) @@ -6,7 +6,8 @@ PROG= hastd SRCS= activemap.c SRCS+= control.c crc32.c SRCS+= ebuf.c event.c -SRCS+= hast_checksum.c hast_proto.c hastd.c hooks.c +SRCS+= hast_checksum.c hast_compression.c hast_proto.c hastd.c hooks.c +SRCS+= lzf.c SRCS+= metadata.c SRCS+= nv.c SRCS+= secondary.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Sun Mar 6 23:01:02 2011 (r219353) +++ head/sbin/hastd/control.c Sun Mar 6 23:09:33 2011 (r219354) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "hast.h" #include "hastd.h" #include "hast_checksum.h" +#include "hast_compression.h" #include "hast_proto.h" #include "hooks.h" #include "nv.h" @@ -249,6 +250,8 @@ control_status(struct hastd_config *cfg, } nv_add_string(nvout, checksum_name(res->hr_checksum), "checksum%u", no); + nv_add_string(nvout, compression_name(res->hr_compression), + "compression%u", no); nv_add_string(nvout, role2str(res->hr_role), "role%u", no); switch (res->hr_role) { Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Sun Mar 6 23:01:02 2011 (r219353) +++ head/sbin/hastd/hast.conf.5 Sun Mar 6 23:09:33 2011 (r219354) @@ -60,6 +60,7 @@ control listen replication checksum +compression timeout exec @@ -79,6 +80,7 @@ resource { # Resource section replication checksum + compression name local timeout @@ -215,6 +217,24 @@ CRC32 checksum will be calculated. .It Ic sha256 SHA256 checksum will be calculated. .El +.It Ic compression Aq algorithm +.Pp +Compression algorithm should be one of the following: +.Bl -tag -width ".Ic none" +.It Ic none +Data send over the network will not be compressed. +.It Ic hole +Only blocks that contain all zeros will be compressed. +This is very useful for initial synchronization where potentially many blocks +are still all zeros. +There should be no measurable performance overhead when this algorithm is being +used. +This is the default setting. +.It Ic lzf +The LZF algorithm by Marc Alexander Lehmann will be used to compress the data +send over the network. +LZF is very fast, general purpose compression algorithm. +.El .It Ic timeout Aq seconds .Pp Connection timeout in seconds. Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Sun Mar 6 23:01:02 2011 (r219353) +++ head/sbin/hastd/hast.h Sun Mar 6 23:09:33 2011 (r219354) @@ -117,6 +117,10 @@ struct hastd_config { #define HAST_REPLICATION_MEMSYNC 1 #define HAST_REPLICATION_ASYNC 2 +#define HAST_COMPRESSION_NONE 0 +#define HAST_COMPRESSION_HOLE 1 +#define HAST_COMPRESSION_LZF 2 + #define HAST_CHECKSUM_NONE 0 #define HAST_CHECKSUM_CRC32 1 #define HAST_CHECKSUM_SHA256 2 @@ -137,6 +141,8 @@ struct hast_resource { int hr_keepdirty; /* Path to a program to execute on various events. */ char hr_exec[PATH_MAX]; + /* Compression algorithm. */ + int hr_compression; /* Checksum algorithm. */ int hr_checksum; Added: head/sbin/hastd/hast_compression.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/hast_compression.c Sun Mar 6 23:09:33 2011 (r219354) @@ -0,0 +1,283 @@ +/*- + * Copyright (c) 2011 Pawel Jakub Dawidek + * 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 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 "hast_compression.h" + +static bool +allzeros(const void *data, size_t size) +{ + const uint64_t *p = data; + unsigned int i; + uint64_t v; + + PJDLOG_ASSERT((size % sizeof(*p)) == 0); + + /* + * This is the fastest method I found for checking if the given + * buffer contain all zeros. + * Because inside the loop we don't check at every step, we would + * get an answer only after walking through entire buffer. + * To return early if the buffer doesn't contain all zeros, we probe + * 8 bytes at the begining, in the middle and at the end of the buffer + * first. + */ + + size >>= 3; /* divide by 8 */ + if ((p[0] | p[size >> 1] | p[size - 1]) != 0) + return (false); + v = 0; + for (i = 0; i < size; i++) + v |= *p++; + return (v == 0); +} + +static void * +hast_hole_compress(const unsigned char *data, size_t *sizep) +{ + uint32_t size; + void *newbuf; + + if (!allzeros(data, *sizep)) + return (NULL); + + newbuf = malloc(sizeof(size)); + if (newbuf == NULL) { + pjdlog_warning("Unable to compress (no memory: %zu).", + (size_t)*sizep); + return (NULL); + } + size = htole32((uint32_t)*sizep); + bcopy(&size, newbuf, sizeof(size)); + *sizep = sizeof(size); + + return (newbuf); +} + +static void * +hast_hole_decompress(const unsigned char *data, size_t *sizep) +{ + uint32_t size; + void *newbuf; + + if (*sizep != sizeof(size)) { + pjdlog_error("Unable to decompress (invalid size: %zu).", + *sizep); + return (NULL); + } + + bcopy(data, &size, sizeof(size)); + size = le32toh(size); + + newbuf = malloc(size); + if (newbuf == NULL) { + pjdlog_error("Unable to decompress (no memory: %zu).", + (size_t)size); + return (NULL); + } + bzero(newbuf, size); + *sizep = size; + + return (newbuf); +} + +/* Minimum block size to try to compress. */ +#define HAST_LZF_COMPRESS_MIN 1024 + +static void * +hast_lzf_compress(const unsigned char *data, size_t *sizep) +{ + unsigned char *newbuf; + uint32_t origsize; + size_t newsize; + + origsize = *sizep; + + if (origsize <= HAST_LZF_COMPRESS_MIN) + return (NULL); + + newsize = sizeof(origsize) + origsize - HAST_LZF_COMPRESS_MIN; + newbuf = malloc(newsize); + if (newbuf == NULL) { + pjdlog_warning("Unable to compress (no memory: %zu).", + newsize); + return (NULL); + } + newsize = lzf_compress(data, *sizep, newbuf + sizeof(origsize), + newsize - sizeof(origsize)); + if (newsize == 0) { + free(newbuf); + return (NULL); + } + origsize = htole32(origsize); + bcopy(&origsize, newbuf, sizeof(origsize)); + + *sizep = sizeof(origsize) + newsize; + return (newbuf); +} + +static void * +hast_lzf_decompress(const unsigned char *data, size_t *sizep) +{ + unsigned char *newbuf; + uint32_t origsize; + size_t newsize; + + PJDLOG_ASSERT(*sizep > sizeof(origsize)); + + bcopy(data, &origsize, sizeof(origsize)); + origsize = le32toh(origsize); + PJDLOG_ASSERT(origsize > HAST_LZF_COMPRESS_MIN); + + newbuf = malloc(origsize); + if (newbuf == NULL) { + pjdlog_error("Unable to decompress (no memory: %zu).", + (size_t)origsize); + return (NULL); + } + newsize = lzf_decompress(data + sizeof(origsize), + *sizep - sizeof(origsize), newbuf, origsize); + if (newsize == 0) { + free(newbuf); + pjdlog_error("Unable to decompress."); + return (NULL); + } + PJDLOG_ASSERT(newsize == origsize); + + *sizep = newsize; + return (newbuf); +} + +const char * +compression_name(int num) +{ + + switch (num) { + case HAST_COMPRESSION_NONE: + return ("none"); + case HAST_COMPRESSION_HOLE: + return ("hole"); + case HAST_COMPRESSION_LZF: + return ("lzf"); + } + return ("unknown"); +} + +int +compression_send(const struct hast_resource *res, struct nv *nv, void **datap, + size_t *sizep, bool *freedatap) +{ + unsigned char *newbuf; + int compression; + size_t size; + + size = *sizep; + compression = res->hr_compression; + + switch (compression) { + case HAST_COMPRESSION_NONE: + return (0); + case HAST_COMPRESSION_HOLE: + newbuf = hast_hole_compress(*datap, &size); + break; + case HAST_COMPRESSION_LZF: + /* Try 'hole' compression first. */ + newbuf = hast_hole_compress(*datap, &size); + if (newbuf != NULL) + compression = HAST_COMPRESSION_HOLE; + else + newbuf = hast_lzf_compress(*datap, &size); + break; + default: + PJDLOG_ABORT("Invalid compression: %d.", res->hr_compression); + } + + if (newbuf == NULL) { + /* Unable to compress the data. */ + return (0); + } + nv_add_string(nv, compression_name(compression), "compression"); + if (nv_error(nv) != 0) { + free(newbuf); + errno = nv_error(nv); + return (-1); + } + if (*freedatap) + free(*datap); + *freedatap = true; + *datap = newbuf; + *sizep = size; + + return (0); +} + +int +compression_recv(const struct hast_resource *res __unused, struct nv *nv, + void **datap, size_t *sizep, bool *freedatap) +{ + unsigned char *newbuf; + const char *algo; + size_t size; + + algo = nv_get_string(nv, "compression"); + if (algo == NULL) + return (0); /* No compression. */ + + newbuf = NULL; + size = *sizep; + + if (strcmp(algo, "hole") == 0) + newbuf = hast_hole_decompress(*datap, &size); + else if (strcmp(algo, "lzf") == 0) + newbuf = hast_lzf_decompress(*datap, &size); + else { + pjdlog_error("Unknown compression algorithm '%s'.", algo); + return (-1); /* Unknown compression algorithm. */ + } + + if (newbuf == NULL) + return (-1); + if (*freedatap) + free(*datap); + *freedatap = true; + *datap = newbuf; + *sizep = size; + + return (0); +} Added: head/sbin/hastd/hast_compression.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/hast_compression.h Sun Mar 6 23:09:33 2011 (r219354) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2011 Pawel Jakub Dawidek + * 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 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$ + */ + +#ifndef _HAST_COMPRESSION_H_ +#define _HAST_COMPRESSION_H_ + +#include /* size_t */ + +#include +#include + +const char *compression_name(int num); + +int compression_send(const struct hast_resource *res, struct nv *nv, + void **datap, size_t *sizep, bool *freedatap); +int compression_recv(const struct hast_resource *res, struct nv *nv, + void **datap, size_t *sizep, bool *freedatap); + +#endif /* !_HAST_COMPRESSION_H_ */ Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Sun Mar 6 23:01:02 2011 (r219353) +++ head/sbin/hastd/hast_proto.c Sun Mar 6 23:09:33 2011 (r219354) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_CRYPTO #include "hast_checksum.h" #endif +#include "hast_compression.h" #include "hast_proto.h" struct hast_main_header { @@ -67,6 +68,7 @@ struct hast_pipe_stage { }; static struct hast_pipe_stage pipeline[] = { + { "compression", compression_send, compression_recv }, { "checksum", checksum_send, checksum_recv } }; Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Sun Mar 6 23:01:02 2011 (r219353) +++ head/sbin/hastd/hastd.c Sun Mar 6 23:09:33 2011 (r219354) @@ -363,6 +363,8 @@ resource_needs_restart(const struct hast return (true); if (res0->hr_checksum != res1->hr_checksum) return (true); + if (res0->hr_compression != res1->hr_compression) + return (true); if (res0->hr_timeout != res1->hr_timeout) return (true); if (strcmp(res0->hr_exec, res1->hr_exec) != 0) @@ -389,6 +391,8 @@ resource_needs_reload(const struct hast_ return (true); if (res0->hr_checksum != res1->hr_checksum) return (true); + if (res0->hr_compression != res1->hr_compression) + return (true); if (res0->hr_timeout != res1->hr_timeout) return (true); if (strcmp(res0->hr_exec, res1->hr_exec) != 0) @@ -409,6 +413,7 @@ resource_reload(const struct hast_resour nv_add_string(nvout, res->hr_remoteaddr, "remoteaddr"); nv_add_int32(nvout, (int32_t)res->hr_replication, "replication"); nv_add_int32(nvout, (int32_t)res->hr_checksum, "checksum"); + nv_add_int32(nvout, (int32_t)res->hr_compression, "compression"); nv_add_int32(nvout, (int32_t)res->hr_timeout, "timeout"); nv_add_string(nvout, res->hr_exec, "exec"); if (nv_error(nvout) != 0) { @@ -568,6 +573,7 @@ hastd_reload(void) sizeof(cres->hr_remoteaddr)); cres->hr_replication = nres->hr_replication; cres->hr_checksum = nres->hr_checksum; + cres->hr_compression = nres->hr_compression; cres->hr_timeout = nres->hr_timeout; strlcpy(cres->hr_exec, nres->hr_exec, sizeof(cres->hr_exec)); Added: head/sbin/hastd/lzf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/lzf.c Sun Mar 6 23:09:33 2011 (r219354) @@ -0,0 +1,406 @@ +/* + * Copyright (c) 2000-2008 Marc Alexander Lehmann + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- + * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- + * CIAL, 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 OTH- + * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License ("GPL") version 2 or any later version, + * in which case the provisions of the GPL are applicable instead of + * the above. If you wish to allow the use of your version of this file + * only under the terms of the GPL and not to allow others to use your + * version of this file under the BSD license, indicate your decision + * by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file under + * either the BSD or the GPL. + */ + +#include "lzf.h" + +#define HSIZE (1 << (HLOG)) + +/* + * don't play with this unless you benchmark! + * decompression is not dependent on the hash function + * the hashing function might seem strange, just believe me + * it works ;) + */ +#ifndef FRST +# define FRST(p) (((p[0]) << 8) | p[1]) +# define NEXT(v,p) (((v) << 8) | p[2]) +# if ULTRA_FAST +# define IDX(h) ((( h >> (3*8 - HLOG)) - h ) & (HSIZE - 1)) +# elif VERY_FAST +# define IDX(h) ((( h >> (3*8 - HLOG)) - h*5) & (HSIZE - 1)) +# else +# define IDX(h) ((((h ^ (h << 5)) >> (3*8 - HLOG)) - h*5) & (HSIZE - 1)) +# endif +#endif +/* + * IDX works because it is very similar to a multiplicative hash, e.g. + * ((h * 57321 >> (3*8 - HLOG)) & (HSIZE - 1)) + * the latter is also quite fast on newer CPUs, and compresses similarly. + * + * the next one is also quite good, albeit slow ;) + * (int)(cos(h & 0xffffff) * 1e6) + */ + +#if 0 +/* original lzv-like hash function, much worse and thus slower */ +# define FRST(p) (p[0] << 5) ^ p[1] +# define NEXT(v,p) ((v) << 5) ^ p[2] +# define IDX(h) ((h) & (HSIZE - 1)) +#endif + +#define MAX_LIT (1 << 5) +#define MAX_OFF (1 << 13) +#define MAX_REF ((1 << 8) + (1 << 3)) + +#if __GNUC__ >= 3 +# define expect(expr,value) __builtin_expect ((expr),(value)) +# define inline inline +#else +# define expect(expr,value) (expr) +# define inline static +#endif + +#define expect_false(expr) expect ((expr) != 0, 0) +#define expect_true(expr) expect ((expr) != 0, 1) + +/* + * compressed format + * + * 000LLLLL ; literal + * LLLooooo oooooooo ; backref L + * 111ooooo LLLLLLLL oooooooo ; backref L+7 + * + */ + +unsigned int +lzf_compress (const void *const in_data, unsigned int in_len, + void *out_data, unsigned int out_len +#if LZF_STATE_ARG + , LZF_STATE htab +#endif + ) +{ +#if !LZF_STATE_ARG + LZF_STATE htab; +#endif + const u8 **hslot; + const u8 *ip = (const u8 *)in_data; + u8 *op = (u8 *)out_data; + const u8 *in_end = ip + in_len; + u8 *out_end = op + out_len; + const u8 *ref; + + /* off requires a type wide enough to hold a general pointer difference. + * ISO C doesn't have that (size_t might not be enough and ptrdiff_t only + * works for differences within a single object). We also assume that no + * no bit pattern traps. Since the only platform that is both non-POSIX + * and fails to support both assumptions is windows 64 bit, we make a + * special workaround for it. + */ +#if defined (WIN32) && defined (_M_X64) + unsigned _int64 off; /* workaround for missing POSIX compliance */ +#else + unsigned long off; +#endif + unsigned int hval; + int lit; + + if (!in_len || !out_len) + return 0; + +#if INIT_HTAB + memset (htab, 0, sizeof (htab)); +# if 0 + for (hslot = htab; hslot < htab + HSIZE; hslot++) + *hslot++ = ip; +# endif +#endif + + lit = 0; op++; /* start run */ + + hval = FRST (ip); + while (ip < in_end - 2) + { + hval = NEXT (hval, ip); + hslot = htab + IDX (hval); + ref = *hslot; *hslot = ip; + + if (1 +#if INIT_HTAB + && ref < ip /* the next test will actually take care of this, but this is faster */ +#endif + && (off = ip - ref - 1) < MAX_OFF + && ip + 4 < in_end + && ref > (const u8 *)in_data +#if STRICT_ALIGN + && ref[0] == ip[0] + && ref[1] == ip[1] + && ref[2] == ip[2] +#else + && *(const u16 *)ref == *(const u16 *)ip + && ref[2] == ip[2] +#endif + ) + { + /* match found at *ref++ */ + unsigned int len = 2; + unsigned int maxlen = in_end - ip - len; + maxlen = maxlen > MAX_REF ? MAX_REF : maxlen; + + if (expect_false (op + 3 + 1 >= out_end)) /* first a faster conservative test */ + if (op - !lit + 3 + 1 >= out_end) /* second the exact but rare test */ + return 0; + + op [- lit - 1] = lit - 1; /* stop run */ + op -= !lit; /* undo run if length is zero */ + + for (;;) + { + if (expect_true (maxlen > 16)) + { + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + len++; if (ref [len] != ip [len]) break; + } + + do + len++; + while (len < maxlen && ref[len] == ip[len]); + + break; + } + + len -= 2; /* len is now #octets - 1 */ + ip++; + + if (len < 7) + { + *op++ = (off >> 8) + (len << 5); + } + else + { + *op++ = (off >> 8) + ( 7 << 5); + *op++ = len - 7; + } + + *op++ = off; + lit = 0; op++; /* start run */ + + ip += len + 1; + + if (expect_false (ip >= in_end - 2)) + break; + +#if ULTRA_FAST || VERY_FAST + --ip; +# if VERY_FAST && !ULTRA_FAST + --ip; +# endif + hval = FRST (ip); + + hval = NEXT (hval, ip); + htab[IDX (hval)] = ip; + ip++; + +# if VERY_FAST && !ULTRA_FAST + hval = NEXT (hval, ip); + htab[IDX (hval)] = ip; + ip++; +# endif +#else + ip -= len + 1; + + do + { + hval = NEXT (hval, ip); + htab[IDX (hval)] = ip; + ip++; + } + while (len--); +#endif + } + else + { + /* one more literal byte we must copy */ + if (expect_false (op >= out_end)) + return 0; + + lit++; *op++ = *ip++; + + if (expect_false (lit == MAX_LIT)) + { + op [- lit - 1] = lit - 1; /* stop run */ + lit = 0; op++; /* start run */ + } + } + } + + if (op + 3 > out_end) /* at most 3 bytes can be missing here */ + return 0; + + while (ip < in_end) + { + lit++; *op++ = *ip++; + + if (expect_false (lit == MAX_LIT)) + { + op [- lit - 1] = lit - 1; /* stop run */ + lit = 0; op++; /* start run */ + } + } + + op [- lit - 1] = lit - 1; /* end run */ + op -= !lit; /* undo run if length is zero */ + + return op - (u8 *)out_data; +} + +#if AVOID_ERRNO +# define SET_ERRNO(n) +#else +# include +# define SET_ERRNO(n) errno = (n) +#endif + +#if (__i386 || __amd64) && __GNUC__ >= 3 +# define lzf_movsb(dst, src, len) \ + asm ("rep movsb" \ + : "=D" (dst), "=S" (src), "=c" (len) \ + : "0" (dst), "1" (src), "2" (len)); +#endif + +unsigned int +lzf_decompress (const void *const in_data, unsigned int in_len, + void *out_data, unsigned int out_len) +{ + u8 const *ip = (const u8 *)in_data; + u8 *op = (u8 *)out_data; + u8 const *const in_end = ip + in_len; + u8 *const out_end = op + out_len; + + do + { + unsigned int ctrl = *ip++; + + if (ctrl < (1 << 5)) /* literal run */ + { + ctrl++; + + if (op + ctrl > out_end) + { + SET_ERRNO (E2BIG); + return 0; + } + +#if CHECK_INPUT + if (ip + ctrl > in_end) + { + SET_ERRNO (EINVAL); + return 0; + } +#endif + +#ifdef lzf_movsb + lzf_movsb (op, ip, ctrl); +#else + do + *op++ = *ip++; + while (--ctrl); +#endif + } + else /* back reference */ + { + unsigned int len = ctrl >> 5; + + u8 *ref = op - ((ctrl & 0x1f) << 8) - 1; + +#if CHECK_INPUT + if (ip >= in_end) + { + SET_ERRNO (EINVAL); + return 0; + } +#endif + if (len == 7) + { + len += *ip++; +#if CHECK_INPUT + if (ip >= in_end) + { + SET_ERRNO (EINVAL); + return 0; + } +#endif + } + + ref -= *ip++; + + if (op + len + 2 > out_end) + { + SET_ERRNO (E2BIG); + return 0; + } + + if (ref < (u8 *)out_data) + { + SET_ERRNO (EINVAL); + return 0; + } + +#ifdef lzf_movsb + len += 2; + lzf_movsb (op, ref, len); +#else + *op++ = *ref++; + *op++ = *ref++; + + do + *op++ = *ref++; + while (--len); +#endif + } + } + while (ip < in_end); + + return op - (u8 *)out_data; +} + Added: head/sbin/hastd/lzf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/lzf.h Sun Mar 6 23:09:33 2011 (r219354) @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2000-2008 Marc Alexander Lehmann + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- + * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- + * CIAL, 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 OTH- + * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License ("GPL") version 2 or any later version, + * in which case the provisions of the GPL are applicable instead of + * the above. If you wish to allow the use of your version of this file + * only under the terms of the GPL and not to allow others to use your + * version of this file under the BSD license, indicate your decision + * by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file under + * either the BSD or the GPL. + */ + +#ifndef LZF_H +#define LZF_H + +/*********************************************************************** +** +** lzf -- an extremely fast/free compression/decompression-method +** http://liblzf.plan9.de/ +** +** This algorithm is believed to be patent-free. +** +***********************************************************************/ + +#define LZF_VERSION 0x0105 /* 1.5, API version */ + +/* + * Compress in_len bytes stored at the memory block starting at + * in_data and write the result to out_data, up to a maximum length + * of out_len bytes. + * + * If the output buffer is not large enough or any error occurs return 0, + * otherwise return the number of bytes used, which might be considerably + * more than in_len (but less than 104% of the original size), so it + * makes sense to always use out_len == in_len - 1), to ensure _some_ + * compression, and store the data uncompressed otherwise (with a flag, of + * course. + * + * lzf_compress might use different algorithms on different systems and + * even different runs, thus might result in different compressed strings + * depending on the phase of the moon or similar factors. However, all + * these strings are architecture-independent and will result in the + * original data when decompressed using lzf_decompress. + * + * The buffers must not be overlapping. + * + * If the option LZF_STATE_ARG is enabled, an extra argument must be + * supplied which is not reflected in this header file. Refer to lzfP.h + * and lzf_c.c. + * + */ +unsigned int +lzf_compress (const void *const in_data, unsigned int in_len, + void *out_data, unsigned int out_len); + +/* + * Decompress data compressed with some version of the lzf_compress + * function and stored at location in_data and length in_len. The result + * will be stored at out_data up to a maximum of out_len characters. + * + * If the output buffer is not large enough to hold the decompressed + * data, a 0 is returned and errno is set to E2BIG. Otherwise the number + * of decompressed bytes (i.e. the original length of the data) is + * returned. + * + * If an error in the compressed data is detected, a zero is returned and + * errno is set to EINVAL. + * + * This function is very fast, about as fast as a copying loop. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Mar 6 23:15:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30D3B106564A; Sun, 6 Mar 2011 23:15:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 051818FC1D; Sun, 6 Mar 2011 23:15: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 p26NFOV1012609; Sun, 6 Mar 2011 23:15:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p26NFOqf012607; Sun, 6 Mar 2011 23:15:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103062315.p26NFOqf012607@svn.freebsd.org> From: Adrian Chadd Date: Sun, 6 Mar 2011 23:15: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: r219355 - head/tools/tools/ath/ath_ee_v14_print X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2011 23:15:25 -0000 Author: adrian Date: Sun Mar 6 23:15:24 2011 New Revision: 219355 URL: http://svn.freebsd.org/changeset/base/219355 Log: Add support for printing out the open-loop TX power control EEPROM fields. Modified: head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c Modified: head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c ============================================================================== --- head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c Sun Mar 6 23:09:33 2011 (r219354) +++ head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c Sun Mar 6 23:15:24 2011 (r219355) @@ -218,6 +218,20 @@ eeprom_v14_modal_print(uint16_t *buf, in } static void +eeprom_v14_print_caldata_perfreq_op_loop(CAL_DATA_PER_FREQ_OP_LOOP *f) +{ + int i, j; + for (i = 0; i < 2; i++) { + printf(" Gain: %d:\n", i); + for (j = 0; j < 5; j++) { + printf(" %d: pwrPdg: %d, vpdPdg: %d, pcdac: %d, empty: %d\n", + j, f->pwrPdg[i][j], f->vpdPdg[i][j], f->pcdac[i][j], f->empty[i][j]); + } + printf("\n"); + } +} + +static void eeprom_v14_print_caldata_perfreq(CAL_DATA_PER_FREQ *f) { int i, j; @@ -252,7 +266,10 @@ eeprom_v14_calfreqpiers_print(uint16_t * printf("2Ghz Cal Pier %d\n", i); for (n = 0; n < AR5416_MAX_CHAINS; n++) { printf(" Chain %d:\n", n); - eeprom_v14_print_caldata_perfreq(&eep->ee_base.calPierData2G[n][i]); + if (eep->ee_base.baseEepHeader.openLoopPwrCntl) + eeprom_v14_print_caldata_perfreq_op_loop((void *) (&eep->ee_base.calPierData2G[n][i])); + else + eeprom_v14_print_caldata_perfreq(&eep->ee_base.calPierData2G[n][i]); } } @@ -270,7 +287,10 @@ eeprom_v14_calfreqpiers_print(uint16_t * printf("5Ghz Cal Pier %d\n", i); for (n = 0; n < AR5416_MAX_CHAINS; n++) { printf(" Chain %d:\n", n); - eeprom_v14_print_caldata_perfreq(&eep->ee_base.calPierData5G[n][i]); + if (eep->ee_base.baseEepHeader.openLoopPwrCntl) + eeprom_v14_print_caldata_perfreq_op_loop((void *) (&eep->ee_base.calPierData2G[n][i])); + else + eeprom_v14_print_caldata_perfreq(&eep->ee_base.calPierData2G[n][i]); } } } From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 00:42:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 258F4106567A; Mon, 7 Mar 2011 00:42:23 +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 ED6B48FC08; Mon, 7 Mar 2011 00:42: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 p270gMQL014432; Mon, 7 Mar 2011 00:42:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p270gMND014429; Mon, 7 Mar 2011 00:42:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103070042.p270gMND014429@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Mar 2011 00:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219356 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 00:42:23 -0000 Author: yongari Date: Mon Mar 7 00:42:22 2011 New Revision: 219356 URL: http://svn.freebsd.org/changeset/base/219356 Log: MFC r219102: Make sure changing ownership of RX descriptor to be done as last operation. Previously ownership was transferred to hardware before setting address of new RX buffer such that it was possible for hardware to use wrong RX buffer address. While here keep compiler from re-ordering instructions by declaring descriptor members volatile. Memory barriers would do the same job but volatile is supposed to be cheaper than using memory barriers, especially on MP systems. Submitted by: marius Modified: stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sis/if_sisreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Sun Mar 6 23:15:24 2011 (r219355) +++ stable/8/sys/dev/sis/if_sis.c Mon Mar 7 00:42:22 2011 (r219356) @@ -1568,8 +1568,8 @@ sis_newbuf(struct sis_softc *sc, struct sc->sis_rx_sparemap = map; bus_dmamap_sync(sc->sis_rx_tag, rxd->rx_dmamap, BUS_DMASYNC_PREREAD); rxd->rx_m = m; - rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); rxd->rx_desc->sis_ptr = htole32(SIS_ADDR_LO(segs[0].ds_addr)); + rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); return (0); } Modified: stable/8/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/8/sys/dev/sis/if_sisreg.h Sun Mar 6 23:15:24 2011 (r219355) +++ stable/8/sys/dev/sis/if_sisreg.h Mon Mar 7 00:42:22 2011 (r219356) @@ -337,8 +337,8 @@ struct sis_desc { /* SiS hardware descriptor section */ uint32_t sis_next; - uint32_t sis_cmdsts; - uint32_t sis_ptr; + volatile uint32_t sis_cmdsts; + volatile uint32_t sis_ptr; }; #define SIS_CMDSTS_BUFLEN 0x00000FFF From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 00:44:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAEAD1065670; Mon, 7 Mar 2011 00:44:00 +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 BC55E8FC12; Mon, 7 Mar 2011 00:44: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 p270i0Mr014501; Mon, 7 Mar 2011 00:44:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p270i0Y5014498; Mon, 7 Mar 2011 00:44:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103070044.p270i0Y5014498@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Mar 2011 00:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219357 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 00:44:01 -0000 Author: yongari Date: Mon Mar 7 00:44:00 2011 New Revision: 219357 URL: http://svn.freebsd.org/changeset/base/219357 Log: MFC r219102: Make sure changing ownership of RX descriptor to be done as last operation. Previously ownership was transferred to hardware before setting address of new RX buffer such that it was possible for hardware to use wrong RX buffer address. While here keep compiler from re-ordering instructions by declaring descriptor members volatile. Memory barriers would do the same job but volatile is supposed to be cheaper than using memory barriers, especially on MP systems. Submitted by: marius Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Mon Mar 7 00:42:22 2011 (r219356) +++ stable/7/sys/dev/sis/if_sis.c Mon Mar 7 00:44:00 2011 (r219357) @@ -1568,8 +1568,8 @@ sis_newbuf(struct sis_softc *sc, struct sc->sis_rx_sparemap = map; bus_dmamap_sync(sc->sis_rx_tag, rxd->rx_dmamap, BUS_DMASYNC_PREREAD); rxd->rx_m = m; - rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); rxd->rx_desc->sis_ptr = htole32(SIS_ADDR_LO(segs[0].ds_addr)); + rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); return (0); } Modified: stable/7/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/7/sys/dev/sis/if_sisreg.h Mon Mar 7 00:42:22 2011 (r219356) +++ stable/7/sys/dev/sis/if_sisreg.h Mon Mar 7 00:44:00 2011 (r219357) @@ -337,8 +337,8 @@ struct sis_desc { /* SiS hardware descriptor section */ uint32_t sis_next; - uint32_t sis_cmdsts; - uint32_t sis_ptr; + volatile uint32_t sis_cmdsts; + volatile uint32_t sis_ptr; }; #define SIS_CMDSTS_BUFLEN 0x00000FFF From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 03:09:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 080FB106564A; Mon, 7 Mar 2011 03:09:25 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E843B8FC12; Mon, 7 Mar 2011 03:09: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 p2739ODX019477; Mon, 7 Mar 2011 03:09:24 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2739Ofn019471; Mon, 7 Mar 2011 03:09:24 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103070309.p2739Ofn019471@svn.freebsd.org> From: David Schultz Date: Mon, 7 Mar 2011 03:09: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: r219359 - in head/lib/msun: . man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 03:09:25 -0000 Author: das Date: Mon Mar 7 03:09:24 2011 New Revision: 219359 URL: http://svn.freebsd.org/changeset/base/219359 Log: Add cexp() and cexpf(). Reviewed by: bde (earlier version) Added: head/lib/msun/man/cexp.3 (contents, props changed) head/lib/msun/src/s_cexp.c (contents, props changed) head/lib/msun/src/s_cexpf.c (contents, props changed) Modified: head/lib/msun/Makefile head/lib/msun/Symbol.map Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Mar 7 02:11:44 2011 (r219358) +++ head/lib/msun/Makefile Mon Mar 7 03:09:24 2011 (r219359) @@ -101,7 +101,8 @@ COMMON_SRCS+= e_acosl.c e_asinl.c e_atan .endif # C99 complex functions -COMMON_SRCS+= s_cimag.c s_cimagf.c s_cimagl.c s_conj.c s_conjf.c s_conjl.c \ +COMMON_SRCS+= s_cexp.c s_cexpf.c s_cimag.c s_cimagf.c s_cimagl.c \ + s_conj.c s_conjf.c s_conjl.c \ s_cproj.c s_cprojf.c s_creal.c s_crealf.c s_creall.c # FreeBSD's C library supplies these functions: @@ -124,7 +125,7 @@ SRCS= ${COMMON_SRCS} ${ARCH_SRCS} INCS= fenv.h math.h -MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 ceil.3 \ +MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 ceil.3 cexp.3 \ cimag.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 exp.3 fabs.3 fdim.3 \ feclearexcept.3 feenableexcept.3 fegetenv.3 \ fegetround.3 fenv.3 floor.3 \ @@ -143,6 +144,7 @@ MLINKS+=atanh.3 atanhf.3 MLINKS+=atan2.3 atan2f.3 atan2.3 atan2l.3 \ atan2.3 carg.3 atan2.3 cargf.3 atan2.3 cargl.3 MLINKS+=ceil.3 ceilf.3 ceil.3 ceill.3 +MLINKS+=cexp.3 cexpf.3 MLINKS+=cimag.3 cimagf.3 cimag.3 cimagl.3 \ cimag.3 conj.3 cimag.3 conjf.3 cimag.3 conjl.3 \ cimag.3 cproj.3 cimag.3 cprojf.3 cimag.3 cprojl.3 \ Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Mon Mar 7 02:11:44 2011 (r219358) +++ head/lib/msun/Symbol.map Mon Mar 7 03:09:24 2011 (r219359) @@ -222,6 +222,9 @@ FBSD_1.1 { /* First added in 9.0-CURRENT */ FBSD_1.2 { __isnanf; + cexp; + cexpf; log2; log2f; + logl; }; Added: head/lib/msun/man/cexp.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/man/cexp.3 Mon Mar 7 03:09:24 2011 (r219359) @@ -0,0 +1,113 @@ +.\" Copyright (c) 2011 David Schultz +.\" 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 March 6, 2011 +.Dt CEXP 3 +.Os +.Sh NAME +.Nm cexp , +.Nm cexpf +.Nd complex exponential functions +.Sh LIBRARY +.Lb libm +.Sh SYNOPSIS +.In complex.h +.Ft double complex +.Fn cexp "double complex z" +.Ft float complex +.Fn cexpf "float complex z" +.Sh DESCRIPTION +The +.Fn cexp +and +.Fn cexpf +functions compute the complex exponential of +.Fa z , +also known as +.Em cis Ns ( Ns +.Fa z Ns ) +.Sh RETURN VALUES +For real numbers +.Fa x +and +.Fa y , +.Fn cexp +behaves according to Euler's formula: +.Bd -ragged -offset indent +.Fn cexp "x + I*y" += +.Ns ( Sy e Ns ** Ns +.Fa x * +.Em cos Ns ( Ns +.Fa y Ns )) + ( Ns +.Sy I +* +.Sy e Ns ** Ns +.Fa x +* +.Em sin Ns ( Ns +.Fa y Ns )) +.Ed +.Pp +Generally speaking, infinities, zeroes and \*(Nas are handled as would +be expected from this identity given the usual rules of floating-point +arithmetic. +However, care is taken to avoid generating \*(Nas when they are not deserved. +For example, mathematically we expect that +.Fo cimag +.Fn cexp "x + I*0" Fc += 0 regardless of the value of +.Fa x , +and +.Fn cexp +preserves this identity even if +.Fa x +is \*(If or \*(Na. +Likewise, +.Fn cexp "-\*(If + I*y" += 0 and +.Fo creal +.Fn cexp "\*(If + I*y" Fc += \*(If +for any +.Fa y +(even though the latter property is only mathematically true for +representable +.Fa y . ) +If +.Fa y +is not finite, the sign of the result is indeterminate. +.Sh SEE ALSO +.Xr complex 3 , +.Xr exp 3 , +.Xr math 3 , +.Sh STANDARDS +The +.Fn cexp +and +.Fn cexpf +functions conform to +.St -isoC-99 . Added: head/lib/msun/src/s_cexp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/s_cexp.c Mon Mar 7 03:09:24 2011 (r219359) @@ -0,0 +1,99 @@ +/*- + * Copyright (c) 2011 David Schultz + * 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 "math_private.h" + +static const uint32_t +exp_ovfl = 0x40862e42, /* high bits of MAX_EXP * ln2 ~= 710 */ +cexp_ovfl = 0x4096b8e4, /* (MAX_EXP - MIN_DENORM_EXP) * ln2 */ +k = 1799; /* constant for reduction */ + +static const double +kln2 = 1246.97177782734161156; /* k * ln2 */ + +double complex +cexp(double complex z) +{ + double x, y, exp_x; + uint32_t hx, hy, lx, ly; + int scale; + + x = creal(z); + y = cimag(z); + + EXTRACT_WORDS(hy, ly, y); + hy &= 0x7fffffff; + + /* cexp(x + I 0) = exp(x) + I 0 */ + if ((hy | ly) == 0) + return (cpack(exp(x), y)); + if (hy >= 0x7ff00000) { + EXTRACT_WORDS(hx, lx, x); + if (lx != 0 || (hx & 0x7fffffff) != 0x7ff00000) { + /* cexp(finite|NaN +- I Inf|NaN) = NaN + I NaN */ + return (cpack(y - y, y - y)); + } else if (hx & 0x80000000) { + /* cexp(-Inf +- I Inf|NaN) = 0 + I 0 */ + return (cpack(0.0, 0.0)); + } else { + /* cexp(+Inf +- I Inf|NaN) = Inf + I NaN */ + return (cpack(x, y - y)); + } + } + + GET_HIGH_WORD(hx, x); + if (hx >= exp_ovfl && hx <= cexp_ovfl) { + /* + * x is between 709.7 and 1454.3, so we must scale to avoid + * overflow in exp(x). We use exp(x) = exp(x - kln2) * 2**k, + * carefully chosen to minimize |exp(kln2) - 2**k|. We also + * scale the exponent of exp(x) to MANT_DIG to avoid loss of + * accuracy due to underflow if sin(y) is tiny. + */ + exp_x = exp(x - kln2); + GET_HIGH_WORD(hx, exp_x); + SET_HIGH_WORD(exp_x, (hx & 0xfffff) | ((0x3ff + 52) << 20)); + scale = (hx >> 20) - (0x3ff + 52) + k; + return (cpack(scalbn(cos(y) * exp_x, scale), + scalbn(sin(y) * exp_x, scale))); + } else { + /* + * Cases covered here: + * - x < exp_ovfl and exp(x) won't overflow (common case) + * - x > cexp_ovfl, so exp(x) * s overflows for all s > 0 + * - x = +-Inf (generated by exp()) + * - x = NaN (spurious inexact exception from y) + */ + exp_x = exp(x); + return (cpack(exp_x * cos(y), exp_x * sin(y))); + } +} Added: head/lib/msun/src/s_cexpf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/s_cexpf.c Mon Mar 7 03:09:24 2011 (r219359) @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2011 David Schultz + * 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 "math_private.h" + +static const uint32_t +exp_ovfl = 0x42b17218, /* MAX_EXP * ln2 ~= 88.722839355 */ +cexp_ovfl = 0x43400074, /* (MAX_EXP - MIN_DENORM_EXP) * ln2 */ +k = 235; /* constant for reduction */ + +static const float +kln2 = 162.88958740f; /* k * ln2 */ + +float complex +cexpf(float complex z) +{ + float x, y, exp_x; + uint32_t hx, hy; + int scale; + + x = crealf(z); + y = cimagf(z); + + GET_FLOAT_WORD(hy, y); + hy &= 0x7fffffff; + + /* cexp(x + I 0) = exp(x) + I 0 */ + if (hy == 0) + return (cpackf(expf(x), y)); + GET_FLOAT_WORD(hx, x); + if (hy >= 0x7f800000) { + if ((hx & 0x7fffffff) != 0x7f800000) { + /* cexp(finite|NaN +- I Inf|NaN) = NaN + I NaN */ + return (cpackf(y - y, y - y)); + } else if (hx & 0x80000000) { + /* cexp(-Inf +- I Inf|NaN) = 0 + I 0 */ + return (cpackf(0.0, 0.0)); + } else { + /* cexp(+Inf +- I Inf|NaN) = Inf + I NaN */ + return (cpackf(x, y - y)); + } + } + + if (hx >= exp_ovfl && hx <= cexp_ovfl) { + /* + * x is between 88.7 and 192, so we must scale to avoid + * overflow in expf(x). We use exp(x) = exp(x - kln2) * 2**k, + * carefully chosen to minimize |exp(kln2) - 2**k|. We also + * scale the exponent of exp(x) to MANT_DIG to avoid loss of + * accuracy due to underflow if sin(y) is tiny. + */ + exp_x = expf(x - kln2); + GET_FLOAT_WORD(hx, exp_x); + SET_FLOAT_WORD(exp_x, (hx & 0x7fffff) | ((0x7f + 23) << 23)); + scale = (hx >> 23) - (0x7f + 23) + k; + return (cpackf(scalbnf(cosf(y) * exp_x, scale), + scalbnf(sinf(y) * exp_x, scale))); + } else { + /* + * Cases covered here: + * - x < exp_ovfl and exp(x) won't overflow (common case) + * - x > cexp_ovfl, so exp(x) * s overflows for all s > 0 + * - x = +-Inf (generated by exp()) + * - x = NaN (spurious inexact exception from y) + */ + exp_x = expf(x); + return (cpackf(exp_x * cosf(y), exp_x * sinf(y))); + } +} From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 03:11:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C188106566B; Mon, 7 Mar 2011 03:11:28 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E496E8FC13; Mon, 7 Mar 2011 03:11: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 p273BRJa019570; Mon, 7 Mar 2011 03:11:27 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p273BR05019568; Mon, 7 Mar 2011 03:11:27 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103070311.p273BR05019568@svn.freebsd.org> From: David Schultz Date: Mon, 7 Mar 2011 03:11: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: r219360 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 03:11:28 -0000 Author: das Date: Mon Mar 7 03:11:27 2011 New Revision: 219360 URL: http://svn.freebsd.org/changeset/base/219360 Log: Convert log10() to use __kernel_log(), which is more accurate and simpler. Modified: head/lib/msun/src/e_log10.c Modified: head/lib/msun/src/e_log10.c ============================================================================== --- head/lib/msun/src/e_log10.c Mon Mar 7 03:09:24 2011 (r219359) +++ head/lib/msun/src/e_log10.c Mon Mar 7 03:11:27 2011 (r219360) @@ -14,45 +14,18 @@ #include __FBSDID("$FreeBSD$"); -/* __ieee754_log10(x) - * Return the base 10 logarithm of x - * - * Method : - * Let log10_2hi = leading 40 bits of log10(2) and - * log10_2lo = log10(2) - log10_2hi, - * ivln10 = 1/log(10) rounded. - * Then - * n = ilogb(x), - * if(n<0) n = n+1; - * x = scalbn(x,-n); - * log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x)) - * - * Note 1: - * To guarantee log10(10**n)=n, where 10**n is normal, the rounding - * mode must set to Round-to-Nearest. - * Note 2: - * [1/log(10)] rounded to 53 bits has error .198 ulps; - * log10 is monotonic at all binary break points. - * - * Special cases: - * log10(x) is NaN with signal if x < 0; - * log10(+INF) is +INF with no signal; log10(0) is -INF with signal; - * log10(NaN) is that NaN with no signal; - * log10(10**N) = N for N=0,1,...,22. - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. +/* + * Return the base 10 logarithm of x. See k_log.c for details on the algorithm. */ #include "math.h" #include "math_private.h" +#include "k_log.h" static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */ +ivln10hi = 4.34294481878168880939e-01, /* 0x3fdbcb7b, 0x15200000 */ +ivln10lo = 2.50829467116452752298e-11, /* 0x3dbb9438, 0xca9aadd5 */ log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */ log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ @@ -61,7 +34,7 @@ static const double zero = 0.0; double __ieee754_log10(double x) { - double y,z; + double f,hi,lo,y,z; int32_t i,k,hx; u_int32_t lx; @@ -77,10 +50,15 @@ __ieee754_log10(double x) } if (hx >= 0x7ff00000) return x+x; k += (hx>>20)-1023; - i = ((u_int32_t)k&0x80000000)>>31; - hx = (hx&0x000fffff)|((0x3ff-i)<<20); - y = (double)(k+i); - SET_HIGH_WORD(x,hx); - z = y*log10_2lo + ivln10*__ieee754_log(x); + hx &= 0x000fffff; + i = (hx+0x95f64)&0x100000; + SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ + k += (i>>20); + y = (double)k; + f = __kernel_log(x); + hi = x = x - 1; + SET_LOW_WORD(hi,0); + lo = x - hi; + z = y*log10_2lo + (x+f)*ivln10lo + (lo+f)*ivln10hi + hi*ivln10hi; return z+y*log10_2hi; } From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 03:12:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85136106566B; Mon, 7 Mar 2011 03:12:08 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 599B38FC15; Mon, 7 Mar 2011 03:12: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 p273C8ph019621; Mon, 7 Mar 2011 03:12:08 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p273C88q019619; Mon, 7 Mar 2011 03:12:08 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103070312.p273C88q019619@svn.freebsd.org> From: David Schultz Date: Mon, 7 Mar 2011 03:12: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: r219361 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 03:12:08 -0000 Author: das Date: Mon Mar 7 03:12:08 2011 New Revision: 219361 URL: http://svn.freebsd.org/changeset/base/219361 Log: Convert log10f() to use __kernel_log(), which is more accurate and simpler. Modified: head/lib/msun/src/e_log10f.c Modified: head/lib/msun/src/e_log10f.c ============================================================================== --- head/lib/msun/src/e_log10f.c Mon Mar 7 03:11:27 2011 (r219360) +++ head/lib/msun/src/e_log10f.c Mon Mar 7 03:12:08 2011 (r219361) @@ -1,7 +1,3 @@ -/* e_log10f.c -- float version of e_log10.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -16,12 +12,18 @@ #include __FBSDID("$FreeBSD$"); +/* + * Return the base 10 logarithm of x. See k_log.c for details on the algorithm. + */ + #include "math.h" #include "math_private.h" +#include "k_logf.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ -ivln10 = 4.3429449201e-01, /* 0x3ede5bd9 */ +ivln10hi = 4.3432617188e-01, /* 0x3ede6000 */ +ivln10lo = -3.1689971365e-05, /* 0xb804ead9 */ log10_2hi = 3.0102920532e-01, /* 0x3e9a2080 */ log10_2lo = 7.9034151668e-07; /* 0x355427db */ @@ -30,7 +32,7 @@ static const float zero = 0.0; float __ieee754_log10f(float x) { - float y,z; + float f,hi,lo,y,z; int32_t i,k,hx; GET_FLOAT_WORD(hx,x); @@ -45,10 +47,16 @@ __ieee754_log10f(float x) } if (hx >= 0x7f800000) return x+x; k += (hx>>23)-127; - i = ((u_int32_t)k&0x80000000)>>31; - hx = (hx&0x007fffff)|((0x7f-i)<<23); - y = (float)(k+i); - SET_FLOAT_WORD(x,hx); - z = y*log10_2lo + ivln10*__ieee754_logf(x); + hx &= 0x007fffff; + i = (hx+(0x4afb0d))&0x800000; + SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ + k += (i>>23); + y = (float)k; + f = __kernel_logf(x); + x = x - (float)1.0; + GET_FLOAT_WORD(hx,x); + SET_FLOAT_WORD(hi,hx&0xfffff000); + lo = x - hi; + z = y*log10_2lo + (x+f)*ivln10lo + (lo+f)*ivln10hi + hi*ivln10hi; return z+y*log10_2hi; } From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 03:15:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D5921065670; Mon, 7 Mar 2011 03:15:49 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 599C88FC17; Mon, 7 Mar 2011 03:15: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 p273Fnlc019724; Mon, 7 Mar 2011 03:15:49 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p273FnmW019720; Mon, 7 Mar 2011 03:15:49 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103070315.p273FnmW019720@svn.freebsd.org> From: David Schultz Date: Mon, 7 Mar 2011 03:15: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: r219362 - head/tools/regression/lib/msun X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 03:15:49 -0000 Author: das Date: Mon Mar 7 03:15:49 2011 New Revision: 219362 URL: http://svn.freebsd.org/changeset/base/219362 Log: Add some tests for cexp() and cexpf(). (I need to clean up all of these tests some day, but in the mean time, they're a useful sanity check for future changes.) Added: head/tools/regression/lib/msun/test-cexp.c (contents, props changed) head/tools/regression/lib/msun/test-cexp.t - copied unchanged from r219213, head/tools/regression/lib/msun/test-csqrt.t Modified: head/tools/regression/lib/msun/Makefile Modified: head/tools/regression/lib/msun/Makefile ============================================================================== --- head/tools/regression/lib/msun/Makefile Mon Mar 7 03:12:08 2011 (r219361) +++ head/tools/regression/lib/msun/Makefile Mon Mar 7 03:15:49 2011 (r219362) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTS= test-conj test-csqrt test-exponential test-fenv test-fma \ +TESTS= test-cexp test-conj test-csqrt test-exponential test-fenv test-fma \ test-fmaxmin test-ilogb test-invtrig test-logarithm test-lrint \ test-lround test-nan test-nearbyint test-next test-rem test-trig CFLAGS+= -O0 -lm Added: head/tools/regression/lib/msun/test-cexp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/msun/test-cexp.c Mon Mar 7 03:15:49 2011 (r219362) @@ -0,0 +1,380 @@ +/*- + * Copyright (c) 2008-2011 David Schultz + * 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. + */ + +/* + * Tests for corner cases in cexp*(). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ + FE_OVERFLOW | FE_UNDERFLOW) +#define FLT_ULP() ldexpl(1.0, 1 - FLT_MANT_DIG) +#define DBL_ULP() ldexpl(1.0, 1 - DBL_MANT_DIG) +#define LDBL_ULP() ldexpl(1.0, 1 - LDBL_MANT_DIG) + +#define N(i) (sizeof(i) / sizeof((i)[0])) + +#pragma STDC FENV_ACCESS ON +#pragma STDC CX_LIMITED_RANGE OFF + +/* + * XXX gcc implements complex multiplication incorrectly. In + * particular, it implements it as if the CX_LIMITED_RANGE pragma + * were ON. Consequently, we need this function to form numbers + * such as x + INFINITY * I, since gcc evalutes INFINITY * I as + * NaN + INFINITY * I. + */ +static inline long double complex +cpackl(long double x, long double y) +{ + long double complex z; + + __real__ z = x; + __imag__ z = y; + return (z); +} + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. In some cases, + * whether cexp() raises an invalid exception is unspecified. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test(func, z, result, exceptmask, excepts, checksign) do { \ + volatile long double complex _d = z; \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(cfpequal((func)(_d), (result), (checksign))); \ + assert(((func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* Test within a given tolerance. */ +#define test_tol(func, z, result, tol) do { \ + volatile long double complex _d = z; \ + assert(cfpequal_tol((func)(_d), (result), (tol))); \ +} while (0) + +/* Test all the functions that compute cexp(x). */ +#define testall(x, result, exceptmask, excepts, checksign) do { \ + test(cexp, x, result, exceptmask, excepts, checksign); \ + test(cexpf, x, result, exceptmask, excepts, checksign); \ +} while (0) + +/* + * Test all the functions that compute cexp(x), within a given tolerance. + * The tolerance is specified in ulps. + */ +#define testall_tol(x, result, tol) do { \ + test_tol(cexp, x, result, tol * DBL_ULP()); \ + test_tol(cexpf, x, result, tol * FLT_ULP()); \ +} while (0) + +/* Various finite non-zero numbers to test. */ +static const float finites[] = +{ -42.0e20, -1.0 -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; + +/* + * Determine whether x and y are equal, with two special rules: + * +0.0 != -0.0 + * NaN == NaN + * If checksign is 0, we compare the absolute values instead. + */ +static int +fpequal(long double x, long double y, int checksign) +{ + if (isnan(x) || isnan(y)) + return (1); + if (checksign) + return (x == y && !signbit(x) == !signbit(y)); + else + return (fabsl(x) == fabsl(y)); +} + +static int +fpequal_tol(long double x, long double y, long double tol) +{ + fenv_t env; + int ret; + + if (isnan(x) && isnan(y)) + return (1); + if (!signbit(x) != !signbit(y)) + return (0); + if (x == y) + return (1); + if (tol == 0) + return (0); + + /* Hard case: need to check the tolerance. */ + feholdexcept(&env); + /* + * For our purposes here, if y=0, we interpret tol as an absolute + * tolerance. This is to account for roundoff in the input, e.g., + * cos(Pi/2) ~= 0. + */ + if (y == 0.0) + ret = fabsl(x - y) <= fabsl(tol); + else + ret = fabsl(x - y) <= fabsl(y * tol); + fesetenv(&env); + return (ret); +} + +static int +cfpequal(long double complex x, long double complex y, int checksign) +{ + return (fpequal(creal(x), creal(y), checksign) + && fpequal(cimag(x), cimag(y), checksign)); +} + +static int +cfpequal_tol(long double complex x, long double complex y, long double tol) +{ + return (fpequal_tol(creal(x), creal(y), tol) + && fpequal_tol(cimag(x), cimag(y), tol)); +} + + +/* Tests for 0 */ +void +test_zero(void) +{ + + /* cexp(0) = 1, no exceptions raised */ + testall(0.0, 1.0, ALL_STD_EXCEPT, 0, 1); + testall(-0.0, 1.0, ALL_STD_EXCEPT, 0, 1); + testall(cpackl(0.0, -0.0), cpackl(1.0, -0.0), ALL_STD_EXCEPT, 0, 1); + testall(cpackl(-0.0, -0.0), cpackl(1.0, -0.0), ALL_STD_EXCEPT, 0, 1); +} + +/* + * Tests for NaN. The signs of the results are indeterminate unless the + * imaginary part is 0. + */ +void +test_nan() +{ + int i; + + /* cexp(x + NaNi) = NaN + NaNi and optionally raises invalid */ + /* cexp(NaN + yi) = NaN + NaNi and optionally raises invalid (|y|>0) */ + for (i = 0; i < N(finites); i++) { + testall(cpackl(finites[i], NAN), cpackl(NAN, NAN), + ALL_STD_EXCEPT & ~FE_INVALID, 0, 0); + if (finites[i] == 0.0) + continue; + /* XXX FE_INEXACT shouldn't be raised here */ + testall(cpackl(NAN, finites[i]), cpackl(NAN, NAN), + ALL_STD_EXCEPT & ~(FE_INVALID | FE_INEXACT), 0, 0); + } + + /* cexp(NaN +- 0i) = NaN +- 0i */ + testall(cpackl(NAN, 0.0), cpackl(NAN, 0.0), ALL_STD_EXCEPT, 0, 1); + testall(cpackl(NAN, -0.0), cpackl(NAN, -0.0), ALL_STD_EXCEPT, 0, 1); + + /* cexp(inf + NaN i) = inf + nan i */ + testall(cpackl(INFINITY, NAN), cpackl(INFINITY, NAN), + ALL_STD_EXCEPT, 0, 0); + /* cexp(-inf + NaN i) = 0 */ + testall(cpackl(-INFINITY, NAN), cpackl(0.0, 0.0), + ALL_STD_EXCEPT, 0, 0); + /* cexp(NaN + NaN i) = NaN + NaN i */ + testall(cpackl(NAN, NAN), cpackl(NAN, NAN), + ALL_STD_EXCEPT, 0, 0); +} + +void +test_inf(void) +{ + int i; + + /* cexp(x + inf i) = NaN + NaNi and raises invalid */ + /* cexp(inf + yi) = 0 + 0yi */ + /* cexp(-inf + yi) = inf + inf yi (except y=0) */ + for (i = 0; i < N(finites); i++) { + testall(cpackl(finites[i], INFINITY), cpackl(NAN, NAN), + ALL_STD_EXCEPT, FE_INVALID, 1); + /* XXX shouldn't raise an inexact exception */ + testall(cpackl(-INFINITY, finites[i]), + cpackl(0.0, 0.0 * finites[i]), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + if (finites[i] == 0) + continue; + testall(cpackl(INFINITY, finites[i]), + cpackl(INFINITY, INFINITY * finites[i]), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + } + testall(cpackl(INFINITY, 0.0), cpackl(INFINITY, 0.0), + ALL_STD_EXCEPT, 0, 1); + testall(cpackl(INFINITY, -0.0), cpackl(INFINITY, -0.0), + ALL_STD_EXCEPT, 0, 1); +} + +void +test_reals(void) +{ + int i; + + for (i = 0; i < N(finites); i++) { + /* XXX could check exceptions more meticulously */ + test(cexp, cpackl(finites[i], 0.0), + cpackl(exp(finites[i]), 0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexp, cpackl(finites[i], -0.0), + cpackl(exp(finites[i]), -0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexpf, cpackl(finites[i], 0.0), + cpackl(expf(finites[i]), 0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexpf, cpackl(finites[i], -0.0), + cpackl(expf(finites[i]), -0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + } +} + +void +test_imaginaries(void) +{ + int i; + + for (i = 0; i < N(finites); i++) { + test(cexp, cpackl(0.0, finites[i]), + cpackl(cos(finites[i]), sin(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexp, cpackl(-0.0, finites[i]), + cpackl(cos(finites[i]), sin(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexpf, cpackl(0.0, finites[i]), + cpackl(cosf(finites[i]), sinf(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexpf, cpackl(-0.0, finites[i]), + cpackl(cosf(finites[i]), sinf(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + } +} + +void +test_small(void) +{ + static const double tests[] = { + /* csqrt(a + bI) = x + yI */ + /* a b x y */ + 1.0, M_PI_4, M_SQRT2 * 0.5 * M_E, M_SQRT2 * 0.5 * M_E, + -1.0, M_PI_4, M_SQRT2 * 0.5 / M_E, M_SQRT2 * 0.5 / M_E, + 2.0, M_PI_2, 0.0, M_E * M_E, + M_LN2, M_PI, -2.0, 0.0, + }; + double a, b; + double x, y; + int i; + + for (i = 0; i < N(tests); i += 4) { + a = tests[i]; + b = tests[i + 1]; + x = tests[i + 2]; + y = tests[i + 3]; + test_tol(cexp, cpackl(a, b), cpackl(x, y), 3 * DBL_ULP()); + + /* float doesn't have enough precision to pass these tests */ + if (x == 0 || y == 0) + continue; + test_tol(cexpf, cpackl(a, b), cpackl(x, y), 1 * FLT_ULP()); + } +} + +/* Test inputs with a real part r that would overflow exp(r). */ +void +test_large(void) +{ + + test_tol(cexp, cpackl(709.79, 0x1p-1074), + cpackl(INFINITY, 8.94674309915433533273e-16), DBL_ULP()); + test_tol(cexp, cpackl(1000, 0x1p-1074), + cpackl(INFINITY, 9.73344457300016401328e+110), DBL_ULP()); + test_tol(cexp, cpackl(1400, 0x1p-1074), + cpackl(INFINITY, 5.08228858149196559681e+284), DBL_ULP()); + test_tol(cexp, cpackl(900, 0x1.23456789abcdep-1020), + cpackl(INFINITY, 7.42156649354218408074e+83), DBL_ULP()); + test_tol(cexp, cpackl(1300, 0x1.23456789abcdep-1020), + cpackl(INFINITY, 3.87514844965996756704e+257), DBL_ULP()); + + test_tol(cexpf, cpackl(88.73, 0x1p-149), + cpackl(INFINITY, 4.80265603e-07), 2 * FLT_ULP()); + test_tol(cexpf, cpackl(90, 0x1p-149), + cpackl(INFINITY, 1.7101492622e-06f), 2 * FLT_ULP()); + test_tol(cexpf, cpackl(192, 0x1p-149), + cpackl(INFINITY, 3.396809344e+38f), 2 * FLT_ULP()); + test_tol(cexpf, cpackl(120, 0x1.234568p-120), + cpackl(INFINITY, 1.1163382522e+16f), 2 * FLT_ULP()); + test_tol(cexpf, cpackl(170, 0x1.234568p-120), + cpackl(INFINITY, 5.7878851079e+37f), 2 * FLT_ULP()); +} + +int +main(int argc, char *argv[]) +{ + + printf("1..7\n"); + + test_zero(); + printf("ok 1 - cexp zero\n"); + + test_nan(); + printf("ok 2 - cexp nan\n"); + + test_inf(); + printf("ok 3 - cexp inf\n"); + + test_reals(); + printf("ok 4 - cexp reals\n"); + + test_imaginaries(); + printf("ok 5 - cexp imaginaries\n"); + + test_small(); + printf("ok 6 - cexp small\n"); + + test_large(); + printf("ok 7 - cexp large\n"); + + return (0); +} Copied: head/tools/regression/lib/msun/test-cexp.t (from r219213, head/tools/regression/lib/msun/test-csqrt.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/msun/test-cexp.t Mon Mar 7 03:15:49 2011 (r219362, copy of r219213, head/tools/regression/lib/msun/test-csqrt.t) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 07:31:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A66AF1065673; Mon, 7 Mar 2011 07:31:15 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95AA58FC12; Mon, 7 Mar 2011 07:31: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 p277VFFW025397; Mon, 7 Mar 2011 07:31:15 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p277VFU7025395; Mon, 7 Mar 2011 07:31:15 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <201103070731.p277VFU7025395@svn.freebsd.org> From: Stefan Farfeleder Date: Mon, 7 Mar 2011 07:31: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: r219363 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 07:31:15 -0000 Author: stefanf Date: Mon Mar 7 07:31:15 2011 New Revision: 219363 URL: http://svn.freebsd.org/changeset/base/219363 Log: Remove unnecessary cast. Reviewed by: jilles Modified: head/bin/sh/arith_yylex.c Modified: head/bin/sh/arith_yylex.c ============================================================================== --- head/bin/sh/arith_yylex.c Mon Mar 7 03:15:49 2011 (r219362) +++ head/bin/sh/arith_yylex.c Mon Mar 7 07:31:15 2011 (r219363) @@ -80,7 +80,7 @@ yylex() case '7': case '8': case '9': - yylval.val = strtoarith_t(buf, (char **)&end, 0); + yylval.val = strtoarith_t(buf, &end, 0); arith_buf = end; return ARITH_NUM; case 'A': From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 08:12:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A15001065672; Mon, 7 Mar 2011 08:12:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 903448FC08; Mon, 7 Mar 2011 08: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 p278C74d026347; Mon, 7 Mar 2011 08:12:07 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p278C7sQ026345; Mon, 7 Mar 2011 08:12:07 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103070812.p278C7sQ026345@svn.freebsd.org> From: Dmitry Chagin Date: Mon, 7 Mar 2011 08: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: r219364 - head/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 08:12:07 -0000 Author: dchagin Date: Mon Mar 7 08:12:07 2011 New Revision: 219364 URL: http://svn.freebsd.org/changeset/base/219364 Log: Remove dead code. MFC after: 1 Week Modified: head/sys/amd64/linux32/linux32_genassym.c Modified: head/sys/amd64/linux32/linux32_genassym.c ============================================================================== --- head/sys/amd64/linux32/linux32_genassym.c Mon Mar 7 07:31:15 2011 (r219363) +++ head/sys/amd64/linux32/linux32_genassym.c Mon Mar 7 08:12:07 2011 (r219364) @@ -9,8 +9,6 @@ __FBSDID("$FreeBSD$"); ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler)); ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc)); -ASSYM(LINUX_SC_ES, offsetof(struct l_sigcontext, sc_es)); -ASSYM(LINUX_SC_DS, offsetof(struct l_sigcontext, sc_ds)); ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler)); ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc)); ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext)); From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 08:46:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D8C106564A; Mon, 7 Mar 2011 08:46:15 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA618FC1A; Mon, 7 Mar 2011 08:46:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p278kF4u027136; Mon, 7 Mar 2011 08:46:15 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p278kFVM027134; Mon, 7 Mar 2011 08:46:15 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103070846.p278kFVM027134@svn.freebsd.org> From: David Schultz Date: Mon, 7 Mar 2011 08:46: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: r219365 - head/lib/msun X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 08:46:15 -0000 Author: das Date: Mon Mar 7 08:46:14 2011 New Revision: 219365 URL: http://svn.freebsd.org/changeset/base/219365 Log: Remove part of an uncommitted change that snuck into the last commit. Modified: head/lib/msun/Symbol.map Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Mon Mar 7 08:12:07 2011 (r219364) +++ head/lib/msun/Symbol.map Mon Mar 7 08:46:14 2011 (r219365) @@ -226,5 +226,4 @@ FBSD_1.2 { cexpf; log2; log2f; - logl; }; From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 08:54:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E50A106566B; Mon, 7 Mar 2011 08:54:20 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3708FC17; Mon, 7 Mar 2011 08:54: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 p278sKIi027442; Mon, 7 Mar 2011 08:54:20 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p278sKv2027440; Mon, 7 Mar 2011 08:54:20 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103070854.p278sKv2027440@svn.freebsd.org> From: David Schultz Date: Mon, 7 Mar 2011 08:54: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: r219366 - head/lib/msun/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 08:54:20 -0000 Author: das Date: Mon Mar 7 08:54:20 2011 New Revision: 219366 URL: http://svn.freebsd.org/changeset/base/219366 Log: Add cexp() to the complex(3) manpage. Thanks to bde for pointing out that I missed this. Modified: head/lib/msun/man/complex.3 Modified: head/lib/msun/man/complex.3 ============================================================================== --- head/lib/msun/man/complex.3 Mon Mar 7 08:46:14 2011 (r219365) +++ head/lib/msun/man/complex.3 Mon Mar 7 08:54:20 2011 (r219366) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2011 +.Dd March 7, 2011 .Dt COMPLEX 3 .Os .Sh NAME @@ -73,6 +73,10 @@ respectively. cabs complex absolute value (i.e. norm, modulus, magnitude) csqrt complex square root .El +.Ss Exponential Function +.Cl +cexp exponential base e +.El .\" Section 7.3.9 of ISO C99 standard .Ss Manipulation Functions .Cl @@ -97,29 +101,23 @@ The functions described here conform to .St -isoC-99 . .Sh BUGS -The trigonmetric functions +The trigonmetric and hyperbolic functions .Fn cacos , -.Fn casin , -.Fn catan , -.Fn ccos , -.Fn csin , -and -.Fn ctan -are not implemented. -.Pp -The hyperbolic functions .Fn cacosh , +.Fn casin , .Fn casinh , +.Fn catan , .Fn catanh , +.Fn ccos , .Fn ccosh , +.Fn csin , .Fn csinh , +.Fn ctan , and .Fn ctanh are not implemented. .Pp -The exponential and logarithmic functions -.Fn cexp , -and +The logarithmic functions .Fn clog are not implemented. .Pp From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 09:04:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8E1106564A; Mon, 7 Mar 2011 09:04:07 +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 2A3FA8FC13; Mon, 7 Mar 2011 09:04: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 p27947H9027801; Mon, 7 Mar 2011 09:04:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27947jE027799; Mon, 7 Mar 2011 09:04:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201103070904.p27947jE027799@svn.freebsd.org> From: Xin LI Date: Mon, 7 Mar 2011 09:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219367 - in stable: 7/usr.sbin/faithd 8/usr.sbin/faithd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 09:04:07 -0000 Author: delphij Date: Mon Mar 7 09:04:06 2011 New Revision: 219367 URL: http://svn.freebsd.org/changeset/base/219367 Log: MFC r219158: Correct a typo. PR: bin/155175 Submitted by: Peter J. Philipp Modified: stable/8/usr.sbin/faithd/faithd.c Directory Properties: stable/8/usr.sbin/faithd/ (props changed) Changes in other areas also in this revision: Modified: stable/7/usr.sbin/faithd/faithd.c Directory Properties: stable/7/usr.sbin/faithd/ (props changed) Modified: stable/8/usr.sbin/faithd/faithd.c ============================================================================== --- stable/8/usr.sbin/faithd/faithd.c Mon Mar 7 08:54:20 2011 (r219366) +++ stable/8/usr.sbin/faithd/faithd.c Mon Mar 7 09:04:06 2011 (r219367) @@ -340,7 +340,7 @@ daemon_main(int argc, char **argv) snprintf(logname, sizeof(logname), "faithd %s", service); snprintf(procname, sizeof(procname), "accepting port %s", service); openlog(logname, LOG_PID | LOG_NOWAIT, LOG_DAEMON); - syslog(LOG_INFO, "Staring faith daemon for %s port", service); + syslog(LOG_INFO, "Starting faith daemon for %s port", service); play_service(s_wld); /* NOTREACHED */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 09:04:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CCCC106566C; Mon, 7 Mar 2011 09:04:07 +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 4A7A58FC14; Mon, 7 Mar 2011 09:04: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 p27947Gi027807; Mon, 7 Mar 2011 09:04:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27947Cm027805; Mon, 7 Mar 2011 09:04:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201103070904.p27947Cm027805@svn.freebsd.org> From: Xin LI Date: Mon, 7 Mar 2011 09:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219367 - in stable: 7/usr.sbin/faithd 8/usr.sbin/faithd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 09:04:07 -0000 Author: delphij Date: Mon Mar 7 09:04:06 2011 New Revision: 219367 URL: http://svn.freebsd.org/changeset/base/219367 Log: MFC r219158: Correct a typo. PR: bin/155175 Submitted by: Peter J. Philipp Modified: stable/7/usr.sbin/faithd/faithd.c Directory Properties: stable/7/usr.sbin/faithd/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.sbin/faithd/faithd.c Directory Properties: stable/8/usr.sbin/faithd/ (props changed) Modified: stable/7/usr.sbin/faithd/faithd.c ============================================================================== --- stable/7/usr.sbin/faithd/faithd.c Mon Mar 7 08:54:20 2011 (r219366) +++ stable/7/usr.sbin/faithd/faithd.c Mon Mar 7 09:04:06 2011 (r219367) @@ -339,7 +339,7 @@ daemon_main(int argc, char **argv) snprintf(logname, sizeof(logname), "faithd %s", service); snprintf(procname, sizeof(procname), "accepting port %s", service); openlog(logname, LOG_PID | LOG_NOWAIT, LOG_DAEMON); - syslog(LOG_INFO, "Staring faith daemon for %s port", service); + syslog(LOG_INFO, "Starting faith daemon for %s port", service); play_service(s_wld); /* NOTREACHED */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 09:28:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FC50106564A; Mon, 7 Mar 2011 09:28:22 +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 F2B478FC13; Mon, 7 Mar 2011 09:28:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p279SL6B028385; Mon, 7 Mar 2011 09:28:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p279SLmT028383; Mon, 7 Mar 2011 09:28:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103070928.p279SLmT028383@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 7 Mar 2011 09:28: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: r219368 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 09:28:22 -0000 Author: pjd Date: Mon Mar 7 09:28:21 2011 New Revision: 219368 URL: http://svn.freebsd.org/changeset/base/219368 Log: To be able to use printf extensions we need to turn off gcc format checking. Following the convention of NO_WERROR and NO_WCAST_ALIGN add NO_WFORMAT, which, when defined in Makefile, turns off compile-time format checking (by adding -Wno-format), but still allows to use high WARNS level. MFC after: 2 weeks Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon Mar 7 09:04:06 2011 (r219367) +++ head/share/mk/bsd.sys.mk Mon Mar 7 09:28:21 2011 (r219368) @@ -73,6 +73,9 @@ CWARNFLAGS += -Werror . endif . endif . endif +. if defined(NO_WFORMAT) +CWARNFLAGS += -Wno-format +. endif .endif .if defined(IGNORE_PRAGMA) From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 10:33:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 731741065674; Mon, 7 Mar 2011 10:33:52 +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 60D7B8FC0A; Mon, 7 Mar 2011 10:33: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 p27AXqqW032087; Mon, 7 Mar 2011 10:33:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27AXqaX032085; Mon, 7 Mar 2011 10:33:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103071033.p27AXqaX032085@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 7 Mar 2011 10:33: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: r219369 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 10:33:52 -0000 Author: pjd Date: Mon Mar 7 10:33:52 2011 New Revision: 219369 URL: http://svn.freebsd.org/changeset/base/219369 Log: Provides three states for pjdlog_initialized, so we can also tell that this is fist initialization ever. MFC after: 2 weeks Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Mon Mar 7 09:28:21 2011 (r219368) +++ head/sbin/hastd/pjdlog.c Mon Mar 7 10:33:52 2011 (r219369) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -42,7 +41,11 @@ __FBSDID("$FreeBSD$"); #include "pjdlog.h" -static bool pjdlog_initialized = false; +#define PJDLOG_NEVER_INITIALIZED 0 +#define PJDLOG_NOT_INITIALIZED 1 +#define PJDLOG_INITIALIZED 2 + +static int pjdlog_initialized = PJDLOG_NEVER_INITIALIZED; static int pjdlog_mode, pjdlog_debug_level; static char pjdlog_prefix[128]; @@ -50,7 +53,8 @@ void pjdlog_init(int mode) { - assert(!pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_NEVER_INITIALIZED || + pjdlog_initialized == PJDLOG_NOT_INITIALIZED); assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); if (mode == PJDLOG_MODE_SYSLOG) @@ -59,19 +63,19 @@ pjdlog_init(int mode) pjdlog_debug_level = 0; bzero(pjdlog_prefix, sizeof(pjdlog_prefix)); - pjdlog_initialized = true; + pjdlog_initialized = PJDLOG_INITIALIZED; } void pjdlog_fini(void) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); if (pjdlog_mode == PJDLOG_MODE_SYSLOG) closelog(); - pjdlog_initialized = false; + pjdlog_initialized = PJDLOG_NOT_INITIALIZED; } /* @@ -84,7 +88,7 @@ void pjdlog_mode_set(int mode) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); if (pjdlog_mode == mode) @@ -105,7 +109,7 @@ int pjdlog_mode_get(void) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); return (pjdlog_mode); } @@ -118,7 +122,7 @@ void pjdlog_debug_set(int level) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); assert(level >= 0); pjdlog_debug_level = level; @@ -131,7 +135,7 @@ int pjdlog_debug_get(void) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); return (pjdlog_debug_level); } @@ -145,7 +149,7 @@ pjdlog_prefix_set(const char *fmt, ...) { va_list ap; - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); va_start(ap, fmt); pjdlogv_prefix_set(fmt, ap); @@ -160,7 +164,7 @@ void pjdlogv_prefix_set(const char *fmt, va_list ap) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); assert(fmt != NULL); vsnprintf(pjdlog_prefix, sizeof(pjdlog_prefix), fmt, ap); @@ -203,7 +207,7 @@ pjdlog_common(int loglevel, int debuglev { va_list ap; - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); va_start(ap, fmt); pjdlogv_common(loglevel, debuglevel, error, fmt, ap); @@ -219,7 +223,7 @@ pjdlogv_common(int loglevel, int debugle va_list ap) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); assert(loglevel == LOG_EMERG || loglevel == LOG_ALERT || loglevel == LOG_CRIT || loglevel == LOG_ERR || loglevel == LOG_WARNING || loglevel == LOG_NOTICE || @@ -296,7 +300,7 @@ void pjdlogv(int loglevel, const char *fmt, va_list ap) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); /* LOG_DEBUG is invalid here, pjdlogv?_debug() should be used. */ assert(loglevel == LOG_EMERG || loglevel == LOG_ALERT || @@ -315,7 +319,7 @@ pjdlog(int loglevel, const char *fmt, .. { va_list ap; - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); va_start(ap, fmt); pjdlogv(loglevel, fmt, ap); @@ -329,7 +333,7 @@ void pjdlogv_debug(int debuglevel, const char *fmt, va_list ap) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); pjdlogv_common(LOG_DEBUG, debuglevel, -1, fmt, ap); } @@ -342,7 +346,7 @@ pjdlog_debug(int debuglevel, const char { va_list ap; - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); va_start(ap, fmt); pjdlogv_debug(debuglevel, fmt, ap); @@ -356,7 +360,7 @@ void pjdlogv_errno(int loglevel, const char *fmt, va_list ap) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); pjdlogv_common(loglevel, 0, errno, fmt, ap); } @@ -369,7 +373,7 @@ pjdlog_errno(int loglevel, const char *f { va_list ap; - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); va_start(ap, fmt); pjdlogv_errno(loglevel, fmt, ap); @@ -383,7 +387,7 @@ void pjdlogv_exit(int exitcode, const char *fmt, va_list ap) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); pjdlogv_errno(LOG_ERR, fmt, ap); exit(exitcode); @@ -398,7 +402,7 @@ pjdlog_exit(int exitcode, const char *fm { va_list ap; - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); va_start(ap, fmt); pjdlogv_exit(exitcode, fmt, ap); @@ -413,7 +417,7 @@ void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) { - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); pjdlogv(LOG_ERR, fmt, ap); exit(exitcode); @@ -428,7 +432,7 @@ pjdlog_exitx(int exitcode, const char *f { va_list ap; - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); va_start(ap, fmt); pjdlogv_exitx(exitcode, fmt, ap); @@ -445,7 +449,7 @@ pjdlog_abort(const char *func, const cha { va_list ap; - assert(pjdlog_initialized); + assert(pjdlog_initialized == PJDLOG_INITIALIZED); /* * When there is no message we pass __func__ as 'fmt'. From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 10:38:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84630106564A; Mon, 7 Mar 2011 10:38:18 +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 720A88FC19; Mon, 7 Mar 2011 10:38: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 p27AcIDK032212; Mon, 7 Mar 2011 10:38:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27AcIKh032208; Mon, 7 Mar 2011 10:38:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103071038.p27AcIKh032208@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 7 Mar 2011 10:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219370 - in head/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 10:38:19 -0000 Author: pjd Date: Mon Mar 7 10:38:18 2011 New Revision: 219370 URL: http://svn.freebsd.org/changeset/base/219370 Log: - Turn on printf extentions. - Load support for %T for pritning time. - Add support for %N for printing number in human readable form. - Add support for %S for printing sockaddr structure (currently only AF_INET family is supported, as this is all we need in HAST). - Disable gcc compile-time format checking as this will no longer work. MFC after: 2 weeks Modified: head/sbin/hastctl/Makefile head/sbin/hastd/Makefile head/sbin/hastd/pjdlog.c Modified: head/sbin/hastctl/Makefile ============================================================================== --- head/sbin/hastctl/Makefile Mon Mar 7 10:33:52 2011 (r219369) +++ head/sbin/hastctl/Makefile Mon Mar 7 10:38:18 2011 (r219370) @@ -19,6 +19,7 @@ SRCS+= subr.c SRCS+= y.tab.h MAN= hastctl.8 +NO_WFORMAT= CFLAGS+=-I${.CURDIR}/../hastd CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" @@ -28,8 +29,8 @@ CFLAGS+=-DINET6 CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT -DPADD= ${LIBL} -LDADD= -ll +DPADD= ${LIBL} ${LIBUTIL} +LDADD= -ll -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Mon Mar 7 10:33:52 2011 (r219369) +++ head/sbin/hastd/Makefile Mon Mar 7 10:38:18 2011 (r219370) @@ -19,6 +19,7 @@ SRCS+= token.l SRCS+= y.tab.h MAN= hastd.8 hast.conf.5 +NO_WFORMAT= CFLAGS+=-I${.CURDIR} CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Mon Mar 7 10:33:52 2011 (r219369) +++ head/sbin/hastd/pjdlog.c Mon Mar 7 10:38:18 2011 (r219370) @@ -31,9 +31,15 @@ #include __FBSDID("$FreeBSD$"); +#include +#include + #include #include +#include +#include #include +#include #include #include #include @@ -49,6 +55,77 @@ static int pjdlog_initialized = PJDLOG_N static int pjdlog_mode, pjdlog_debug_level; static char pjdlog_prefix[128]; +static int +pjdlog_printf_arginfo_humanized_number(const struct printf_info *pi __unused, + size_t n, int *argt) +{ + + assert(n >= 1); + argt[0] = PA_INT | PA_FLAG_INTMAX; + return (1); +} + +static int +pjdlog_printf_render_humanized_number(struct __printf_io *io, + const struct printf_info *pi, const void * const *arg) +{ + char buf[5]; + intmax_t num; + int ret; + + num = *(const intmax_t *)arg[0]; + humanize_number(buf, sizeof(buf), (int64_t)num, "", HN_AUTOSCALE, + HN_NOSPACE | HN_DECIMAL); + ret = __printf_out(io, pi, buf, strlen(buf)); + __printf_flush(io); + return (ret); +} + +static int +pjdlog_printf_arginfo_sockaddr(const struct printf_info *pi __unused, + size_t n, int *argt) +{ + + assert(n >= 1); + argt[0] = PA_POINTER; + return (1); +} + +static int +pjdlog_printf_render_sockaddr(struct __printf_io *io, + const struct printf_info *pi, const void * const *arg) +{ + const struct sockaddr *sa; + char buf[64]; + int ret; + + sa = *(const struct sockaddr * const *)arg[0]; + switch (sa->sa_family) { + case AF_INET: + { + const struct sockaddr_in *sin; + in_addr_t ip; + unsigned int port; + + sin = (const struct sockaddr_in *)sa; + ip = ntohl(sin->sin_addr.s_addr); + port = ntohs(sin->sin_port); + + snprintf(buf, sizeof(buf), "%u.%u.%u.%u:%u", + ((ip >> 24) & 0xff), ((ip >> 16) & 0xff), + ((ip >> 8) & 0xff), (ip & 0xff), port); + break; + } + default: + snprintf(buf, sizeof(buf), "[unsupported family %u]", + (unsigned int)sa->sa_family); + break; + } + ret = __printf_out(io, pi, buf, strlen(buf)); + __printf_flush(io); + return (ret); +} + void pjdlog_init(int mode) { @@ -57,6 +134,17 @@ pjdlog_init(int mode) pjdlog_initialized == PJDLOG_NOT_INITIALIZED); assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); + if (pjdlog_initialized == PJDLOG_NEVER_INITIALIZED) { + __use_xprintf = 1; + register_printf_render_std("T"); + register_printf_render('N', + pjdlog_printf_render_humanized_number, + pjdlog_printf_arginfo_humanized_number); + register_printf_render('S', + pjdlog_printf_render_sockaddr, + pjdlog_printf_arginfo_sockaddr); + } + if (mode == PJDLOG_MODE_SYSLOG) openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON); pjdlog_mode = mode; From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 10:39:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CA91106564A; Mon, 7 Mar 2011 10:39:26 +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 5AF4E8FC18; Mon, 7 Mar 2011 10:39: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 p27AdQVA032269; Mon, 7 Mar 2011 10:39:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27AdQMO032267; Mon, 7 Mar 2011 10:39:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103071039.p27AdQMO032267@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 7 Mar 2011 10:39: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: r219371 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 10:39:26 -0000 Author: pjd Date: Mon Mar 7 10:39:26 2011 New Revision: 219371 URL: http://svn.freebsd.org/changeset/base/219371 Log: Use %S to print IP address and port number. MFC after: 2 weeks Modified: head/sbin/hastd/proto_tcp4.c Modified: head/sbin/hastd/proto_tcp4.c ============================================================================== --- head/sbin/hastd/proto_tcp4.c Mon Mar 7 10:38:18 2011 (r219370) +++ head/sbin/hastd/proto_tcp4.c Mon Mar 7 10:39:26 2011 (r219371) @@ -475,22 +475,6 @@ tcp4_descriptor(const void *ctx) return (tctx->tc_fd); } -static void -sin2str(struct sockaddr_in *sinp, char *addr, size_t size) -{ - in_addr_t ip; - unsigned int port; - - PJDLOG_ASSERT(addr != NULL); - PJDLOG_ASSERT(sinp->sin_family == AF_INET); - - ip = ntohl(sinp->sin_addr.s_addr); - port = ntohs(sinp->sin_port); - PJDLOG_VERIFY(snprintf(addr, size, "tcp4://%u.%u.%u.%u:%u", - ((ip >> 24) & 0xff), ((ip >> 16) & 0xff), ((ip >> 8) & 0xff), - (ip & 0xff), port) < (ssize_t)size); -} - static bool tcp4_address_match(const void *ctx, const char *addr) { @@ -529,7 +513,7 @@ tcp4_local_address(const void *ctx, char PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); return; } - sin2str(&sin, addr, size); + PJDLOG_VERIFY(snprintf(addr, size, "tcp4://%S", &sin) < (ssize_t)size); } static void @@ -547,7 +531,7 @@ tcp4_remote_address(const void *ctx, cha PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); return; } - sin2str(&sin, addr, size); + PJDLOG_VERIFY(snprintf(addr, size, "tcp4://%S", &sin) < (ssize_t)size); } static void From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 10:41:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04F86106564A; Mon, 7 Mar 2011 10:41:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE2E28FC13; Mon, 7 Mar 2011 10:41: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 p27AfCeM032346; Mon, 7 Mar 2011 10:41:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27AfCas032344; Mon, 7 Mar 2011 10:41:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103071041.p27AfCas032344@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 7 Mar 2011 10:41: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: r219372 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 10:41:13 -0000 Author: pjd Date: Mon Mar 7 10:41:12 2011 New Revision: 219372 URL: http://svn.freebsd.org/changeset/base/219372 Log: - Log size of data to synchronize in human readable form (using %N). - Log synchronization time (using %T). - Log synchronization speed in human readable form (using %N). MFC after: 2 weeks Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Mon Mar 7 10:39:26 2011 (r219371) +++ head/sbin/hastd/primary.c Mon Mar 7 10:41:12 2011 (r219372) @@ -1667,6 +1667,7 @@ sync_thread(void *arg __unused) struct hast_resource *res = arg; struct hio *hio; struct g_gate_ctl_io *ggio; + struct timeval tstart, tend, tdiff; unsigned int ii, ncomp, ncomps; off_t offset, length, synced; bool dorewind; @@ -1680,8 +1681,10 @@ sync_thread(void *arg __unused) for (;;) { mtx_lock(&sync_lock); if (offset >= 0 && !sync_inprogress) { - pjdlog_info("Synchronization interrupted. " - "%jd bytes synchronized so far.", + gettimeofday(&tend, NULL); + timersub(&tend, &tstart, &tdiff); + pjdlog_info("Synchronization interrupted after %#.0T. " + "%NB synchronized so far.", &tdiff, (intmax_t)synced); event_send(res, EVENT_SYNCINTR); } @@ -1713,10 +1716,11 @@ sync_thread(void *arg __unused) if (offset < 0) pjdlog_info("Nodes are in sync."); else { - pjdlog_info("Synchronization started. %ju bytes to go.", - (uintmax_t)(res->hr_extentsize * + pjdlog_info("Synchronization started. %NB to go.", + (intmax_t)(res->hr_extentsize * activemap_ndirty(res->hr_amp))); event_send(res, EVENT_SYNCSTART); + gettimeofday(&tstart, NULL); } } if (offset < 0) { @@ -1730,9 +1734,17 @@ sync_thread(void *arg __unused) rw_rlock(&hio_remote_lock[ncomp]); if (ISCONNECTED(res, ncomp)) { if (synced > 0) { + int64_t bps; + + gettimeofday(&tend, NULL); + timersub(&tend, &tstart, &tdiff); + bps = (int64_t)((double)synced / + ((double)tdiff.tv_sec + + (double)tdiff.tv_usec / 1000000)); pjdlog_info("Synchronization complete. " - "%jd bytes synchronized.", - (intmax_t)synced); + "%NB synchronized in %#.0lT (%NB/sec).", + (intmax_t)synced, &tdiff, + (intmax_t)bps); event_send(res, EVENT_SYNCDONE); } mtx_lock(&metadata_lock); From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 10:42:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE2571065670; Mon, 7 Mar 2011 10:42:28 +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 B30008FC13; Mon, 7 Mar 2011 10:42: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 p27AgSAU032410; Mon, 7 Mar 2011 10:42:28 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27AgSBL032408; Mon, 7 Mar 2011 10:42:28 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103071042.p27AgSBL032408@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 7 Mar 2011 10:42: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: r219373 - head/sbin/hastctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 10:42:29 -0000 Author: pjd Date: Mon Mar 7 10:42:28 2011 New Revision: 219373 URL: http://svn.freebsd.org/changeset/base/219373 Log: Print some of the numbers in human readable form (using %N). MFC after: 2 weeks Modified: head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Mon Mar 7 10:41:12 2011 (r219372) +++ head/sbin/hastctl/hastctl.c Mon Mar 7 10:42:28 2011 (r219373) @@ -213,8 +213,10 @@ dump_one(struct hast_resource *res) 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(" datasize: %ju (%NB)\n", (uintmax_t)res->hr_datasize, + (intmax_t)res->hr_datasize); + printf(" extentsize: %d (%NB)\n", res->hr_extentsize, + (intmax_t)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); @@ -321,8 +323,9 @@ control_status(struct nv *nv) 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(" extentsize: %u (%NB)\n", + (unsigned int)nv_get_uint32(nv, "extentsize%u", ii), + (intmax_t)nv_get_uint32(nv, "extentsize%u", ii)); printf(" keepdirty: %u\n", (unsigned int)nv_get_uint32(nv, "keepdirty%u", ii)); printf(" remoteaddr: %s\n", @@ -332,8 +335,9 @@ control_status(struct nv *nv) 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)); + printf(" dirty: %ju (%NB)\n", + (uintmax_t)nv_get_uint64(nv, "dirty%u", ii), + (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); } return (ret); } From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 12:31:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE1CC106566C; Mon, 7 Mar 2011 12:31:28 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 71A478FC16; Mon, 7 Mar 2011 12:31:28 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 8E87D45C9B; Mon, 7 Mar 2011 13:31:26 +0100 (CET) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 21E0445C8A; Mon, 7 Mar 2011 13:31:21 +0100 (CET) Date: Mon, 7 Mar 2011 13:31:20 +0100 From: Pawel Jakub Dawidek To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20110307123120.GE2342@garage.freebsd.pl> References: <201103071041.p27AfCas032344@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W13SgbpmD6bhZUTM" Content-Disposition: inline In-Reply-To: <201103071041.p27AfCas032344@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: Subject: Re: svn commit: r219372 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 12:31:28 -0000 --W13SgbpmD6bhZUTM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 07, 2011 at 10:41:12AM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Mon Mar 7 10:41:12 2011 > New Revision: 219372 > URL: http://svn.freebsd.org/changeset/base/219372 >=20 > Log: > - Log size of data to synchronize in human readable form (using %N). > - Log synchronization time (using %T). > - Log synchronization speed in human readable form (using %N). With those changes: [INFO] [test] (primary) Synchronization started. 37GB to go. [INFO] [test] (primary) Synchronization complete. 37GB synchronized in 7m24= s (86MB/sec). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --W13SgbpmD6bhZUTM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk100BcACgkQForvXbEpPzTYugCbBmIeeefI/NYW5W0HOV6bjXZ2 yBQAniEXjZVQyvpoo0tl1V3f5B5Spu7d =wZ48 -----END PGP SIGNATURE----- --W13SgbpmD6bhZUTM-- From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 13:40:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C04E2106566C; Mon, 7 Mar 2011 13:40:24 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 71DD38FC0A; Mon, 7 Mar 2011 13:40:24 +0000 (UTC) Received: from outgoing.leidinger.net (p5B1556CA.dip.t-dialin.net [91.21.86.202]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 83E84844012; Mon, 7 Mar 2011 14:40:20 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id 484802523; Mon, 7 Mar 2011 14:40:15 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p27Ddx9E025611; Mon, 7 Mar 2011 14:39:59 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 07 Mar 2011 14:39:58 +0100 Message-ID: <20110307143958.64254z992owdpkco@webmail.leidinger.net> Date: Mon, 07 Mar 2011 14:39:58 +0100 From: Alexander Leidinger To: Chagin Dmitry References: <201102231323.p1NDNSVH061525@svn.freebsd.org> <20110305194528.GA3892@dchagin.static.corbina.ru> In-Reply-To: <20110305194528.GA3892@dchagin.static.corbina.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 83E84844012.A357B X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.351, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1300110021.13132@xJZesAeptq08yZTRyKkrXA X-EBL-Spam-Status: No Cc: Lucius Windschuh , svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r218970 - in head/sys: compat/linux sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 13:40:24 -0000 Quoting Chagin Dmitry (from Sat, 5 Mar 2011 22:45:28 +0300): > On Sat, Mar 05, 2011 at 08:02:44PM +0100, Lucius Windschuh wrote: >> BTW, is there an easy way to debug such futex issues, other than >> perhaps linux_kdump? >> > > try r219242. kdump now (in HEAD) decode linux syscalls. also see ktr(4). DTrace is much more leightwight, does not need as much configuration in the kernel as KTR (once KDTRACE_HOOKS is inside), and is much more flexibel. Bye, Alexander. -- Greatness is a transitory experience. It is never consistent. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 14:48:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4838106564A; Mon, 7 Mar 2011 14:48:23 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C27FE8FC08; Mon, 7 Mar 2011 14:48: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 p27EmNvY038056; Mon, 7 Mar 2011 14:48:23 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27EmNrp038046; Mon, 7 Mar 2011 14:48:23 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201103071448.p27EmNrp038046@svn.freebsd.org> From: Martin Matuska Date: Mon, 7 Mar 2011 14:48: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: r219374 - in head/contrib/gcc: . config/i386 doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 14:48:23 -0000 Author: mm Date: Mon Mar 7 14:48:22 2011 New Revision: 219374 URL: http://svn.freebsd.org/changeset/base/219374 Log: Backport Intel Core 2 and AMD Geode CPU types from gcc-4.3 (GPLv2) These options are supported in this shape in all newer GCC versions. PR: gnu/155308 Obtained from: gcc 4.3 (rev. 118090, 118973, 120846; GPLv2) MFC after: 2 weeks Added: head/contrib/gcc/config/i386/geode.md Modified: head/contrib/gcc/config.gcc head/contrib/gcc/config/i386/i386.c head/contrib/gcc/config/i386/i386.h head/contrib/gcc/config/i386/i386.md head/contrib/gcc/doc/gcc.1 head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/config.gcc ============================================================================== --- head/contrib/gcc/config.gcc Mon Mar 7 10:42:28 2011 (r219373) +++ head/contrib/gcc/config.gcc Mon Mar 7 14:48:22 2011 (r219374) @@ -1207,14 +1207,14 @@ i[34567]86-*-solaris2*) # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*. case X"${with_cpu}" in - Xgeneric|Xnocona|Xx86-64|Xk8|Xopteron|Xathlon64|Xathlon-fx) + Xgeneric|Xcore2|Xnocona|Xx86-64|Xk8|Xopteron|Xathlon64|Xathlon-fx) ;; X) with_cpu=generic ;; *) echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 - echo "generic nocona x86-64 k8 opteron athlon64 athlon-fx" 1>&2 + echo "generic core2 nocona x86-64 k8 opteron athlon64 athlon-fx" 1>&2 exit 1 ;; esac @@ -2537,6 +2537,9 @@ if test x$with_cpu = x ; then nocona-*) with_cpu=nocona ;; + core2-*) + with_cpu=core2 + ;; pentium_m-*) with_cpu=pentium-m ;; @@ -2556,6 +2559,9 @@ if test x$with_cpu = x ; then nocona-*) with_cpu=nocona ;; + core2-*) + with_cpu=core2 + ;; *) with_cpu=generic ;; @@ -2787,7 +2793,7 @@ case "${target}" in esac # OK ;; - "" | k8 | opteron | athlon64 | athlon-fx | nocona | generic) + "" | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) # OK ;; *) Added: head/contrib/gcc/config/i386/geode.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/gcc/config/i386/geode.md Mon Mar 7 14:48:22 2011 (r219374) @@ -0,0 +1,153 @@ +;; Geode Scheduling +;; Copyright (C) 2006 +;; Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING. If not, write to +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. +;; +;; The Geode architecture is one insn issue processor. +;; +;; This description is based on data from the following documents: +;; +;; "AMD Geode GX Processor Data Book" +;; Advanced Micro Devices, Inc., Aug 2005. +;; +;; "AMD Geode LX Processor Data Book" +;; Advanced Micro Devices, Inc., Jan 2006. +;; +;; +;; CPU execution units of the Geode: +;; +;; issue describes the issue pipeline. +;; alu describes the Integer unit +;; fpu describes the FP unit +;; +;; The fp unit is out of order execution unit with register renaming. +;; There is also memory management unit and execution pipeline for +;; load/store operations. We ignore it and difference between insns +;; using memory and registers. + +(define_automaton "geode") + +(define_cpu_unit "geode_issue,geode_alu,geode_fpu" "geode") + +(define_insn_reservation "alu" 1 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "alu,alu1,negnot,icmp,lea,test,imov,imovx,icmov,incdec,setcc")) + "geode_issue,geode_alu") + +(define_insn_reservation "shift" 2 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "ishift,ishift1,rotate,rotate1,cld")) + "geode_issue,geode_alu*2") + +(define_insn_reservation "imul" 7 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "imul")) + "geode_issue,geode_alu*7") + +(define_insn_reservation "idiv" 40 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "idiv")) + "geode_issue,geode_alu*40") + +;; The branch unit. +(define_insn_reservation "call" 2 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "call,callv")) + "geode_issue,geode_alu*2") + +(define_insn_reservation "geode_branch" 1 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "ibr")) + "geode_issue,geode_alu") + +(define_insn_reservation "geode_pop_push" 1 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "pop,push")) + "geode_issue,geode_alu") + +(define_insn_reservation "geode_leave" 2 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "leave")) + "geode_issue,geode_alu*2") + +(define_insn_reservation "geode_load_str" 4 + (and (eq_attr "cpu" "geode") + (and (eq_attr "type" "str") + (eq_attr "memory" "load,both"))) + "geode_issue,geode_alu*4") + +(define_insn_reservation "geode_store_str" 2 + (and (eq_attr "cpu" "geode") + (and (eq_attr "type" "str") + (eq_attr "memory" "store"))) + "geode_issue,geode_alu*2") + +;; Be optimistic +(define_insn_reservation "geode_unknown" 1 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "multi,other")) + "geode_issue,geode_alu") + +;; FPU + +(define_insn_reservation "geode_fop" 6 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "fop,fcmp")) + "geode_issue,geode_fpu*6") + +(define_insn_reservation "geode_fsimple" 1 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "fmov,fcmov,fsgn,fxch")) + "geode_issue,geode_fpu") + +(define_insn_reservation "geode_fist" 4 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "fistp,fisttp")) + "geode_issue,geode_fpu*4") + +(define_insn_reservation "geode_fmul" 10 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "fmul")) + "geode_issue,geode_fpu*10") + +(define_insn_reservation "geode_fdiv" 47 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "fdiv")) + "geode_issue,geode_fpu*47") + +;; We use minimal latency (fsin) here +(define_insn_reservation "geode_fpspc" 54 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "fpspc")) + "geode_issue,geode_fpu*54") + +(define_insn_reservation "geode_frndint" 12 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "frndint")) + "geode_issue,geode_fpu*12") + +(define_insn_reservation "geode_mmxmov" 1 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "mmxmov")) + "geode_issue,geode_fpu") + +(define_insn_reservation "geode_mmx" 2 + (and (eq_attr "cpu" "geode") + (eq_attr "type" "mmx,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft")) + "geode_issue,geode_fpu*2") Modified: head/contrib/gcc/config/i386/i386.c ============================================================================== --- head/contrib/gcc/config/i386/i386.c Mon Mar 7 10:42:28 2011 (r219373) +++ head/contrib/gcc/config/i386/i386.c Mon Mar 7 14:48:22 2011 (r219374) @@ -336,6 +336,60 @@ struct processor_costs pentiumpro_cost = }; static const +struct processor_costs geode_cost = { + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (1), /* cost of a lea instruction */ + COSTS_N_INSNS (2), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ + COSTS_N_INSNS (4), /* HI */ + COSTS_N_INSNS (7), /* SI */ + COSTS_N_INSNS (7), /* DI */ + COSTS_N_INSNS (7)}, /* other */ + 0, /* cost of multiply per each bit set */ + {COSTS_N_INSNS (15), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (23), /* HI */ + COSTS_N_INSNS (39), /* SI */ + COSTS_N_INSNS (39), /* DI */ + COSTS_N_INSNS (39)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ + 8, /* "large" insn */ + 4, /* MOVE_RATIO */ + 1, /* cost for loading QImode using movzbl */ + {1, 1, 1}, /* cost of loading integer registers + in QImode, HImode and SImode. + Relative to reg-reg move (2). */ + {1, 1, 1}, /* cost of storing integer registers */ + 1, /* cost of reg,reg fld/fst */ + {1, 1, 1}, /* cost of loading fp registers + in SFmode, DFmode and XFmode */ + {4, 6, 6}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ + + 1, /* cost of moving MMX register */ + {1, 1}, /* cost of loading MMX registers + in SImode and DImode */ + {1, 1}, /* cost of storing MMX registers + in SImode and DImode */ + 1, /* cost of moving SSE register */ + {1, 1, 1}, /* cost of loading SSE registers + in SImode, DImode and TImode */ + {1, 1, 1}, /* cost of storing SSE registers + in SImode, DImode and TImode */ + 1, /* MMX or SSE register to integer */ + 32, /* size of prefetch block */ + 1, /* number of parallel prefetches */ + 1, /* Branch cost */ + COSTS_N_INSNS (6), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (11), /* cost of FMUL instruction. */ + COSTS_N_INSNS (47), /* cost of FDIV instruction. */ + COSTS_N_INSNS (1), /* cost of FABS instruction. */ + COSTS_N_INSNS (1), /* cost of FCHS instruction. */ + COSTS_N_INSNS (54), /* cost of FSQRT instruction. */ +}; + +static const struct processor_costs k6_cost = { COSTS_N_INSNS (1), /* cost of an add instruction */ COSTS_N_INSNS (2), /* cost of a lea instruction */ @@ -600,6 +654,58 @@ struct processor_costs nocona_cost = { COSTS_N_INSNS (44), /* cost of FSQRT instruction. */ }; +static const +struct processor_costs core2_cost = { + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ + COSTS_N_INSNS (1), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ + COSTS_N_INSNS (3), /* HI */ + COSTS_N_INSNS (3), /* SI */ + COSTS_N_INSNS (3), /* DI */ + COSTS_N_INSNS (3)}, /* other */ + 0, /* cost of multiply per each bit set */ + {COSTS_N_INSNS (22), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (22), /* HI */ + COSTS_N_INSNS (22), /* SI */ + COSTS_N_INSNS (22), /* DI */ + COSTS_N_INSNS (22)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ + 8, /* "large" insn */ + 16, /* MOVE_RATIO */ + 2, /* cost for loading QImode using movzbl */ + {6, 6, 6}, /* cost of loading integer registers + in QImode, HImode and SImode. + Relative to reg-reg move (2). */ + {4, 4, 4}, /* cost of storing integer registers */ + 2, /* cost of reg,reg fld/fst */ + {6, 6, 6}, /* cost of loading fp registers + in SFmode, DFmode and XFmode */ + {4, 4, 4}, /* cost of loading integer registers */ + 2, /* cost of moving MMX register */ + {6, 6}, /* cost of loading MMX registers + in SImode and DImode */ + {4, 4}, /* cost of storing MMX registers + in SImode and DImode */ + 2, /* cost of moving SSE register */ + {6, 6, 6}, /* cost of loading SSE registers + in SImode, DImode and TImode */ + {4, 4, 4}, /* cost of storing SSE registers + in SImode, DImode and TImode */ + 2, /* MMX or SSE register to integer */ + 128, /* size of prefetch block */ + 8, /* number of parallel prefetches */ + 3, /* Branch cost */ + COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (5), /* cost of FMUL instruction. */ + COSTS_N_INSNS (32), /* cost of FDIV instruction. */ + COSTS_N_INSNS (1), /* cost of FABS instruction. */ + COSTS_N_INSNS (1), /* cost of FCHS instruction. */ + COSTS_N_INSNS (58), /* cost of FSQRT instruction. */ +}; + /* Generic64 should produce code tuned for Nocona and K8. */ static const struct processor_costs generic64_cost = { @@ -721,38 +827,41 @@ const struct processor_costs *ix86_cost #define m_486 (1< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C359F106566B; Mon, 7 Mar 2011 14:58:23 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 994BD8FC16; Mon, 7 Mar 2011 14:58: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 p27EwNIQ038654; Mon, 7 Mar 2011 14:58:23 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27EwNKR038651; Mon, 7 Mar 2011 14:58:23 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201103071458.p27EwNKR038651@svn.freebsd.org> From: Martin Matuska Date: Mon, 7 Mar 2011 14:58: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: r219376 - in head/share: examples/etc mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 14:58:23 -0000 Author: mm Date: Mon Mar 7 14:58:23 2011 New Revision: 219376 URL: http://svn.freebsd.org/changeset/base/219376 Log: Add AMD Geode CPU type to bsd.cpu.mk and examples/etc/make.conf For CPUTYPE=core2 use -march=core2 PR: gnu/155308 MFC after: 2 weeks Modified: head/share/examples/etc/make.conf head/share/mk/bsd.cpu.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Mon Mar 7 14:54:45 2011 (r219375) +++ head/share/examples/etc/make.conf Mon Mar 7 14:58:23 2011 (r219376) @@ -32,7 +32,7 @@ # Intel x86 architecture: # (AMD CPUs) opteron-sse3 opteron athlon64-sse3 athlon64 athlon-mp # athlon-xp athlon-4 athlon-tbird athlon k8-sse3 k8 -# k6-3 k6-2 k6 k5 +# geode k6-3 k6-2 k6 k5 # (Intel CPUs) core2 core nocona pentium4m pentium4 prescott # pentium3m pentium3 pentium-m pentium2 # pentiumpro pentium-mmx pentium i486 i386 Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Mar 7 14:54:45 2011 (r219375) +++ head/share/mk/bsd.cpu.mk Mon Mar 7 14:58:23 2011 (r219376) @@ -59,7 +59,7 @@ CPUTYPE = athlon-mp CPUTYPE = athlon . endif . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" +. if ${CPUTYPE} == "prescott" CPUTYPE = nocona . endif . elif ${MACHINE_ARCH} == "sparc64" @@ -170,7 +170,7 @@ MACHINE_CPU = athlon-xp athlon k7 3dnow MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386 . elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird" MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386 -. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" +. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "geode" MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386 . elif ${CPUTYPE} == "k6" MACHINE_CPU = mmx k6 k5 i586 i486 i386 @@ -206,7 +206,7 @@ MACHINE_CPU = i386 MACHINE_CPU = k8 3dnow sse3 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow -. elif ${CPUTYPE} == "nocona" +. elif ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core2" MACHINE_CPU = sse3 . endif MACHINE_CPU += amd64 sse2 sse mmx From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 15:15:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 4925D106566C; Mon, 7 Mar 2011 15:15:02 +0000 (UTC) Date: Mon, 7 Mar 2011 15:15:02 +0000 From: Alexander Best To: Martin Matuska Message-ID: <20110307151502.GA89045@freebsd.org> References: <201103071458.p27EwNKR038651@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103071458.p27EwNKR038651@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219376 - in head/share: examples/etc mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 15:15:02 -0000 On Mon Mar 7 11, Martin Matuska wrote: > Author: mm > Date: Mon Mar 7 14:58:23 2011 > New Revision: 219376 > URL: http://svn.freebsd.org/changeset/base/219376 > > Log: > Add AMD Geode CPU type to bsd.cpu.mk and examples/etc/make.conf > For CPUTYPE=core2 use -march=core2 very cool. never thought core2 support would be coming. :) any plans for -march=native? for me it works, but apparently there are some users which claim native doesn't always chose the correct -m{tune,arch} setting [1]. maybe something like .if ${CPUTYPE} == "native" .error "bla bla don't do that" .endif would be a nice idea. however the PR was with a geode cpu, so this might in fact has been fixed in this (or recent gcc) commit. any chance you could test touch hello.c && gcc -march=native -### hello.c on a system with a geode cpu and see, if -m{tune,arch}=geode gets chosen? cheers. alex [1] http://www.freebsd.org/cgi/query-pr.cgi?pr=gnu/146716 > > PR: gnu/155308 > MFC after: 2 weeks > > Modified: > head/share/examples/etc/make.conf > head/share/mk/bsd.cpu.mk > > Modified: head/share/examples/etc/make.conf > ============================================================================== > --- head/share/examples/etc/make.conf Mon Mar 7 14:54:45 2011 (r219375) > +++ head/share/examples/etc/make.conf Mon Mar 7 14:58:23 2011 (r219376) > @@ -32,7 +32,7 @@ > # Intel x86 architecture: > # (AMD CPUs) opteron-sse3 opteron athlon64-sse3 athlon64 athlon-mp > # athlon-xp athlon-4 athlon-tbird athlon k8-sse3 k8 > -# k6-3 k6-2 k6 k5 > +# geode k6-3 k6-2 k6 k5 > # (Intel CPUs) core2 core nocona pentium4m pentium4 prescott > # pentium3m pentium3 pentium-m pentium2 > # pentiumpro pentium-mmx pentium i486 i386 > > Modified: head/share/mk/bsd.cpu.mk > ============================================================================== > --- head/share/mk/bsd.cpu.mk Mon Mar 7 14:54:45 2011 (r219375) > +++ head/share/mk/bsd.cpu.mk Mon Mar 7 14:58:23 2011 (r219376) > @@ -59,7 +59,7 @@ CPUTYPE = athlon-mp > CPUTYPE = athlon > . endif > . elif ${MACHINE_CPUARCH} == "amd64" > -. if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" > +. if ${CPUTYPE} == "prescott" > CPUTYPE = nocona > . endif > . elif ${MACHINE_ARCH} == "sparc64" > @@ -170,7 +170,7 @@ MACHINE_CPU = athlon-xp athlon k7 3dnow > MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386 > . elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird" > MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386 > -. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" > +. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "geode" > MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386 > . elif ${CPUTYPE} == "k6" > MACHINE_CPU = mmx k6 k5 i586 i486 i386 > @@ -206,7 +206,7 @@ MACHINE_CPU = i386 > MACHINE_CPU = k8 3dnow sse3 > . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" > MACHINE_CPU = k8 3dnow > -. elif ${CPUTYPE} == "nocona" > +. elif ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core2" > MACHINE_CPU = sse3 > . endif > MACHINE_CPU += amd64 sse2 sse mmx -- a13x From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 15:19:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E54461065677; Mon, 7 Mar 2011 15:19:17 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4AB08FC0C; Mon, 7 Mar 2011 15: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 p27FJHLQ039146; Mon, 7 Mar 2011 15:19:17 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27FJH88039144; Mon, 7 Mar 2011 15:19:17 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201103071519.p27FJH88039144@svn.freebsd.org> From: Ryan Stone Date: Mon, 7 Mar 2011 15: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: r219377 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 15:19:18 -0000 Author: rstone Date: Mon Mar 7 15:19:17 2011 New Revision: 219377 URL: http://svn.freebsd.org/changeset/base/219377 Log: Correct a typo in the malloc(3) manpage. Malloc options are set in the MALLOC_OPTIONS environment variable, not JEMALLOC_OPTIONS. Reviewed by: jasone Approved by: emaste (mentor) Modified: head/lib/libc/stdlib/malloc.3 Modified: head/lib/libc/stdlib/malloc.3 ============================================================================== --- head/lib/libc/stdlib/malloc.3 Mon Mar 7 14:58:23 2011 (r219376) +++ head/lib/libc/stdlib/malloc.3 Mon Mar 7 15:19:17 2011 (r219377) @@ -218,7 +218,7 @@ thread-specific cache garbage collection Garbage collection is actually performed incrementally, one size class at a time, in order to avoid large collection pauses. The default sweep interval is 8192; -.Ev JEMALLOC_OPTIONS=14g +.Ev MALLOC_OPTIONS=14g will disable garbage collection. .It H Double/halve the number of thread-specific cache slots per size @@ -232,7 +232,7 @@ See the .Dq G option for related tuning information. The default number of cache slots is 128; -.Ev JEMALLOC_OPTIONS=7h +.Ev MALLOC_OPTIONS=7h will disable thread-specific caching. Note that one cache slot per size class is not a valid configuration due to implementation details. From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 15:24:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13413106566C; Mon, 7 Mar 2011 15:24:36 +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 021D08FC16; Mon, 7 Mar 2011 15:24: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 p27FOZhg039339; Mon, 7 Mar 2011 15:24:35 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27FOZrp039336; Mon, 7 Mar 2011 15:24:35 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201103071524.p27FOZrp039336@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 7 Mar 2011 15:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219378 - stable/8/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 15:24:36 -0000 Author: jh Date: Mon Mar 7 15:24:35 2011 New Revision: 219378 URL: http://svn.freebsd.org/changeset/base/219378 Log: MFC r215687: Use g_eventlock to protect against losing wakeups in the g_event process and replace tsleep(9) with msleep(9) which doesn't use a timeout. The previously used timeout caused the event process to wake up ten times per second on an idle system. one_event() is now called with the topology lock held and it returns with both the topology and event locks held when there are no more events in the queue. Modified: stable/8/sys/geom/geom_event.c stable/8/sys/geom/geom_kern.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/geom_event.c ============================================================================== --- stable/8/sys/geom/geom_event.c Mon Mar 7 15:19:17 2011 (r219377) +++ stable/8/sys/geom/geom_event.c Mon Mar 7 15:24:35 2011 (r219378) @@ -183,33 +183,27 @@ one_event(void) struct g_event *ep; struct g_provider *pp; - g_topology_lock(); - for (;;) { - mtx_lock(&g_eventlock); - TAILQ_FOREACH(pp, &g_doorstep, orphan) { - if (pp->nstart == pp->nend) - break; - } - if (pp != NULL) { - G_VALID_PROVIDER(pp); - TAILQ_REMOVE(&g_doorstep, pp, orphan); - } - mtx_unlock(&g_eventlock); - if (pp == NULL) + g_topology_assert(); + mtx_lock(&g_eventlock); + TAILQ_FOREACH(pp, &g_doorstep, orphan) { + if (pp->nstart == pp->nend) break; + } + if (pp != NULL) { + G_VALID_PROVIDER(pp); + TAILQ_REMOVE(&g_doorstep, pp, orphan); + mtx_unlock(&g_eventlock); g_orphan_register(pp); + return (1); } - mtx_lock(&g_eventlock); + ep = TAILQ_FIRST(&g_events); if (ep == NULL) { wakeup(&g_pending_events); - mtx_unlock(&g_eventlock); - g_topology_unlock(); return (0); } if (ep->flag & EV_INPROGRESS) { mtx_unlock(&g_eventlock); - g_topology_unlock(); return (1); } ep->flag |= EV_INPROGRESS; @@ -228,7 +222,6 @@ one_event(void) mtx_unlock(&g_eventlock); g_free(ep); } - g_topology_unlock(); return (1); } @@ -237,16 +230,27 @@ g_run_events() { int i; - while (one_event()) - ; - g_topology_lock(); - i = g_wither_work; - while (i) { - i = g_wither_washer(); - g_wither_work = i & 1; - i &= 2; + for (;;) { + g_topology_lock(); + while (one_event()) + ; + mtx_assert(&g_eventlock, MA_OWNED); + i = g_wither_work; + if (i) { + mtx_unlock(&g_eventlock); + while (i) { + i = g_wither_washer(); + g_wither_work = i & 1; + i &= 2; + } + g_topology_unlock(); + } else { + g_topology_unlock(); + msleep(&g_wait_event, &g_eventlock, PRIBIO | PDROP, + "-", 0); + } } - g_topology_unlock(); + /* NOTREACHED */ } void @@ -338,9 +342,12 @@ g_post_event(g_event_t *func, void *arg, } void -g_do_wither() { +g_do_wither() +{ + mtx_lock(&g_eventlock); g_wither_work = 1; + mtx_unlock(&g_eventlock); wakeup(&g_wait_event); } Modified: stable/8/sys/geom/geom_kern.c ============================================================================== --- stable/8/sys/geom/geom_kern.c Mon Mar 7 15:19:17 2011 (r219377) +++ stable/8/sys/geom/geom_kern.c Mon Mar 7 15:24:35 2011 (r219378) @@ -137,10 +137,8 @@ g_event_procbody(void) thread_lock(tp); sched_prio(tp, PRIBIO); thread_unlock(tp); - for(;;) { - g_run_events(); - tsleep(&g_wait_event, PRIBIO, "-", hz/10); - } + g_run_events(); + /* NOTREACHED */ } static struct kproc_desc g_event_kp = { From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 16:05:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECA31106564A; Mon, 7 Mar 2011 16:05:45 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCA908FC1A; Mon, 7 Mar 2011 16:05: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 p27G5jmC040291; Mon, 7 Mar 2011 16:05:45 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27G5jGm040289; Mon, 7 Mar 2011 16:05:45 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201103071605.p27G5jGm040289@svn.freebsd.org> From: David Schultz Date: Mon, 7 Mar 2011 16:05: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: r219379 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 16:05:46 -0000 Author: das Date: Mon Mar 7 16:05:45 2011 New Revision: 219379 URL: http://svn.freebsd.org/changeset/base/219379 Log: Add missing declarations that I intended to commit with r219359. Not sure why we have math.h in lib/msun/ and complex.h in include/. Modified: head/include/complex.h Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Mon Mar 7 15:24:35 2011 (r219378) +++ head/include/complex.h Mon Mar 7 16:05:45 2011 (r219379) @@ -49,6 +49,8 @@ long double cabsl(long double complex); double carg(double complex); float cargf(float complex); long double cargl(long double complex); +double complex cexp(double complex); +float complex cexpf(float complex); double cimag(double complex) __pure2; float cimagf(float complex) __pure2; long double cimagl(long double complex) __pure2; From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 17:14:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B36106566C; Mon, 7 Mar 2011 17:14:18 +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 61DF58FC18; Mon, 7 Mar 2011 17:14: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 p27HEI1m041771; Mon, 7 Mar 2011 17:14:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27HEIbZ041768; Mon, 7 Mar 2011 17:14:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201103071714.p27HEIbZ041768@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Mar 2011 17:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219380 - in stable/7/sys: compat/linux sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 17:14:18 -0000 Author: jhb Date: Mon Mar 7 17:14:18 2011 New Revision: 219380 URL: http://svn.freebsd.org/changeset/base/219380 Log: MFC 218970,219240: Use umtx_key objects to uniquely identify futexes. Private futexes in different processes that happen to use the same user address in the separate processes will now be treated as distinct futexes rather than the same futex. We can now honor shared futexes properly by mapping them to a AUTO_SHARED umtx_key. Private futexes use THREAD_SHARED umtx_key objects. Modified: stable/7/sys/compat/linux/linux_futex.c stable/7/sys/sys/umtx.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/compat/linux/linux_futex.c ============================================================================== --- stable/7/sys/compat/linux/linux_futex.c Mon Mar 7 16:05:45 2011 (r219379) +++ stable/7/sys/compat/linux/linux_futex.c Mon Mar 7 17:14:18 2011 (r219380) @@ -52,6 +52,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #include +#include #ifdef COMPAT_LINUX32 #include @@ -77,7 +78,8 @@ struct waiting_proc { struct futex { struct sx f_lck; - uint32_t *f_uaddr; + uint32_t *f_uaddr; /* user-supplied value, for debug */ + struct umtx_key f_key; uint32_t f_refcount; LIST_ENTRY(futex) f_list; TAILQ_HEAD(lf_waiting_proc, waiting_proc) f_waiting_proc; @@ -99,6 +101,7 @@ struct mtx futex_mtx; /* protects the #define FUTEX_CREATE_WP 0x1 /* create waiting_proc */ #define FUTEX_DONTCREATE 0x2 /* don't create futex if not exists */ #define FUTEX_DONTEXISTS 0x4 /* return EINVAL if futex exists */ +#define FUTEX_SHARED 0x8 /* shared futex */ /* wp_flags */ #define FUTEX_WP_REQUEUED 0x1 /* wp requeued - wp moved from wp_list @@ -135,6 +138,7 @@ futex_put(struct futex *f, struct waitin LINUX_CTR2(sys_futex, "futex_put destroy uaddr %p ref %d", f->f_uaddr, f->f_refcount); + umtx_key_release(&f->f_key); FUTEX_DESTROY(f); free(f, M_FUTEX); return; @@ -150,13 +154,19 @@ static int futex_get0(uint32_t *uaddr, struct futex **newf, uint32_t flags) { struct futex *f, *tmpf; + struct umtx_key key; + int error; *newf = tmpf = NULL; + error = umtx_key_get(uaddr, TYPE_FUTEX, (flags & FUTEX_SHARED) ? + AUTO_SHARE : THREAD_SHARE, &key); + if (error) + return (error); retry: FUTEXES_LOCK; LIST_FOREACH(f, &futex_list, f_list) { - if (f->f_uaddr == uaddr) { + if (umtx_key_match(&f->f_key, &key)) { if (tmpf != NULL) { FUTEX_UNLOCK(tmpf); FUTEX_DESTROY(tmpf); @@ -164,6 +174,7 @@ retry: } if (flags & FUTEX_DONTEXISTS) { FUTEXES_UNLOCK; + umtx_key_release(&key); return (EINVAL); } @@ -173,6 +184,7 @@ retry: */ ++f->f_refcount; FUTEXES_UNLOCK; + umtx_key_release(&key); FUTEX_LOCK(f); *newf = f; @@ -184,6 +196,7 @@ retry: if (flags & FUTEX_DONTCREATE) { FUTEXES_UNLOCK; + umtx_key_release(&key); LINUX_CTR1(sys_futex, "futex_get uaddr %p null", uaddr); return (0); } @@ -192,6 +205,7 @@ retry: FUTEXES_UNLOCK; tmpf = malloc(sizeof(*tmpf), M_FUTEX, M_WAITOK | M_ZERO); tmpf->f_uaddr = uaddr; + tmpf->f_key = key; tmpf->f_refcount = 1; FUTEX_INIT(tmpf); TAILQ_INIT(&tmpf->f_waiting_proc); @@ -433,15 +447,13 @@ linux_sys_futex(struct thread *td, struc struct waiting_proc *wp; struct futex *f, *f2; int error = 0; + uint32_t flags; - /* - * Our implementation provides only privates futexes. Most of the apps - * should use private futexes but don't claim so. Therefore we treat - * all futexes as private by clearing the FUTEX_PRIVATE_FLAG. It works - * in most cases (ie. when futexes are not shared on file descriptor - * or between different processes.). - */ - args->op = (args->op & ~LINUX_FUTEX_PRIVATE_FLAG); + if (args->op & LINUX_FUTEX_PRIVATE_FLAG) { + flags = 0; + args->op &= ~LINUX_FUTEX_PRIVATE_FLAG; + } else + flags = FUTEX_SHARED; switch (args->op) { case LINUX_FUTEX_WAIT: @@ -453,7 +465,8 @@ linux_sys_futex(struct thread *td, struc printf(ARGS(sys_futex, "futex_wait val %d uaddr %p"), args->val, args->uaddr); #endif - error = futex_get(args->uaddr, &wp, &f, FUTEX_CREATE_WP); + error = futex_get(args->uaddr, &wp, &f, + flags | FUTEX_CREATE_WP); if (error) return (error); error = copyin(args->uaddr, &val, sizeof(val)); @@ -488,7 +501,8 @@ linux_sys_futex(struct thread *td, struc printf(ARGS(sys_futex, "futex_wake val %d uaddr %p"), args->val, args->uaddr); #endif - error = futex_get(args->uaddr, NULL, &f, FUTEX_DONTCREATE); + error = futex_get(args->uaddr, NULL, &f, + flags | FUTEX_DONTCREATE); if (error) return (error); if (f == NULL) { @@ -520,7 +534,7 @@ linux_sys_futex(struct thread *td, struc */ if (args->uaddr == args->uaddr2) return (EINVAL); - error = futex_get0(args->uaddr, &f, 0); + error = futex_get(args->uaddr, NULL, &f, flags); if (error) return (error); @@ -532,7 +546,8 @@ linux_sys_futex(struct thread *td, struc * Glibc fall back to FUTEX_WAKE in case of any error * returned by FUTEX_CMP_REQUEUE. */ - error = futex_get0(args->uaddr2, &f2, FUTEX_DONTEXISTS); + error = futex_get(args->uaddr2, NULL, &f2, + flags | FUTEX_DONTEXISTS); if (error) { futex_put(f, NULL); return (error); @@ -573,11 +588,11 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->op, args->val, args->uaddr2, args->val3); #endif - error = futex_get0(args->uaddr, &f, 0); + error = futex_get(args->uaddr, NULL, &f, flags); if (error) return (error); if (args->uaddr != args->uaddr2) - error = futex_get0(args->uaddr2, &f2, 0); + error = futex_get(args->uaddr2, NULL, &f2, flags); if (error) { futex_put(f, NULL); return (error); @@ -747,7 +762,7 @@ retry: if (!pi && (uval & FUTEX_WAITERS)) { error = futex_get(uaddr, NULL, &f, - FUTEX_DONTCREATE); + FUTEX_DONTCREATE | FUTEX_SHARED); if (error) return (error); if (f != NULL) { Modified: stable/7/sys/sys/umtx.h ============================================================================== --- stable/7/sys/sys/umtx.h Mon Mar 7 16:05:45 2011 (r219379) +++ stable/7/sys/sys/umtx.h Mon Mar 7 17:14:18 2011 (r219380) @@ -203,6 +203,7 @@ enum { TYPE_PI_UMUTEX, TYPE_PP_UMUTEX, TYPE_RWLOCK, + TYPE_FUTEX }; /* Key to represent a unique userland synchronous object */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 17:15:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 711751065672; Mon, 7 Mar 2011 17:15:10 +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 5F7408FC14; Mon, 7 Mar 2011 17:15: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 p27HFAMK041831; Mon, 7 Mar 2011 17:15:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27HFAMT041828; Mon, 7 Mar 2011 17:15:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201103071715.p27HFAMT041828@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Mar 2011 17:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219381 - in stable/8/sys: compat/linux sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 17:15:10 -0000 Author: jhb Date: Mon Mar 7 17:15:10 2011 New Revision: 219381 URL: http://svn.freebsd.org/changeset/base/219381 Log: MFC 218970,219240: Use umtx_key objects to uniquely identify futexes. Private futexes in different processes that happen to use the same user address in the separate processes will now be treated as distinct futexes rather than the same futex. We can now honor shared futexes properly by mapping them to a AUTO_SHARED umtx_key. Private futexes use THREAD_SHARED umtx_key objects. Modified: stable/8/sys/compat/linux/linux_futex.c stable/8/sys/sys/umtx.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/linux/linux_futex.c ============================================================================== --- stable/8/sys/compat/linux/linux_futex.c Mon Mar 7 17:14:18 2011 (r219380) +++ stable/8/sys/compat/linux/linux_futex.c Mon Mar 7 17:15:10 2011 (r219381) @@ -52,6 +52,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #include +#include #ifdef COMPAT_LINUX32 #include @@ -77,7 +78,8 @@ struct waiting_proc { struct futex { struct sx f_lck; - uint32_t *f_uaddr; + uint32_t *f_uaddr; /* user-supplied value, for debug */ + struct umtx_key f_key; uint32_t f_refcount; uint32_t f_bitset; LIST_ENTRY(futex) f_list; @@ -100,6 +102,7 @@ struct mtx futex_mtx; /* protects the #define FUTEX_CREATE_WP 0x1 /* create waiting_proc */ #define FUTEX_DONTCREATE 0x2 /* don't create futex if not exists */ #define FUTEX_DONTEXISTS 0x4 /* return EINVAL if futex exists */ +#define FUTEX_SHARED 0x8 /* shared futex */ /* wp_flags */ #define FUTEX_WP_REQUEUED 0x1 /* wp requeued - wp moved from wp_list @@ -136,6 +139,7 @@ futex_put(struct futex *f, struct waitin LINUX_CTR2(sys_futex, "futex_put destroy uaddr %p ref %d", f->f_uaddr, f->f_refcount); + umtx_key_release(&f->f_key); FUTEX_DESTROY(f); free(f, M_FUTEX); return; @@ -151,13 +155,19 @@ static int futex_get0(uint32_t *uaddr, struct futex **newf, uint32_t flags) { struct futex *f, *tmpf; + struct umtx_key key; + int error; *newf = tmpf = NULL; + error = umtx_key_get(uaddr, TYPE_FUTEX, (flags & FUTEX_SHARED) ? + AUTO_SHARE : THREAD_SHARE, &key); + if (error) + return (error); retry: FUTEXES_LOCK; LIST_FOREACH(f, &futex_list, f_list) { - if (f->f_uaddr == uaddr) { + if (umtx_key_match(&f->f_key, &key)) { if (tmpf != NULL) { FUTEX_UNLOCK(tmpf); FUTEX_DESTROY(tmpf); @@ -165,6 +175,7 @@ retry: } if (flags & FUTEX_DONTEXISTS) { FUTEXES_UNLOCK; + umtx_key_release(&key); return (EINVAL); } @@ -174,6 +185,7 @@ retry: */ ++f->f_refcount; FUTEXES_UNLOCK; + umtx_key_release(&key); FUTEX_LOCK(f); *newf = f; @@ -185,6 +197,7 @@ retry: if (flags & FUTEX_DONTCREATE) { FUTEXES_UNLOCK; + umtx_key_release(&key); LINUX_CTR1(sys_futex, "futex_get uaddr %p null", uaddr); return (0); } @@ -193,6 +206,7 @@ retry: FUTEXES_UNLOCK; tmpf = malloc(sizeof(*tmpf), M_FUTEX, M_WAITOK | M_ZERO); tmpf->f_uaddr = uaddr; + tmpf->f_key = key; tmpf->f_refcount = 1; tmpf->f_bitset = FUTEX_BITSET_MATCH_ANY; FUTEX_INIT(tmpf); @@ -450,15 +464,13 @@ linux_sys_futex(struct thread *td, struc struct waiting_proc *wp; struct futex *f, *f2; int error; + uint32_t flags; - /* - * Our implementation provides only privates futexes. Most of the apps - * should use private futexes but don't claim so. Therefore we treat - * all futexes as private by clearing the FUTEX_PRIVATE_FLAG. It works - * in most cases (ie. when futexes are not shared on file descriptor - * or between different processes.). - */ - args->op = args->op & ~LINUX_FUTEX_PRIVATE_FLAG; + if (args->op & LINUX_FUTEX_PRIVATE_FLAG) { + flags = 0; + args->op &= ~LINUX_FUTEX_PRIVATE_FLAG; + } else + flags = FUTEX_SHARED; /* * Currently support for switching between CLOCK_MONOTONIC and @@ -490,7 +502,8 @@ linux_sys_futex(struct thread *td, struc "futex_wait uaddr %p val %d val3 %d"), args->uaddr, args->val, args->val3); #endif - error = futex_get(args->uaddr, &wp, &f, FUTEX_CREATE_WP); + error = futex_get(args->uaddr, &wp, &f, + flags | FUTEX_CREATE_WP); if (error) return (error); error = copyin(args->uaddr, &val, sizeof(val)); @@ -530,7 +543,8 @@ linux_sys_futex(struct thread *td, struc printf(ARGS(sys_futex, "futex_wake uaddr %p val %d val3 %d"), args->uaddr, args->val, args->val3); #endif - error = futex_get(args->uaddr, NULL, &f, FUTEX_DONTCREATE); + error = futex_get(args->uaddr, NULL, &f, + flags | FUTEX_DONTCREATE); if (error) return (error); if (f == NULL) { @@ -562,7 +576,7 @@ linux_sys_futex(struct thread *td, struc */ if (args->uaddr == args->uaddr2) return (EINVAL); - error = futex_get0(args->uaddr, &f, 0); + error = futex_get(args->uaddr, NULL, &f, flags); if (error) return (error); @@ -573,7 +587,8 @@ linux_sys_futex(struct thread *td, struc * Glibc fall back to FUTEX_WAKE in case of any error * returned by FUTEX_CMP_REQUEUE. */ - error = futex_get0(args->uaddr2, &f2, FUTEX_DONTEXISTS); + error = futex_get(args->uaddr2, NULL, &f2, + flags | FUTEX_DONTEXISTS); if (error) { futex_put(f, NULL); return (error); @@ -614,11 +629,11 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->op, args->val, args->uaddr2, args->val3); #endif - error = futex_get0(args->uaddr, &f, 0); + error = futex_get(args->uaddr, NULL, &f, flags); if (error) return (error); if (args->uaddr != args->uaddr2) - error = futex_get0(args->uaddr2, &f2, 0); + error = futex_get(args->uaddr2, NULL, &f2, flags); if (error) { futex_put(f, NULL); return (error); @@ -812,7 +827,7 @@ retry: if (!pi && (uval & FUTEX_WAITERS)) { error = futex_get(uaddr, NULL, &f, - FUTEX_DONTCREATE); + FUTEX_DONTCREATE | FUTEX_SHARED); if (error) return (error); if (f != NULL) { Modified: stable/8/sys/sys/umtx.h ============================================================================== --- stable/8/sys/sys/umtx.h Mon Mar 7 17:14:18 2011 (r219380) +++ stable/8/sys/sys/umtx.h Mon Mar 7 17:15:10 2011 (r219381) @@ -203,6 +203,7 @@ enum { TYPE_PI_UMUTEX, TYPE_PP_UMUTEX, TYPE_RWLOCK, + TYPE_FUTEX }; /* Key to represent a unique userland synchronous object */ From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 18:00:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8F4106566C; Mon, 7 Mar 2011 18:00:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 115F58FC0A; Mon, 7 Mar 2011 18:00: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 p27I0w55042836; Mon, 7 Mar 2011 18:00:58 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27I0w6e042834; Mon, 7 Mar 2011 18:00:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103071800.p27I0w6e042834@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 7 Mar 2011 18:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219382 - stable/8/usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 18:00:59 -0000 Author: jkim Date: Mon Mar 7 18:00:58 2011 New Revision: 219382 URL: http://svn.freebsd.org/changeset/base/219382 Log: MFC: r218293 Do not let pw.conf(5) or -M option affect creation of basehome, e.g., /home. When the basehome does not exist, it creates all intermediate directories as required, which is logically equivalent to mkdir(1) with -m and -p options. However, it modifies all intermediate directories, not just the final home directory unlike mkdir. This problem was introduced in two revisions, i.e., r1.59 (SVN r167919) and r1.60 (SVN r168044). Modified: stable/8/usr.sbin/pw/pw_user.c Directory Properties: stable/8/usr.sbin/pw/ (props changed) Modified: stable/8/usr.sbin/pw/pw_user.c ============================================================================== --- stable/8/usr.sbin/pw/pw_user.c Mon Mar 7 17:15:10 2011 (r219381) +++ stable/8/usr.sbin/pw/pw_user.c Mon Mar 7 18:00:58 2011 (r219382) @@ -156,14 +156,14 @@ pw_user(struct userconf * cnf, int mode, cnf->home = arg->val; } + dmode = S_IRWXU | S_IRWXG | S_IRWXO; if ((arg = getarg(args, 'M')) != NULL) { dmode_c = arg->val; if ((set = setmode(dmode_c)) == NULL) errx(EX_DATAERR, "invalid directory creation mode '%s'", dmode_c); - dmode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); + cnf->homemode = getmode(set, dmode); free(set); - cnf->homemode = dmode; } /* @@ -191,7 +191,7 @@ pw_user(struct userconf * cnf, int mode, if (strchr(cnf->home+1, '/') == NULL) { strcpy(dbuf, "/usr"); strncat(dbuf, cnf->home, MAXPATHLEN-5); - if (mkdir(dbuf, cnf->homemode) != -1 || errno == EEXIST) { + if (mkdir(dbuf, dmode) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); /* * Skip first "/" and create symlink: @@ -207,7 +207,7 @@ pw_user(struct userconf * cnf, int mode, while ((p = strchr(++p, '/')) != NULL) { *p = '\0'; if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, cnf->homemode) == -1) + if (mkdir(dbuf, dmode) == -1) goto direrr; chown(dbuf, 0, 0); } else if (!S_ISDIR(st.st_mode)) @@ -216,7 +216,7 @@ pw_user(struct userconf * cnf, int mode, } } if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, cnf->homemode) == -1) { + if (mkdir(dbuf, dmode) == -1) { direrr: err(EX_OSFILE, "mkdir '%s'", dbuf); } chown(dbuf, 0, 0); From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 18:01:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06515106564A; Mon, 7 Mar 2011 18:01:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF6FA8FC0A; Mon, 7 Mar 2011 18:01: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 p27I1wS9042919; Mon, 7 Mar 2011 18:01:58 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27I1w2K042917; Mon, 7 Mar 2011 18:01:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103071801.p27I1w2K042917@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 7 Mar 2011 18:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219383 - stable/7/usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 18:01:59 -0000 Author: jkim Date: Mon Mar 7 18:01:58 2011 New Revision: 219383 URL: http://svn.freebsd.org/changeset/base/219383 Log: MFC: r218293 Do not let pw.conf(5) or -M option affect creation of basehome, e.g., /home. When the basehome does not exist, it creates all intermediate directories as required, which is logically equivalent to mkdir(1) with -m and -p options. However, it modifies all intermediate directories, not just the final home directory unlike mkdir. This problem was introduced in two revisions, i.e., r1.59 (SVN r167919) and r1.60 (SVN r168044). Modified: stable/7/usr.sbin/pw/pw_user.c Directory Properties: stable/7/usr.sbin/pw/ (props changed) Modified: stable/7/usr.sbin/pw/pw_user.c ============================================================================== --- stable/7/usr.sbin/pw/pw_user.c Mon Mar 7 18:00:58 2011 (r219382) +++ stable/7/usr.sbin/pw/pw_user.c Mon Mar 7 18:01:58 2011 (r219383) @@ -159,14 +159,14 @@ pw_user(struct userconf * cnf, int mode, cnf->home = arg->val; } + dmode = S_IRWXU | S_IRWXG | S_IRWXO; if ((arg = getarg(args, 'M')) != NULL) { dmode_c = arg->val; if ((set = setmode(dmode_c)) == NULL) errx(EX_DATAERR, "invalid directory creation mode '%s'", dmode_c); - dmode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); + cnf->homemode = getmode(set, dmode); free(set); - cnf->homemode = dmode; } /* @@ -194,7 +194,7 @@ pw_user(struct userconf * cnf, int mode, if (strchr(cnf->home+1, '/') == NULL) { strcpy(dbuf, "/usr"); strncat(dbuf, cnf->home, MAXPATHLEN-5); - if (mkdir(dbuf, cnf->homemode) != -1 || errno == EEXIST) { + if (mkdir(dbuf, dmode) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); /* * Skip first "/" and create symlink: @@ -210,7 +210,7 @@ pw_user(struct userconf * cnf, int mode, while ((p = strchr(++p, '/')) != NULL) { *p = '\0'; if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, cnf->homemode) == -1) + if (mkdir(dbuf, dmode) == -1) goto direrr; chown(dbuf, 0, 0); } else if (!S_ISDIR(st.st_mode)) @@ -219,7 +219,7 @@ pw_user(struct userconf * cnf, int mode, } } if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, cnf->homemode) == -1) { + if (mkdir(dbuf, dmode) == -1) { direrr: err(EX_OSFILE, "mkdir '%s'", dbuf); } chown(dbuf, 0, 0); From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 18:33:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7B631065674; Mon, 7 Mar 2011 18:33:29 +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 D60CA8FC18; Mon, 7 Mar 2011 18:33: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 p27IXTV5043709; Mon, 7 Mar 2011 18:33:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27IXTKs043706; Mon, 7 Mar 2011 18:33:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201103071833.p27IXTKs043706@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Mar 2011 18:33: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: r219384 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 18:33:30 -0000 Author: jhb Date: Mon Mar 7 18:33:29 2011 New Revision: 219384 URL: http://svn.freebsd.org/changeset/base/219384 Log: The UFS dirhash code was attempting to update shared state in the dirhash from multiple threads while holding a shared lock during a lookup operation. This could result in incorrect ENOENT failures which could then be permanently stored in the name cache. Specifically, the dirhash code optimizes the case that a single thread is walking a directory sequentially opening (or stat'ing) each file. It uses state in the dirhash structure to determine if a given lookup is using the optimization. If the optimization fails, it disables it and restarts the lookup. The problem arises when two threads both attempt the optimization and fail. The first thread will restart the loop, but the second thread will incorrectly think that it did not try the optimization and will only examine a subset of the directory entires in its hash chain. As a result, it may fail to find its directory entry and incorrectly fail with ENOENT. To make this safe for use with shared locks, simplify the state stored in the dirhash and move some of the state (the part that determines if the current thread is trying the optimization) into a local variable. One result is that we will now try the optimization more often. We still update the value under the shared lock, but it is a single atomic store similar to i_diroff that is stored in UFS directory i-nodes for the non-dirhash lookup. Reviewed by: kib MFC after: 1 week Modified: head/sys/ufs/ufs/dirhash.h head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/dirhash.h ============================================================================== --- head/sys/ufs/ufs/dirhash.h Mon Mar 7 18:01:58 2011 (r219383) +++ head/sys/ufs/ufs/dirhash.h Mon Mar 7 18:33:29 2011 (r219384) @@ -98,7 +98,6 @@ struct dirhash { int dh_dirblks; /* number of DIRBLKSIZ blocks in dir */ int dh_firstfree[DH_NFSTATS + 1]; /* first blk with N words free */ - int dh_seqopt; /* sequential access optimisation enabled */ doff_t dh_seqoff; /* sequential access optimisation offset */ int dh_score; /* access count for this dirhash */ Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Mon Mar 7 18:01:58 2011 (r219383) +++ head/sys/ufs/ufs/ufs_dirhash.c Mon Mar 7 18:33:29 2011 (r219384) @@ -402,8 +402,7 @@ ufsdirhash_build(struct inode *ip) dh->dh_firstfree[i] = -1; dh->dh_firstfree[DH_NFSTATS] = 0; dh->dh_hused = 0; - dh->dh_seqopt = 0; - dh->dh_seqoff = 0; + dh->dh_seqoff = -1; dh->dh_score = DH_SCOREINIT; dh->dh_lastused = time_second; @@ -551,7 +550,7 @@ ufsdirhash_lookup(struct inode *ip, char struct direct *dp; struct vnode *vp; struct buf *bp; - doff_t blkoff, bmask, offset, prevoff; + doff_t blkoff, bmask, offset, prevoff, seqoff; int i, slot; int error; @@ -591,29 +590,30 @@ ufsdirhash_lookup(struct inode *ip, char bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; blkoff = -1; bp = NULL; + seqoff = dh->dh_seqoff; restart: slot = ufsdirhash_hash(dh, name, namelen); - if (dh->dh_seqopt) { + if (seqoff != -1) { /* - * Sequential access optimisation. dh_seqoff contains the + * Sequential access optimisation. seqoff contains the * offset of the directory entry immediately following * the last entry that was looked up. Check if this offset * appears in the hash chain for the name we are looking for. */ for (i = slot; (offset = DH_ENTRY(dh, i)) != DIRHASH_EMPTY; i = WRAPINCR(i, dh->dh_hlen)) - if (offset == dh->dh_seqoff) + if (offset == seqoff) break; - if (offset == dh->dh_seqoff) { + if (offset == seqoff) { /* * We found an entry with the expected offset. This * is probably the entry we want, but if not, the - * code below will turn off seqopt and retry. + * code below will retry. */ slot = i; - } else - dh->dh_seqopt = 0; + } else + seqoff = -1; } for (; (offset = DH_ENTRY(dh, slot)) != DIRHASH_EMPTY; @@ -655,9 +655,7 @@ restart: *prevoffp = prevoff; } - /* Check for sequential access, and update offset. */ - if (dh->dh_seqopt == 0 && dh->dh_seqoff == offset) - dh->dh_seqopt = 1; + /* Update offset. */ dh->dh_seqoff = offset + DIRSIZ(0, dp); *bpp = bp; *offp = offset; @@ -666,11 +664,11 @@ restart: } /* - * When the name doesn't match in the seqopt case, go back - * and search normally. + * When the name doesn't match in the sequential + * optimization case, go back and search normally. */ - if (dh->dh_seqopt) { - dh->dh_seqopt = 0; + if (seqoff != -1) { + seqoff = -1; goto restart; } } From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 19:54:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A31AC106564A; Mon, 7 Mar 2011 19:54:51 +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 9077C8FC12; Mon, 7 Mar 2011 19: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 p27Jspr0045519; Mon, 7 Mar 2011 19:54:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27JspWM045517; Mon, 7 Mar 2011 19:54:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103071954.p27JspWM045517@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 7 Mar 2011 19: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: r219385 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 19:54:51 -0000 Author: pjd Date: Mon Mar 7 19:54:51 2011 New Revision: 219385 URL: http://svn.freebsd.org/changeset/base/219385 Log: Unbreak the build. MFC after: 2 weeks Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Mon Mar 7 18:33:29 2011 (r219384) +++ head/sbin/hastd/pjdlog.c Mon Mar 7 19:54:51 2011 (r219385) @@ -95,19 +95,19 @@ static int pjdlog_printf_render_sockaddr(struct __printf_io *io, const struct printf_info *pi, const void * const *arg) { - const struct sockaddr *sa; + const struct sockaddr_storage *ss; char buf[64]; int ret; - sa = *(const struct sockaddr * const *)arg[0]; - switch (sa->sa_family) { + ss = *(const struct sockaddr_storage * const *)arg[0]; + switch (ss->ss_family) { case AF_INET: { const struct sockaddr_in *sin; in_addr_t ip; unsigned int port; - sin = (const struct sockaddr_in *)sa; + sin = (const struct sockaddr_in *)ss; ip = ntohl(sin->sin_addr.s_addr); port = ntohs(sin->sin_port); @@ -118,7 +118,7 @@ pjdlog_printf_render_sockaddr(struct __p } default: snprintf(buf, sizeof(buf), "[unsupported family %u]", - (unsigned int)sa->sa_family); + (unsigned int)ss->ss_family); break; } ret = __printf_out(io, pi, buf, strlen(buf)); From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 20:32:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3625B1065674; Mon, 7 Mar 2011 20:32:47 +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 22BF48FC08; Mon, 7 Mar 2011 20:32: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 p27KWlA5046679; Mon, 7 Mar 2011 20:32:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27KWluE046677; Mon, 7 Mar 2011 20:32:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103072032.p27KWluE046677@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 7 Mar 2011 20:32: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: r219386 - head/libexec/rtld-elf/powerpc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 20:32:47 -0000 Author: nwhitehorn Date: Mon Mar 7 20:32:46 2011 New Revision: 219386 URL: http://svn.freebsd.org/changeset/base/219386 Log: Remove dead code that snuck in from the 32-bit PowerPC version of this file. The error being checked for does not exist on 64-bit systems. Modified: head/libexec/rtld-elf/powerpc64/reloc.c Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Mon Mar 7 19:54:51 2011 (r219385) +++ head/libexec/rtld-elf/powerpc64/reloc.c Mon Mar 7 20:32:46 2011 (r219386) @@ -336,10 +336,6 @@ reloc_plt_object(Obj_Entry *obj, const E obj->priv = malloc(obj->pltrelasize); glink = obj->priv + reloff*sizeof(Elf_Addr)*2; - if ((reloff < 0) || (reloff >= 0x8000)) { - return (-1); - } - dbg(" reloc_plt_object: where=%p,reloff=%lx,glink=%p", (void *)where, reloff, glink); memcpy(where, _rtld_bind_start, sizeof(struct funcdesc)); From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 21:05:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F1EE61065676; Mon, 7 Mar 2011 21:05:54 +0000 (UTC) Date: Mon, 7 Mar 2011 21:05:54 +0000 From: Alexander Best To: Martin Matuska Message-ID: <20110307210554.GA48707@freebsd.org> References: <201103071458.p27EwNKR038651@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103071458.p27EwNKR038651@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219376 - in head/share: examples/etc mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 21:05:55 -0000 On Mon Mar 7 11, Martin Matuska wrote: > Author: mm > Date: Mon Mar 7 14:58:23 2011 > New Revision: 219376 > URL: http://svn.freebsd.org/changeset/base/219376 > > Log: > Add AMD Geode CPU type to bsd.cpu.mk and examples/etc/make.conf > For CPUTYPE=core2 use -march=core2 maybe you might also want to add a note to UPDATING. apparently there are still people (see freebsd-current@) who have CPUTYPE?=core2 in their make.conf and rely on fbsd overwritting it to nocona. trying to build a kernel with this commit will no longer do that and thus gcc complains about core2. the best strategie might be: 1) set CPUTYPE?=native 2) build world 3) build kernel; install kernel 4) install world 5) set CPUTYPE?=core2 again cheers. alex > > PR: gnu/155308 > MFC after: 2 weeks > > Modified: > head/share/examples/etc/make.conf > head/share/mk/bsd.cpu.mk > > Modified: head/share/examples/etc/make.conf > ============================================================================== > --- head/share/examples/etc/make.conf Mon Mar 7 14:54:45 2011 (r219375) > +++ head/share/examples/etc/make.conf Mon Mar 7 14:58:23 2011 (r219376) > @@ -32,7 +32,7 @@ > # Intel x86 architecture: > # (AMD CPUs) opteron-sse3 opteron athlon64-sse3 athlon64 athlon-mp > # athlon-xp athlon-4 athlon-tbird athlon k8-sse3 k8 > -# k6-3 k6-2 k6 k5 > +# geode k6-3 k6-2 k6 k5 > # (Intel CPUs) core2 core nocona pentium4m pentium4 prescott > # pentium3m pentium3 pentium-m pentium2 > # pentiumpro pentium-mmx pentium i486 i386 > > Modified: head/share/mk/bsd.cpu.mk > ============================================================================== > --- head/share/mk/bsd.cpu.mk Mon Mar 7 14:54:45 2011 (r219375) > +++ head/share/mk/bsd.cpu.mk Mon Mar 7 14:58:23 2011 (r219376) > @@ -59,7 +59,7 @@ CPUTYPE = athlon-mp > CPUTYPE = athlon > . endif > . elif ${MACHINE_CPUARCH} == "amd64" > -. if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" > +. if ${CPUTYPE} == "prescott" > CPUTYPE = nocona > . endif > . elif ${MACHINE_ARCH} == "sparc64" > @@ -170,7 +170,7 @@ MACHINE_CPU = athlon-xp athlon k7 3dnow > MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386 > . elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird" > MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386 > -. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" > +. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "geode" > MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386 > . elif ${CPUTYPE} == "k6" > MACHINE_CPU = mmx k6 k5 i586 i486 i386 > @@ -206,7 +206,7 @@ MACHINE_CPU = i386 > MACHINE_CPU = k8 3dnow sse3 > . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" > MACHINE_CPU = k8 3dnow > -. elif ${CPUTYPE} == "nocona" > +. elif ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core2" > MACHINE_CPU = sse3 > . endif > MACHINE_CPU += amd64 sse2 sse mmx -- a13x From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 21:42:22 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 610C9106564A; Mon, 7 Mar 2011 21:42:22 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 1319E8FC0C; Mon, 7 Mar 2011 21:42:21 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 2AA629CB0C5; Mon, 7 Mar 2011 22:42:20 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DIdTVgIHuOZz; Mon, 7 Mar 2011 22:42:19 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 9E6BD9CB2E9; Mon, 7 Mar 2011 22:42:19 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p27LgJLi006639; Mon, 7 Mar 2011 22:42:19 +0100 (CET) (envelope-from rdivacky) Date: Mon, 7 Mar 2011 22:42:19 +0100 From: Roman Divacky To: Martin Matuska Message-ID: <20110307214219.GA6472@freebsd.org> References: <201103071448.p27EmNrp038046@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103071448.p27EmNrp038046@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r219374 - in head/contrib/gcc: . config/i386 doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 21:42:22 -0000 On Mon, Mar 07, 2011 at 02:48:23PM +0000, Martin Matuska wrote: > Author: mm > Date: Mon Mar 7 14:48:22 2011 > New Revision: 219374 > URL: http://svn.freebsd.org/changeset/base/219374 > > Log: > Backport Intel Core 2 and AMD Geode CPU types from gcc-4.3 (GPLv2) > These options are supported in this shape in all newer GCC versions. > > PR: gnu/155308 > Obtained from: gcc 4.3 (rev. 118090, 118973, 120846; GPLv2) > MFC after: 2 weeks is the MFC actually safe without the newer binutils being merged as well? just wondering.... From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 21:53:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12CE2106566C; Mon, 7 Mar 2011 21:53:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2A508FC15; Mon, 7 Mar 2011 21:53: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 p27LrFqU048378; Mon, 7 Mar 2011 21:53:15 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27LrFQh048364; Mon, 7 Mar 2011 21:53:15 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201103072153.p27LrFQh048364@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 7 Mar 2011 21:53: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: r219387 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 21:53:16 -0000 Author: hselasky Date: Mon Mar 7 21:53:15 2011 New Revision: 219387 URL: http://svn.freebsd.org/changeset/base/219387 Log: - Remove superfluous ucom device lines in USB manual pages. Submitted by: Carl @ telus.net MFC after: 14 days Approved by: thompsa (mentor) Modified: head/share/man/man4/u3g.4 head/share/man/man4/uark.4 head/share/man/man4/ubsa.4 head/share/man/man4/uchcom.4 head/share/man/man4/ufoma.4 head/share/man/man4/uftdi.4 head/share/man/man4/uipaq.4 head/share/man/man4/umct.4 head/share/man/man4/umodem.4 head/share/man/man4/uplcom.4 head/share/man/man4/uslcom.4 head/share/man/man4/uvisor.4 head/share/man/man4/uvscom.4 Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/u3g.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -30,7 +30,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device u3g" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/uark.4 ============================================================================== --- head/share/man/man4/uark.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/uark.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -28,7 +28,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device uark" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/ubsa.4 ============================================================================== --- head/share/man/man4/ubsa.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/ubsa.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -40,7 +40,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device ubsa" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/uchcom.4 ============================================================================== --- head/share/man/man4/uchcom.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/uchcom.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -41,7 +41,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device uchcom" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/ufoma.4 ============================================================================== --- head/share/man/man4/ufoma.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/ufoma.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -39,7 +39,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device ufoma" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/uftdi.4 ============================================================================== --- head/share/man/man4/uftdi.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/uftdi.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -41,7 +41,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device uftdi" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/uipaq.4 ============================================================================== --- head/share/man/man4/uipaq.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/uipaq.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -42,7 +42,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device uipaq" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/umct.4 ============================================================================== --- head/share/man/man4/umct.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/umct.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -37,7 +37,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device umct" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/umodem.4 ============================================================================== --- head/share/man/man4/umodem.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/umodem.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -41,7 +41,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device umodem" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/uplcom.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -41,7 +41,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device uplcom" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/uslcom.4 ============================================================================== --- head/share/man/man4/uslcom.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/uslcom.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -28,7 +28,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device uslcom" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/uvisor.4 ============================================================================== --- head/share/man/man4/uvisor.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/uvisor.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -41,7 +41,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device uvisor" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a Modified: head/share/man/man4/uvscom.4 ============================================================================== --- head/share/man/man4/uvscom.4 Mon Mar 7 20:32:46 2011 (r219386) +++ head/share/man/man4/uvscom.4 Mon Mar 7 21:53:15 2011 (r219387) @@ -41,7 +41,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device uvscom" -.Cd "device ucom" .Ed .Pp Alternatively, to load the driver as a From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 22:36:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76554106564A; Mon, 7 Mar 2011 22:36:11 +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 534178FC13; Mon, 7 Mar 2011 22:36: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 p27MaBqP049388; Mon, 7 Mar 2011 22:36:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27MaBlO049385; Mon, 7 Mar 2011 22:36:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201103072236.p27MaBlO049385@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 7 Mar 2011 22:36: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: r219388 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 22:36:11 -0000 Author: kib Date: Mon Mar 7 22:36:11 2011 New Revision: 219388 URL: http://svn.freebsd.org/changeset/base/219388 Log: Simplify uses of the web of pointers. Reviewed by: mckusick MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_dirhash.c head/sys/ufs/ufs/ufs_quota.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Mon Mar 7 21:53:15 2011 (r219387) +++ head/sys/ufs/ufs/ufs_dirhash.c Mon Mar 7 22:36:11 2011 (r219388) @@ -426,7 +426,7 @@ ufsdirhash_build(struct inode *ip) } for (i = 0; i < dirblocks; i++) dh->dh_blkfree[i] = DIRBLKSIZ / DIRALIGN; - bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; + bmask = vp->v_mount->mnt_stat.f_iosize - 1; pos = 0; while (pos < ip->i_size) { /* If necessary, get the next directory block. */ @@ -587,7 +587,7 @@ ufsdirhash_lookup(struct inode *ip, char DIRHASHLIST_UNLOCK(); vp = ip->i_vnode; - bmask = VFSTOUFS(vp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; + bmask = vp->v_mount->mnt_stat.f_iosize - 1; blkoff = -1; bp = NULL; seqoff = dh->dh_seqoff; Modified: head/sys/ufs/ufs/ufs_quota.c ============================================================================== --- head/sys/ufs/ufs/ufs_quota.c Mon Mar 7 21:53:15 2011 (r219387) +++ head/sys/ufs/ufs/ufs_quota.c Mon Mar 7 22:36:11 2011 (r219388) @@ -232,8 +232,7 @@ chkdq(struct inode *ip, ufs2_daddr_t cha /* Reset timer when crossing soft limit */ if (dq->dq_curblocks + change >= dq->dq_bsoftlimit && dq->dq_curblocks < dq->dq_bsoftlimit) - dq->dq_btime = time_second + - VFSTOUFS(ITOV(ip)->v_mount)->um_btime[i]; + dq->dq_btime = time_second + ip->i_ump->um_btime[i]; dq->dq_curblocks += change; dq->dq_flags |= DQ_MOD; DQI_UNLOCK(dq); @@ -278,8 +277,7 @@ chkdqchg(struct inode *ip, ufs2_daddr_t */ if (ncurblocks >= dq->dq_bsoftlimit && dq->dq_bsoftlimit) { if (dq->dq_curblocks < dq->dq_bsoftlimit) { - dq->dq_btime = time_second + - VFSTOUFS(ITOV(ip)->v_mount)->um_btime[type]; + dq->dq_btime = time_second + ip->i_ump->um_btime[type]; if (ip->i_uid == cred->cr_uid) *warn = 1; return (0); @@ -378,8 +376,7 @@ chkiq(struct inode *ip, int change, stru /* Reset timer when crossing soft limit */ if (dq->dq_curinodes + change >= dq->dq_isoftlimit && dq->dq_curinodes < dq->dq_isoftlimit) - dq->dq_itime = time_second + - VFSTOUFS(ITOV(ip)->v_mount)->um_itime[i]; + dq->dq_itime = time_second + ip->i_ump->um_itime[i]; dq->dq_curinodes += change; dq->dq_flags |= DQ_MOD; DQI_UNLOCK(dq); @@ -423,8 +420,7 @@ chkiqchg(struct inode *ip, int change, s */ if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) { if (dq->dq_curinodes < dq->dq_isoftlimit) { - dq->dq_itime = time_second + - VFSTOUFS(ITOV(ip)->v_mount)->um_itime[type]; + dq->dq_itime = time_second + ip->i_ump->um_itime[type]; if (ip->i_uid == cred->cr_uid) *warn = 1; return (0); @@ -455,7 +451,7 @@ chkiqchg(struct inode *ip, int change, s static void chkdquot(struct inode *ip) { - struct ufsmount *ump = VFSTOUFS(ITOV(ip)->v_mount); + struct ufsmount *ump = ip->i_ump; struct vnode *vp = ITOV(ip); int i; From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 22:50:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEC01065670; Mon, 7 Mar 2011 22:50:27 +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 8FD5C8FC08; Mon, 7 Mar 2011 22:50: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 p27MoRTf049807; Mon, 7 Mar 2011 22:50:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27MoRqB049805; Mon, 7 Mar 2011 22:50:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103072250.p27MoRqB049805@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 7 Mar 2011 22:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219389 - stable/7/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 22:50:27 -0000 Author: jilles Date: Mon Mar 7 22:50:27 2011 New Revision: 219389 URL: http://svn.freebsd.org/changeset/base/219389 Log: MFC r198216 by ed: Fix quoting in a comment, to make it look more consistent. Modified: stable/7/etc/rc.subr Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/rc.subr ============================================================================== --- stable/7/etc/rc.subr Mon Mar 7 22:36:11 2011 (r219388) +++ stable/7/etc/rc.subr Mon Mar 7 22:50:27 2011 (r219389) @@ -551,7 +551,7 @@ run_rc_command() rc_fast=yes rc_quiet=yes ;; - force*) # "force prefix; always run + force*) # "force" prefix; always run rc_force=yes _rc_prefix=force rc_arg=${rc_arg#${_rc_prefix}} From owner-svn-src-all@FreeBSD.ORG Mon Mar 7 23:52:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 117D71065670; Mon, 7 Mar 2011 23:52:24 +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 F2AED8FC14; Mon, 7 Mar 2011 23:52: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 p27NqNiD051148; Mon, 7 Mar 2011 23:52:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p27NqNgP051147; Mon, 7 Mar 2011 23:52:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103072352.p27NqNgP051147@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 7 Mar 2011 23:52: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: r219390 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2011 23:52:24 -0000 Author: jilles Date: Mon Mar 7 23:52:23 2011 New Revision: 219390 URL: http://svn.freebsd.org/changeset/base/219390 Log: sh: Test that . /dev/null returns exit status 0 and does not preserve $?. Preserving $? may cause problems particularly if set -e is in effect. It may be useful to preserve the old value of $? in the dot script but this must not be implemented in such a way that it would break this test. Added: head/tools/regression/bin/sh/builtins/dot3.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/dot3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/dot3.0 Mon Mar 7 23:52:23 2011 (r219390) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +# . should return 0 if no command was executed. + +if false; then + exit 3 +else + . /dev/null + exit $? +fi From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 01:17:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D6191065672; Tue, 8 Mar 2011 01:17:30 +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 8B9358FC17; Tue, 8 Mar 2011 01:17: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 p281HUe3053015; Tue, 8 Mar 2011 01:17:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p281HUBK053013; Tue, 8 Mar 2011 01:17:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103080117.p281HUBK053013@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 8 Mar 2011 01:17: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: r219391 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 01:17:30 -0000 Author: nwhitehorn Date: Tue Mar 8 01:17:30 2011 New Revision: 219391 URL: http://svn.freebsd.org/changeset/base/219391 Log: Only validate the partition setup when the user presses "Save". If the user wants to exit without saving, it's not a problem if the disk is set up in an invalid way. Modified: head/usr.sbin/bsdinstall/partedit/partedit.c Modified: head/usr.sbin/bsdinstall/partedit/partedit.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit.c Mon Mar 7 23:52:23 2011 (r219390) +++ head/usr.sbin/bsdinstall/partedit/partedit.c Tue Mar 8 01:17:30 2011 (r219391) @@ -128,7 +128,7 @@ main(int argc, const char **argv) { } error = 0; - if (op == 5 && validate_setup()) { /* Finished */ + if (op == 5) { /* Finished */ dialog_vars.extra_button = TRUE; dialog_vars.extra_label = __DECONST(char *, "Abort"); @@ -140,7 +140,7 @@ main(int argc, const char **argv) { dialog_vars.extra_button = FALSE; dialog_vars.ok_label = NULL; - if (op == 0) { /* Save */ + if (op == 0 && validate_setup()) { /* Save */ error = apply_changes(&mesh); break; } else if (op == 3) { /* Don't save => Quit */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 03:04:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ECCC106566C; Tue, 8 Mar 2011 03:04:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 638248FC21; Tue, 8 Mar 2011 03:04: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 p28347jE055513; Tue, 8 Mar 2011 03:04:07 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28347RA055509; Tue, 8 Mar 2011 03:04:07 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201103080304.p28347RA055509@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 8 Mar 2011 03:04: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: r219392 - head/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 03:04:07 -0000 Author: np Date: Tue Mar 8 03:04:07 2011 New Revision: 219392 URL: http://svn.freebsd.org/changeset/base/219392 Log: cxgbe shouldn't directly know of the UMA zones where network buffers come from. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Mar 8 01:17:30 2011 (r219391) +++ head/sys/dev/cxgbe/adapter.h Tue Mar 8 03:04:07 2011 (r219392) @@ -115,7 +115,11 @@ enum { RX_FL_ESIZE = 64, /* 8 64bit addresses */ - FL_BUF_SIZES = 4, +#if MJUMPAGESIZE != MCLBYTES + FL_BUF_SIZES = 4, /* cluster, jumbop, jumbo9k, jumbo16k */ +#else + FL_BUF_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ +#endif TX_EQ_QSIZE = 1024, TX_EQ_ESIZE = 64, @@ -562,6 +566,7 @@ void t4_os_portmod_changed(const struct void t4_os_link_changed(struct adapter *, int, int); /* t4_sge.c */ +void t4_sge_modload(void); void t4_sge_init(struct adapter *); int t4_create_dma_tag(struct adapter *); int t4_destroy_dma_tag(struct adapter *); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Mar 8 01:17:30 2011 (r219391) +++ head/sys/dev/cxgbe/t4_main.c Tue Mar 8 03:04:07 2011 (r219392) @@ -278,7 +278,7 @@ static int sysctl_qsize_rxq(SYSCTL_HANDL static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static inline void txq_start(struct ifnet *, struct sge_txq *); - +static int t4_mod_event(module_t, int, void *); struct t4_pciids { uint16_t device; @@ -2815,10 +2815,20 @@ t4_ioctl(struct cdev *dev, unsigned long return (rc); } +static int +t4_mod_event(module_t mod, int cmd, void *arg) +{ + + if (cmd == MOD_LOAD) + t4_sge_modload(); + + return (0); +} + static devclass_t t4_devclass; static devclass_t cxgbe_devclass; -DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, 0, 0); +DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, t4_mod_event, 0); MODULE_VERSION(t4nex, 1); DRIVER_MODULE(cxgbe, t4nex, cxgbe_driver, cxgbe_devclass, 0, 0); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Mar 8 01:17:30 2011 (r219391) +++ head/sys/dev/cxgbe/t4_sge.c Tue Mar 8 03:04:07 2011 (r219392) @@ -58,13 +58,9 @@ struct fl_buf_info { uma_zone_t zone; }; -/* t4_sge_init will fill up the zone */ -static struct fl_buf_info fl_buf_info[FL_BUF_SIZES] = { - { MCLBYTES, EXT_CLUSTER, NULL}, - { MJUMPAGESIZE, EXT_JUMBOP, NULL}, - { MJUM9BYTES, EXT_JUMBO9, NULL}, - { MJUM16BYTES, EXT_JUMBO16, NULL} -}; +/* Filled up by t4_sge_modload */ +static struct fl_buf_info fl_buf_info[FL_BUF_SIZES]; + #define FL_BUF_SIZE(x) (fl_buf_info[x].size) #define FL_BUF_TYPE(x) (fl_buf_info[x].type) #define FL_BUF_ZONE(x) (fl_buf_info[x].zone) @@ -142,6 +138,29 @@ static __be64 get_flit(bus_dma_segment_t static int handle_sge_egr_update(struct adapter *, const struct cpl_sge_egr_update *); +/* + * Called on MOD_LOAD and fills up fl_buf_info[]. + */ +void +t4_sge_modload(void) +{ + int i; + int bufsize[FL_BUF_SIZES] = { + MCLBYTES, +#if MJUMPAGESIZE != MCLBYTES + MJUMPAGESIZE, +#endif + MJUM9BYTES, + MJUM16BYTES + }; + + for (i = 0; i < FL_BUF_SIZES; i++) { + FL_BUF_SIZE(i) = bufsize[i]; + FL_BUF_TYPE(i) = m_gettype(bufsize[i]); + FL_BUF_ZONE(i) = m_getzone(bufsize[i]); + } +} + /** * t4_sge_init - initialize SGE * @sc: the adapter @@ -156,11 +175,6 @@ t4_sge_init(struct adapter *sc) struct sge *s = &sc->sge; int i; - FL_BUF_ZONE(0) = zone_clust; - FL_BUF_ZONE(1) = zone_jumbop; - FL_BUF_ZONE(2) = zone_jumbo9; - FL_BUF_ZONE(3) = zone_jumbo16; - t4_set_reg_field(sc, A_SGE_CONTROL, V_PKTSHIFT(M_PKTSHIFT) | V_INGPADBOUNDARY(M_INGPADBOUNDARY) | F_EGRSTATUSPAGESIZE, @@ -584,7 +598,7 @@ t4_intr_data(void *arg) bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, BUS_DMASYNC_POSTREAD); - m_init(m0, zone_mbuf, MLEN, M_NOWAIT, MT_DATA, M_PKTHDR); + m_init(m0, NULL, 0, M_NOWAIT, MT_DATA, M_PKTHDR); if (len < MINCLSIZE) { /* copy data to mbuf, buffer will be recycled */ bcopy(sd->cl, mtod(m0, caddr_t), len); @@ -645,7 +659,7 @@ t4_intr_data(void *arg) bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, BUS_DMASYNC_POSTREAD); - m_init(m, zone_mbuf, MLEN, M_NOWAIT, MT_DATA, 0); + m_init(m, NULL, 0, M_NOWAIT, MT_DATA, 0); if (len <= MLEN) { bcopy(sd->cl, mtod(m, caddr_t), len); m->m_len = len; @@ -1600,9 +1614,6 @@ alloc_fl_sdesc(struct sge_fl *fl) rc = bus_dmamap_create(tag, 0, &sd->map); if (rc != 0) goto failed; - - /* Doesn't matter if this succeeds or not */ - sd->m = m_gethdr(M_NOWAIT, MT_NOINIT); } return (0); @@ -1611,7 +1622,7 @@ failed: sd--; bus_dmamap_destroy(tag, sd->map); if (sd->m) { - m_init(sd->m, zone_mbuf, MLEN, M_NOWAIT, MT_DATA, 0); + m_init(sd->m, NULL, 0, M_NOWAIT, MT_DATA, 0); m_free(sd->m); sd->m = NULL; } @@ -1636,7 +1647,7 @@ free_fl_sdesc(struct sge_fl *fl) for (i = 0; i < fl->cap; i++, sd++) { if (sd->m) { - m_init(sd->m, zone_mbuf, MLEN, M_NOWAIT, MT_DATA, 0); + m_init(sd->m, NULL, 0, M_NOWAIT, MT_DATA, 0); m_free(sd->m); sd->m = NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 07:00:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13954106564A; Tue, 8 Mar 2011 07:00:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F380B8FC08; Tue, 8 Mar 2011 06:59: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 p286xxno060454; Tue, 8 Mar 2011 06:59:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p286xxV2060442; Tue, 8 Mar 2011 06:59:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103080659.p286xxV2060442@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Mar 2011 06:59: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: r219393 - in head/sys: conf dev/ath/ath_hal/ar5416 dev/ath/ath_hal/ar9002 modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 07:00:00 -0000 Author: adrian Date: Tue Mar 8 06:59:59 2011 New Revision: 219393 URL: http://svn.freebsd.org/changeset/base/219393 Log: Implement open-loop TX power control (OLC) for Merlin (AR9280) and generally tidy up the TX power programming code. Enforce that the TX power offset for Merlin is -5 dBm, rather than any other value programmable in the EEPROM. This requires some further code to be ported over from ath9k, so until that is done and tested, fail to attach NICs whose TX power offset isn't -5 dBm. This improves both legacy and HT transmission on my merlin board. It allows for stable MCS TX up to MCS15. Specifics: * Refactor out a bunch of the TX power calibration code - setting/obtaining the power detector / gain boundaries, programming the PDADC * Take the -5 dBm TX power offset into account on Merlin - "0" in the per-rate TX power register means -5 dBm, not 0 dBm * When doing OLC * Enforce min (0) and max (AR5416_MAX_RATE_POWER) when fiddling with the TX power, to avoid the TX power values from wrapping when low. * Implement the 1 dBm cck power offset when doing OLC * Implement temperature compensation for 2.4ghz mode when doing OLC * Implement an AR9280 specific TX power calibration routine which includes the OLC twiddles, leaving the earlier chipset path (AR5416, AR9160) alone Whilst here, use these refactored routines for the AR9285 TX power calibration/programming code and enforce correct overflow/underflow handling when fiddling with TX power values. Obtained from: linux ath9k Added: head/sys/dev/ath/ath_hal/ar9002/ar9002phy.h (contents, props changed) head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c (contents, props changed) head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.h (contents, props changed) Modified: head/sys/conf/files 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_cal.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9280.h head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Mar 8 03:04:07 2011 (r219392) +++ head/sys/conf/files Tue Mar 8 06:59:59 2011 (r219393) @@ -759,6 +759,9 @@ dev/ath/ath_hal/ar9001/ar9160_attach.c o dev/ath/ath_hal/ar9002/ar9280_attach.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/ar9002/ar9280_olc.c optional ath_hal | ath_ar9280 | \ + 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/ar9002/ar9285_attach.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Mar 8 03:04:07 2011 (r219392) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Mar 8 06:59:59 2011 (r219393) @@ -74,6 +74,16 @@ struct ath_hal_5416 { void (*ah_spurMitigate)(struct ath_hal *, const struct ieee80211_channel *); + /* optional open-loop tx power control related methods */ + void (*ah_olcInit)(struct ath_hal *); + void (*ah_olcTempCompensation)(struct ath_hal *); + + /* tx power control */ + HAL_BOOL (*ah_setPowerCalTable) (struct ath_hal *ah, + struct ar5416eeprom *pEepData, + const struct ieee80211_channel *chan, + int16_t *pTxPowerIndexOffset); + u_int ah_globaltxtimeout; /* global tx timeout */ u_int ah_gpioMask; int ah_hangs; /* h/w hangs state */ @@ -93,6 +103,8 @@ struct ath_hal_5416 { struct ar5416NfLimits nf_2g; struct ar5416NfLimits nf_5g; + + int initPDADC; }; #define AH5416(_ah) ((struct ath_hal_5416 *)(_ah)) @@ -192,6 +204,7 @@ 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 int ar5416GetRegChainOffset(struct ath_hal *ah, int i); extern HAL_BOOL ar5416SetBoardValues(struct ath_hal *, const struct ieee80211_channel *); extern HAL_BOOL ar5416SetResetReg(struct ath_hal *, uint32_t type); @@ -215,6 +228,28 @@ extern void ar5416GetTargetPowersLeg(str extern void ar5416InitChainMasks(struct ath_hal *ah); extern void ar5416RestoreChainMask(struct ath_hal *ah); +/* TX power setup related routines in ar5416_reset.c */ +extern HAL_BOOL getLowerUpperIndex(uint8_t target, uint8_t *pList, + uint16_t listSize, uint16_t *indexL, uint16_t *indexR); +extern void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, + const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet, + uint8_t * bChans, uint16_t availPiers, + uint16_t tPdGainOverlap, int16_t *pMinCalPower, + uint16_t * pPdGainBoundaries, uint8_t * pPDADCValues, + uint16_t numXpdGains); +extern void ar5416SetGainBoundariesClosedLoop(struct ath_hal *ah, + int regChainOffset, uint16_t pdGainOverlap_t2, + uint16_t gainBoundaries[]); +extern uint16_t ar5416GetXpdGainValues(struct ath_hal *ah, uint16_t xpdMask, + uint16_t xpdGainValues[]); +extern void ar5416WriteDetectorGainBiases(struct ath_hal *ah, + uint16_t numXpdGain, uint16_t xpdGainValues[]); +extern void ar5416WritePdadcValues(struct ath_hal *ah, int regChainOffset, + uint8_t pdadcValues[]); +extern HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah, + struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan, + int16_t *pTxPowerIndexOffset); + extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q); extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int txPower, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Mar 8 03:04:07 2011 (r219392) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Mar 8 06:59:59 2011 (r219393) @@ -62,6 +62,19 @@ ar5416AniSetup(struct ath_hal *ah) } /* + * AR5416 doesn't do OLC or temperature compensation. + */ +static void +ar5416olcInit(struct ath_hal *ah) +{ +} + +static void +ar5416olcTempCompensation(struct ath_hal *ah) +{ +} + +/* * Attach for an AR5416 part. */ void @@ -161,8 +174,15 @@ ar5416InitState(struct ath_hal_5416 *ahp #endif ahp->ah_priv.ah_getChipPowerLimits = ar5416GetChipPowerLimits; + /* Internal ops */ AH5416(ah)->ah_writeIni = ar5416WriteIni; AH5416(ah)->ah_spurMitigate = ar5416SpurMitigate; + + /* Internal TX power control related operations */ + AH5416(ah)->ah_olcInit = ar5416olcInit; + AH5416(ah)->ah_olcTempCompensation = ar5416olcTempCompensation; + AH5416(ah)->ah_setPowerCalTable = ar5416SetPowerCalTable; + /* * Start by setting all Owl devices to 2x2 */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Tue Mar 8 03:04:07 2011 (r219392) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Tue Mar 8 06:59:59 2011 (r219393) @@ -468,6 +468,9 @@ ar5416PerCalibrationN(struct ath_hal *ah /* Do NF cal only at longer intervals */ if (longcal) { + /* Do temperature compensation if the chipset needs it */ + AH5416(ah)->ah_olcTempCompensation(ah); + /* * Get the value from the previous NF cal * and update the history buffer. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 8 03:04:07 2011 (r219392) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 8 06:59:59 2011 (r219393) @@ -61,24 +61,12 @@ static HAL_BOOL ar5416SetPowerPerRateTab uint16_t cfgCtl, uint16_t AntennaReduction, uint16_t twiceMaxRegulatoryPower, uint16_t powerLimit); -static HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah, - struct ar5416eeprom *pEepData, - const struct ieee80211_channel *chan, - int16_t *pTxPowerIndexOffset); static uint16_t ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz); static int16_t interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, int16_t targetLeft, int16_t targetRight); 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, - 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 HAL_BOOL ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, uint8_t *pPwrList, uint8_t *pVpdList, uint16_t numIntercepts, uint8_t *pRetVpdList); @@ -224,6 +212,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO * before any radio register twiddling is done. */ ar5416InitChainMasks(ah); + AH5416(ah)->ah_olcInit(ah); /* Setup the transmit power values. */ if (!ah->ah_setTxPower(ah, chan, rfXpdGain)) { @@ -848,7 +837,7 @@ ar5416SetTransmitPower(struct ath_hal *a return AH_FALSE; } - if (!ar5416SetPowerCalTable(ah, pEepData, chan, &txPowerIndexOffset)) { + if (!AH5416(ah)->ah_setPowerCalTable(ah, pEepData, chan, &txPowerIndexOffset)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unable to set power table\n", __func__); return AH_FALSE; @@ -879,9 +868,71 @@ ar5416SetTransmitPower(struct ath_hal *a } #ifdef AH_EEPROM_DUMP + /* + * Dump the rate array whilst it represents the intended dBm*2 + * values versus what's being adjusted before being programmed + * in. Keep this in mind if you code up this function and enable + * this debugging; the values won't necessarily be what's being + * programmed into the hardware. + */ ar5416PrintPowerPerRate(ah, ratesArray); #endif + /* + * Merlin and later have a power offset, so subtract + * pwr_table_offset * 2 from each value. The default + * power offset is -5 dBm - ie, a register value of 0 + * equates to a TX power of -5 dBm. + */ + if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + int8_t pwr_table_offset; + + (void) ath_hal_eepromGet(ah, AR_EEP_PWR_TABLE_OFFSET, + &pwr_table_offset); + /* Underflow power gets clamped at raw value 0 */ + /* Overflow power gets camped at AR5416_MAX_RATE_POWER */ + for (i = 0; i < N(ratesArray); i++) { + /* + * + pwr_table_offset is in dBm + * + ratesArray is in 1/2 dBm + */ + ratesArray[i] -= (pwr_table_offset * 2); + if (ratesArray[i] < 0) + ratesArray[i] = 0; + else if (ratesArray[i] > AR5416_MAX_RATE_POWER) + ratesArray[i] = AR5416_MAX_RATE_POWER; + } + } + + /* + * Adjust rates for OLC where needed + * + * The following CCK rates need adjusting when doing 2.4ghz + * CCK transmission. + * + * + rate2s, rate2l, rate1l, rate11s, rate11l, rate5_5s, rate5_5l + * + rateExtCck, rateDupCck + * + * They're adjusted here regardless. The hardware then gets + * programmed as needed. 5GHz operation doesn't program in CCK + * rates for legacy mode but they seem to be initialised for + * HT40 regardless of channel type. + */ + if (AR_SREV_MERLIN_20_OR_LATER(ah) && + ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) { + int adj[] = { + rate2s, rate2l, rate1l, rate11s, rate11l, + rate5_5s, rate5_5l, rateExtCck, rateDupCck + }; + int cck_ofdm_delta = 2; + int i; + for (i = 0; i < N(adj); i++) { + ratesArray[i] -= cck_ofdm_delta; + if (ratesArray[i] < 0) + ratesArray[i] = 0; + } + } + /* Write the OFDM power per rate set */ OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE1, POW_SM(ratesArray[rate18mb], 24) @@ -1297,7 +1348,32 @@ ar5416SetDefGainValues(struct ath_hal *a } } +/* + * Get the register chain offset for the given chain. + * + * Take into account the register chain swapping with AR5416 v2.0. + * + * XXX make sure that the reg chain swapping is only done for + * XXX AR5416 v2.0 or greater, and not later chips? + */ +int +ar5416GetRegChainOffset(struct ath_hal *ah, int i) +{ + int regChainOffset; + + 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 + */ + regChainOffset = (i == 1) ? 0x2000 : 0x1000; + } else { + regChainOffset = i * 0x1000; + } + return regChainOffset; +} /* * Read EEPROM header info and program the device for correct operation @@ -1323,16 +1399,7 @@ ar5416SetBoardValues(struct ath_hal *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 - * only chains 0 and 2 populated - */ - regChainOffset = (i == 1) ? 0x2000 : 0x1000; - } else { - regChainOffset = i * 0x1000; - } + regChainOffset = ar5416GetRegChainOffset(ah, i); OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset, pModal->antCtrlChain[i]); @@ -1857,6 +1924,120 @@ ar5416GetTargetPowersLeg(struct ath_hal } } +/* + * Set the gain boundaries for the given radio chain. + * + * The gain boundaries tell the hardware at what point in the + * PDADC array to "switch over" from one PD gain setting + * to another. There's also a gain overlap between two + * PDADC array gain curves where there's valid PD values + * for 2 gain settings. + * + * The hardware uses the gain overlap and gain boundaries + * to determine which gain curve to use for the given + * target TX power. + */ +void +ar5416SetGainBoundariesClosedLoop(struct ath_hal *ah, int regChainOffset, + uint16_t pdGainOverlap_t2, uint16_t gainBoundaries[]) +{ + 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) | + SM(gainBoundaries[1], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2) | + SM(gainBoundaries[2], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3) | + SM(gainBoundaries[3], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4)); +} + +/* + * Get the gain values and the number of gain levels given + * in xpdMask. + * + * The EEPROM xpdMask determines which power detector gain + * levels were used during calibration. Each of these mask + * bits maps to a fixed gain level in hardware. + */ +uint16_t +ar5416GetXpdGainValues(struct ath_hal *ah, uint16_t xpdMask, + uint16_t xpdGainValues[]) +{ + int i; + uint16_t numXpdGain = 0; + + for (i = 1; i <= AR5416_PD_GAINS_IN_MASK; i++) { + if ((xpdMask >> (AR5416_PD_GAINS_IN_MASK - i)) & 1) { + if (numXpdGain >= AR5416_NUM_PD_GAINS) { + HALASSERT(0); + break; + } + xpdGainValues[numXpdGain] = (uint16_t)(AR5416_PD_GAINS_IN_MASK - i); + numXpdGain++; + } + } + return numXpdGain; +} + +/* + * Write the detector gain and biases. + * + * There are four power detector gain levels. The xpdMask in the EEPROM + * determines which power detector gain levels have TX power calibration + * data associated with them. This function writes the number of + * PD gain levels and their values into the hardware. + * + * This is valid for all TX chains - the calibration data itself however + * will likely differ per-chain. + */ +void +ar5416WriteDetectorGainBiases(struct ath_hal *ah, uint16_t numXpdGain, + uint16_t xpdGainValues[]) +{ + OS_REG_WRITE(ah, AR_PHY_TPCRG1, (OS_REG_READ(ah, AR_PHY_TPCRG1) & + ~(AR_PHY_TPCRG1_NUM_PD_GAIN | AR_PHY_TPCRG1_PD_GAIN_1 | + AR_PHY_TPCRG1_PD_GAIN_2 | AR_PHY_TPCRG1_PD_GAIN_3)) | + SM(numXpdGain - 1, AR_PHY_TPCRG1_NUM_PD_GAIN) | + SM(xpdGainValues[0], AR_PHY_TPCRG1_PD_GAIN_1 ) | + SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | + SM(xpdGainValues[2], AR_PHY_TPCRG1_PD_GAIN_3)); +} + +/* + * Write the PDADC array to the given chain offset. + * + * The 32 PDADC registers are written without any care about + * their contents - so if various chips treat values as "special", + * this routine will not care. + */ +void +ar5416WritePdadcValues(struct ath_hal *ah, int regChainOffset, + uint8_t pdadcValues[]) +{ + int regOffset; + int j; + int reg32; + + regOffset = AR_PHY_BASE + (672 << 2) + regChainOffset; + + for (j = 0; j < 32; j++) { + reg32 = ((pdadcValues[4*j + 0] & 0xFF) << 0) | + ((pdadcValues[4*j + 1] & 0xFF) << 8) | + ((pdadcValues[4*j + 2] & 0xFF) << 16) | + ((pdadcValues[4*j + 3] & 0xFF) << 24) ; + OS_REG_WRITE(ah, regOffset, reg32); +#ifdef PDADC_DUMP + ath_hal_printf(ah, "PDADC: Chain %d | PDADC %3d Value %3d |" + " PDADC %3d Value %3d | PDADC %3d Value %3d | PDADC %3d" + " Value %3d |\n", + i, + 4*j, pdadcValues[4*j], + 4*j+1, pdadcValues[4*j + 1], + 4*j+2, pdadcValues[4*j + 2], + 4*j+3, pdadcValues[4*j + 3]); +#endif + regOffset += 4; + } +} + /************************************************************** * ar5416SetPowerCalTable * @@ -1864,7 +2045,7 @@ ar5416GetTargetPowersLeg(struct ath_hal * points as well as from the nearest pier(s) to get a power detector * linear voltage to power level table. */ -static HAL_BOOL +HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset) { @@ -1873,11 +2054,11 @@ ar5416SetPowerCalTable(struct ath_hal *a uint16_t pdGainOverlap_t2; static uint8_t pdadcValues[AR5416_NUM_PDADC_VALUES]; uint16_t gainBoundaries[AR5416_PD_GAINS_IN_MASK]; - uint16_t numPiers, i, j; + uint16_t numPiers, i; int16_t tMinCalPower; uint16_t numXpdGain, xpdMask; uint16_t xpdGainValues[AR5416_NUM_PD_GAINS]; - uint32_t reg32, regOffset, regChainOffset; + uint32_t regChainOffset; OS_MEMZERO(xpdGainValues, sizeof(xpdGainValues)); @@ -1897,36 +2078,14 @@ ar5416SetPowerCalTable(struct ath_hal *a numPiers = AR5416_NUM_5G_CAL_PIERS; } - numXpdGain = 0; /* Calculate the value of xpdgains from the xpdGain Mask */ - for (i = 1; i <= AR5416_PD_GAINS_IN_MASK; i++) { - if ((xpdMask >> (AR5416_PD_GAINS_IN_MASK - i)) & 1) { - if (numXpdGain >= AR5416_NUM_PD_GAINS) { - HALASSERT(0); - break; - } - xpdGainValues[numXpdGain] = (uint16_t)(AR5416_PD_GAINS_IN_MASK - i); - numXpdGain++; - } - } + numXpdGain = ar5416GetXpdGainValues(ah, xpdMask, xpdGainValues); /* Write the detector gain biases and their number */ - OS_REG_WRITE(ah, AR_PHY_TPCRG1, (OS_REG_READ(ah, AR_PHY_TPCRG1) & - ~(AR_PHY_TPCRG1_NUM_PD_GAIN | AR_PHY_TPCRG1_PD_GAIN_1 | AR_PHY_TPCRG1_PD_GAIN_2 | AR_PHY_TPCRG1_PD_GAIN_3)) | - SM(numXpdGain - 1, AR_PHY_TPCRG1_NUM_PD_GAIN) | SM(xpdGainValues[0], AR_PHY_TPCRG1_PD_GAIN_1 ) | - SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | SM(xpdGainValues[2], AR_PHY_TPCRG1_PD_GAIN_3)); + ar5416WriteDetectorGainBiases(ah, numXpdGain, xpdGainValues); for (i = 0; i < AR5416_MAX_CHAINS; i++) { - - 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 - */ - regChainOffset = (i == 1) ? 0x2000 : 0x1000; - } else { - regChainOffset = i * 0x1000; - } + regChainOffset = ar5416GetRegChainOffset(ah, i); if (pEepData->baseEepHeader.txMask & (1 << i)) { if (IEEE80211_IS_CHAN_2GHZ(chan)) { @@ -1935,47 +2094,20 @@ ar5416SetPowerCalTable(struct ath_hal *a pRawDataset = pEepData->calPierData5G[i]; } - ar5416GetGainBoundariesAndPdadcs(ah, chan, pRawDataset, + /* Fetch the gain boundaries and the PDADC values */ + ar5416GetGainBoundariesAndPdadcs(ah, chan, pRawDataset, pCalBChans, numPiers, pdGainOverlap_t2, &tMinCalPower, gainBoundaries, pdadcValues, numXpdGain); if ((i == 0) || AR_SREV_OWL_20_OR_LATER(ah)) { - /* - * Note the pdadc table may not start at 0 dBm power, could be - * 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) | - SM(gainBoundaries[1], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2) | - SM(gainBoundaries[2], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3) | - SM(gainBoundaries[3], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4)); + ar5416SetGainBoundariesClosedLoop(ah, regChainOffset, + pdGainOverlap_t2, gainBoundaries); } /* Write the power values into the baseband power table */ - regOffset = AR_PHY_BASE + (672 << 2) + regChainOffset; - - for (j = 0; j < 32; j++) { - reg32 = ((pdadcValues[4*j + 0] & 0xFF) << 0) | - ((pdadcValues[4*j + 1] & 0xFF) << 8) | - ((pdadcValues[4*j + 2] & 0xFF) << 16) | - ((pdadcValues[4*j + 3] & 0xFF) << 24) ; - OS_REG_WRITE(ah, regOffset, reg32); - -#ifdef PDADC_DUMP - ath_hal_printf(ah, "PDADC: Chain %d | PDADC %3d Value %3d | PDADC %3d Value %3d | PDADC %3d Value %3d | PDADC %3d Value %3d |\n", - i, - 4*j, pdadcValues[4*j], - 4*j+1, pdadcValues[4*j + 1], - 4*j+2, pdadcValues[4*j + 2], - 4*j+3, pdadcValues[4*j + 3]); -#endif - regOffset += 4; - } + ar5416WritePdadcValues(ah, regChainOffset, pdadcValues); } } *pTxPowerIndexOffset = 0; @@ -1989,7 +2121,7 @@ ar5416SetPowerCalTable(struct ath_hal *a * Uses the data points read from EEPROM to reconstruct the pdadc power table * Called by ar5416SetPowerCalTable only. */ -static void +void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet, Added: head/sys/dev/ath/ath_hal/ar9002/ar9002phy.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9002/ar9002phy.h Tue Mar 8 06:59:59 2011 (r219393) @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd. + * + * 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 __ATH_AR9002PHY_H__ +#define __ATH_AR9002PHY_H__ + +#define AR_PHY_TX_PWRCTRL4 0xa264 +#define AR_PHY_TX_PWRCTRL_PD_AVG_VALID 0x00000001 +#define AR_PHY_TX_PWRCTRL_PD_AVG_VALID_S 0 +#define AR_PHY_TX_PWRCTRL_PD_AVG_OUT 0x000001FE +#define AR_PHY_TX_PWRCTRL_PD_AVG_OUT_S 1 + +#define AR_PHY_TX_PWRCTRL6_0 0xa270 +#define AR_PHY_TX_PWRCTRL6_1 0xb270 +#define AR_PHY_TX_PWRCTRL_ERR_EST_MODE 0x03000000 +#define AR_PHY_TX_PWRCTRL_ERR_EST_MODE_S 24 + +#define AR_PHY_TX_PWRCTRL7 0xa274 +#define AR_PHY_TX_PWRCTRL_INIT_TX_GAIN 0x01F80000 +#define AR_PHY_TX_PWRCTRL_INIT_TX_GAIN_S 19 + + +#define AR_PHY_TX_GAIN_TBL1 0xa300 +#define AR_PHY_TX_GAIN 0x0007F000 +#define AR_PHY_TX_GAIN_S 12 + +#endif Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280.h Tue Mar 8 03:04:07 2011 (r219392) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280.h Tue Mar 8 06:59:59 2011 (r219393) @@ -20,12 +20,23 @@ #include "ar5416/ar5416.h" +/* + * This is a chip thing, but it's used here as part of the + * ath_hal_9280 struct; so it's convienent to locate the + * define here. + */ +#define AR9280_TX_GAIN_TABLE_SIZE 22 + struct ath_hal_9280 { struct ath_hal_5416 ah_5416; HAL_INI_ARRAY ah_ini_xmodes; HAL_INI_ARRAY ah_ini_rxgain; HAL_INI_ARRAY ah_ini_txgain; + + int PDADCdelta; + + uint32_t originalGain[AR9280_TX_GAIN_TABLE_SIZE]; }; #define AH9280(_ah) ((struct ath_hal_9280 *)(_ah)) Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Mar 8 03:04:07 2011 (r219392) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Mar 8 06:59:59 2011 (r219393) @@ -30,6 +30,7 @@ #include "ar9002/ar9280v1.ini" #include "ar9002/ar9280v2.ini" +#include "ar9002/ar9280_olc.h" static const HAL_PERCAL_DATA ar9280_iq_cal = { /* single sample */ .calName = "IQ", .calType = IQ_MISMATCH_CAL, @@ -112,6 +113,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s uint32_t val; HAL_STATUS ecode; HAL_BOOL rfStatus; + int8_t pwr_table_offset; HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); @@ -142,6 +144,10 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate; AH5416(ah)->ah_writeIni = ar9280WriteIni; + AH5416(ah)->ah_olcInit = ar9280olcInit; + AH5416(ah)->ah_olcTempCompensation = ar9280olcTemperatureCompensation; + AH5416(ah)->ah_setPowerCalTable = ar9280SetPowerCalTable; + AH5416(ah)->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK; @@ -240,6 +246,18 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s goto bad; } + /* + * Check whether the power table offset isn't the default. + * This can occur with eeprom minor V21 or greater on Merlin. + */ + (void) ath_hal_eepromGet(ah, AR_EEP_PWR_TABLE_OFFSET, &pwr_table_offset); + if (pwr_table_offset != AR5416_PWR_TABLE_OFFSET_DB) { + ath_hal_printf(ah, "ERROR: default pwr offset: %d dBm != EEPROM pwr offset: %d dBm\n", + AR5416_PWR_TABLE_OFFSET_DB, (int) pwr_table_offset); + ecode = HAL_ENOTSUPP; + goto bad; + } + if (AR_SREV_MERLIN_20_OR_LATER(ah)) { /* setup rxgain table */ switch (ath_hal_eepromGet(ah, AR_EEP_RXGAIN_TYPE, AH_NULL)) { Added: head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Tue Mar 8 06:59:59 2011 (r219393) @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" + +#include "ah_eeprom_v14.h" + +#include "ar9002/ar9280.h" +#include "ar5416/ar5416reg.h" +#include "ar5416/ar5416phy.h" +#include "ar9002/ar9002phy.h" + +#include "ar9002/ar9280_olc.h" + +void +ar9280olcInit(struct ath_hal *ah) +{ + uint32_t i; + + for (i = 0; i < AR9280_TX_GAIN_TABLE_SIZE; i++) + AH9280(ah)->originalGain[i] = MS(OS_REG_READ(ah, + AR_PHY_TX_GAIN_TBL1 + i * 4), AR_PHY_TX_GAIN); + + AH9280(ah)->PDADCdelta = 0; +} + +void +ar9280olcGetTxGainIndex(struct ath_hal *ah, + const struct ieee80211_channel *chan, + struct calDataPerFreqOpLoop *rawDatasetOpLoop, + uint8_t *calChans, uint16_t availPiers, uint8_t *pwr, uint8_t *pcdacIdx) +{ + uint8_t pcdac, i = 0; + uint16_t idxL = 0, idxR = 0, numPiers; + HAL_BOOL match; + CHAN_CENTERS centers; + + ar5416GetChannelCenters(ah, chan, ¢ers); + + for (numPiers = 0; numPiers < availPiers; numPiers++) + if (calChans[numPiers] == AR5416_BCHAN_UNUSED) + break; + + match = getLowerUpperIndex((uint8_t)FREQ2FBIN(centers.synth_center, + IEEE80211_IS_CHAN_2GHZ(chan)), calChans, numPiers, + &idxL, &idxR); + if (match) { + pcdac = rawDatasetOpLoop[idxL].pcdac[0][0]; + *pwr = rawDatasetOpLoop[idxL].pwrPdg[0][0]; + } else { + pcdac = rawDatasetOpLoop[idxR].pcdac[0][0]; + *pwr = (rawDatasetOpLoop[idxL].pwrPdg[0][0] + + rawDatasetOpLoop[idxR].pwrPdg[0][0])/2; + } + while (pcdac > AH9280(ah)->originalGain[i] && + i < (AR9280_TX_GAIN_TABLE_SIZE - 1)) + i++; + + *pcdacIdx = i; +} + +/* + * XXX txPower here is likely not the target txPower in the traditional + * XXX sense, but is set by a call to ar9280olcGetTxGainIndex(). + * XXX Thus, be careful if you're trying to use this routine yourself. + */ +void +ar9280olcGetPDADCs(struct ath_hal *ah, uint32_t initTxGain, int txPower, + uint8_t *pPDADCValues) +{ + uint32_t i; + uint32_t offset; + + OS_REG_RMW_FIELD(ah, AR_PHY_TX_PWRCTRL6_0, AR_PHY_TX_PWRCTRL_ERR_EST_MODE, 3); + OS_REG_RMW_FIELD(ah, AR_PHY_TX_PWRCTRL6_1, AR_PHY_TX_PWRCTRL_ERR_EST_MODE, 3); + + OS_REG_RMW_FIELD(ah, AR_PHY_TX_PWRCTRL7, AR_PHY_TX_PWRCTRL_INIT_TX_GAIN, initTxGain); + + offset = txPower; + for (i = 0; i < AR5416_NUM_PDADC_VALUES; i++) + if (i < offset) + pPDADCValues[i] = 0x0; + else + pPDADCValues[i] = 0xFF; +} + +/* + * Run temperature compensation calibration. + * + * The TX gain table is adjusted depending upon the difference + * between the initial PDADC value and the currently read + * average TX power sample value. This value is only valid if + * frames have been transmitted, so currPDADC will be 0 if + * no frames have yet been transmitted. + */ +void +ar9280olcTemperatureCompensation(struct ath_hal *ah) +{ + uint32_t rddata, i; + int delta, currPDADC, regval; + uint8_t hpwr_5g = 0; + + rddata = OS_REG_READ(ah, AR_PHY_TX_PWRCTRL4); + currPDADC = MS(rddata, AR_PHY_TX_PWRCTRL_PD_AVG_OUT); + + HALDEBUG(ah, HAL_DEBUG_PERCAL, + "%s: called: initPDADC=%d, currPDADC=%d\n", + __func__, AH5416(ah)->initPDADC, currPDADC); + + if (AH5416(ah)->initPDADC == 0 || currPDADC == 0) + return; + + (void) (ath_hal_eepromGet(ah, AR_EEP_DAC_HPWR_5G, &hpwr_5g)); + + if (hpwr_5g) + delta = (currPDADC - AH5416(ah)->initPDADC + 4) / 8; + else + delta = (currPDADC - AH5416(ah)->initPDADC + 5) / 10; + + HALDEBUG(ah, HAL_DEBUG_PERCAL, "%s: delta=%d, PDADCdelta=%d\n", + __func__, delta, AH9280(ah)->PDADCdelta); + + if (delta != AH9280(ah)->PDADCdelta) { + AH9280(ah)->PDADCdelta = delta; + for (i = 1; i < AR9280_TX_GAIN_TABLE_SIZE; i++) { + regval = AH9280(ah)->originalGain[i] - delta; + if (regval < 0) + regval = 0; + + OS_REG_RMW_FIELD(ah, + AR_PHY_TX_GAIN_TBL1 + i * 4, + AR_PHY_TX_GAIN, regval); + } + } +} + +/* + * This effectively disables the gain boundaries leaving it + * to the open-loop TX power control. + */ +static void +ar9280SetGainBoundariesOpenLoop(struct ath_hal *ah, int regChainOffset, + uint16_t pdGainOverlap_t2, uint16_t gainBoundaries[]) +{ + /* These are unused for OLC */ + (void) pdGainOverlap_t2; + (void) gainBoundaries; + + OS_REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, + SM(0x6, AR_PHY_TPCRG5_PD_GAIN_OVERLAP) | + SM(0x38, AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1) | + SM(0x38, AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_2) | + SM(0x38, AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_3) | + SM(0x38, AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_4)); +} + +/* Eeprom versioning macros. Returns true if the version is equal or newer than the ver specified */ +/* XXX shouldn't be here! */ +#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) + +/************************************************************** + * ar9280SetPowerCalTable + * + * Pull the PDADC piers from cal data and interpolate them across the given + * points as well as from the nearest pier(s) to get a power detector + * linear voltage to power level table. + * + * Handle OLC for Merlin where required. + */ +HAL_BOOL +ar9280SetPowerCalTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, + const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset) +{ + CAL_DATA_PER_FREQ *pRawDataset; + uint8_t *pCalBChans = AH_NULL; + uint16_t pdGainOverlap_t2; + static uint8_t pdadcValues[AR5416_NUM_PDADC_VALUES]; + uint16_t gainBoundaries[AR5416_PD_GAINS_IN_MASK]; + uint16_t numPiers, i; + int16_t tMinCalPower; + uint16_t numXpdGain, xpdMask; + uint16_t xpdGainValues[AR5416_NUM_PD_GAINS]; + uint32_t regChainOffset; + + OS_MEMZERO(xpdGainValues, sizeof(xpdGainValues)); + + xpdMask = pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].xpdGain; + + if (IS_EEP_MINOR_V2(ah)) { + 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)) { + pCalBChans = pEepData->calFreqPier2G; + numPiers = AR5416_NUM_2G_CAL_PIERS; + } else { + pCalBChans = pEepData->calFreqPier5G; + numPiers = AR5416_NUM_5G_CAL_PIERS; + } + + /* If OLC is being done, set the init PDADC value appropriately */ + if (IEEE80211_IS_CHAN_2GHZ(chan) && AR_SREV_MERLIN_20_OR_LATER(ah) && + ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) { + struct calDataPerFreq *pRawDataset = pEepData->calPierData2G[0]; + AH5416(ah)->initPDADC = ((struct calDataPerFreqOpLoop *) pRawDataset)->vpdPdg[0][0]; + } else { + /* + * XXX ath9k doesn't clear this for 5ghz mode if + * it were set in 2ghz mode before! + * The Merlin OLC temperature compensation code + * uses this to calculate the PDADC delta during + * calibration ; 0 here effectively stops the + * temperature compensation calibration from + * occuring. + */ + AH5416(ah)->initPDADC = 0; + } + + /* Calculate the value of xpdgains from the xpdGain Mask */ + numXpdGain = ar5416GetXpdGainValues(ah, xpdMask, xpdGainValues); + + /* Write the detector gain biases and their number */ + ar5416WriteDetectorGainBiases(ah, numXpdGain, xpdGainValues); + + for (i = 0; i < AR5416_MAX_CHAINS; i++) { + regChainOffset = ar5416GetRegChainOffset(ah, i); + if (pEepData->baseEepHeader.txMask & (1 << i)) { + if (IEEE80211_IS_CHAN_2GHZ(chan)) { + pRawDataset = pEepData->calPierData2G[i]; + } else { + pRawDataset = pEepData->calPierData5G[i]; + } + + /* Fetch the gain boundaries and the PDADC values */ + if (AR_SREV_MERLIN_20_OR_LATER(ah) && + ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) { + uint8_t pcdacIdx; + uint8_t txPower; + + ar9280olcGetTxGainIndex(ah, chan, + (struct calDataPerFreqOpLoop *) pRawDataset, + pCalBChans, numPiers, &txPower, &pcdacIdx); + ar9280olcGetPDADCs(ah, pcdacIdx, txPower / 2, pdadcValues); + } else { + ar5416GetGainBoundariesAndPdadcs(ah, chan, + pRawDataset, pCalBChans, numPiers, + pdGainOverlap_t2, &tMinCalPower, + gainBoundaries, pdadcValues, numXpdGain); + } + + /* + * Prior to writing the boundaries or the pdadc vs. power table + * into the chip registers the default starting point on the pdadc + * vs. power table needs to be checked and the curve boundaries + * adjusted accordingly + */ + // XXX ath9k_change_gain_boundary_setting(); + + if ((i == 0) || AR_SREV_OWL_20_OR_LATER(ah)) { + /* Set gain boundaries for either open- or closed-loop TPC */ + if (AR_SREV_MERLIN_20_OR_LATER(ah) && + ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) + ar9280SetGainBoundariesOpenLoop(ah, + regChainOffset, pdGainOverlap_t2, + gainBoundaries); + else + ar5416SetGainBoundariesClosedLoop(ah, + regChainOffset, pdGainOverlap_t2, + gainBoundaries); + } + + /* + * If this is a board that has a pwrTableOffset that differs from + * the default AR5416_PWR_TABLE_OFFSET_DB then the start of the + * pdadc vs pwr table needs to be adjusted prior to writing to the + * chip. + */ + /* XXX ath9k_adjust_pdadc_values() */ + + /* Write the power values into the baseband power table */ + ar5416WritePdadcValues(ah, regChainOffset, pdadcValues); + } + } + *pTxPowerIndexOffset = 0; + + return AH_TRUE; +} Added: head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.h Tue Mar 8 06:59:59 2011 (r219393) @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd. + * + * 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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 07:42:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BEF1106566B; Tue, 8 Mar 2011 07:42:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 694388FC16; Tue, 8 Mar 2011 07:42:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p287g9ps061352; Tue, 8 Mar 2011 07:42:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p287g9vD061349; Tue, 8 Mar 2011 07:42:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103080742.p287g9vD061349@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Mar 2011 07:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219394 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 07:42:09 -0000 Author: adrian Date: Tue Mar 8 07:42:09 2011 New Revision: 219394 URL: http://svn.freebsd.org/changeset/base/219394 Log: Break out the ath regulatory domain structures into a separate header file. Added: head/sys/dev/ath/ath_hal/ah_regdomain.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Tue Mar 8 06:59:59 2011 (r219393) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Tue Mar 8 07:42:09 2011 (r219394) @@ -28,6 +28,8 @@ #include "ah_eeprom.h" #include "ah_devid.h" +#include "ah_regdomain.h" + /* * XXX this code needs a audit+review */ @@ -44,9 +46,7 @@ * definition that's used to setup initializers. See also further * comments below. */ -#define BMLEN 2 /* 2 x 64 bits in each channel bitmask */ -typedef uint64_t chanbmask_t[BMLEN]; - +/* BMLEN is now defined in ah_regdomain.h */ #define W0(_a) \ (((_a) >= 0 && (_a) < 64 ? (((uint64_t) 1)<<(_a)) : (uint64_t) 0)) #define W1(_a) \ @@ -314,25 +314,6 @@ enum { * THE following table is the mapping of regdomain pairs specified by * an 8 bit regdomain value to the individual unitary reg domains */ -typedef struct regDomainPair { - HAL_REG_DOMAIN regDmnEnum; /* 16 bit reg domain pair */ - HAL_REG_DOMAIN regDmn5GHz; /* 5GHz reg domain */ - HAL_REG_DOMAIN regDmn2GHz; /* 2GHz reg domain */ - uint32_t flags5GHz; /* Requirements flags (AdHoc - disallow, noise floor cal needed, - etc) */ - uint32_t flags2GHz; /* Requirements flags (AdHoc - disallow, noise floor cal needed, - etc) */ - uint64_t pscanMask; /* Passive Scan flags which - can override unitary domain - passive scan flags. This - value is used as a mask on - the unitary flags*/ - uint16_t singleCC; /* Country code of single country if - a one-on-one mapping exists */ -} REG_DMN_PAIR_MAPPING; - static REG_DMN_PAIR_MAPPING regDomainPairs[] = { {NO_ENUMRD, DEBUG_REG_DMN, DEBUG_REG_DMN, NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT }, {NULL1_WORLD, NULL1, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT }, @@ -446,11 +427,6 @@ static REG_DMN_PAIR_MAPPING regDomainPai #define COUNTRY_ERD_FLAG 0x8000 #define WORLDWIDE_ROAMING_FLAG 0x4000 -typedef struct { - HAL_CTRY_CODE countryCode; - HAL_REG_DOMAIN regDmnEnum; -} COUNTRY_CODE_TO_ENUM_RD; - static COUNTRY_CODE_TO_ENUM_RD allCountries[] = { { CTRY_DEBUG, NO_ENUMRD }, { CTRY_DEFAULT, DEF_REGDMN }, @@ -614,21 +590,6 @@ enum { * function so the compiler checks for duplicates. */ -typedef struct { - uint16_t lowChannel; /* Low channel center in MHz */ - uint16_t highChannel; /* High Channel center in MHz */ - uint8_t powerDfs; /* Max power (dBm) for channel - range when using DFS */ - uint8_t antennaMax; /* Max allowed antenna gain */ - uint8_t channelBW; /* Bandwidth of the channel */ - uint8_t channelSep; /* Channel separation within - the band */ - uint64_t useDfs; /* Use DFS in the RegDomain - if corresponding bit is set */ - uint64_t usePassScan; /* Use Passive Scan in the RegDomain - if corresponding bit is set */ -} REG_DMN_FREQ_BAND; - /* * 5GHz 11A channel tags */ @@ -1009,25 +970,6 @@ static REG_DMN_FREQ_BAND regDmn2Ghz11gTu #define T1_2512_2732 AFTER(T3_2437_2437) }; -typedef struct regDomain { - uint16_t regDmnEnum; /* value from EnumRd table */ - uint8_t conformanceTestLimit; - uint32_t flags; /* Requirement flags (AdHoc disallow, - noise floor cal needed, etc) */ - uint64_t dfsMask; /* DFS bitmask for 5Ghz tables */ - uint64_t pscan; /* Bitmask for passive scan */ - chanbmask_t chan11a; /* 11a channels */ - chanbmask_t chan11a_turbo; /* 11a static turbo channels */ - chanbmask_t chan11a_dyn_turbo; /* 11a dynamic turbo channels */ - chanbmask_t chan11a_half; /* 11a 1/2 width channels */ - chanbmask_t chan11a_quarter; /* 11a 1/4 width channels */ - chanbmask_t chan11b; /* 11b channels */ - chanbmask_t chan11g; /* 11g channels */ - chanbmask_t chan11g_turbo; /* 11g dynamic turbo channels */ - chanbmask_t chan11g_half; /* 11g 1/2 width channels */ - chanbmask_t chan11g_quarter; /* 11g 1/4 width channels */ -} REG_DOMAIN; - static REG_DOMAIN regDomains[] = { {.regDmnEnum = DEBUG_REG_DMN, @@ -1713,11 +1655,6 @@ static REG_DOMAIN regDomains[] = { } }; -struct cmode { - u_int mode; - u_int flags; -}; - static const struct cmode modes[] = { { HAL_MODE_TURBO, IEEE80211_CHAN_ST }, { HAL_MODE_11A, IEEE80211_CHAN_A }, Added: head/sys/dev/ath/ath_hal/ah_regdomain.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ah_regdomain.h Tue Mar 8 07:42:09 2011 (r219394) @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2005-2006 Atheros Communications, Inc. + * All rights reserved. + * + * 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 __AH_REGDOMAIN_H__ +#define __AH_REGDOMAIN_H__ + +/* + * BMLEN defines the size of the bitmask used to hold frequency + * band specifications. Note this must agree with the BM macro + * definition that's used to setup initializers. See also further + * comments below. + */ +#define BMLEN 2 /* 2 x 64 bits in each channel bitmask */ +typedef uint64_t chanbmask_t[BMLEN]; + +/* + * THE following table is the mapping of regdomain pairs specified by + * an 8 bit regdomain value to the individual unitary reg domains + */ +typedef struct regDomainPair { + HAL_REG_DOMAIN regDmnEnum; /* 16 bit reg domain pair */ + HAL_REG_DOMAIN regDmn5GHz; /* 5GHz reg domain */ + HAL_REG_DOMAIN regDmn2GHz; /* 2GHz reg domain */ + uint32_t flags5GHz; /* Requirements flags (AdHoc + disallow, noise floor cal needed, + etc) */ + uint32_t flags2GHz; /* Requirements flags (AdHoc + disallow, noise floor cal needed, + etc) */ + uint64_t pscanMask; /* Passive Scan flags which + can override unitary domain + passive scan flags. This + value is used as a mask on + the unitary flags*/ + uint16_t singleCC; /* Country code of single country if + a one-on-one mapping exists */ +} REG_DMN_PAIR_MAPPING; + +typedef struct { + HAL_CTRY_CODE countryCode; + HAL_REG_DOMAIN regDmnEnum; +} COUNTRY_CODE_TO_ENUM_RD; + +/* + * Frequency band collections are defined using bitmasks. Each bit + * in a mask is the index of an entry in one of the following tables. + * Bitmasks are BMLEN*64 bits so if a table grows beyond that the bit + * vectors must be enlarged or the tables split somehow (e.g. split + * 1/2 and 1/4 rate channels into a separate table). + * + * Beware of ordering; the indices are defined relative to the preceding + * entry so if things get off there will be confusion. A good way to + * check the indices is to collect them in a switch statement in a stub + * function so the compiler checks for duplicates. + */ +typedef struct { + uint16_t lowChannel; /* Low channel center in MHz */ + uint16_t highChannel; /* High Channel center in MHz */ + uint8_t powerDfs; /* Max power (dBm) for channel + range when using DFS */ + uint8_t antennaMax; /* Max allowed antenna gain */ + uint8_t channelBW; /* Bandwidth of the channel */ + uint8_t channelSep; /* Channel separation within + the band */ + uint64_t useDfs; /* Use DFS in the RegDomain + if corresponding bit is set */ + uint64_t usePassScan; /* Use Passive Scan in the RegDomain + if corresponding bit is set */ +} REG_DMN_FREQ_BAND; + +typedef struct regDomain { + uint16_t regDmnEnum; /* value from EnumRd table */ + uint8_t conformanceTestLimit; + uint32_t flags; /* Requirement flags (AdHoc disallow, + noise floor cal needed, etc) */ + uint64_t dfsMask; /* DFS bitmask for 5Ghz tables */ + uint64_t pscan; /* Bitmask for passive scan */ + chanbmask_t chan11a; /* 11a channels */ + chanbmask_t chan11a_turbo; /* 11a static turbo channels */ + chanbmask_t chan11a_dyn_turbo; /* 11a dynamic turbo channels */ + chanbmask_t chan11a_half; /* 11a 1/2 width channels */ + chanbmask_t chan11a_quarter; /* 11a 1/4 width channels */ + chanbmask_t chan11b; /* 11b channels */ + chanbmask_t chan11g; /* 11g channels */ + chanbmask_t chan11g_turbo; /* 11g dynamic turbo channels */ + chanbmask_t chan11g_half; /* 11g 1/2 width channels */ + chanbmask_t chan11g_quarter; /* 11g 1/4 width channels */ +} REG_DOMAIN; + +struct cmode { + u_int mode; + u_int flags; +}; +#endif From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 08:02:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2BEC106564A; Tue, 8 Mar 2011 08:02:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC83E8FC14; Tue, 8 Mar 2011 08:02: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 p2882dXR061827; Tue, 8 Mar 2011 08:02:39 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2882dn2061825; Tue, 8 Mar 2011 08:02:39 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201103080802.p2882dn2061825@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 8 Mar 2011 08:02: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: r219395 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 08:02:40 -0000 Author: hselasky Date: Tue Mar 8 08:02:39 2011 New Revision: 219395 URL: http://svn.freebsd.org/changeset/base/219395 Log: - Bugfix: Root HUBs do not support re-enumeration. MFC after: 14 days Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb_generic.c Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Tue Mar 8 07:42:09 2011 (r219394) +++ head/sys/dev/usb/usb_generic.c Tue Mar 8 08:02:39 2011 (r219395) @@ -952,8 +952,14 @@ ugen_re_enumerate(struct usb_fifo *f) } if (udev->flags.usb_mode != USB_MODE_HOST) { /* not possible in device side mode */ + DPRINTFN(6, "device mode\n"); return (ENOTTY); } + if (udev->parent_hub == NULL) { + /* the root HUB cannot be re-enumerated */ + DPRINTFN(6, "cannot reset root HUB\n"); + return (EINVAL); + } /* make sure all FIFO's are gone */ /* else there can be a deadlock */ if (ugen_fs_uninit(f)) { From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 11:51:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AF21106566C; Tue, 8 Mar 2011 11:50:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A9A08FC28; Tue, 8 Mar 2011 11:50: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 p28BoxAG072568; Tue, 8 Mar 2011 11:50:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28BoxFV072566; Tue, 8 Mar 2011 11:50:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201103081150.p28BoxFV072566@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 8 Mar 2011 11:50: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: r219396 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 11:51:01 -0000 Author: kib Date: Tue Mar 8 11:50:59 2011 New Revision: 219396 URL: http://svn.freebsd.org/changeset/base/219396 Log: Do not assert buffer lock in VFS_STRATEGY() when kernel already paniced. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Mar 8 08:02:39 2011 (r219395) +++ head/sys/kern/vfs_subr.c Tue Mar 8 11:50:59 2011 (r219396) @@ -3894,7 +3894,7 @@ vop_strategy_pre(void *ap) if ((bp->b_flags & B_CLUSTER) != 0) return; - if (!BUF_ISLOCKED(bp)) { + if (panicstr == NULL && !BUF_ISLOCKED(bp)) { if (vfs_badlock_print) printf( "VOP_STRATEGY: bp is not locked but should be\n"); From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 11:58:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEF5F106566B; Tue, 8 Mar 2011 11:58:25 +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 DD82D8FC14; Tue, 8 Mar 2011 11:58: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 p28BwPPx072776; Tue, 8 Mar 2011 11:58:25 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28BwPSM072763; Tue, 8 Mar 2011 11:58:25 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201103081158.p28BwPSM072763@svn.freebsd.org> From: Randall Stewart Date: Tue, 8 Mar 2011 11:58: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: r219397 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 11:58:26 -0000 Author: rrs Date: Tue Mar 8 11:58:25 2011 New Revision: 219397 URL: http://svn.freebsd.org/changeset/base/219397 Log: Tunes and fixes the new DC-CC to seem to hit the right mix. Still may need some tweaks but it appears to almost not give away too much to an RFC2581 flow, but can really minimize the amount of buffers used in the net. MFC after: 3 months Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_dtrace_declare.h head/sys/netinet/sctp_dtrace_define.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp.h Tue Mar 8 11:58:25 2011 (r219397) @@ -263,6 +263,7 @@ struct sctp_paramhdr { #define SCTP_CC_OPT_RTCC_SETMODE 0x00002000 #define SCTP_CC_OPT_USE_DCCC_ECN 0x00002001 +#define SCTP_CC_OPT_STEADY_STEP 0x00002002 /* RS - Supported stream scheduling modules for pluggable * stream scheduling Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_cc_functions.c Tue Mar 8 11:58:25 2011 (r219397) @@ -185,6 +185,328 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } +/* Defines for instantaneous bw decisions */ +#define SCTP_INST_LOOSING 1 /* Loosing to other flows */ +#define SCTP_INST_NEUTRAL 2 /* Neutral, no indication */ +#define SCTP_INST_GAINING 3 /* Gaining, step down possible */ + + +static int +cc_bw_same(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, + uint64_t rtt_offset, uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + probepoint = (((uint64_t) net->cwnd) << 32); + if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* + * rtt increased we don't update bw.. so we don't update the + * rtt either. + */ + /* Probe point 5 */ + probepoint |= ((5 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { + if (net->cc_mod.rtcc.last_step_state == 5) + net->cc_mod.rtcc.step_cnt++; + else + net->cc_mod.rtcc.step_cnt = 1; + net->cc_mod.rtcc.last_step_state = 5; + if ((net->cc_mod.rtcc.step_cnt == net->cc_mod.rtcc.steady_step) || + ((net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step) && + ((net->cc_mod.rtcc.step_cnt % net->cc_mod.rtcc.steady_step) == 0))) { + /* Try a step down */ + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if (net->cwnd > (4 * net->mtu)) { + net->cwnd -= net->mtu; + net->cc_mod.rtcc.vol_reduce++; + } else { + net->cc_mod.rtcc.step_cnt = 0; + } + } + } + return (1); + } + if (net->rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* + * rtt decreased, there could be more room. we update both + * the bw and the rtt here to lock this in as a good step + * down. + */ + /* Probe point 6 */ + probepoint |= ((6 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.last_step_state == 5) && + (net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step)) { + /* Step down worked */ + net->cc_mod.rtcc.step_cnt = 0; + return (1); + } else { + net->cc_mod.rtcc.last_step_state = 6; + net->cc_mod.rtcc.step_cnt = 0; + } + } + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + if (inst_ind == SCTP_INST_GAINING) + return (1); + else if (inst_ind == SCTP_INST_NEUTRAL) + return (1); + else + return (0); + } + /* + * Ok bw and rtt remained the same .. no update to any + */ + /* Probe point 7 */ + probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + + if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { + if (net->cc_mod.rtcc.last_step_state == 5) + net->cc_mod.rtcc.step_cnt++; + else + net->cc_mod.rtcc.step_cnt = 1; + net->cc_mod.rtcc.last_step_state = 5; + if ((net->cc_mod.rtcc.step_cnt == net->cc_mod.rtcc.steady_step) || + ((net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step) && + ((net->cc_mod.rtcc.step_cnt % net->cc_mod.rtcc.steady_step) == 0))) { + /* Try a step down */ + if (net->cwnd > (4 * net->mtu)) { + net->cwnd -= net->mtu; + net->cc_mod.rtcc.vol_reduce++; + return (1); + } else { + net->cc_mod.rtcc.step_cnt = 0; + } + } + } + if (inst_ind == SCTP_INST_GAINING) + return (1); + else if (inst_ind == SCTP_INST_NEUTRAL) + return (1); + else + return ((int)net->cc_mod.rtcc.ret_from_eq); +} + +static int +cc_bw_decrease(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t rtt_offset, + uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + /* Bandwidth decreased. */ + probepoint = (((uint64_t) net->cwnd) << 32); + if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* rtt increased */ + /* Did we add more */ + if ((net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) && + (inst_ind != SCTP_INST_LOOSING)) { + /* We caused it maybe.. back off? */ + /* PROBE POINT 1 */ + probepoint |= ((1 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + + if (net->cc_mod.rtcc.ret_from_eq) { + /* + * Switch over to CA if we are less + * aggressive + */ + net->ssthresh = net->cwnd - 1; + net->partial_bytes_acked = 0; + } + return (1); + } + /* Probe point 2 */ + probepoint |= ((2 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + + /* Someone else - fight for more? */ + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + /* + * Did we voluntarily give up some? if so take one + * back please + */ + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 2; + net->cc_mod.rtcc.step_cnt = 0; + } + goto out_decision; + } else if (net->rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* bw & rtt decreased */ + /* Probe point 3 */ + probepoint |= ((3 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 3; + net->cc_mod.rtcc.step_cnt = 0; + } + goto out_decision; + } + /* The bw decreased but rtt stayed the same */ + /* Probe point 4 */ + probepoint |= ((4 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 4; + net->cc_mod.rtcc.step_cnt = 0; + } +out_decision: + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + if (inst_ind == SCTP_INST_GAINING) { + return (1); + } else { + return (0); + } +} + +static int +cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, + uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + /* + * BW increased, so update and return 0, since all actions in our + * table say to do the normal CC update. Note that we pay no + * attention to the inst_ind since our overall sum is increasing. + */ + /* PROBE POINT 0 */ + probepoint = (((uint64_t) net->cwnd) << 32); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + net->cc_mod.rtcc.last_step_state = 0; + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.vol_reduce = 0; + } + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); +} /* RTCC Algoritm to limit growth of cwnd, return * true if you want to NOT allow cwnd growth @@ -193,6 +515,11 @@ static int cc_bw_limit(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw) { uint64_t bw_offset, rtt_offset, rtt, vtag, probepoint; + uint64_t bytes_for_this_rtt, inst_bw; + uint64_t div, inst_off; + int bw_shift; + uint8_t inst_ind; + int ret; /*- * Here we need to see if we want @@ -231,151 +558,67 @@ cc_bw_limit(struct sctp_tcb *stcb, struc * RTT it stayed the same if it did not * change within 1/32nd */ + bw_shift = SCTP_BASE_SYSCTL(sctp_rttvar_bw); rtt = stcb->asoc.my_vtag; vtag = (rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); probepoint = (((uint64_t) net->cwnd) << 32); rtt = net->rtt; - bw_offset = net->cc_mod.rtcc.lbw >> SCTP_BASE_SYSCTL(sctp_rttvar_bw); - if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { - /* - * BW increased, so update and return 0, since all actions - * in our table say to do the normal CC update - */ - /* PROBE POINT 0 */ + if (net->cc_mod.rtcc.rtt_set_this_sack) { + net->cc_mod.rtcc.rtt_set_this_sack = 0; + bytes_for_this_rtt = net->cc_mod.rtcc.bw_bytes - net->cc_mod.rtcc.bw_bytes_at_last_rttc; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = net->cc_mod.rtcc.bw_bytes; + if (net->rtt) { + div = net->rtt / 1000; + if (div) { + inst_bw = bytes_for_this_rtt / div; + inst_off = inst_bw >> bw_shift; + if (inst_bw > nbw) + inst_ind = SCTP_INST_GAINING; + else if ((inst_bw + inst_off) < nbw) + inst_ind = SCTP_INST_LOOSING; + else + inst_ind = SCTP_INST_NEUTRAL; + probepoint |= ((0xb << 16) | inst_ind); + } else { + inst_bw = bytes_for_this_rtt / (uint64_t) (net->rtt); + /* Can't determine do not change */ + inst_ind = net->cc_mod.rtcc.last_inst_ind; + probepoint |= ((0xc << 16) | inst_ind); + } + } else { + inst_bw = bytes_for_this_rtt; + /* Can't determine do not change */ + inst_ind = net->cc_mod.rtcc.last_inst_ind; + probepoint |= ((0xd << 16) | inst_ind); + } SDT_PROBE(sctp, cwnd, net, rttvar, vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, + ((nbw << 32) | inst_bw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | rtt), + net->flight_size, probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); + } else { + /* No rtt measurement, use last one */ + inst_ind = net->cc_mod.rtcc.last_inst_ind; + } + bw_offset = net->cc_mod.rtcc.lbw >> bw_shift; + if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { + ret = cc_bw_increase(stcb, net, nbw, vtag, inst_ind); + goto out; } rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); if (nbw < net->cc_mod.rtcc.lbw - bw_offset) { - /* Bandwidth decreased. */ - if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { - /* rtt increased */ - /* Did we add more */ - if (net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) { - /* We caused it maybe.. back off */ - /* PROBE POINT 1 */ - probepoint |= ((1 << 16) | 1); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cwnd = net->cc_mod.rtcc.cwnd_at_bw_set; - if (net->cc_mod.rtcc.ret_from_eq) { - /* - * Switch over to CA if we are less - * aggressive - */ - net->ssthresh = net->cwnd - 1; - net->partial_bytes_acked = 0; - } - return (1); - } - /* Probe point 2 */ - probepoint |= ((2 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - - /* Someone else - fight for more? */ - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } else if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { - /* rtt decreased */ - /* Probe point 3 */ - probepoint |= ((3 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } - /* The bw decreased but rtt stayed the same */ - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - /* Probe point 4 */ - probepoint |= ((4 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return (0); + ret = cc_bw_decrease(stcb, net, nbw, rtt_offset, vtag, inst_ind); + goto out; } /* * If we reach here then we are in a situation where the bw stayed * the same. */ - if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { - /* - * rtt increased we don't update bw.. so we don't update the - * rtt either. - */ - /* Probe point 5 */ - probepoint |= ((5 << 16) | 1); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return (1); - } - if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { - /* - * rtt decreased, there could be more room. we update both - * the bw and the rtt here. - */ - /* Probe point 6 */ - probepoint |= ((6 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } - /* - * Ok bw and rtt remained the same .. no update to any but save the - * latest cwnd. - */ - /* Probe point 7 */ - probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return ((int)net->cc_mod.rtcc.ret_from_eq); + ret = cc_bw_same(stcb, net, nbw, rtt_offset, vtag, inst_ind); +out: + net->cc_mod.rtcc.last_inst_ind = inst_ind; + return (ret); } static void @@ -554,11 +797,15 @@ sctp_cwnd_update_after_sack_common(struc SDT_PROBE(sctp, cwnd, net, rttvar, vtag, nbw, - 0, - net->rtt, + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, probepoint); net->cc_mod.rtcc.lbw = nbw; net->cc_mod.rtcc.lbw_rtt = net->rtt; + if (net->cc_mod.rtcc.rtt_set_this_sack) { + net->cc_mod.rtcc.rtt_set_this_sack = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = net->cc_mod.rtcc.bw_bytes; + } } } /* @@ -1014,15 +1261,22 @@ sctp_cwnd_new_rtcc_transmission_begins(s SDT_PROBE(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | 0), - net->cc_mod.rtcc.lbw_rtt, - 0, + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, probepoint); net->cc_mod.rtcc.lbw_rtt = 0; net->cc_mod.rtcc.cwnd_at_bw_set = 0; net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = 0; + net->cc_mod.rtcc.vol_reduce = 0; net->cc_mod.rtcc.bw_tot_time = 0; net->cc_mod.rtcc.bw_bytes = 0; net->cc_mod.rtcc.tls_needs_set = 0; + if (net->cc_mod.rtcc.steady_step) { + net->cc_mod.rtcc.vol_reduce = 0; + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.last_step_state = 0; + } if (net->cc_mod.rtcc.ret_from_eq) { /* less aggressive one - reset cwnd too */ uint32_t cwnd_in_mtu, cwnd; @@ -1075,11 +1329,20 @@ sctp_set_rtcc_initial_cc_param(struct sc probepoint); net->cc_mod.rtcc.lbw_rtt = 0; net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.vol_reduce = 0; net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.vol_reduce = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = 0; net->cc_mod.rtcc.bw_tot_time = 0; net->cc_mod.rtcc.bw_bytes = 0; net->cc_mod.rtcc.tls_needs_set = 0; net->cc_mod.rtcc.ret_from_eq = SCTP_BASE_SYSCTL(sctp_rttvar_eqret); + net->cc_mod.rtcc.steady_step = SCTP_BASE_SYSCTL(sctp_steady_step); + net->cc_mod.rtcc.use_dccc_ecn = SCTP_BASE_SYSCTL(sctp_use_dccc_ecn); + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.last_step_state = 0; + + } static int @@ -1106,6 +1369,10 @@ sctp_cwnd_rtcc_socket_option(struct sctp TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { net->cc_mod.rtcc.use_dccc_ecn = cc_opt->aid_value.assoc_value; } + } else if (cc_opt->option == SCTP_CC_OPT_STEADY_STEP) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.steady_step = cc_opt->aid_value.assoc_value; + } } else { return (EINVAL); } @@ -1123,6 +1390,12 @@ sctp_cwnd_rtcc_socket_option(struct sctp return (EFAULT); } cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.use_dccc_ecn; + } else if (cc_opt->option == SCTP_CC_OPT_STEADY_STEP) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.steady_step; } else { return (EINVAL); } @@ -1149,6 +1422,12 @@ sctp_cwnd_update_rtcc_after_sack(struct sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 1); } +static void +sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb, + struct sctp_nets *net, struct timeval *now) +{ + net->cc_mod.rtcc.rtt_set_this_sack = 1; +} /* Here starts Sally Floyds HS-TCP */ @@ -2203,6 +2482,7 @@ struct sctp_cc_functions sctp_cc_functio .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, .sctp_cwnd_prepare_net_for_sack = sctp_cwnd_prepare_rtcc_net_for_sack, - .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option + .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option, + .sctp_rtt_calculated = sctp_rtt_rtcc_calculated } }; Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_constants.h Tue Mar 8 11:58:25 2011 (r219397) @@ -355,8 +355,8 @@ __FBSDID("$FreeBSD$"); /* RTO calculation flag to say if it * is safe to determine local lan or not. */ -#define SCTP_DETERMINE_LL_NOTOK 0 -#define SCTP_DETERMINE_LL_OK 1 +#define SCTP_RTT_FROM_NON_DATA 0 +#define SCTP_RTT_FROM_DATA 1 /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ Modified: head/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- head/sys/netinet/sctp_dtrace_declare.h Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_dtrace_declare.h Tue Mar 8 11:58:25 2011 (r219397) @@ -57,6 +57,7 @@ SDT_PROBE_DECLARE(sctp, cwnd, net, ecn); SDT_PROBE_DECLARE(sctp, cwnd, net, pd); /* Rttvar probe declaration */ SDT_PROBE_DECLARE(sctp, cwnd, net, rttvar); +SDT_PROBE_DECLARE(sctp, cwnd, net, rttstep); /* One to track an associations rwnd */ SDT_PROBE_DECLARE(sctp, rwnd, assoc, val); Modified: head/sys/netinet/sctp_dtrace_define.h ============================================================================== --- head/sys/netinet/sctp_dtrace_define.h Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_dtrace_define.h Tue Mar 8 11:58:25 2011 (r219397) @@ -78,14 +78,27 @@ SDT_PROBE_DEFINE(sctp, cwnd, net, rttvar SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 0, "uint64_t"); /* obw | nbw */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 1, "uint64_t"); -/* newrtt */ +/* bwrtt | newrtt */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 2, "uint64_t"); -/* bwrtt */ +/* flight */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 3, "uint64_t"); /* (cwnd << 32) | point << 16 | retval(0/1) */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 4, "uint64_t"); +SDT_PROBE_DEFINE(sctp, cwnd, net, rttstep, rttstep); +/* The Vtag << 32 | localport << 16 | remoteport */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 0, "uint64_t"); +/* obw | nbw */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 1, "uint64_t"); +/* bwrtt | nrtt */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 2, "uint64_t"); +/* cwnd_saved | stepcnt << 16 | oldstep */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 3, "uint64_t"); +/* (cwnd << 32) | point << 16 | retval(0/1) */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 4, "uint64_t"); + + /* FastRetransmit-DECREASE */ SDT_PROBE_DEFINE(sctp, cwnd, net, fr, fr); /* The Vtag for this end */ Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_indata.c Tue Mar 8 11:58:25 2011 (r219397) @@ -2817,7 +2817,7 @@ sctp_process_segment_range(struct sctp_t int *num_frs, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int *ecn_seg_sums) + int *ecn_seg_sums, int *rto_ok) { struct sctp_tmit_chunk *tp1; unsigned int theTSN; @@ -2956,13 +2956,19 @@ sctp_process_segment_range(struct sctp_t * update RTO too ? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - &stcb->asoc, - tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (*rto_ok) { + tp1->whoTo->RTO = + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + *rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -3033,7 +3039,8 @@ static int sctp_handle_segments(struct mbuf *m, int *offset, struct sctp_tcb *stcb, struct sctp_association *asoc, uint32_t last_tsn, uint32_t * biggest_tsn_acked, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int num_seg, int num_nr_seg, int *ecn_seg_sums) + int num_seg, int num_nr_seg, int *ecn_seg_sums, + int *rto_ok) { struct sctp_gap_ack_block *frag, block; struct sctp_tmit_chunk *tp1; @@ -3079,7 +3086,7 @@ sctp_handle_segments(struct mbuf *m, int } if (sctp_process_segment_range(stcb, &tp1, last_tsn, frag_strt, frag_end, non_revocable, &num_frs, biggest_newly_acked_tsn, - this_sack_lowest_newack, ecn_seg_sums)) { + this_sack_lowest_newack, ecn_seg_sums, rto_ok)) { chunk_freed = 1; } prev_frag_end = frag_end; @@ -3579,6 +3586,9 @@ sctp_strike_gap_ack_chunks(struct sctp_t * this guy had a RTO calculation pending on * it, cancel it */ + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } if (alt != tp1->whoTo) { @@ -3775,6 +3785,7 @@ sctp_express_handle_sack(struct sctp_tcb int win_probe_recovery = 0; int win_probe_recovered = 0; int j, done_once = 0; + int rto_ok = 1; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_SACK_ARRIVALS_ENABLE) { sctp_misc_ints(SCTP_SACK_LOG_EXPRESS, cumack, @@ -3916,16 +3927,23 @@ sctp_express_handle_sack(struct sctp_tcb /* update RTO too? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - /* - * sa_ignore - * NO_NULL_CHK - */ - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (rto_ok) { + tp1->whoTo->RTO = + /* + * sa_ignore + * NO_NULL_CH + * K + */ + sctp_calculate_rto(stcb, + asoc, tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -4280,6 +4298,7 @@ sctp_handle_sack(struct mbuf *m, int off struct sctp_nets *net = NULL; int ecn_seg_sums = 0; int done_once; + int rto_ok = 1; uint8_t reneged_all = 0; uint8_t cmt_dac_flag; @@ -4526,12 +4545,18 @@ sctp_handle_sack(struct mbuf *m, int off /* update RTO too? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (rto_ok) { + tp1->whoTo->RTO = + sctp_calculate_rto(stcb, + asoc, tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -4606,7 +4631,8 @@ sctp_handle_sack(struct mbuf *m, int off */ if (sctp_handle_segments(m, &offset_seg, stcb, asoc, last_tsn, &biggest_tsn_acked, &biggest_tsn_newly_acked, &this_sack_lowest_newack, - num_seg, num_nr_seg, &ecn_seg_sums)) { + num_seg, num_nr_seg, &ecn_seg_sums, + &rto_ok)) { wake_him++; } if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_input.c Tue Mar 8 11:58:25 2011 (r219397) @@ -485,7 +485,7 @@ sctp_process_init_ack(struct mbuf *m, in /* calculate the RTO */ net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { @@ -630,7 +630,7 @@ sctp_handle_heartbeat_ack(struct sctp_he } /* Now lets do a RTO with this */ r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + SCTP_RTT_FROM_NON_DATA); /* Mobility adaptation */ if (req_prim) { if ((sctp_is_mobility_feature_on(stcb->sctp_ep, @@ -1547,7 +1547,7 @@ sctp_process_cookie_existing(struct mbuf net->RTO = sctp_calculate_rto(stcb, asoc, net, &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); if (stcb->asoc.sctp_autoclose_ticks && (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE))) { @@ -2251,7 +2251,7 @@ sctp_process_cookie_new(struct mbuf *m, if ((netp) && (*netp)) { (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2849,7 +2849,7 @@ sctp_handle_cookie_ack(struct sctp_cooki if (asoc->overall_error_count == 0) { net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); @@ -3218,6 +3218,9 @@ process_chunk_drop(struct sctp_tcb *stcb * this guy had a RTO calculation * pending on it, cancel it */ + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } SCTP_STAT_INCR(sctps_pdrpmark); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_output.c Tue Mar 8 11:58:25 2011 (r219397) @@ -8254,7 +8254,10 @@ no_data_fill: } else { asoc->time_last_sent = *now; } - data_list[0]->do_rtt = 1; + if (net->rto_needed) { + data_list[0]->do_rtt = 1; + net->rto_needed = 0; + } SCTP_STAT_INCR_BY(sctps_senddata, bundle_at); sctp_clean_up_datalist(stcb, asoc, data_list, bundle_at, net); if (SCTP_BASE_SYSCTL(sctp_early_fr)) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_pcb.c Tue Mar 8 11:58:25 2011 (r219397) @@ -3858,6 +3858,7 @@ sctp_add_remote_addr(struct sctp_tcb *st * We set this to 0, the timer code knows that this means its an * initial value */ + net->rto_needed = 1; net->RTO = 0; net->RTO_measured = 0; stcb->asoc.numnets++; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_structs.h Tue Mar 8 11:58:25 2011 (r219397) @@ -226,11 +226,20 @@ struct rtcc_cc { uint64_t bw_bytes; /* The total bytes since this sending began */ uint64_t bw_tot_time; /* The total time since sending began */ uint64_t new_tot_time; /* temp holding the new value */ - uint32_t cwnd_at_bw_set; - uint8_t ret_from_eq; - uint8_t use_dccc_ecn; + uint64_t bw_bytes_at_last_rttc; /* What bw_bytes was at last rtt calc */ + uint32_t cwnd_at_bw_set;/* Cwnd at last bw saved - lbw */ + uint32_t vol_reduce; /* cnt of voluntary reductions */ + uint16_t steady_step; /* The number required to be in steady state */ + uint16_t step_cnt; /* The current number */ + uint8_t ret_from_eq; /* When all things are equal what do I return + * 0/1 - 1 no cc advance */ + uint8_t use_dccc_ecn; /* Flag to enable DCCC ECN */ uint8_t tls_needs_set; /* Flag to indicate we need to set tls 0 or 1 * means set at send 2 not */ + uint8_t last_step_state;/* Last state if steady state stepdown is on */ + uint8_t rtt_set_this_sack; /* Flag saying this sack had RTT calc + * on it */ + uint8_t last_inst_ind; /* Last saved inst indication */ }; @@ -364,6 +373,7 @@ struct sctp_nets { uint8_t RTO_measured; /* Have we done the first measure */ uint8_t last_hs_used; /* index into the last HS table entry we used */ uint8_t lan_type; + uint8_t rto_needed; uint32_t flowid; #ifdef INVARIANTS uint8_t flowidset; @@ -671,6 +681,7 @@ struct sctp_cc_functions { void (*sctp_cwnd_prepare_net_for_sack) (struct sctp_tcb *stcb, struct sctp_nets *net); int (*sctp_cwnd_socket_option) (struct sctp_tcb *stcb, int set, struct sctp_cc_option *); + void (*sctp_rtt_calculated) (struct sctp_tcb *, struct sctp_nets *, struct timeval *); }; /* Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Mar 8 11:50:59 2011 (r219396) +++ head/sys/netinet/sctp_sysctl.c Tue Mar 8 11:58:25 2011 (r219397) @@ -118,6 +118,9 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_rttvar_bw) = SCTPCTL_RTTVAR_BW_DEFAULT; SCTP_BASE_SYSCTL(sctp_rttvar_rtt) = SCTPCTL_RTTVAR_RTT_DEFAULT; SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; + SCTP_BASE_SYSCTL(sctp_steady_step) = SCTPCTL_RTTVAR_STEADYS_DEFAULT; + SCTP_BASE_SYSCTL(sctp_use_dccc_ecn) = SCTPCTL_RTTVAR_DCCCECN_DEFAULT; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 12:08:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E402F106566B; Tue, 8 Mar 2011 12:08:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D408F8FC19; Tue, 8 Mar 2011 12:08: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 p28C8NtE073396; Tue, 8 Mar 2011 12:08:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28C8NQG073394; Tue, 8 Mar 2011 12:08:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103081208.p28C8NQG073394@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Mar 2011 12:08: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: r219398 - head/tools/tools/ath/athrd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 12:08:24 -0000 Author: adrian Date: Tue Mar 8 12:08:23 2011 New Revision: 219398 URL: http://svn.freebsd.org/changeset/base/219398 Log: Update to keep in sync with the HAL Modified: head/tools/tools/ath/athrd/athrd.c Modified: head/tools/tools/ath/athrd/athrd.c ============================================================================== --- head/tools/tools/ath/athrd/athrd.c Tue Mar 8 11:58:25 2011 (r219397) +++ head/tools/tools/ath/athrd/athrd.c Tue Mar 8 12:08:23 2011 (r219398) @@ -1664,12 +1664,10 @@ ath_hal_printf(struct ath_hal *ah, const } void -HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) +DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { - if (ath_hal_debug & mask) { - __va_list ap; - va_start(ap, fmt); - ath_hal_vprintf(ah, fmt, ap); - va_end(ap); - } + __va_list ap; + va_start(ap, fmt); + ath_hal_vprintf(ah, fmt, ap); + va_end(ap); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 14:18:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F299B1065672; Tue, 8 Mar 2011 14:18:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E39828FC17; Tue, 8 Mar 2011 14:18: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 p28EILfQ076722; Tue, 8 Mar 2011 14:18:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28EILZ0076720; Tue, 8 Mar 2011 14:18:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201103081418.p28EILZ0076720@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Mar 2011 14:18: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: r219399 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 14:18:22 -0000 Author: jhb Date: Tue Mar 8 14:18:21 2011 New Revision: 219399 URL: http://svn.freebsd.org/changeset/base/219399 Log: When constructing a new cpuset, apply the parent cpuset's mask to the new set's mask rather than the root mask. This was causing the root mask to be modified incorrectly. Reviewed by: jeff MFC after: 1 week Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Tue Mar 8 12:08:23 2011 (r219398) +++ head/sys/kern/kern_cpuset.c Tue Mar 8 14:18:21 2011 (r219399) @@ -249,7 +249,7 @@ cpuset_lookup(cpusetid_t setid, struct t * will have no valid cpu based on restrictions from the parent. */ static int -_cpuset_create(struct cpuset *set, struct cpuset *parent, cpuset_t *mask, +_cpuset_create(struct cpuset *set, struct cpuset *parent, const cpuset_t *mask, cpusetid_t id) { @@ -260,7 +260,7 @@ _cpuset_create(struct cpuset *set, struc refcount_init(&set->cs_ref, 1); set->cs_flags = 0; mtx_lock_spin(&cpuset_lock); - CPU_AND(mask, &parent->cs_mask); + CPU_AND(&set->cs_mask, &parent->cs_mask); set->cs_id = id; set->cs_parent = cpuset_ref(parent); LIST_INSERT_HEAD(&parent->cs_children, set, cs_siblings); @@ -277,7 +277,7 @@ _cpuset_create(struct cpuset *set, struc * allocated. */ static int -cpuset_create(struct cpuset **setp, struct cpuset *parent, cpuset_t *mask) +cpuset_create(struct cpuset **setp, struct cpuset *parent, const cpuset_t *mask) { struct cpuset *set; cpusetid_t id; @@ -475,7 +475,7 @@ cpuset_which(cpuwhich_t which, id_t id, * the new set is a child of 'set'. */ static int -cpuset_shadow(struct cpuset *set, struct cpuset *fset, cpuset_t *mask) +cpuset_shadow(struct cpuset *set, struct cpuset *fset, const cpuset_t *mask) { struct cpuset *parent; From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 17:00:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1440E1065675; Tue, 8 Mar 2011 17:00:32 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 022888FC0C; Tue, 8 Mar 2011 17:00: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 p28H0V6L080457; Tue, 8 Mar 2011 17:00:31 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28H0V9A080455; Tue, 8 Mar 2011 17:00:31 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201103081700.p28H0V9A080455@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 8 Mar 2011 17:00: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: r219400 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 17:00:32 -0000 Author: sobomax Date: Tue Mar 8 17:00:31 2011 New Revision: 219400 URL: http://svn.freebsd.org/changeset/base/219400 Log: Some linux distros put mount point into the ext2fs labels, such as '/', or '/boot', which confuses the devfs code and can cause userland programs to fail reading /dev/ext2fs directory with weird error code, such as any program that uses pwlib. Strip any leading slashes before feeding the label to the geom_label code. Sponsored by: Sippy Software, Inc. MFC after: 1 week Modified: head/sys/geom/label/g_label_ext2fs.c Modified: head/sys/geom/label/g_label_ext2fs.c ============================================================================== --- head/sys/geom/label/g_label_ext2fs.c Tue Mar 8 14:18:21 2011 (r219399) +++ head/sys/geom/label/g_label_ext2fs.c Tue Mar 8 17:00:31 2011 (r219400) @@ -53,6 +53,7 @@ g_label_ext2fs_taste(struct g_consumer * { struct g_provider *pp; e2sb_t *fs; + char *s_volume_name; g_topology_assert_not(); pp = cp->provider; @@ -74,13 +75,18 @@ g_label_ext2fs_taste(struct g_consumer * goto exit_free; } + s_volume_name = fs->s_volume_name; + /* Terminate label */ + s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; + + if (s_volume_name[0] == '/') + s_volume_name += 1; + /* Check for volume label */ - if (fs->s_volume_name[0] == '\0') + if (s_volume_name[0] == '\0') goto exit_free; - /* Terminate label */ - fs->s_volume_name[sizeof(fs->s_volume_name) - 1] = '\0'; - strlcpy(label, fs->s_volume_name, size); + strlcpy(label, s_volume_name, size); exit_free: g_free(fs); From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 17:27:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34438106564A; Tue, 8 Mar 2011 17:27:37 +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 211E38FC19; Tue, 8 Mar 2011 17:27:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p28HRb5i081173; Tue, 8 Mar 2011 17:27:37 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28HRaVu081169; Tue, 8 Mar 2011 17:27:36 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201103081727.p28HRaVu081169@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 8 Mar 2011 17:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219401 - stable/8/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 17:27:37 -0000 Author: jh Date: Tue Mar 8 17:27:36 2011 New Revision: 219401 URL: http://svn.freebsd.org/changeset/base/219401 Log: MFC r201773: - Change the type of size_max to u_quad_t because its value is converted with vfs_scanopt(9) using the "%qu" format string. - Limit the maximum value of size_max to (SIZE_MAX - PAGE_SIZE) to prevent overflow in howmany() macro. PR: kern/141194 MFC r202187: - Fix some style bugs in tmpfs_mount(). - Remove a stale comment about tmpfs_mem_info() 'total' argument. MFC r202708: - Change the type of nodes_max to u_int and use "%u" format string to convert its value. - Set default tm_nodes_max to min(pages + 3, UINT32_MAX). It's more reasonable than the old four nodes per page (with page size 4096) because non-empty regular files always use at least one page. This fixes possible overflow in the calculation. - Don't allow more than tm_nodes_max nodes allocated in tmpfs_alloc_node(). PR: kern/138367 Modified: stable/8/sys/fs/tmpfs/tmpfs.h stable/8/sys/fs/tmpfs/tmpfs_subr.c stable/8/sys/fs/tmpfs/tmpfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs.h Tue Mar 8 17:00:31 2011 (r219400) +++ stable/8/sys/fs/tmpfs/tmpfs.h Tue Mar 8 17:27:36 2011 (r219401) @@ -476,10 +476,6 @@ int tmpfs_truncate(struct vnode *, off_t * Returns information about the number of available memory pages, * including physical and virtual ones. * - * If 'total' is TRUE, the value returned is the total amount of memory - * pages configured for the system (either in use or free). - * If it is FALSE, the value returned is the amount of free memory pages. - * * Remember to remove TMPFS_PAGES_RESERVED from the returned value to avoid * excessive memory usage. * Modified: stable/8/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_subr.c Tue Mar 8 17:00:31 2011 (r219400) +++ stable/8/sys/fs/tmpfs/tmpfs_subr.c Tue Mar 8 17:27:36 2011 (r219401) @@ -93,7 +93,7 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp MPASS(IFF(type == VLNK, target != NULL)); MPASS(IFF(type == VBLK || type == VCHR, rdev != VNOVAL)); - if (tmp->tm_nodes_inuse > tmp->tm_nodes_max) + if (tmp->tm_nodes_inuse >= tmp->tm_nodes_max) return (ENOSPC); nnode = (struct tmpfs_node *)uma_zalloc_arg( Modified: stable/8/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vfsops.c Tue Mar 8 17:00:31 2011 (r219400) +++ stable/8/sys/fs/tmpfs/tmpfs_vfsops.c Tue Mar 8 17:27:36 2011 (r219401) @@ -182,18 +182,18 @@ tmpfs_mount(struct mount *mp) struct tmpfs_mount *tmp; struct tmpfs_node *root; size_t pages, mem_size; - ino_t nodes; + uint32_t nodes; int error; /* Size counters. */ - ino_t nodes_max; - size_t size_max; + u_int nodes_max; + u_quad_t size_max; /* Root node attributes. */ - uid_t root_uid; - gid_t root_gid; - mode_t root_mode; + uid_t root_uid; + gid_t root_gid; + mode_t root_mode; - struct vattr va; + struct vattr va; if (vfs_filteropt(mp->mnt_optnew, tmpfs_opts)) return (EINVAL); @@ -223,7 +223,7 @@ tmpfs_mount(struct mount *mp) if (mp->mnt_cred->cr_ruid != 0 || vfs_scanopt(mp->mnt_optnew, "mode", "%ho", &root_mode) != 1) root_mode = va.va_mode; - if (vfs_scanopt(mp->mnt_optnew, "inodes", "%d", &nodes_max) != 1) + if (vfs_scanopt(mp->mnt_optnew, "inodes", "%u", &nodes_max) != 1) nodes_max = 0; if (vfs_scanopt(mp->mnt_optnew, "size", "%qu", &size_max) != 1) size_max = 0; @@ -239,15 +239,18 @@ tmpfs_mount(struct mount *mp) * allowed to use, based on the maximum size the user passed in * the mount structure. A value of zero is treated as if the * maximum available space was requested. */ - if (size_max < PAGE_SIZE || size_max >= SIZE_MAX) + if (size_max < PAGE_SIZE || size_max > SIZE_MAX - PAGE_SIZE) pages = SIZE_MAX; else pages = howmany(size_max, PAGE_SIZE); MPASS(pages > 0); - if (nodes_max <= 3) - nodes = 3 + pages * PAGE_SIZE / 1024; - else + if (nodes_max <= 3) { + if (pages > UINT32_MAX - 3) + nodes = UINT32_MAX; + else + nodes = pages + 3; + } else nodes = nodes_max; MPASS(nodes >= 3); From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 17:41:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D282106564A; Tue, 8 Mar 2011 17:41:07 +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 5A1A38FC24; Tue, 8 Mar 2011 17:41: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 p28Hf7Oq081632; Tue, 8 Mar 2011 17:41:07 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28Hf7vn081630; Tue, 8 Mar 2011 17:41:07 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201103081741.p28Hf7vn081630@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 8 Mar 2011 17:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219402 - stable/8/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 17:41:07 -0000 Author: jh Date: Tue Mar 8 17:41:07 2011 New Revision: 219402 URL: http://svn.freebsd.org/changeset/base/219402 Log: MFC r196526 by delphij: Add a missing .El. Modified: stable/8/share/man/man5/tmpfs.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/tmpfs.5 ============================================================================== --- stable/8/share/man/man5/tmpfs.5 Tue Mar 8 17:27:36 2011 (r219401) +++ stable/8/share/man/man5/tmpfs.5 Tue Mar 8 17:41:07 2011 (r219402) @@ -70,6 +70,7 @@ permissions in octal format. maximum number of inodes. .It Cm size maximum size (in bytes) for the file system. +.El .Sh EXAMPLES To mount a .Nm From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 17:43:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFE9F106566C; Tue, 8 Mar 2011 17:43:35 +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 BCDD98FC08; Tue, 8 Mar 2011 17:43: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 p28HhZoM081816; Tue, 8 Mar 2011 17:43:35 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28HhZAr081814; Tue, 8 Mar 2011 17:43:35 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201103081743.p28HhZAr081814@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 8 Mar 2011 17:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219403 - stable/7/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 17:43:35 -0000 Author: jh Date: Tue Mar 8 17:43:35 2011 New Revision: 219403 URL: http://svn.freebsd.org/changeset/base/219403 Log: MFC r196526 by delphij: Add a missing .El. Modified: stable/7/share/man/man5/tmpfs.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/tmpfs.5 ============================================================================== --- stable/7/share/man/man5/tmpfs.5 Tue Mar 8 17:41:07 2011 (r219402) +++ stable/7/share/man/man5/tmpfs.5 Tue Mar 8 17:43:35 2011 (r219403) @@ -70,6 +70,7 @@ permissions in octal format. maximum number of inodes. .It Cm size maximum size (in bytes) for the file system. +.El .Sh EXAMPLES To mount a .Nm From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 17:55:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFF00106566B; Tue, 8 Mar 2011 17:55:04 +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 A54538FC12; Tue, 8 Mar 2011 17:55:04 +0000 (UTC) Received: from ws64.jh.dy.fi (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 0B6CA216668; Tue, 8 Mar 2011 19:36:11 +0200 (EET) Date: Tue, 8 Mar 2011 19:36:12 +0200 From: Jaakko Heinonen To: Maxim Sobolev Message-ID: <20110308173611.GA44635@ws64.jh.dy.fi> References: <201103081700.p28H0V9A080455@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201103081700.p28H0V9A080455@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219400 - head/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 17:55:05 -0000 On 2011-03-08, Maxim Sobolev wrote: > Some linux distros put mount point into the ext2fs labels, such as '/', or > '/boot', which confuses the devfs code and can cause userland programs to > fail reading /dev/ext2fs directory with weird error code, such as any > program that uses pwlib. Do you still see such behavior after r214063? > Strip any leading slashes before feeding the label to the geom_label code. make_dev*() should strip redundant slashes since r213526. -- Jaakko From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 18:39:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C6921065706; Tue, 8 Mar 2011 18:39:42 +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 17EDC8FC0C; Tue, 8 Mar 2011 18:39: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 p28IdfOA083236; Tue, 8 Mar 2011 18:39:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28Idfoh083234; Tue, 8 Mar 2011 18:39:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201103081839.p28Idfoh083234@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 8 Mar 2011 18:39: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: r219404 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 18:39:42 -0000 Author: pjd Date: Tue Mar 8 18:39:41 2011 New Revision: 219404 URL: http://svn.freebsd.org/changeset/base/219404 Log: Correct readdir over ZFS handling. Reported by: Pierre Beyssac MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Mar 8 17:43:35 2011 (r219403) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Mar 8 18:39:41 2011 (r219404) @@ -2394,7 +2394,8 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cre * Minimum entry size is dirent size and 1 byte for a file name. */ ncooks = uio->uio_resid / (sizeof(struct dirent) - sizeof(((struct dirent *)NULL)->d_name) + 1); - *cookies = malloc(ncooks * sizeof(u_long), M_TEMP, M_WAITOK); + cooks = malloc(ncooks * sizeof(u_long), M_TEMP, M_WAITOK); + *cookies = cooks; *ncookies = ncooks; } /* @@ -2541,16 +2542,6 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cre if (prefetch) dmu_prefetch(os, objnum, 0, 0); - if (ncookies != NULL) { - if (cooks == NULL) - cooks = *cookies; - else { - *cooks++ = offset; - ncooks--; - KASSERT(ncooks >= 0, ("ncookies=%d", ncooks)); - } - } - skip_entry: /* * Move to the next entry, fill in the previous offset. @@ -2561,6 +2552,12 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cre } else { offset += 1; } + + if (cooks != NULL) { + *cooks++ = offset; + ncooks--; + KASSERT(ncooks >= 0, ("ncookies=%d", ncooks)); + } } zp->z_zn_prefetch = B_FALSE; /* a lookup will re-enable pre-fetching */ From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 18:46:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05EDE106566B; Tue, 8 Mar 2011 18:46:55 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A01828FC08; Tue, 8 Mar 2011 18:46:54 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 19B7D45CA6; Tue, 8 Mar 2011 19:46:53 +0100 (CET) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 215904569A; Tue, 8 Mar 2011 19:46:48 +0100 (CET) Date: Tue, 8 Mar 2011 19:46:46 +0100 From: Pawel Jakub Dawidek To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20110308184646.GB2312@garage.freebsd.pl> References: <201103081839.p28Idfoh083234@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oC1+HKm2/end4ao3" Content-Disposition: inline In-Reply-To: <201103081839.p28Idfoh083234@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 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: Subject: Re: svn commit: r219404 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 18:46:55 -0000 --oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 08, 2011 at 06:39:41PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Tue Mar 8 18:39:41 2011 > New Revision: 219404 > URL: http://svn.freebsd.org/changeset/base/219404 >=20 > Log: > Correct readdir over ZFS handling. s/ZFS/NFS/ --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --oC1+HKm2/end4ao3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk12eZYACgkQForvXbEpPzQwrwCeIJh0gnZp2SIFXH9e6QEqDUCR EL8AnRibGt/kc0Fuq/EYY6TfrTb98wtw =xOYv -----END PGP SIGNATURE----- --oC1+HKm2/end4ao3-- From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 19:01:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30576106564A; Tue, 8 Mar 2011 19:01:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 187A38FC17; Tue, 8 Mar 2011 19:01: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 p28J1kkI083843; Tue, 8 Mar 2011 19:01:46 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28J1jjh083821; Tue, 8 Mar 2011 19:01:45 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103081901.p28J1jjh083821@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 8 Mar 2011 19:01: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: r219405 - in head/sys: amd64/amd64 amd64/linux32 arm/arm compat/ia32 compat/linux compat/svr4 i386/i386 i386/ibcs2 i386/linux ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 19:01:46 -0000 Author: dchagin Date: Tue Mar 8 19:01:45 2011 New Revision: 219405 URL: http://svn.freebsd.org/changeset/base/219405 Log: Extend struct sysvec with new method sv_schedtail, which is used for an explicit process at fork trampoline path instead of eventhadler(schedtail) invocation for each child process. Remove eventhandler(schedtail) code and change linux ABI to use newly added sysvec method. While here replace explicit comparing of module sysentvec structure with the newly created process sysentvec to detect the linux ABI. Discussed with: kib MFC after: 2 Week Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/elf_machdep.c head/sys/compat/ia32/ia32_sysvec.c head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_emul.h head/sys/compat/svr4/svr4_sysvec.c head/sys/i386/i386/elf_machdep.c head/sys/i386/ibcs2/ibcs2_sysvec.c head/sys/i386/linux/linux_sysvec.c head/sys/ia64/ia64/elf_machdep.c head/sys/kern/imgact_aout.c head/sys/kern/init_main.c head/sys/kern/kern_fork.c head/sys/mips/mips/elf64_machdep.c head/sys/mips/mips/elf_machdep.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/sparc64/sparc64/elf_machdep.c head/sys/sys/eventhandler.h head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/amd64/amd64/elf_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -81,6 +81,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_syscallnames = syscallnames, .sv_shared_page_base = SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, + .sv_schedtail = NULL, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Mar 8 19:01:45 2011 (r219405) @@ -128,7 +128,6 @@ static void linux32_fixlimit(struct rlim static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); static eventhandler_tag linux_exit_tag; -static eventhandler_tag linux_schedtail_tag; static eventhandler_tag linux_exec_tag; /* @@ -1063,6 +1062,7 @@ struct sysentvec elf_linux_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux32_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = linux_schedtail, }; static char GNU_ABI_VENDOR[] = "GNU"; @@ -1156,8 +1156,6 @@ linux_elf_modevent(module_t mod, int typ mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, NULL, 1000); - linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail, - linux_schedtail, NULL, 1000); linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec, NULL, 1000); linux_szplatform = roundup(strlen(linux_platform) + 1, @@ -1189,7 +1187,6 @@ linux_elf_modevent(module_t mod, int typ sx_destroy(&emul_shared_lock); mtx_destroy(&futex_mtx); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); - EVENTHANDLER_DEREGISTER(schedtail, linux_schedtail_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); linux_osd_jail_deregister(); if (bootverbose) Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/arm/arm/elf_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -78,6 +78,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = NULL, /* XXXKIB */ .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/compat/ia32/ia32_sysvec.c Tue Mar 8 19:01:45 2011 (r219405) @@ -149,6 +149,7 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_syscallnames = freebsd32_syscallnames, .sv_shared_page_base = FREEBSD32_SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, + .sv_schedtail = NULL, }; INIT_SYSENTVEC(elf_ia32_sysvec, &ia32_freebsd_sysvec); Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/compat/linux/linux_emul.c Tue Mar 8 19:01:45 2011 (r219405) @@ -300,13 +300,16 @@ linux_proc_exec(void *arg __unused, stru } void -linux_schedtail(void *arg __unused, struct proc *p) +linux_schedtail(struct thread *td) { struct linux_emuldata *em; + struct proc *p; int error = 0; int *child_set_tid; - if (__predict_true(p->p_sysent != &elf_linux_sysvec)) + p = td->td_proc; + + if (SV_PROC_ABI(p) != SV_ABI_LINUX) return; /* find the emuldata */ Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/compat/linux/linux_emul.h Tue Mar 8 19:01:45 2011 (r219405) @@ -82,7 +82,7 @@ struct linux_emuldata *em_find(struct pr int linux_proc_init(struct thread *, pid_t, int); void linux_proc_exit(void *, struct proc *); -void linux_schedtail(void *, struct proc *); +void linux_schedtail(struct thread *); void linux_proc_exec(void *, struct proc *, struct image_params *); void linux_kill_threads(struct thread *, int); Modified: head/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- head/sys/compat/svr4/svr4_sysvec.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/compat/svr4/svr4_sysvec.c Tue Mar 8 19:01:45 2011 (r219405) @@ -195,6 +195,7 @@ struct sysentvec svr4_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = NULL, }; const char svr4_emul_path[] = "/compat/svr4"; Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/i386/i386/elf_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -78,6 +78,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: head/sys/i386/ibcs2/ibcs2_sysvec.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysvec.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/i386/ibcs2/ibcs2_sysvec.c Tue Mar 8 19:01:45 2011 (r219405) @@ -90,6 +90,7 @@ struct sysentvec ibcs2_svr3_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = NULL, }; static int Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/i386/linux/linux_sysvec.c Tue Mar 8 19:01:45 2011 (r219405) @@ -112,7 +112,6 @@ static int linux_szplatform; const char *linux_platform; static eventhandler_tag linux_exit_tag; -static eventhandler_tag linux_schedtail_tag; static eventhandler_tag linux_exec_tag; /* @@ -998,6 +997,7 @@ struct sysentvec linux_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = linux_schedtail, }; struct sysentvec elf_linux_sysvec = { @@ -1032,6 +1032,7 @@ struct sysentvec elf_linux_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = linux_schedtail, }; static char GNU_ABI_VENDOR[] = "GNU"; @@ -1125,8 +1126,6 @@ linux_elf_modevent(module_t mod, int typ mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, NULL, 1000); - linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail, linux_schedtail, - NULL, 1000); linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec, NULL, 1000); linux_get_machine(&linux_platform); @@ -1159,7 +1158,6 @@ linux_elf_modevent(module_t mod, int typ sx_destroy(&emul_shared_lock); mtx_destroy(&futex_mtx); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); - EVENTHANDLER_DEREGISTER(schedtail, linux_schedtail_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); linux_osd_jail_deregister(); if (bootverbose) Modified: head/sys/ia64/ia64/elf_machdep.c ============================================================================== --- head/sys/ia64/ia64/elf_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/ia64/ia64/elf_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -85,6 +85,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/kern/imgact_aout.c Tue Mar 8 19:01:45 2011 (r219405) @@ -93,6 +93,7 @@ struct sysentvec aout_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static int Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/kern/init_main.c Tue Mar 8 19:01:45 2011 (r219405) @@ -378,6 +378,7 @@ struct sysentvec null_sysvec = { .sv_set_syscall_retval = null_set_syscall_retval, .sv_fetch_syscall_args = null_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = NULL, }; /* Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/kern/kern_fork.c Tue Mar 8 19:01:45 2011 (r219405) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -895,7 +896,8 @@ fork_exit(void (*callout)(void *, struct } mtx_assert(&Giant, MA_NOTOWNED); - EVENTHANDLER_INVOKE(schedtail, p); + if (p->p_sysent->sv_schedtail != NULL) + (p->p_sysent->sv_schedtail)(td); } /* Modified: head/sys/mips/mips/elf64_machdep.c ============================================================================== --- head/sys/mips/mips/elf64_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/mips/mips/elf64_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -82,6 +82,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = NULL, /* XXXKIB */ .sv_syscallnames = NULL, + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_gnutools_info64 = { Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/mips/mips/elf_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -82,6 +82,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = NULL, /* XXXKIB */ .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { @@ -137,6 +138,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = NULL, /* XXXKIB */ .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/powerpc/powerpc/elf32_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -106,6 +106,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_shared_page_base = FREEBSD32_SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, + .sv_schedtail = NULL, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/powerpc/powerpc/elf64_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -82,6 +82,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_syscallnames = syscallnames, .sv_shared_page_base = SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, + .sv_schedtail = NULL, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/sparc64/sparc64/elf_machdep.c Tue Mar 8 19:01:45 2011 (r219405) @@ -93,6 +93,7 @@ static struct sysentvec elf64_freebsd_sy .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/sys/eventhandler.h Tue Mar 8 19:01:45 2011 (r219405) @@ -250,6 +250,4 @@ typedef void (*uma_zone_chfn)(void *); EVENTHANDLER_DECLARE(nmbclusters_change, uma_zone_chfn); EVENTHANDLER_DECLARE(maxsockets_change, uma_zone_chfn); -typedef void(*schedtail_fn)(void *, struct proc *); -EVENTHANDLER_DECLARE(schedtail, schedtail_fn); #endif /* SYS_EVENTHANDLER_H */ Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Tue Mar 8 18:39:41 2011 (r219404) +++ head/sys/sys/sysent.h Tue Mar 8 19:01:45 2011 (r219405) @@ -125,6 +125,7 @@ struct sysentvec { vm_offset_t sv_shared_page_len; vm_offset_t sv_sigcode_base; void *sv_shared_page_obj; + void (*sv_schedtail)(struct thread *); }; #define SV_ILP32 0x000100 From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 19:05:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71D71106566C; Tue, 8 Mar 2011 19:05:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E23B8FC0A; Tue, 8 Mar 2011 19:05: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 p28J5EY4083955; Tue, 8 Mar 2011 19:05:14 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28J5ENk083953; Tue, 8 Mar 2011 19:05:14 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103081905.p28J5ENk083953@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 8 Mar 2011 19:05: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: r219406 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 19:05:14 -0000 Author: dchagin Date: Tue Mar 8 19:05:14 2011 New Revision: 219406 URL: http://svn.freebsd.org/changeset/base/219406 Log: Bump __FreeBSD_version for struct sysvec (sv_schedtail) changes. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Mar 8 19:01:45 2011 (r219405) +++ head/sys/sys/param.h Tue Mar 8 19:05:14 2011 (r219406) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900033 /* Master, propagated to newvers */ +#define __FreeBSD_version 900034 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 19:49:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6A31065679; Tue, 8 Mar 2011 19:49:16 +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 76BAC8FC22; Tue, 8 Mar 2011 19:49: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 p28JnGwE085026; Tue, 8 Mar 2011 19:49:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28JnGg1085024; Tue, 8 Mar 2011 19:49:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103081949.p28JnGg1085024@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Mar 2011 19:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219407 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 19:49:16 -0000 Author: yongari Date: Tue Mar 8 19:49:16 2011 New Revision: 219407 URL: http://svn.freebsd.org/changeset/base/219407 Log: Rearrange dc_tx_underrun() a bit to correctly set TX FIFO threshold value. Controllers that always require "store and forward" mode( Davicom and PNIC 82C168) have no way to recover from TX underrun except completely reinitializing hardware. Previously only Davicom was reinitialized and the TX FIFO threshold was changed not to use "store and forward" mode after reinitialization since the default FIFO threshold value was 0. This effectively disabled Davicom controller's "store and forward" mode once it encountered TX underruns. In theory, this can cause watchodg timeouts. Intel 21143 controller requires TX MAC should be idle before changing TX FIFO threshold. So driver tried to disable TX MAC and checked whether it saw the idle state of TX MAC. Driver should perform full hardware reinitialization on failing to enter to idle state and it should not touch TX MAC again once it performed full reinitialization. While I'm here remove resetting TX FIFO threshold to 0 when interface is put into down state. If driver ever encountered TX underrun, it's likely to trigger TX underrun again whenever interface is brought to up again. Keeping old/learned TX FIFO threshold value shall reduce the chance of seeing TX underrns in next run. Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Tue Mar 8 19:05:14 2011 (r219406) +++ head/sys/dev/dc/if_dc.c Tue Mar 8 19:49:16 2011 (r219407) @@ -3142,50 +3142,57 @@ dc_tick(void *xsc) static void dc_tx_underrun(struct dc_softc *sc) { - uint32_t isr; - int i; + uint32_t netcfg, isr; + int i, reinit; - if (DC_IS_DAVICOM(sc)) { - sc->dc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - dc_init_locked(sc); - } - - if (DC_IS_INTEL(sc)) { - /* - * The real 21143 requires that the transmitter be idle - * in order to change the transmit threshold or store - * and forward state. - */ - DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); - - for (i = 0; i < DC_TIMEOUT; i++) { - isr = CSR_READ_4(sc, DC_ISR); - if (isr & DC_ISR_TX_IDLE) - break; - DELAY(10); - } - if (i == DC_TIMEOUT) { - device_printf(sc->dc_dev, - "%s: failed to force tx to idle state\n", - __func__); - sc->dc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - dc_init_locked(sc); + reinit = 0; + netcfg = CSR_READ_4(sc, DC_NETCFG); + device_printf(sc->dc_dev, "TX underrun -- "); + if ((sc->dc_flags & DC_TX_STORENFWD) == 0) { + if (sc->dc_txthresh + DC_TXTHRESH_INC > DC_TXTHRESH_MAX) { + printf("using store and forward mode\n"); + netcfg |= DC_NETCFG_STORENFWD; + } else { + printf("increasing TX threshold\n"); + sc->dc_txthresh += DC_TXTHRESH_INC; + netcfg &= ~DC_NETCFG_TX_THRESH; + netcfg |= sc->dc_txthresh; + } + + if (DC_IS_INTEL(sc)) { + /* + * The real 21143 requires that the transmitter be idle + * in order to change the transmit threshold or store + * and forward state. + */ + CSR_WRITE_4(sc, DC_NETCFG, netcfg & ~DC_NETCFG_TX_ON); + + for (i = 0; i < DC_TIMEOUT; i++) { + isr = CSR_READ_4(sc, DC_ISR); + if (isr & DC_ISR_TX_IDLE) + break; + DELAY(10); + } + if (i == DC_TIMEOUT) { + device_printf(sc->dc_dev, + "%s: failed to force tx to idle state\n", + __func__); + reinit++; + } } + } else { + printf("resetting\n"); + reinit++; } - device_printf(sc->dc_dev, "TX underrun -- "); - sc->dc_txthresh += DC_TXTHRESH_INC; - if (sc->dc_txthresh > DC_TXTHRESH_MAX) { - printf("using store and forward mode\n"); - DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_STORENFWD); + if (reinit == 0) { + CSR_WRITE_4(sc, DC_NETCFG, netcfg); + if (DC_IS_INTEL(sc)) + CSR_WRITE_4(sc, DC_NETCFG, netcfg | DC_NETCFG_TX_ON); } else { - printf("increasing TX threshold\n"); - DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_TX_THRESH); - DC_SETBIT(sc, DC_NETCFG, sc->dc_txthresh); + sc->dc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + dc_init_locked(sc); } - - if (DC_IS_INTEL(sc)) - DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); } #ifdef DEVICE_POLLING @@ -3825,7 +3832,6 @@ dc_ioctl(struct ifnet *ifp, u_long comma if (need_setfilt) dc_setfilt(sc); } else { - sc->dc_txthresh = 0; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; dc_init_locked(sc); } From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 20:13:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 205701065670; Tue, 8 Mar 2011 20:13:30 +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 0B3888FC19; Tue, 8 Mar 2011 20:13: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 p28KDTXw085576; Tue, 8 Mar 2011 20:13:29 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28KDTYb085571; Tue, 8 Mar 2011 20:13:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201103082013.p28KDTYb085571@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 8 Mar 2011 20:13: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: r219408 - head/usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 20:13:30 -0000 Author: jkim Date: Tue Mar 8 20:13:29 2011 New Revision: 219408 URL: http://svn.freebsd.org/changeset/base/219408 Log: Stop hard-coding default directory mode as 0777. Modified: head/usr.sbin/pw/cpdir.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/cpdir.c ============================================================================== --- head/usr.sbin/pw/cpdir.c Tue Mar 8 19:49:16 2011 (r219407) +++ head/usr.sbin/pw/cpdir.c Tue Mar 8 20:13:29 2011 (r219408) @@ -41,6 +41,7 @@ static const char rcsid[] = #include #include +#include "pw.h" #include "pwupd.h" void @@ -81,7 +82,7 @@ copymkdir(char const * dir, char const * else { if (S_ISDIR(st.st_mode)) { /* Recurse for this */ if (strcmp(e->d_name, ".") != 0 && strcmp(e->d_name, "..") != 0) - copymkdir(dst, src, (st.st_mode & 0777), uid, gid); + copymkdir(dst, src, st.st_mode & _DEF_DIRMODE, uid, gid); chflags(dst, st.st_flags); /* propogate flags */ } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk))) != -1) { lnk[len] = '\0'; Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Tue Mar 8 19:49:16 2011 (r219407) +++ head/usr.sbin/pw/pw.h Tue Mar 8 20:13:29 2011 (r219408) @@ -95,6 +95,7 @@ struct userconf int numgroups; /* (internal) size of default_group array */ }; +#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) #define _PATH_PW_CONF "/etc/pw.conf" #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Tue Mar 8 19:49:16 2011 (r219407) +++ head/usr.sbin/pw/pw_conf.c Tue Mar 8 20:13:29 2011 (r219408) @@ -91,7 +91,7 @@ static struct userconf config = NULL, /* Mail to send to new accounts */ "/var/log/userlog", /* Where to log changes */ "/home", /* Where to create home directory */ - 0777, /* Home directory perms, modified by umask */ + _DEF_DIRMODE, /* Home directory perms, modified by umask */ "/bin", /* Where shells are located */ system_shells, /* List of shells (first is default) */ bourne_shell, /* Default shell */ @@ -302,7 +302,7 @@ read_userconfig(char const * file) case _UC_HOMEMODE: modeset = setmode(q); config.homemode = (q == NULL || !boolean_val(q, 1)) - ? 0777 : getmode(modeset, 0777); + ? _DEF_DIRMODE : getmode(modeset, _DEF_DIRMODE); free(modeset); break; case _UC_SHELLPATH: Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Tue Mar 8 19:49:16 2011 (r219407) +++ head/usr.sbin/pw/pw_user.c Tue Mar 8 20:13:29 2011 (r219408) @@ -107,7 +107,6 @@ pw_user(struct userconf * cnf, int mode, struct stat st; char line[_PASSWORD_LEN+1]; FILE *fp; - mode_t dmode; char *dmode_c; void *set = NULL; @@ -151,13 +150,12 @@ pw_user(struct userconf * cnf, int mode, cnf->home = arg->val; } - dmode = S_IRWXU | S_IRWXG | S_IRWXO; if ((arg = getarg(args, 'M')) != NULL) { dmode_c = arg->val; if ((set = setmode(dmode_c)) == NULL) errx(EX_DATAERR, "invalid directory creation mode '%s'", dmode_c); - cnf->homemode = getmode(set, dmode); + cnf->homemode = getmode(set, _DEF_DIRMODE); free(set); } @@ -186,7 +184,7 @@ pw_user(struct userconf * cnf, int mode, if (strchr(cnf->home+1, '/') == NULL) { strcpy(dbuf, "/usr"); strncat(dbuf, cnf->home, MAXPATHLEN-5); - if (mkdir(dbuf, dmode) != -1 || errno == EEXIST) { + if (mkdir(dbuf, _DEF_DIRMODE) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); /* * Skip first "/" and create symlink: @@ -202,7 +200,7 @@ pw_user(struct userconf * cnf, int mode, while ((p = strchr(++p, '/')) != NULL) { *p = '\0'; if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, dmode) == -1) + if (mkdir(dbuf, _DEF_DIRMODE) == -1) goto direrr; chown(dbuf, 0, 0); } else if (!S_ISDIR(st.st_mode)) @@ -211,7 +209,7 @@ pw_user(struct userconf * cnf, int mode, } } if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, dmode) == -1) { + if (mkdir(dbuf, _DEF_DIRMODE) == -1) { direrr: err(EX_OSFILE, "mkdir '%s'", dbuf); } chown(dbuf, 0, 0); From owner-svn-src-all@FreeBSD.ORG Tue Mar 8 21:06:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B17F0106564A; Tue, 8 Mar 2011 21:06:17 +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 9CE5A8FC17; Tue, 8 Mar 2011 21:06: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 p28L6HuO086761; Tue, 8 Mar 2011 21:06:17 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28L6Hjw086756; Tue, 8 Mar 2011 21:06:17 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201103082106.p28L6Hjw086756@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 8 Mar 2011 21:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219409 - vendor/tzdata/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 21:06:17 -0000 Author: edwin Date: Tue Mar 8 21:06:17 2011 New Revision: 219409 URL: http://svn.freebsd.org/changeset/base/219409 Log: Vendor import of tzdata2011c - No leapsecond in June 2011 - Add and update timezones for America/Juneau, America/Sitka, America/Metlakatla - Change of Summer time to Winter time in Chili happens in April 2011, not in March 2011. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/leapseconds vendor/tzdata/dist/northamerica vendor/tzdata/dist/southamerica vendor/tzdata/dist/zone.tab Modified: vendor/tzdata/dist/leapseconds ============================================================================== --- vendor/tzdata/dist/leapseconds Tue Mar 8 20:13:29 2011 (r219408) +++ vendor/tzdata/dist/leapseconds Tue Mar 8 21:06:17 2011 (r219409) @@ -1,5 +1,5 @@ #
-# @(#)leapseconds	8.10
+# @(#)leapseconds	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -56,13 +56,13 @@ Leap	2008	Dec	31	23:59:60	+	S
 # SERVICE DE LA ROTATION TERRESTRE
 # OBSERVATOIRE DE PARIS
 # 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 26
+# Tel.      : 33 (0) 1 40 51 22 29
 # FAX       : 33 (0) 1 40 51 22 91
 # Internet  : services.iers@obspm.fr
 #
-# Paris, 14 July 2010
+# Paris, 2 February 2011
 #
-# Bulletin C 40
+# Bulletin C 41
 #
 # To authorities responsible
 # for the measurement and
@@ -70,9 +70,9 @@ Leap	2008	Dec	31	23:59:60	+	S
 #
 # INFORMATION ON UTC - TAI
 #
-# NO positive leap second will be introduced at the end of December 2010.
+# NO positive leap second will be introduced at the end of June 2011.
 # The difference between Coordinated Universal Time UTC and the
-# International Atomic Time TAI is :
+# International Atomic Time TAI is :		
 #
 # from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
 #
@@ -82,6 +82,6 @@ Leap	2008	Dec	31	23:59:60	+	S
 # will be no time step at the next possible date.
 #
 # Daniel GAMBIS
-# Director
-# Earth Orientation Center of IERS
+# Head			
+# Earth Orientation Center of the IERS
 # Observatoire de Paris, France

Modified: vendor/tzdata/dist/northamerica
==============================================================================
--- vendor/tzdata/dist/northamerica	Tue Mar  8 20:13:29 2011	(r219408)
+++ vendor/tzdata/dist/northamerica	Tue Mar  8 21:06:17 2011	(r219409)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.40
+# @(#)northamerica	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -426,15 +426,74 @@ Zone America/Los_Angeles -7:52:58 -	LMT	
 # were nearby inhabitants in some cases and for our purposes perhaps
 # it's best to simply use the official transition.
 #
+
+# From Steve Ferguson (2011-01-31):
+# The author lives in Alaska and many of the references listed are only
+# available to Alaskan residents.
+#
+# 
+# http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98
+# 
+
+# From Arthur David Olson (2011-02-01):
+# Here's database-relevant material from the 2001 "Alaska History" article:
+#
+# On September 20 [1979]...DOT...officials decreed that on April 27,
+# 1980, Juneau and other nearby communities would move to Yukon Time.
+# Sitka, Petersburg, Wrangell, and Ketchikan, however, would remain on
+# Pacific Time.
+#
+# ...on September 22, 1980, DOT Secretary Neil E. Goldschmidt rescinded the
+# Department's September 1979 decision. Juneau and other communities in
+# northern Southeast reverted to Pacific Time on October 26.
+#
+# On October 28 [1983]...the Metlakatla Indian Community Council voted
+# unanimously to keep the reservation on Pacific Time.
+#
+# According to DOT official Joanne Petrie, Indian reservations are not
+# bound to follow time zones imposed by neighboring jurisdictions.
+#
+# (The last is consistent with how the database now handles the Navajo
+# Nation.)
+
+# From Arthur David Olson (2011-02-09):
+# I just spoke by phone with a staff member at the Metlakatla Indian
+# Community office (using contact information available at
+# 
+# http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla
+# ).
+# It's shortly after 1:00 here on the east coast of the United States;
+# the staffer said it was shortly after 10:00 there. When I asked whether
+# that meant they were on Pacific time, they said no--they were on their
+# own time. I asked about daylight saving; they said it wasn't used. I
+# did not inquire about practices in the past.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
 			 -8:57:41 -	LMT	1900 Aug 20 12:00
 			 -8:00	-	PST	1942
 			 -8:00	US	P%sT	1946
 			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1980 Apr 27 2:00
+			 -9:00	US	Y%sT	1980 Oct 26 2:00	
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Sitka	 -14:58:47 -	LMT	1867 Oct 18
+			 -9:01:13 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
 			 -8:00	US	P%sT	1983 Oct 30 2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
+Zone America/Metlakatla	 15:13:42 -	LMT	1867 Oct 18
+			 -8:46:18 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -8:00	US	MeST
 Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
 			 -9:18:55 -	LMT	1900 Aug 20 12:00
 			 -9:00	-	YST	1942

Modified: vendor/tzdata/dist/southamerica
==============================================================================
--- vendor/tzdata/dist/southamerica	Tue Mar  8 20:13:29 2011	(r219408)
+++ vendor/tzdata/dist/southamerica	Tue Mar  8 21:06:17 2011	(r219409)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.44
+# @(#)southamerica	8.45
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1154,6 +1154,23 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur Daivd Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
+# From Glenn Eychaner (2011-03-02): [geychaner@mac.com]
+# It appears that the Chilean government has decided to postpone the
+# change from summer time to winter time again, by three weeks to April
+# 2nd:
+# 
+# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
+# 
+#
+# This is not yet reflected in the offical "cambio de hora" site, but
+# probably will be soon:
+# 
+# http://www.horaoficial.cl/cambio.htm
+# 
+
+# From Arthur David Olson (2011-03-02):
+# The emol.com article mentions a water shortage as the cause of the
+# postponement, which may mean that it's not a permanent change.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1189,8 +1206,8 @@ Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	2011	max	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: vendor/tzdata/dist/zone.tab
==============================================================================
--- vendor/tzdata/dist/zone.tab	Tue Mar  8 20:13:29 2011	(r219408)
+++ vendor/tzdata/dist/zone.tab	Tue Mar  8 21:06:17 2011	(r219409)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.40
+# @(#)zone.tab	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -412,9 +412,11 @@ US	+332654-1120424	America/Phoenix	Mount
 US	+340308-1181434	America/Los_Angeles	Pacific Time
 US	+611305-1495401	America/Anchorage	Alaska Time
 US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
+US	+571035-1351807	America/Sitka	Alaska Time - southeast Alaska panhandle
 US	+593249-1394338	America/Yakutat	Alaska Time - Alaska panhandle neck
 US	+643004-1652423	America/Nome	Alaska Time - west Alaska
 US	+515248-1763929	America/Adak	Aleutian Islands
+US	+550737-1313435	America/Metlakatla	Metlakatla Time - Annette Island
 US	+211825-1575130	Pacific/Honolulu	Hawaii
 UY	-3453-05611	America/Montevideo
 UZ	+3940+06648	Asia/Samarkand	west Uzbekistan

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 21:07:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 01903106566C;
	Tue,  8 Mar 2011 21:07:54 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C95AE8FC1F;
	Tue,  8 Mar 2011 21:07: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 p28L7r3K086840;
	Tue, 8 Mar 2011 21:07:53 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28L7rFC086839;
	Tue, 8 Mar 2011 21:07:53 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103082107.p28L7rFC086839@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 8 Mar 2011 21:07:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219410 - vendor/tzdata/tzdata2011c
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 21:07:54 -0000

Author: edwin
Date: Tue Mar  8 21:07:53 2011
New Revision: 219410
URL: http://svn.freebsd.org/changeset/base/219410

Log:
  Tag of tzdata2011c

Added:
  vendor/tzdata/tzdata2011c/
     - copied from r219409, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 21:11:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7191A106564A;
	Tue,  8 Mar 2011 21:11:31 +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 5D49B8FC17;
	Tue,  8 Mar 2011 21:11:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p28LBVlx086979;
	Tue, 8 Mar 2011 21:11:31 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28LBV5H086974;
	Tue, 8 Mar 2011 21:11:31 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103082111.p28LBV5H086974@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 8 Mar 2011 21:11: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: r219411 - head/contrib/tzdata
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 21:11:31 -0000

Author: edwin
Date: Tue Mar  8 21:11:31 2011
New Revision: 219411
URL: http://svn.freebsd.org/changeset/base/219411

Log:
  MFV of tzdata2011c, r219409
  
  - No leapsecond in June 2011
  - Add and update timezones for America/Juneau, America/Sitka,
    America/Metlakatla
  - Change of Summer time to Winter time in Chili happens in April
    2011, not in March 2011.

Modified:
  head/contrib/tzdata/leapseconds
  head/contrib/tzdata/northamerica
  head/contrib/tzdata/southamerica
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/leapseconds
==============================================================================
--- head/contrib/tzdata/leapseconds	Tue Mar  8 21:07:53 2011	(r219410)
+++ head/contrib/tzdata/leapseconds	Tue Mar  8 21:11:31 2011	(r219411)
@@ -1,5 +1,5 @@
 # 
-# @(#)leapseconds	8.10
+# @(#)leapseconds	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -56,13 +56,13 @@ Leap	2008	Dec	31	23:59:60	+	S
 # SERVICE DE LA ROTATION TERRESTRE
 # OBSERVATOIRE DE PARIS
 # 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 26
+# Tel.      : 33 (0) 1 40 51 22 29
 # FAX       : 33 (0) 1 40 51 22 91
 # Internet  : services.iers@obspm.fr
 #
-# Paris, 14 July 2010
+# Paris, 2 February 2011
 #
-# Bulletin C 40
+# Bulletin C 41
 #
 # To authorities responsible
 # for the measurement and
@@ -70,9 +70,9 @@ Leap	2008	Dec	31	23:59:60	+	S
 #
 # INFORMATION ON UTC - TAI
 #
-# NO positive leap second will be introduced at the end of December 2010.
+# NO positive leap second will be introduced at the end of June 2011.
 # The difference between Coordinated Universal Time UTC and the
-# International Atomic Time TAI is :
+# International Atomic Time TAI is :		
 #
 # from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
 #
@@ -82,6 +82,6 @@ Leap	2008	Dec	31	23:59:60	+	S
 # will be no time step at the next possible date.
 #
 # Daniel GAMBIS
-# Director
-# Earth Orientation Center of IERS
+# Head			
+# Earth Orientation Center of the IERS
 # Observatoire de Paris, France

Modified: head/contrib/tzdata/northamerica
==============================================================================
--- head/contrib/tzdata/northamerica	Tue Mar  8 21:07:53 2011	(r219410)
+++ head/contrib/tzdata/northamerica	Tue Mar  8 21:11:31 2011	(r219411)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.40
+# @(#)northamerica	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -426,15 +426,74 @@ Zone America/Los_Angeles -7:52:58 -	LMT	
 # were nearby inhabitants in some cases and for our purposes perhaps
 # it's best to simply use the official transition.
 #
+
+# From Steve Ferguson (2011-01-31):
+# The author lives in Alaska and many of the references listed are only
+# available to Alaskan residents.
+#
+# 
+# http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98
+# 
+
+# From Arthur David Olson (2011-02-01):
+# Here's database-relevant material from the 2001 "Alaska History" article:
+#
+# On September 20 [1979]...DOT...officials decreed that on April 27,
+# 1980, Juneau and other nearby communities would move to Yukon Time.
+# Sitka, Petersburg, Wrangell, and Ketchikan, however, would remain on
+# Pacific Time.
+#
+# ...on September 22, 1980, DOT Secretary Neil E. Goldschmidt rescinded the
+# Department's September 1979 decision. Juneau and other communities in
+# northern Southeast reverted to Pacific Time on October 26.
+#
+# On October 28 [1983]...the Metlakatla Indian Community Council voted
+# unanimously to keep the reservation on Pacific Time.
+#
+# According to DOT official Joanne Petrie, Indian reservations are not
+# bound to follow time zones imposed by neighboring jurisdictions.
+#
+# (The last is consistent with how the database now handles the Navajo
+# Nation.)
+
+# From Arthur David Olson (2011-02-09):
+# I just spoke by phone with a staff member at the Metlakatla Indian
+# Community office (using contact information available at
+# 
+# http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla
+# ).
+# It's shortly after 1:00 here on the east coast of the United States;
+# the staffer said it was shortly after 10:00 there. When I asked whether
+# that meant they were on Pacific time, they said no--they were on their
+# own time. I asked about daylight saving; they said it wasn't used. I
+# did not inquire about practices in the past.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
 			 -8:57:41 -	LMT	1900 Aug 20 12:00
 			 -8:00	-	PST	1942
 			 -8:00	US	P%sT	1946
 			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1980 Apr 27 2:00
+			 -9:00	US	Y%sT	1980 Oct 26 2:00	
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Sitka	 -14:58:47 -	LMT	1867 Oct 18
+			 -9:01:13 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
 			 -8:00	US	P%sT	1983 Oct 30 2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
+Zone America/Metlakatla	 15:13:42 -	LMT	1867 Oct 18
+			 -8:46:18 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -8:00	US	MeST
 Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
 			 -9:18:55 -	LMT	1900 Aug 20 12:00
 			 -9:00	-	YST	1942

Modified: head/contrib/tzdata/southamerica
==============================================================================
--- head/contrib/tzdata/southamerica	Tue Mar  8 21:07:53 2011	(r219410)
+++ head/contrib/tzdata/southamerica	Tue Mar  8 21:11:31 2011	(r219411)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.44
+# @(#)southamerica	8.45
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1154,6 +1154,23 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur Daivd Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
+# From Glenn Eychaner (2011-03-02): [geychaner@mac.com]
+# It appears that the Chilean government has decided to postpone the
+# change from summer time to winter time again, by three weeks to April
+# 2nd:
+# 
+# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
+# 
+#
+# This is not yet reflected in the offical "cambio de hora" site, but
+# probably will be soon:
+# 
+# http://www.horaoficial.cl/cambio.htm
+# 
+
+# From Arthur David Olson (2011-03-02):
+# The emol.com article mentions a water shortage as the cause of the
+# postponement, which may mean that it's not a permanent change.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1189,8 +1206,8 @@ Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	2011	max	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Tue Mar  8 21:07:53 2011	(r219410)
+++ head/contrib/tzdata/zone.tab	Tue Mar  8 21:11:31 2011	(r219411)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.40
+# @(#)zone.tab	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -412,9 +412,11 @@ US	+332654-1120424	America/Phoenix	Mount
 US	+340308-1181434	America/Los_Angeles	Pacific Time
 US	+611305-1495401	America/Anchorage	Alaska Time
 US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
+US	+571035-1351807	America/Sitka	Alaska Time - southeast Alaska panhandle
 US	+593249-1394338	America/Yakutat	Alaska Time - Alaska panhandle neck
 US	+643004-1652423	America/Nome	Alaska Time - west Alaska
 US	+515248-1763929	America/Adak	Aleutian Islands
+US	+550737-1313435	America/Metlakatla	Metlakatla Time - Annette Island
 US	+211825-1575130	Pacific/Honolulu	Hawaii
 UY	-3453-05611	America/Montevideo
 UZ	+3940+06648	Asia/Samarkand	west Uzbekistan

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 21:14:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA7FA106566C;
	Tue,  8 Mar 2011 21:14:02 +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 B57E48FC1A;
	Tue,  8 Mar 2011 21:14: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 p28LE2RT087118;
	Tue, 8 Mar 2011 21:14:02 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28LE2Jv087113;
	Tue, 8 Mar 2011 21:14:02 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103082114.p28LE2Jv087113@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 8 Mar 2011 21:14:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219412 - stable/8/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 21:14:02 -0000

Author: edwin
Date: Tue Mar  8 21:14:02 2011
New Revision: 219412
URL: http://svn.freebsd.org/changeset/base/219412

Log:
  MFC of tzdata2011c, r219411
  
  - No leapsecond in June 2011
  - Add and update timezones for America/Juneau, America/Sitka,
    America/Metlakatla
  - Change of Summer time to Winter time in Chili happens in April
    2011, not in March 2011.

Modified:
  stable/8/share/zoneinfo/leapseconds
  stable/8/share/zoneinfo/northamerica
  stable/8/share/zoneinfo/southamerica
  stable/8/share/zoneinfo/zone.tab
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/leapseconds
==============================================================================
--- stable/8/share/zoneinfo/leapseconds	Tue Mar  8 21:11:31 2011	(r219411)
+++ stable/8/share/zoneinfo/leapseconds	Tue Mar  8 21:14:02 2011	(r219412)
@@ -1,5 +1,5 @@
 # 
-# @(#)leapseconds	8.10
+# @(#)leapseconds	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -56,13 +56,13 @@ Leap	2008	Dec	31	23:59:60	+	S
 # SERVICE DE LA ROTATION TERRESTRE
 # OBSERVATOIRE DE PARIS
 # 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 26
+# Tel.      : 33 (0) 1 40 51 22 29
 # FAX       : 33 (0) 1 40 51 22 91
 # Internet  : services.iers@obspm.fr
 #
-# Paris, 14 July 2010
+# Paris, 2 February 2011
 #
-# Bulletin C 40
+# Bulletin C 41
 #
 # To authorities responsible
 # for the measurement and
@@ -70,9 +70,9 @@ Leap	2008	Dec	31	23:59:60	+	S
 #
 # INFORMATION ON UTC - TAI
 #
-# NO positive leap second will be introduced at the end of December 2010.
+# NO positive leap second will be introduced at the end of June 2011.
 # The difference between Coordinated Universal Time UTC and the
-# International Atomic Time TAI is :
+# International Atomic Time TAI is :		
 #
 # from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
 #
@@ -82,6 +82,6 @@ Leap	2008	Dec	31	23:59:60	+	S
 # will be no time step at the next possible date.
 #
 # Daniel GAMBIS
-# Director
-# Earth Orientation Center of IERS
+# Head			
+# Earth Orientation Center of the IERS
 # Observatoire de Paris, France

Modified: stable/8/share/zoneinfo/northamerica
==============================================================================
--- stable/8/share/zoneinfo/northamerica	Tue Mar  8 21:11:31 2011	(r219411)
+++ stable/8/share/zoneinfo/northamerica	Tue Mar  8 21:14:02 2011	(r219412)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.40
+# @(#)northamerica	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -426,15 +426,74 @@ Zone America/Los_Angeles -7:52:58 -	LMT	
 # were nearby inhabitants in some cases and for our purposes perhaps
 # it's best to simply use the official transition.
 #
+
+# From Steve Ferguson (2011-01-31):
+# The author lives in Alaska and many of the references listed are only
+# available to Alaskan residents.
+#
+# 
+# http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98
+# 
+
+# From Arthur David Olson (2011-02-01):
+# Here's database-relevant material from the 2001 "Alaska History" article:
+#
+# On September 20 [1979]...DOT...officials decreed that on April 27,
+# 1980, Juneau and other nearby communities would move to Yukon Time.
+# Sitka, Petersburg, Wrangell, and Ketchikan, however, would remain on
+# Pacific Time.
+#
+# ...on September 22, 1980, DOT Secretary Neil E. Goldschmidt rescinded the
+# Department's September 1979 decision. Juneau and other communities in
+# northern Southeast reverted to Pacific Time on October 26.
+#
+# On October 28 [1983]...the Metlakatla Indian Community Council voted
+# unanimously to keep the reservation on Pacific Time.
+#
+# According to DOT official Joanne Petrie, Indian reservations are not
+# bound to follow time zones imposed by neighboring jurisdictions.
+#
+# (The last is consistent with how the database now handles the Navajo
+# Nation.)
+
+# From Arthur David Olson (2011-02-09):
+# I just spoke by phone with a staff member at the Metlakatla Indian
+# Community office (using contact information available at
+# 
+# http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla
+# ).
+# It's shortly after 1:00 here on the east coast of the United States;
+# the staffer said it was shortly after 10:00 there. When I asked whether
+# that meant they were on Pacific time, they said no--they were on their
+# own time. I asked about daylight saving; they said it wasn't used. I
+# did not inquire about practices in the past.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
 			 -8:57:41 -	LMT	1900 Aug 20 12:00
 			 -8:00	-	PST	1942
 			 -8:00	US	P%sT	1946
 			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1980 Apr 27 2:00
+			 -9:00	US	Y%sT	1980 Oct 26 2:00	
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Sitka	 -14:58:47 -	LMT	1867 Oct 18
+			 -9:01:13 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
 			 -8:00	US	P%sT	1983 Oct 30 2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
+Zone America/Metlakatla	 15:13:42 -	LMT	1867 Oct 18
+			 -8:46:18 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -8:00	US	MeST
 Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
 			 -9:18:55 -	LMT	1900 Aug 20 12:00
 			 -9:00	-	YST	1942

Modified: stable/8/share/zoneinfo/southamerica
==============================================================================
--- stable/8/share/zoneinfo/southamerica	Tue Mar  8 21:11:31 2011	(r219411)
+++ stable/8/share/zoneinfo/southamerica	Tue Mar  8 21:14:02 2011	(r219412)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.44
+# @(#)southamerica	8.45
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1154,6 +1154,23 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur Daivd Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
+# From Glenn Eychaner (2011-03-02): [geychaner@mac.com]
+# It appears that the Chilean government has decided to postpone the
+# change from summer time to winter time again, by three weeks to April
+# 2nd:
+# 
+# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
+# 
+#
+# This is not yet reflected in the offical "cambio de hora" site, but
+# probably will be soon:
+# 
+# http://www.horaoficial.cl/cambio.htm
+# 
+
+# From Arthur David Olson (2011-03-02):
+# The emol.com article mentions a water shortage as the cause of the
+# postponement, which may mean that it's not a permanent change.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1189,8 +1206,8 @@ Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	2011	max	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Tue Mar  8 21:11:31 2011	(r219411)
+++ stable/8/share/zoneinfo/zone.tab	Tue Mar  8 21:14:02 2011	(r219412)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.40
+# @(#)zone.tab	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -412,9 +412,11 @@ US	+332654-1120424	America/Phoenix	Mount
 US	+340308-1181434	America/Los_Angeles	Pacific Time
 US	+611305-1495401	America/Anchorage	Alaska Time
 US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
+US	+571035-1351807	America/Sitka	Alaska Time - southeast Alaska panhandle
 US	+593249-1394338	America/Yakutat	Alaska Time - Alaska panhandle neck
 US	+643004-1652423	America/Nome	Alaska Time - west Alaska
 US	+515248-1763929	America/Adak	Aleutian Islands
+US	+550737-1313435	America/Metlakatla	Metlakatla Time - Annette Island
 US	+211825-1575130	Pacific/Honolulu	Hawaii
 UY	-3453-05611	America/Montevideo
 UZ	+3940+06648	Asia/Samarkand	west Uzbekistan

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 21:14:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6111410656A4;
	Tue,  8 Mar 2011 21:14:15 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4C38D8FC16;
	Tue,  8 Mar 2011 21:14: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 p28LEFgC087164;
	Tue, 8 Mar 2011 21:14:15 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28LEFme087159;
	Tue, 8 Mar 2011 21:14:15 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103082114.p28LEFme087159@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 8 Mar 2011 21:14:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219413 - stable/7/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 21:14:15 -0000

Author: edwin
Date: Tue Mar  8 21:14:14 2011
New Revision: 219413
URL: http://svn.freebsd.org/changeset/base/219413

Log:
  MFC of tzdata2011c, r219411
  
  - No leapsecond in June 2011
  - Add and update timezones for America/Juneau, America/Sitka,
    America/Metlakatla
  - Change of Summer time to Winter time in Chili happens in April
    2011, not in March 2011.

Modified:
  stable/7/share/zoneinfo/leapseconds
  stable/7/share/zoneinfo/northamerica
  stable/7/share/zoneinfo/southamerica
  stable/7/share/zoneinfo/zone.tab
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/leapseconds
==============================================================================
--- stable/7/share/zoneinfo/leapseconds	Tue Mar  8 21:14:02 2011	(r219412)
+++ stable/7/share/zoneinfo/leapseconds	Tue Mar  8 21:14:14 2011	(r219413)
@@ -1,5 +1,5 @@
 # 
-# @(#)leapseconds	8.10
+# @(#)leapseconds	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -56,13 +56,13 @@ Leap	2008	Dec	31	23:59:60	+	S
 # SERVICE DE LA ROTATION TERRESTRE
 # OBSERVATOIRE DE PARIS
 # 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 26
+# Tel.      : 33 (0) 1 40 51 22 29
 # FAX       : 33 (0) 1 40 51 22 91
 # Internet  : services.iers@obspm.fr
 #
-# Paris, 14 July 2010
+# Paris, 2 February 2011
 #
-# Bulletin C 40
+# Bulletin C 41
 #
 # To authorities responsible
 # for the measurement and
@@ -70,9 +70,9 @@ Leap	2008	Dec	31	23:59:60	+	S
 #
 # INFORMATION ON UTC - TAI
 #
-# NO positive leap second will be introduced at the end of December 2010.
+# NO positive leap second will be introduced at the end of June 2011.
 # The difference between Coordinated Universal Time UTC and the
-# International Atomic Time TAI is :
+# International Atomic Time TAI is :		
 #
 # from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
 #
@@ -82,6 +82,6 @@ Leap	2008	Dec	31	23:59:60	+	S
 # will be no time step at the next possible date.
 #
 # Daniel GAMBIS
-# Director
-# Earth Orientation Center of IERS
+# Head			
+# Earth Orientation Center of the IERS
 # Observatoire de Paris, France

Modified: stable/7/share/zoneinfo/northamerica
==============================================================================
--- stable/7/share/zoneinfo/northamerica	Tue Mar  8 21:14:02 2011	(r219412)
+++ stable/7/share/zoneinfo/northamerica	Tue Mar  8 21:14:14 2011	(r219413)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.40
+# @(#)northamerica	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -426,15 +426,74 @@ Zone America/Los_Angeles -7:52:58 -	LMT	
 # were nearby inhabitants in some cases and for our purposes perhaps
 # it's best to simply use the official transition.
 #
+
+# From Steve Ferguson (2011-01-31):
+# The author lives in Alaska and many of the references listed are only
+# available to Alaskan residents.
+#
+# 
+# http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98
+# 
+
+# From Arthur David Olson (2011-02-01):
+# Here's database-relevant material from the 2001 "Alaska History" article:
+#
+# On September 20 [1979]...DOT...officials decreed that on April 27,
+# 1980, Juneau and other nearby communities would move to Yukon Time.
+# Sitka, Petersburg, Wrangell, and Ketchikan, however, would remain on
+# Pacific Time.
+#
+# ...on September 22, 1980, DOT Secretary Neil E. Goldschmidt rescinded the
+# Department's September 1979 decision. Juneau and other communities in
+# northern Southeast reverted to Pacific Time on October 26.
+#
+# On October 28 [1983]...the Metlakatla Indian Community Council voted
+# unanimously to keep the reservation on Pacific Time.
+#
+# According to DOT official Joanne Petrie, Indian reservations are not
+# bound to follow time zones imposed by neighboring jurisdictions.
+#
+# (The last is consistent with how the database now handles the Navajo
+# Nation.)
+
+# From Arthur David Olson (2011-02-09):
+# I just spoke by phone with a staff member at the Metlakatla Indian
+# Community office (using contact information available at
+# 
+# http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla
+# ).
+# It's shortly after 1:00 here on the east coast of the United States;
+# the staffer said it was shortly after 10:00 there. When I asked whether
+# that meant they were on Pacific time, they said no--they were on their
+# own time. I asked about daylight saving; they said it wasn't used. I
+# did not inquire about practices in the past.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
 			 -8:57:41 -	LMT	1900 Aug 20 12:00
 			 -8:00	-	PST	1942
 			 -8:00	US	P%sT	1946
 			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1980 Apr 27 2:00
+			 -9:00	US	Y%sT	1980 Oct 26 2:00	
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Sitka	 -14:58:47 -	LMT	1867 Oct 18
+			 -9:01:13 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
 			 -8:00	US	P%sT	1983 Oct 30 2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
+Zone America/Metlakatla	 15:13:42 -	LMT	1867 Oct 18
+			 -8:46:18 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -8:00	US	MeST
 Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
 			 -9:18:55 -	LMT	1900 Aug 20 12:00
 			 -9:00	-	YST	1942

Modified: stable/7/share/zoneinfo/southamerica
==============================================================================
--- stable/7/share/zoneinfo/southamerica	Tue Mar  8 21:14:02 2011	(r219412)
+++ stable/7/share/zoneinfo/southamerica	Tue Mar  8 21:14:14 2011	(r219413)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.44
+# @(#)southamerica	8.45
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1154,6 +1154,23 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur Daivd Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
+# From Glenn Eychaner (2011-03-02): [geychaner@mac.com]
+# It appears that the Chilean government has decided to postpone the
+# change from summer time to winter time again, by three weeks to April
+# 2nd:
+# 
+# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
+# 
+#
+# This is not yet reflected in the offical "cambio de hora" site, but
+# probably will be soon:
+# 
+# http://www.horaoficial.cl/cambio.htm
+# 
+
+# From Arthur David Olson (2011-03-02):
+# The emol.com article mentions a water shortage as the cause of the
+# postponement, which may mean that it's not a permanent change.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1189,8 +1206,8 @@ Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	2011	max	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Tue Mar  8 21:14:02 2011	(r219412)
+++ stable/7/share/zoneinfo/zone.tab	Tue Mar  8 21:14:14 2011	(r219413)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.40
+# @(#)zone.tab	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -412,9 +412,11 @@ US	+332654-1120424	America/Phoenix	Mount
 US	+340308-1181434	America/Los_Angeles	Pacific Time
 US	+611305-1495401	America/Anchorage	Alaska Time
 US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
+US	+571035-1351807	America/Sitka	Alaska Time - southeast Alaska panhandle
 US	+593249-1394338	America/Yakutat	Alaska Time - Alaska panhandle neck
 US	+643004-1652423	America/Nome	Alaska Time - west Alaska
 US	+515248-1763929	America/Adak	Aleutian Islands
+US	+550737-1313435	America/Metlakatla	Metlakatla Time - Annette Island
 US	+211825-1575130	Pacific/Honolulu	Hawaii
 UY	-3453-05611	America/Montevideo
 UZ	+3940+06648	Asia/Samarkand	west Uzbekistan

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 21:14:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5BEF21065677;
	Tue,  8 Mar 2011 21:14:19 +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 4727A8FC08;
	Tue,  8 Mar 2011 21: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 p28LEJw4087205;
	Tue, 8 Mar 2011 21:14:19 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28LEJRp087200;
	Tue, 8 Mar 2011 21:14:19 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103082114.p28LEJRp087200@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 8 Mar 2011 21:14:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219414 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 21:14:19 -0000

Author: edwin
Date: Tue Mar  8 21:14:18 2011
New Revision: 219414
URL: http://svn.freebsd.org/changeset/base/219414

Log:
  MFC of tzdata2011c, r219411
  
  - No leapsecond in June 2011
  - Add and update timezones for America/Juneau, America/Sitka,
    America/Metlakatla
  - Change of Summer time to Winter time in Chili happens in April
    2011, not in March 2011.

Modified:
  stable/6/share/zoneinfo/leapseconds
  stable/6/share/zoneinfo/northamerica
  stable/6/share/zoneinfo/southamerica
  stable/6/share/zoneinfo/zone.tab
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/leapseconds
==============================================================================
--- stable/6/share/zoneinfo/leapseconds	Tue Mar  8 21:14:14 2011	(r219413)
+++ stable/6/share/zoneinfo/leapseconds	Tue Mar  8 21:14:18 2011	(r219414)
@@ -1,5 +1,5 @@
 # 
-# @(#)leapseconds	8.10
+# @(#)leapseconds	8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -56,13 +56,13 @@ Leap	2008	Dec	31	23:59:60	+	S
 # SERVICE DE LA ROTATION TERRESTRE
 # OBSERVATOIRE DE PARIS
 # 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 26
+# Tel.      : 33 (0) 1 40 51 22 29
 # FAX       : 33 (0) 1 40 51 22 91
 # Internet  : services.iers@obspm.fr
 #
-# Paris, 14 July 2010
+# Paris, 2 February 2011
 #
-# Bulletin C 40
+# Bulletin C 41
 #
 # To authorities responsible
 # for the measurement and
@@ -70,9 +70,9 @@ Leap	2008	Dec	31	23:59:60	+	S
 #
 # INFORMATION ON UTC - TAI
 #
-# NO positive leap second will be introduced at the end of December 2010.
+# NO positive leap second will be introduced at the end of June 2011.
 # The difference between Coordinated Universal Time UTC and the
-# International Atomic Time TAI is :
+# International Atomic Time TAI is :		
 #
 # from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
 #
@@ -82,6 +82,6 @@ Leap	2008	Dec	31	23:59:60	+	S
 # will be no time step at the next possible date.
 #
 # Daniel GAMBIS
-# Director
-# Earth Orientation Center of IERS
+# Head			
+# Earth Orientation Center of the IERS
 # Observatoire de Paris, France

Modified: stable/6/share/zoneinfo/northamerica
==============================================================================
--- stable/6/share/zoneinfo/northamerica	Tue Mar  8 21:14:14 2011	(r219413)
+++ stable/6/share/zoneinfo/northamerica	Tue Mar  8 21:14:18 2011	(r219414)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.40
+# @(#)northamerica	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -426,15 +426,74 @@ Zone America/Los_Angeles -7:52:58 -	LMT	
 # were nearby inhabitants in some cases and for our purposes perhaps
 # it's best to simply use the official transition.
 #
+
+# From Steve Ferguson (2011-01-31):
+# The author lives in Alaska and many of the references listed are only
+# available to Alaskan residents.
+#
+# 
+# http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98
+# 
+
+# From Arthur David Olson (2011-02-01):
+# Here's database-relevant material from the 2001 "Alaska History" article:
+#
+# On September 20 [1979]...DOT...officials decreed that on April 27,
+# 1980, Juneau and other nearby communities would move to Yukon Time.
+# Sitka, Petersburg, Wrangell, and Ketchikan, however, would remain on
+# Pacific Time.
+#
+# ...on September 22, 1980, DOT Secretary Neil E. Goldschmidt rescinded the
+# Department's September 1979 decision. Juneau and other communities in
+# northern Southeast reverted to Pacific Time on October 26.
+#
+# On October 28 [1983]...the Metlakatla Indian Community Council voted
+# unanimously to keep the reservation on Pacific Time.
+#
+# According to DOT official Joanne Petrie, Indian reservations are not
+# bound to follow time zones imposed by neighboring jurisdictions.
+#
+# (The last is consistent with how the database now handles the Navajo
+# Nation.)
+
+# From Arthur David Olson (2011-02-09):
+# I just spoke by phone with a staff member at the Metlakatla Indian
+# Community office (using contact information available at
+# 
+# http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla
+# ).
+# It's shortly after 1:00 here on the east coast of the United States;
+# the staffer said it was shortly after 10:00 there. When I asked whether
+# that meant they were on Pacific time, they said no--they were on their
+# own time. I asked about daylight saving; they said it wasn't used. I
+# did not inquire about practices in the past.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
 			 -8:57:41 -	LMT	1900 Aug 20 12:00
 			 -8:00	-	PST	1942
 			 -8:00	US	P%sT	1946
 			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1980 Apr 27 2:00
+			 -9:00	US	Y%sT	1980 Oct 26 2:00	
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Sitka	 -14:58:47 -	LMT	1867 Oct 18
+			 -9:01:13 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
 			 -8:00	US	P%sT	1983 Oct 30 2:00
 			 -9:00	US	Y%sT	1983 Nov 30
 			 -9:00	US	AK%sT
+Zone America/Metlakatla	 15:13:42 -	LMT	1867 Oct 18
+			 -8:46:18 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -8:00	US	MeST
 Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
 			 -9:18:55 -	LMT	1900 Aug 20 12:00
 			 -9:00	-	YST	1942

Modified: stable/6/share/zoneinfo/southamerica
==============================================================================
--- stable/6/share/zoneinfo/southamerica	Tue Mar  8 21:14:14 2011	(r219413)
+++ stable/6/share/zoneinfo/southamerica	Tue Mar  8 21:14:18 2011	(r219414)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.44
+# @(#)southamerica	8.45
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1154,6 +1154,23 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # From Arthur Daivd Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
+# From Glenn Eychaner (2011-03-02): [geychaner@mac.com]
+# It appears that the Chilean government has decided to postpone the
+# change from summer time to winter time again, by three weeks to April
+# 2nd:
+# 
+# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
+# 
+#
+# This is not yet reflected in the offical "cambio de hora" site, but
+# probably will be soon:
+# 
+# http://www.horaoficial.cl/cambio.htm
+# 
+
+# From Arthur David Olson (2011-03-02):
+# The emol.com article mentions a water shortage as the cause of the
+# postponement, which may mean that it's not a permanent change.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1189,8 +1206,8 @@ Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	2011	max	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: stable/6/share/zoneinfo/zone.tab
==============================================================================
--- stable/6/share/zoneinfo/zone.tab	Tue Mar  8 21:14:14 2011	(r219413)
+++ stable/6/share/zoneinfo/zone.tab	Tue Mar  8 21:14:18 2011	(r219414)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.40
+# @(#)zone.tab	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -412,9 +412,11 @@ US	+332654-1120424	America/Phoenix	Mount
 US	+340308-1181434	America/Los_Angeles	Pacific Time
 US	+611305-1495401	America/Anchorage	Alaska Time
 US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
+US	+571035-1351807	America/Sitka	Alaska Time - southeast Alaska panhandle
 US	+593249-1394338	America/Yakutat	Alaska Time - Alaska panhandle neck
 US	+643004-1652423	America/Nome	Alaska Time - west Alaska
 US	+515248-1763929	America/Adak	Aleutian Islands
+US	+550737-1313435	America/Metlakatla	Metlakatla Time - Annette Island
 US	+211825-1575130	Pacific/Honolulu	Hawaii
 UY	-3453-05611	America/Montevideo
 UZ	+3940+06648	Asia/Samarkand	west Uzbekistan

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 21:32:05 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A602C106564A;
	Tue,  8 Mar 2011 21:32:05 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A9D68FC0A;
	Tue,  8 Mar 2011 21:32:05 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 36FE146B39;
	Tue,  8 Mar 2011 16:32:05 -0500 (EST)
Received: from jhbbsd.localnet (unknown [209.249.190.10])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id C2C1A8A01B;
	Tue,  8 Mar 2011 16:32:04 -0500 (EST)
From: John Baldwin 
To: Dmitry Chagin 
Date: Tue, 8 Mar 2011 16:27:36 -0500
User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; )
References: <201103081901.p28J1jjh083821@svn.freebsd.org>
In-Reply-To: <201103081901.p28J1jjh083821@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201103081627.37026.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Tue, 08 Mar 2011 16:32:04 -0500 (EST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219405 - in head/sys: amd64/amd64 amd64/linux32
	arm/arm compat/ia32 compat/linux compat/svr4 i386/i386
	i386/ibcs2 i386/linux ia64/ia64 kern mips/mips
	powerpc/powerpc sparc64/sparc64 sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 21:32:05 -0000

On Tuesday, March 08, 2011 2:01:45 pm Dmitry Chagin wrote:
> Author: dchagin
> Date: Tue Mar  8 19:01:45 2011
> New Revision: 219405
> URL: http://svn.freebsd.org/changeset/base/219405
> 
> Log:
>   Extend struct sysvec with new method sv_schedtail, which is used for an
>   explicit process at fork trampoline path instead of eventhadler(schedtail)
>   invocation for each child process.
>   
>   Remove eventhandler(schedtail) code and change linux ABI to use newly added
>   sysvec method.
>   
>   While here replace explicit comparing of module sysentvec structure with the
>   newly created process sysentvec to detect the linux ABI.
>   
>   Discussed with:	kib
>   
>   MFC after:	2 Week
> 
> Modified: head/sys/compat/linux/linux_emul.c
> ==============================================================================
> --- head/sys/compat/linux/linux_emul.c	Tue Mar  8 18:39:41 2011	(r219404)
> +++ head/sys/compat/linux/linux_emul.c	Tue Mar  8 19:01:45 2011	(r219405)
> @@ -300,13 +300,16 @@ linux_proc_exec(void *arg __unused, stru
>  }
>  
>  void
> -linux_schedtail(void *arg __unused, struct proc *p)
> +linux_schedtail(struct thread *td)
>  {
>  	struct linux_emuldata *em;
> +	struct proc *p;
>  	int error = 0;
>  	int *child_set_tid;
>  
> -	if (__predict_true(p->p_sysent != &elf_linux_sysvec))
> +	p = td->td_proc;
> +
> +	if (SV_PROC_ABI(p) != SV_ABI_LINUX)
>  		return;

Isn't this always false now?

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 21:36:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 334F8106566B;
	Tue,  8 Mar 2011 21:36:43 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2057D8FC17;
	Tue,  8 Mar 2011 21:36: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 p28Lah5q087707;
	Tue, 8 Mar 2011 21:36:43 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28LahIl087704;
	Tue, 8 Mar 2011 21:36:43 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201103082136.p28LahIl087704@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 8 Mar 2011 21:36: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: r219415 - head/sbin/geom/class/part
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 21:36:43 -0000

Author: ae
Date: Tue Mar  8 21:36:42 2011
New Revision: 219415
URL: http://svn.freebsd.org/changeset/base/219415

Log:
  Add -p option to `gpart show` command to show provider's names of
  partitions instead of partition's indexes. This may be useful with
  GPT partitioning scheme or EBR without GEOM_PART_EBR_COMPAT option.
  
  MFC after:	2 weeks

Modified:
  head/sbin/geom/class/part/geom_part.c
  head/sbin/geom/class/part/gpart.8

Modified: head/sbin/geom/class/part/geom_part.c
==============================================================================
--- head/sbin/geom/class/part/geom_part.c	Tue Mar  8 21:14:18 2011	(r219414)
+++ head/sbin/geom/class/part/geom_part.c	Tue Mar  8 21:36:42 2011	(r219415)
@@ -83,7 +83,7 @@ static void gpart_bootcode(struct gctl_r
 static void *gpart_bootfile_read(const char *, ssize_t *);
 static void gpart_issue(struct gctl_req *, unsigned int);
 static void gpart_show(struct gctl_req *, unsigned int);
-static void gpart_show_geom(struct ggeom *, const char *);
+static void gpart_show_geom(struct ggeom *, const char *, int);
 static int gpart_show_hasopt(struct gctl_req *, const char *, const char *);
 static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t);
 static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *);
@@ -153,8 +153,9 @@ struct g_command PUBSYM(class_commands)[
 	{ "show", 0, gpart_show, {
 		{ 'l', "show_label", NULL, G_TYPE_BOOL },
 		{ 'r', "show_rawtype", NULL, G_TYPE_BOOL },
+		{ 'p', "show_providers", NULL, G_TYPE_BOOL },
 		G_OPT_SENTINEL },
-	    "[-lr] [geom ...]"
+	    "[-lrp] [geom ...]"
 	},
 	{ "undo", 0, gpart_issue, G_NULL_OPTS,
 	    "geom"
@@ -543,13 +544,13 @@ done:
 }
 
 static void
-gpart_show_geom(struct ggeom *gp, const char *element)
+gpart_show_geom(struct ggeom *gp, const char *element, int show_providers)
 {
 	struct gprovider *pp;
 	const char *s, *scheme;
 	off_t first, last, sector, end;
 	off_t length, secsz;
-	int idx, wblocks, wname;
+	int idx, wblocks, wname, wmax;
 
 	scheme = find_geomcfg(gp, "scheme");
 	s = find_geomcfg(gp, "first");
@@ -560,7 +561,21 @@ gpart_show_geom(struct ggeom *gp, const 
 	s = find_geomcfg(gp, "state");
 	if (s != NULL && *s != 'C')
 		s = NULL;
-	wname = strlen(gp->lg_name);
+	wmax = strlen(gp->lg_name);
+	if (show_providers) {
+		LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
+			wname = strlen(pp->lg_name);
+			if (wname > wmax)
+				wmax = wname;
+		}
+	} else {
+		/* In some cases width of index can be greater than
+		 * length of provider's name.
+		 */
+		if (wblocks > wmax)
+			wmax = wblocks;
+	}
+	wname = wmax;
 	pp = LIST_FIRST(&gp->lg_consumer)->lg_provider;
 	secsz = pp->lg_sectorsize;
 	printf("=>%*jd  %*jd  %*s  %s  (%s)%s\n",
@@ -594,10 +609,18 @@ gpart_show_geom(struct ggeom *gp, const 
 			    (intmax_t)(sector - first), wname, "",
 			    fmtsize((sector - first) * secsz));
 		}
-		printf("  %*jd  %*jd  %*d  %s %s (%s)\n",
-		    wblocks, (intmax_t)sector, wblocks, (intmax_t)length,
-		    wname, idx, find_provcfg(pp, element),
-		    fmtattrib(pp), fmtsize(pp->lg_mediasize));
+		if (show_providers) {
+			printf("  %*jd  %*jd  %*s  %s %s (%s)\n",
+			    wblocks, (intmax_t)sector, wblocks,
+			    (intmax_t)length, wname, pp->lg_name,
+			    find_provcfg(pp, element), fmtattrib(pp),
+			    fmtsize(pp->lg_mediasize));
+		} else
+			printf("  %*jd  %*jd  %*d  %s %s (%s)\n",
+			    wblocks, (intmax_t)sector, wblocks,
+			    (intmax_t)length, wname, idx,
+			    find_provcfg(pp, element), fmtattrib(pp),
+			    fmtsize(pp->lg_mediasize));
 		first = end + 1;
 	}
 	if (first <= last) {
@@ -630,7 +653,7 @@ gpart_show(struct gctl_req *req, unsigne
 	struct gclass *classp;
 	struct ggeom *gp;
 	const char *element, *name;
-	int error, i, nargs;
+	int error, i, nargs, show_providers;
 
 	element = NULL;
 	if (gpart_show_hasopt(req, "show_label", element))
@@ -651,19 +674,20 @@ gpart_show(struct gctl_req *req, unsigne
 		geom_deletetree(&mesh);
 		errx(EXIT_FAILURE, "Class %s not found.", name);
 	}
+	show_providers = gctl_get_int(req, "show_providers");
 	nargs = gctl_get_int(req, "nargs");
 	if (nargs > 0) {
 		for (i = 0; i < nargs; i++) {
 			name = gctl_get_ascii(req, "arg%d", i);
 			gp = find_geom(classp, name);
 			if (gp != NULL)
-				gpart_show_geom(gp, element);
+				gpart_show_geom(gp, element, show_providers);
 			else
 				errx(EXIT_FAILURE, "No such geom: %s.", name);
 		}
 	} else {
 		LIST_FOREACH(gp, &classp->lg_geom, lg_geom) {
-			gpart_show_geom(gp, element);
+			gpart_show_geom(gp, element, show_providers);
 		}
 	}
 	geom_deletetree(&mesh);

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Tue Mar  8 21:14:18 2011	(r219414)
+++ head/sbin/geom/class/part/gpart.8	Tue Mar  8 21:36:42 2011	(r219415)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 28, 2011
+.Dd March 9, 2011
 .Dt GPART 8
 .Os
 .Sh NAME
@@ -162,7 +162,7 @@ utility:
 .\" ==== SHOW ====
 .Nm
 .Cm show
-.Op Fl lr
+.Op Fl lrp
 .Op Ar geom ...
 .\" ==== UNDO ====
 .Nm
@@ -468,6 +468,8 @@ Additional options include:
 .It Fl l
 For partition schemes that support partition labels print them
 instead of partition type.
+.It Fl p
+Show provider names instead of partition indexes.
 .It Fl r
 Show raw partition type instead of symbolic name.
 .El

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 21:59:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 181651065672;
	Tue,  8 Mar 2011 21:59:04 +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 E45CD8FC1F;
	Tue,  8 Mar 2011 21:59:03 +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 8B4DF46B8E;
	Tue,  8 Mar 2011 16:59:03 -0500 (EST)
Received: from jhbbsd.localnet (unknown [209.249.190.10])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2CAED8A01B;
	Tue,  8 Mar 2011 16:59:03 -0500 (EST)
From: John Baldwin 
To: src-committers@freebsd.org
Date: Tue, 8 Mar 2011 16:59:02 -0500
User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; )
References: <201103081418.p28EILZ0076720@svn.freebsd.org>
In-Reply-To: <201103081418.p28EILZ0076720@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201103081659.02621.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Tue, 08 Mar 2011 16:59:03 -0500 (EST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r219399 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 21:59:04 -0000

On Tuesday, March 08, 2011 9:18:21 am John Baldwin wrote:
> Author: jhb
> Date: Tue Mar  8 14:18:21 2011
> New Revision: 219399
> URL: http://svn.freebsd.org/changeset/base/219399
> 
> Log:
>   When constructing a new cpuset, apply the parent cpuset's mask to the new
>   set's mask rather than the root mask.  This was causing the root mask to
>   be modified incorrectly.
>   
>   Reviewed by:	jeff
>   MFC after:	1 week

The effect of this bug was that if you started a jail from a thread that had a 
restricted cpuset (e.g. cpuset -l 0 sh /etc/rc.d/jail start), then the root 
cpuset for the entire system would be changed to just be the restricted set 
(e.g. '0').  The existing cpusets such as set 1 were not modified, but if you 
later tried to modify a set such as set 1 or create a new set by something 
like 'cpuset -l 2 foo', then those actions would fail.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  8 22:01:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76C8A106566C;
	Tue,  8 Mar 2011 22:01:47 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6575F8FC1E;
	Tue,  8 Mar 2011 22:01: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 p28M1lKT088280;
	Tue, 8 Mar 2011 22:01:47 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p28M1llT088278;
	Tue, 8 Mar 2011 22:01:47 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201103082201.p28M1llT088278@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 8 Mar 2011 22:01: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: r219416 - head/sbin/geom/class/part
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 08 Mar 2011 22:01:47 -0000

Author: ae
Date: Tue Mar  8 22:01:47 2011
New Revision: 219416
URL: http://svn.freebsd.org/changeset/base/219416

Log:
  It is better to sometimes have not aligned columns than
  often have wrapped lines.
  
  MFC after:	2 weeks

Modified:
  head/sbin/geom/class/part/geom_part.c

Modified: head/sbin/geom/class/part/geom_part.c
==============================================================================
--- head/sbin/geom/class/part/geom_part.c	Tue Mar  8 21:36:42 2011	(r219415)
+++ head/sbin/geom/class/part/geom_part.c	Tue Mar  8 22:01:47 2011	(r219416)
@@ -568,12 +568,6 @@ gpart_show_geom(struct ggeom *gp, const 
 			if (wname > wmax)
 				wmax = wname;
 		}
-	} else {
-		/* In some cases width of index can be greater than
-		 * length of provider's name.
-		 */
-		if (wblocks > wmax)
-			wmax = wblocks;
 	}
 	wname = wmax;
 	pp = LIST_FIRST(&gp->lg_consumer)->lg_provider;

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 02:23:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBD3A106564A;
	Wed,  9 Mar 2011 02:23:21 +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 A94A88FC13;
	Wed,  9 Mar 2011 02:23: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 p292NLo5093795;
	Wed, 9 Mar 2011 02:23:21 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p292NLom093793;
	Wed, 9 Mar 2011 02:23:21 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201103090223.p292NLom093793@svn.freebsd.org>
From: Ed Maste 
Date: Wed, 9 Mar 2011 02:23: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: r219418 - head/contrib/gdb/gdb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 02:23:21 -0000

Author: emaste
Date: Wed Mar  9 02:23:21 2011
New Revision: 219418
URL: http://svn.freebsd.org/changeset/base/219418

Log:
  Remove stray semicolon.  This fix appears in later upstream gdb versions.
  
  Submitted by:	eadler

Modified:
  head/contrib/gdb/gdb/i386-tdep.c

Modified: head/contrib/gdb/gdb/i386-tdep.c
==============================================================================
--- head/contrib/gdb/gdb/i386-tdep.c	Tue Mar  8 23:33:29 2011	(r219417)
+++ head/contrib/gdb/gdb/i386-tdep.c	Wed Mar  9 02:23:21 2011	(r219418)
@@ -735,7 +735,7 @@ i386_skip_prologue (CORE_ADDR start_pc)
 
       /* addl y,%ebx */
       if (delta > 0 && op == 0x81
-	  && read_memory_unsigned_integer (pc + delta + 1, 1) == 0xc3);
+	  && read_memory_unsigned_integer (pc + delta + 1, 1) == 0xc3)
 	{
 	  pc += delta + 6;
 	}

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 04:39:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2C58106564A;
	Wed,  9 Mar 2011 04:39:35 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D64908FC1A;
	Wed,  9 Mar 2011 04:39: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 p294dZAg096849;
	Wed, 9 Mar 2011 04:39:35 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p294dZfL096845;
	Wed, 9 Mar 2011 04:39:35 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103090439.p294dZfL096845@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 9 Mar 2011 04:39: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: r219419 - in head/sys/dev/ath/ath_hal: ar5212 ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 04:39:36 -0000

Author: adrian
Date: Wed Mar  9 04:39:35 2011
New Revision: 219419
URL: http://svn.freebsd.org/changeset/base/219419

Log:
  For chips that are full reset in ar5416ChipReset(), save and restore the TSF.
  
  Merlin (ar9280) and later were full-reset if they're doing open-loop TX
  power control but the TSF wasn't being saved/restored.
  
  Add ar5212SetTsf64() which sets the 64 bit TSF appropriately.

Modified:
  head/sys/dev/ath/ath_hal/ar5212/ar5212.h
  head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212.h	Wed Mar  9 02:23:21 2011	(r219418)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h	Wed Mar  9 04:39:35 2011	(r219419)
@@ -462,6 +462,7 @@ extern	void ar5212WriteAssocid(struct at
 		uint16_t assocId);
 extern	uint32_t ar5212GetTsf32(struct ath_hal *ah);
 extern	uint64_t ar5212GetTsf64(struct ath_hal *ah);
+extern	void ar5212SetTsf64(struct ath_hal *ah, uint64_t tsf64);
 extern	void ar5212ResetTsf(struct ath_hal *ah);
 extern	void ar5212SetBasicRate(struct ath_hal *ah, HAL_RATE_SET *pSet);
 extern	uint32_t ar5212GetRandomSeed(struct ath_hal *ah);

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c	Wed Mar  9 02:23:21 2011	(r219418)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c	Wed Mar  9 04:39:35 2011	(r219419)
@@ -264,6 +264,13 @@ ar5212GetTsf32(struct ath_hal *ah)
 	return OS_REG_READ(ah, AR_TSF_L32);
 }
 
+void
+ar5212SetTsf64(struct ath_hal *ah, uint64_t tsf64)
+{
+	OS_REG_WRITE(ah, AR_TSF_L32, tsf64 & 0xffffffff);
+	OS_REG_WRITE(ah, AR_TSF_U32, (tsf64 >> 32) & 0xffffffff);
+}
+
 /*
  * Reset the current hardware tsf for stamlme.
  */

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Wed Mar  9 02:23:21 2011	(r219418)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Wed Mar  9 04:39:35 2011	(r219419)
@@ -95,6 +95,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 	uint32_t powerVal, rssiThrReg;
 	uint32_t ackTpcPow, ctsTpcPow, chirpTpcPow;
 	int i;
+	uint64_t tsf = 0;
 
 	OS_MARK(ah, AH_MARK_RESET, bChannelChange);
 
@@ -151,6 +152,10 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 		(AR_MAC_LED_ASSOC | AR_MAC_LED_MODE |
 		 AR_MAC_LED_BLINK_THRESH_SEL | AR_MAC_LED_BLINK_SLOW);
 
+	/* For chips on which the RTC reset is done, save TSF before it gets cleared */
+	if (AR_SREV_MERLIN_20_OR_LATER(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL))
+		tsf = ar5212GetTsf64(ah);
+
 	if (!ar5416ChipReset(ah, chan)) {
 		HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__);
 		FAIL(HAL_EIO);
@@ -159,6 +164,10 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 	/* Restore bmiss rssi & count thresholds */
 	OS_REG_WRITE(ah, AR_RSSI_THR, rssiThrReg);
 
+	/* Restore TSF */
+	if (tsf)
+		ar5212SetTsf64(ah, tsf);
+
 	OS_MARK(ah, AH_MARK_RESET_LINE, __LINE__);
 	if (AR_SREV_MERLIN_10_OR_LATER(ah))
 		OS_REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 04:48:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A76E106564A;
	Wed,  9 Mar 2011 04:48:06 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 57CFE8FC13;
	Wed,  9 Mar 2011 04:48: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 p294m6VN097064;
	Wed, 9 Mar 2011 04:48:06 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p294m6sR097061;
	Wed, 9 Mar 2011 04:48:06 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103090448.p294m6sR097061@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 9 Mar 2011 04:48: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: r219420 - in head/tools/tools/ath: ath_ee_v14_print
	ath_ee_v4k_print
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 04:48:06 -0000

Author: adrian
Date: Wed Mar  9 04:48:06 2011
New Revision: 219420
URL: http://svn.freebsd.org/changeset/base/219420

Log:
  The regdomain entries are 16 bits, not 8. Print out all 16 bits.

Modified:
  head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c
  head/tools/tools/ath/ath_ee_v4k_print/v4k.c

Modified: head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c
==============================================================================
--- head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c	Wed Mar  9 04:39:35 2011	(r219419)
+++ head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c	Wed Mar  9 04:48:06 2011	(r219420)
@@ -91,7 +91,7 @@ eeprom_v14_base_print(uint16_t *buf)
 
 	printf("| Version: 0x%.4x   | Length: 0x%.4x | Checksum: 0x%.4x ",
 	    eh->version, eh->length, eh->checksum);
-	printf("| CapFlags: 0x%.2x  | eepMisc: 0x%.2x | RegDomain: 0x%.2x 0x%.2x | \n",
+	printf("| CapFlags: 0x%.2x  | eepMisc: 0x%.2x | RegDomain: 0x%.4x 0x%.4x | \n",
 	    eh->opCapFlags, eh->eepMisc, eh->regDmn[0], eh->regDmn[1]);
 	printf("| MAC: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x ",
 	    eh->macAddr[0], eh->macAddr[1], eh->macAddr[2],

Modified: head/tools/tools/ath/ath_ee_v4k_print/v4k.c
==============================================================================
--- head/tools/tools/ath/ath_ee_v4k_print/v4k.c	Wed Mar  9 04:39:35 2011	(r219419)
+++ head/tools/tools/ath/ath_ee_v4k_print/v4k.c	Wed Mar  9 04:48:06 2011	(r219420)
@@ -54,7 +54,7 @@ eeprom_v4k_base_print(uint16_t *buf)
 
 	printf("| Version: 0x%.4x   | Length: 0x%.4x | Checksum: 0x%.4x ",
 	    eh->version, eh->length, eh->checksum);
-	printf("| CapFlags: 0x%.2x  | eepMisc: 0x%.2x | RegDomain: 0x%.2x 0x%.2x | \n",
+	printf("| CapFlags: 0x%.2x  | eepMisc: 0x%.2x | RegDomain: 0x%.4x 0x%.4x | \n",
 	    eh->opCapFlags, eh->eepMisc, eh->regDmn[0], eh->regDmn[1]);
 	printf("| MAC: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x ",
 	    eh->macAddr[0], eh->macAddr[1], eh->macAddr[2],

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 05:59:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C510C106564A;
	Wed,  9 Mar 2011 05:59:33 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B3FD08FC15;
	Wed,  9 Mar 2011 05:59: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 p295xXYY098572;
	Wed, 9 Mar 2011 05:59:33 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p295xXhi098569;
	Wed, 9 Mar 2011 05:59:33 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103090559.p295xXhi098569@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 9 Mar 2011 05:59: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: r219421 - head/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 05:59:33 -0000

Author: dchagin
Date: Wed Mar  9 05:59:33 2011
New Revision: 219421
URL: http://svn.freebsd.org/changeset/base/219421

Log:
  Indeed, remove bogus since r219405 check of the Linux ABI.
  
  Pointed out:	jhb
  
  MFC after:	2 Week

Modified:
  head/sys/compat/linux/linux_emul.c

Modified: head/sys/compat/linux/linux_emul.c
==============================================================================
--- head/sys/compat/linux/linux_emul.c	Wed Mar  9 04:48:06 2011	(r219420)
+++ head/sys/compat/linux/linux_emul.c	Wed Mar  9 05:59:33 2011	(r219421)
@@ -309,9 +309,6 @@ linux_schedtail(struct thread *td)
 
 	p = td->td_proc;
 
-	if (SV_PROC_ABI(p) != SV_ABI_LINUX)
-		return;
-
 	/* find the emuldata */
 	em = em_find(p, EMUL_DOLOCK);
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 06:01:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86D94106564A;
	Wed,  9 Mar 2011 06:01:33 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F7B08FC12;
	Wed,  9 Mar 2011 06:01:32 +0000 (UTC)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id 71CACCC4D4;
	Wed,  9 Mar 2011 09:01:29 +0300 (MSK)
X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9
Received: from [10.208.22.99] (HELO dchagin.static.corbina.ru)
	by corbina.ru (CommuniGate Pro SMTP 5.1.14)
	with ESMTPS id 306765802; Wed, 09 Mar 2011 09:01:29 +0300
Received: from dchagin.static.corbina.ru (localhost [127.0.0.1])
	by dchagin.static.corbina.ru (8.14.4/8.14.4) with ESMTP id
	p2961SFn004131; Wed, 9 Mar 2011 09:01:28 +0300 (MSK)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: (from dchagin@localhost)
	by dchagin.static.corbina.ru (8.14.4/8.14.4/Submit) id p2961NTB004130; 
	Wed, 9 Mar 2011 09:01:23 +0300 (MSK) (envelope-from dchagin)
Date: Wed, 9 Mar 2011 09:01:23 +0300
From: Chagin Dmitry 
To: John Baldwin 
Message-ID: <20110309060123.GA4088@dchagin.static.corbina.ru>
References: <201103081901.p28J1jjh083821@svn.freebsd.org>
	<201103081627.37026.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="sdtB3X0nJg68CQEu"
Content-Disposition: inline
In-Reply-To: <201103081627.37026.jhb@freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219405 - in head/sys: amd64/amd64 amd64/linux32
 arm/arm compat/ia32 compat/linux compat/svr4 i386/i386 i386/ibcs2 i386/linux
 ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 06:01:33 -0000


--sdtB3X0nJg68CQEu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 08, 2011 at 04:27:36PM -0500, John Baldwin wrote:
> On Tuesday, March 08, 2011 2:01:45 pm Dmitry Chagin wrote:
> > Author: dchagin
> > Date: Tue Mar  8 19:01:45 2011
> > New Revision: 219405
> > URL: http://svn.freebsd.org/changeset/base/219405
> >=20
> > Log:
> >   Extend struct sysvec with new method sv_schedtail, which is used for =
an
> >   explicit process at fork trampoline path instead of eventhadler(sched=
tail)
> >   invocation for each child process.
> >  =20
> >   Remove eventhandler(schedtail) code and change linux ABI to use newly=
 added
> >   sysvec method.
> >  =20
> >   While here replace explicit comparing of module sysentvec structure w=
ith the
> >   newly created process sysentvec to detect the linux ABI.
> >  =20
> >   Discussed with:	kib
> >  =20
> >   MFC after:	2 Week
> >=20
> > Modified: head/sys/compat/linux/linux_emul.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/compat/linux/linux_emul.c	Tue Mar  8 18:39:41 2011	(r21940=
4)
> > +++ head/sys/compat/linux/linux_emul.c	Tue Mar  8 19:01:45 2011	(r21940=
5)
> > @@ -300,13 +300,16 @@ linux_proc_exec(void *arg __unused, stru
> >  }
> > =20
> >  void
> > -linux_schedtail(void *arg __unused, struct proc *p)
> > +linux_schedtail(struct thread *td)
> >  {
> >  	struct linux_emuldata *em;
> > +	struct proc *p;
> >  	int error =3D 0;
> >  	int *child_set_tid;
> > =20
> > -	if (__predict_true(p->p_sysent !=3D &elf_linux_sysvec))
> > +	p =3D td->td_proc;
> > +
> > +	if (SV_PROC_ABI(p) !=3D SV_ABI_LINUX)
> >  		return;
>=20
> Isn't this always false now?
>=20

Indeed, even a bit funny. fixed, thanks!!

--=20
Have fun!
chd

--sdtB3X0nJg68CQEu
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iEYEARECAAYFAk13F7MACgkQ0t2Tb3OO/O3p9QCeJK/F9I43jMxC2vZwTVDsyrLj
E9YAoMfdhgjpbGYv63l3I1Jtu/UD1CsH
=bajL
-----END PGP SIGNATURE-----

--sdtB3X0nJg68CQEu--

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 06:14:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58E791065672;
	Wed,  9 Mar 2011 06:14:33 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 463598FC0C;
	Wed,  9 Mar 2011 06:14:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p296EXmT098932;
	Wed, 9 Mar 2011 06:14:33 GMT (envelope-from das@svn.freebsd.org)
Received: (from das@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p296EXno098927;
	Wed, 9 Mar 2011 06:14:33 GMT (envelope-from das@svn.freebsd.org)
Message-Id: <201103090614.p296EXno098927@svn.freebsd.org>
From: David Schultz 
Date: Wed, 9 Mar 2011 06:14:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219422 - in vendor/gdtoa/dist: . test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 06:14:33 -0000

Author: das
Date: Wed Mar  9 06:14:33 2011
New Revision: 219422
URL: http://svn.freebsd.org/changeset/base/219422

Log:
  Import gdtoa sources dated 2011-03-04.  This version includes a number
  of bugfixes, although I believe we already have local patches for the
  ones people are likely to notice.
  
  Per a request from arundel@, I also added the vendor's change log,
  which is available separately from ftp://ftp.netlib.org/fp/.

Added:
  vendor/gdtoa/dist/changes
  vendor/gdtoa/dist/printf.c   (contents, props changed)
  vendor/gdtoa/dist/printf.c0
  vendor/gdtoa/dist/stdio1.h   (contents, props changed)
  vendor/gdtoa/dist/test/pfLqtestnos
  vendor/gdtoa/dist/test/pftest.c   (contents, props changed)
  vendor/gdtoa/dist/test/pftestLq.out
  vendor/gdtoa/dist/test/pftestQ.out
  vendor/gdtoa/dist/test/pftestnos
  vendor/gdtoa/dist/test/pftestx.out
Modified:
  vendor/gdtoa/dist/README
  vendor/gdtoa/dist/dtoa.c
  vendor/gdtoa/dist/g__fmt.c
  vendor/gdtoa/dist/g_ddfmt.c
  vendor/gdtoa/dist/g_dfmt.c
  vendor/gdtoa/dist/gdtoa.c
  vendor/gdtoa/dist/gdtoa.h
  vendor/gdtoa/dist/gdtoaimp.h
  vendor/gdtoa/dist/gethex.c
  vendor/gdtoa/dist/hexnan.c
  vendor/gdtoa/dist/makefile
  vendor/gdtoa/dist/misc.c
  vendor/gdtoa/dist/smisc.c
  vendor/gdtoa/dist/strtoIg.c
  vendor/gdtoa/dist/strtod.c
  vendor/gdtoa/dist/strtodI.c
  vendor/gdtoa/dist/strtodg.c
  vendor/gdtoa/dist/strtof.c
  vendor/gdtoa/dist/strtopdd.c
  vendor/gdtoa/dist/strtopf.c
  vendor/gdtoa/dist/strtopx.c
  vendor/gdtoa/dist/strtopxL.c
  vendor/gdtoa/dist/strtordd.c
  vendor/gdtoa/dist/strtorf.c
  vendor/gdtoa/dist/strtorx.c
  vendor/gdtoa/dist/strtorxL.c
  vendor/gdtoa/dist/test/Qtest.c
  vendor/gdtoa/dist/test/README
  vendor/gdtoa/dist/test/ddtest.c
  vendor/gdtoa/dist/test/dt.c
  vendor/gdtoa/dist/test/dtest.c
  vendor/gdtoa/dist/test/ftest.c
  vendor/gdtoa/dist/test/getround.c
  vendor/gdtoa/dist/test/makefile
  vendor/gdtoa/dist/test/strtodt.c
  vendor/gdtoa/dist/test/testnos3
  vendor/gdtoa/dist/test/xLtest.c
  vendor/gdtoa/dist/test/xQtest.c
  vendor/gdtoa/dist/test/xsum0.out
  vendor/gdtoa/dist/test/xtest.c
  vendor/gdtoa/dist/ulp.c
  vendor/gdtoa/dist/xsum0.out

Modified: vendor/gdtoa/dist/README
==============================================================================
--- vendor/gdtoa/dist/README	Wed Mar  9 05:59:33 2011	(r219421)
+++ vendor/gdtoa/dist/README	Wed Mar  9 06:14:33 2011	(r219422)
@@ -353,5 +353,12 @@ you also compile with -DNO_LOCALE_CACHE,
 current "decimal point" character string are cached and assumed not
 to change during the program's execution.
 
+On machines with a 64-bit long double and perhaps a 113-bit "quad"
+type, you can invoke "make Printf" to add Printf (and variants, such
+as Fprintf) to gdtoa.a.  These are analogs, declared in stdio1.h, of
+printf and fprintf, etc. in which %La, %Le, %Lf, and %Lg are for long
+double and (if appropriate) %Lqa, %Lqe, %Lqf, and %Lqg are for quad
+precision printing.
+
 Please send comments to	David M. Gay (dmg at acm dot org, with " at "
 changed at "@" and " dot " changed to ".").

Added: vendor/gdtoa/dist/changes
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/gdtoa/dist/changes	Wed Mar  9 06:14:33 2011	(r219422)
@@ -0,0 +1,672 @@
+Sun Jun 30 13:48:26 EDT 1991:
+  dtoa.c: adjust dtoa to allow negative ndigits for modes 3,5,7,9
+(fixed-point mode); fix rounding bug in these modes when the input
+d (to be converted) satisfies 10^-(ndigits+1) <= |d| < 10^-ndigits ,
+i.e., when the result, before rounding, would be empty but might
+round to one digit.  Adjust the decpt returned in these modes when
+the result is empty (i.e., when |d| <= 5 * 10^-ndigits).
+
+Tue Jul  2 21:44:00 EDT 1991
+  Correct an inefficiency introduced 2 days ago in dtoa's handling of
+integers in modes 0, 1.
+
+Mon Sep  9 23:29:38 EDT 1991
+  dtoa.c: remove superfluous declaration of size_t.
+
+Sun Oct  6 15:34:15 EDT 1991
+  dtoa.c: fix another bug in modes 3,5,7,9 when the result, before
+rounding, would be empty, but rounds to one digit: *decpt was low by
+one.
+
+Sat Jan 18 12:30:04 EST 1992
+  dtoa.c: add some #ifdef KR_headers lines relevant only if IBM is
+defined; for input decimal strings representing numbers too large, have
+strtod return HUGE_VAL only if __STDC__ is defined; otherwise have it
+return +-Infinity for IEEE arithmetic, +- the largest machine number
+for IBM and VAX arithmetic.  (If __STDC__ is not defined, HUGE_VAL may
+not be defined either, or it may be wrong.)
+
+Mon Apr 27 23:13:43 EDT 1992
+  dtoa.c: tweak strtod (one-line addition) so the end-pointer = start
+pointer when the input has, e.g., only white space.
+
+Thu May  7 18:04:46 EDT 1992
+  dtoa.c: adjust treatment of exponent field (in strtod) to behave
+reasonably with huge numbers and 16-bit ints.
+
+Fri Jun 19 08:29:02 EDT 1992
+  dtoa.c: fix a botch in placement of #ifdef __cplusplus (which only
+matters if you're using a C++ compiler).
+
+Wed Oct 21 11:23:07 EDT 1992
+  dtoa.c: add #ifdef Bad_float_h lines for systems with missing or
+inferior float.h .
+
+Thu Apr 22 07:54:48 EDT 1993
+  dtoa.c: change < to <= in line 2059:
+<	for(result_k = 0; sizeof(Bigint) - sizeof(unsigned long) + j < i;
+---
+>	for(result_k = 0; sizeof(Bigint) - sizeof(unsigned long) + j <= i;
+With 32-bit ints, the former could give too small a block for the return
+value when, e.g., mode = 2 or 4 and ndigits = 24 (16 for 16-bit ints).
+
+Mon Jun 21 12:56:42 EDT 1993
+  dtoa.c: tweak to work with 32-bit ints and 64-bit longs
+when compiled with -DLong=int .
+
+Wed Jan 26 11:09:16 EST 1994
+  dtoa.c: fix bug in strtod's handling of numbers with very
+negative exponents (e.g. 1.8826e-512), which should underflow to 0;
+fix storage leak in strtod with underflows and overflows near
+the underflow and overflow thresholds.
+
+Mon Feb 28 11:37:30 EST 1994
+  dtoa.c:
+85a86,89
+>  * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
+>  *	if memory is available and otherwise does something you deem
+>  *	appropriate.  If MALLOC is undefined, malloc will be invoked
+>  *	directly -- and assumed always to succeed.
+87a92,95
+> #ifndef MALLOC
+> #define MALLOC malloc
+> #endif
+>
+352c360
+< 		rv = (Bigint *)malloc(sizeof(Bigint) + (x-1)*sizeof(Long));
+---
+> 		rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long));
+
+Thu Mar  3 16:56:39 EST 1994
+  dtoa.c: if MALLOC is #defined, declare it.
+
+Wed Jan  4 15:45:34 EST 1995
+  dtoa.c: add CONST qualification to tens, bigtens, tinytens (for use
+on embedded systems with little spare RAM).
+
+Fri Mar  1 08:55:39 EST 1996
+  g_fmt.c: honor the sign of 0 and return the first argument (buf).
+
+Sat Jul  6 07:59:28 EDT 1996
+  dtoa.c: cosmetic changes: "ULong" rather than "unsigned Long";
+update comments to reflect AT&T breakup.
+
+Mon Aug  5 23:31:24 EDT 1996
+  dtoa.c: add comment about invoking _control87(PC_53, MCW_PC)
+(or the equivalent) on 80x87 machines before calling strtod or dtoa.
+
+Tue Dec 17 15:01:56 EST 1996
+  dtoa.c: new #define possibilities: #define INFNAN_CHECK to have
+strtod check (case insensitively) for "Infinity" and "NaN" on machines
+with IEEE arithmetic; #define MULTIPLE_THREADS if the system offers
+preemptively scheduled multiple threads, in which case you must supply
+routines ACQUIRE_DTOA_LOCK(n) and FREE_DTOA_LOCK(n) (n = 0 or 1).
+New void freedtoa(char*) for freeing values returned by dtoa; use of
+freedtoa() is required if MULTIPLE_THREADS is #defined, and is merely
+recommended otherwise.
+  g_fmt.c: adjusted to invoke freedtoa().
+
+Wed Feb 12 00:40:01 EST 1997
+  dtoa.c: strtod: on IEEE systems, scale to avoid intermediate
+underflows when the result does not underflow; compiling with
+-DNO_IEEE_Scale restores the old logic.  Fix a bug, revealed by
+input string 2.2250738585072012e-308, in treating input just less
+than the smallest normalized number.  (The bug introduced an extra
+ULP of error in this special case.)
+
+Tue May 12 11:13:04 EDT 1998
+  dtoa.c: strtod: fix a glitch introduced with the scaling of 19970212
+that caused one-bit rounding errors in certain denormal numbers, such
+as 8.44291197326099e-309, which was read as 8.442911973260987e-309.
+Remove #ifdef Unsigned_Shifts logic in favor of unsigned arithmetic.
+Unless compiled with -DNO_LONG_LONG, use 64-bit arithmetic where
+possible.
+
+Fri May 15 07:49:07 EDT 1998
+  dtoa.c: strtod: fix another glitch with scaling to avoid underflow
+with IEEE arithmetic, again revealed by the input string
+2.2250738585072012e-308, which was rounded to the largest denormal
+rather than the smallest normal double precision number.
+
+Wed Aug  5 23:27:26 EDT 1998
+  gdtoa.tar.gz: tweaks in response to comments from Shawn C. Sheridan
+(with no effect on the resulting .o files except when strtod.c is
+compiled with -DNO_ERRNO); bigtens --> bigtens_D2A (a symbol meant
+to be private to gdtoa.a).
+
+Sat Sep 12 17:05:15 EDT 1998
+  gdtoa.tar.gz: more changes in response to comments from Shawn C.
+Sheridan (including repair of a glitch in g_ffmt.c).  For consistency
+and possible convenience, there are some new functions and some name
+changes to existing ones:
+	Old	New
+	---	g_xLfmt
+	strtoQ	strtopQ
+	---	strtopd
+	strtodd	strtopdd
+	---	strtopf
+	strtox	strtopx
+	---	strtopxL
+	---	strtorxL
+	---	strtoIxL
+Functions strtopd and strtopf are variations of strtod and strtof,
+respectively, which write their results to their final (pointer)
+arguments.  Functions strtorf and strtord are now analogous to the
+other strtor* functions in that they now have a final pointer
+argument to which they write their results, and they return the
+int value they get from strtodg.
+  The xL family (g_xLfmt, strto[Irp]xL) is a variation of the old x
+family (for 80-bit IEEE double-extended precision) that assumes the
+storage layout of the Motorola 68881's double-extended format:  80
+interesting bits stored in 3 unsigned 32-bit ints (with a "hole", 16
+zero bits, in the word that holds the sign and exponent).  The x
+family now deals with 80-bit (5 unsigned 16-bit ints) rather than
+96-bit arrays (3 unsigned 32-bit ints) that hold its 80-bit
+double-extended values.  (This relaxes the alignment requirements of
+the x family and results in strto[Ipr]x writing 80 rather than 96 bits
+to their final arguments.)
+  Each g_*fmt routine now returns a pointer to the null character
+that terminates the strings it writes, rather than a pointer to
+the beginning of that string (the first argument).  These routines
+still return 0 (NULL) if the first argument is too short.
+  The second argument to g_dfmt is now pointer (to a double) rather
+than a double value.
+
+Thu Oct 29 21:54:00 EST 1998
+  dtoa.c: Fix bug in strtod under -DSudden_Underflow and (the default)
+-DAvoid_Underflow: some numbers that should have suffered sudden
+underflow were scaled inappropriately (giving nonzero return values).
+Example: "1e-320" gave -3.6304123742133376e+280 rather than 0.
+
+Mon Nov  2 15:41:16 EST 1998
+  dtoa.c: tweak to remove LL suffixes from numeric constants (for
+compilers that offer a 64-bit long long type but do not recognize the
+LL constants prescribed by C9x, the proposed update to the ANSI/ISO C
+standard).  Thanks to Earl Chew for pointing out the existence of such
+compilers.
+  gdtoa.tar.gz: renamed gdtoa.tgz and updated to incorporate the above
+changes (of 29 Oct. and 2 Nov. 1998) to dtoa.c.
+
+Thu Mar 25 17:56:44 EST 1999
+  dtoa.c, gdtoa.tgz: fix a bug in strtod's reading of 4.9e-324:
+it returned 0 rather than the smallest denormal.
+
+Mon Apr 12 10:39:25 EDT 1999
+  gdtoa.tgz: test/ftest.c: change %.7g to %.8g throughout.
+
+Fri Aug 20 19:17:52 EDT 1999
+  gdtoa.tgz: gdtoa.c: fix two bugs reported by David Chase (thanks!):
+1. An adjustment for denormalized numbers around 503 was off by one.
+2. A check for "The special case" around line 551 omitted the condition
+that we not be at the bottom of the exponent range.
+
+Mon Sep 13 10:53:34 EDT 1999
+  dtoa.c: computationally invisible tweak for the benefit of people
+who actually read the code:
+
+2671c2671
+< 		 && word0(d) & Exp_mask
+---
+> 		 && word0(d) & (Exp_mask & Exp_mask << 1)
+
+I.e., in dtoa(), the "special case" does not arise for the smallest
+normalized IEEE double.  Thanks to Waldemar Horwat for pointing this
+out and suggesting the modified test above.  Also, some tweaks for
+compilation with -DKR_headers.
+  gdtoa.tgz: gdtoa.c: analogous change:
+
+552c552
+< 		if (bbits == 1 && be0 > fpi->emin) {
+---
+> 		if (bbits == 1 && be0 > fpi->emin + 1) {
+
+This has no effect on the g*fmt.c routines, but might affect the
+computation of the shortest decimal string that rounds to the
+smallest normalized floating-point number of other precisions.
+  gdota.tgz: test/d.out test/dI.out test/dd.out: updated to reflect
+previous changes (of 19990820); test/*.c: most test programs modified
+to permit #hex input.  See the comments.
+
+Fri Sep 17 01:39:25 EDT 1999
+  Try again to update dtoa.c: somehow dtoa.c got put back to a version
+from 3 years ago after this "changes" file was updated on 13 Sept. 1999.
+One more tweak to omit a warning on some systems:
+2671c2671
+<		 && word0(d) & (Exp_mask & Exp_mask << 1)
+---
+>		 && word0(d) & (Exp_mask & ~Exp_msk1)
+Plus changes to avoid trouble with aggressively optimizing compilers
+(e.g., gcc 2.95.1 under -O2).  On some systems, these changes do not
+affect the resulting machine code; on others, the old way of viewing
+a double as a pair of ULongs is available with -DYES_ALIAS.
+
+Tue Sep 21 09:21:25 EDT 1999
+  gdtoa.tgz: changes analogous to those of 17 Sept. 1999 to dtoa.c to
+avoid trouble with aggressively optimizing compilers.
+
+Wed Dec 15 13:14:38 EST 1999
+  dtoa.c: tweak to bypass a bug with HUGE_VAL on HP systems.
+
+Mon Jan 17 18:32:52 EST 2000
+  dtoa.c and gdtoa.tgz: strtod: set errno = ERANGE on all inputs that
+underflow to zero (not just those sufficiently less than the smallest
+positive denormalized number).
+  gdtoa.tgz: README: point out that compiling with -DNO_ERRNO inhibits
+errno assignments (by strtod and the core converter, strtodg).
+
+Tue Jan 18 16:35:31 EST 2000
+  dtoa.c and gdtoa.tgz: strtod: modify the test inserted yesterday so
+it may work correctly with buggy 80x87 compilers.  (The change matters,
+e.g., to Microsoft Visual C++ 4.2 and 6.0.)
+
+Thu Nov  2 21:00:45 EST 2000
+  dtoa.c and gdtoa.tgz:
+1. Fix bug in test for exact half-way cases of denormalized numbers
+   (without -DNO_IEEE_Scale).
+2. Compilation with -DNO_ERRNO prevents strtod from assigning
+   errno = ERANGE when the result overflows or underflows to 0.
+3. With IEEE arithmetic and no -DNO_IEEE_Scale, adjust scaling so
+   ulp(d) never returns a denormalized number.  This and other tweaks
+   permit strtod and dtoa to work correctly on machines that flush
+   underflows to zero but otherwise use IEEE arithmetic without
+   Sudden_Underflow being #defined (and with strtod simply returning 0
+   instead of denormalized numbers).
+4. Compilations with -DUSE_LOCALE causes strtod to use the current
+   locale's decimal_point value.
+5. Under compilations with -DINFNAN_CHECK, strtod and strtodg (case
+   insensitively) treat "inf" the same as "infinity" and, unless
+   compiled with -DNo_Hex_NaN, accept "nan(x)", where x is a string of
+   hexadecimal digits and spaces, as a NaN whose value is constructed
+   from x (as explained in comments near the top of dtoa.c and in
+   gdtoaimp.h).
+6. The default PRIVATE_MEM is increased slightly (to 2304), and comments
+   near the top of dtoa.c provide more discussion of PRIVATE_MEM.
+7. Meanings of dtoa modes 4,5,8,9 changed.  See comments in dtoa.c and
+   gdtoa.c; modes 4 and 5 may now provide shorter strings that round
+   (in round-nearest mode) to the given double value.  (Paxson's
+   testbase program is unhappy with this new rounding, as it can
+   introduce an error of more than one base-10 ulp when 17 or more
+   decimal digits are requested.)
+8. With IEEE arithmetic, compilation with -DHonor_FLT_ROUNDS causes
+   strtod and dtoa to round according to FLT_ROUNDS:
+	0 ==> towards 0,
+	1 ==> nearest,
+	2 ==> towards +Infinity,
+	3 ==> towards -Infinity.
+9. With IEEE arithmetic, compilation with -DSET_INEXACT causes extra
+   computation (and sometimes slower conversions in dtoa and strtod,
+   particularly for dtoa in cases where otherwise some simple floating-
+   point computations would suffice) to set the IEEE inexact flag
+   correctly.  As comments in dtoa.c explain in more detail, this
+   requires compilation in an environment (such as #include "dtoa.c"
+   in suitable source) that provides
+		int get_inexact(void);
+		void clear_inexact(void);
+10. On input "-x", return 0 rather than -0.
+
+gdtoa.tgz: gethex.c: adjust logic for reading hex constants to accord
+with current wording of the C99 standard.  Previously, I thought hex
+constants read by strtod and friends had to have either a decimal point
+or an exponent field; p. 307 of the C99 standard states that both are
+optional.  Because of the complexity of this reading, it is available
+only in the variant of strtod that appears in gdtoa.tgz.
+
+strtodg (gdtoa.tgz): New return value STRTOG_NaNbits (with
+STRTOG_NoNumber renumbered).  Allow STRTOG_Neg bit in strtodg returns
+for STRTOG_NaN and STRTOG_NaNbits.
+
+gdtoa.tgz: Fix uninitialized variable bug in g_Qfmt.c's handling of NaNs.
+
+Mon Nov 13 14:00:05 EST 2000
+  gdtoa.tgz: strtodg:  fix a storage leak and an apparently rare infinite
+loop with a boundary case of directed rounding.  Example input to
+gdtoa/test/Qtest where the loop bug bit:
+	r 3
+	35184372088831.999999999999999999999999999999999999
+This was revealed by testbase for quad precision Solaris arithmetic;
+it did not show up in several other testbase configurations.
+
+Wed Feb  7 12:56:11 EST 2001
+  dtoa.c:  fix bug (possible infinite loop, e.g., with
+2.47032822920623272e-324) introduced 20001113 in handling the special
+case of a power of 2 to be rounded down one ulp.  Add test (required
+by changes of 20001113) for the extra special case of 2^-1075 (half
+the smallest denormal).
+  gdtoa.tgz: corresponding adjustments to strtod.c and strtodg.c.
+
+Tue Mar 13 00:46:09 EST 2001
+  gdtoa.tgz: gdtoa/strtodg.c: fix bug in handling values exactly half
+an ulp less than the smallest normal floating-point number;
+gdtoa/*test.c: fix glitch in handling "n ..." lines (intended to
+change "ndig").
+
+Wed Mar  6 10:13:52 EST 2002
+  gdtoa.tgz:  add gdtoa/test/strtodt.c and gdtoa/test/testnos3 to test
+strtod on hard cases posted by Fred Tydeman to comp.arch.arithmetic on
+26 Feb. 1996.  Add comment to gdtoa/README about strtod requiring true
+IEEE arithmetic (with 53-bit rounding precision on 80x87 chips).
+In gdtoa/test, automate selection of expected output files [xQ]*.out.
+
+Wed Mar  5 10:35:41 EST 2003
+  gdtoa.tgz:  fix a bug in strtod's handling of 0-valued 0x... "decimal"
+strings.  A fault was possible.  Thanks to David Shultz for reporting
+this bug.
+
+Tue Mar 18 09:38:28 EST 2003
+  gdtoa.tgz:  fix a glitch in strtodg.c with -DUSE_LOCALE; add #ifdef
+USE_LOCALE lines to g__fmt.c (to affect binary --> decimal conversions
+via the g*fmt routines), and add comments about -DUSE_LOCALE to README.
+In short, compiling strtod.c, strtodg.c, and g__fmt.c with -DUSE_LOCALE
+causes them to determine the decimal-point character from the current
+locale.  (Otherwise it is '.'.)
+
+Fri Mar 21 16:36:27 EST 2003
+  gdtoa.tgz:  gethex.c: add #ifdef USE_LOCAL logic; strtod.c: fix a
+glitch in handling 0x... input (the return from gethex was ignored).
+
+Wed Mar 26 15:35:10 EST 2003
+  gdtoa.tgz:  gethex.c:  pedantic (and normally invisible) change:
+use unsigned char for decimalpoint variable (under -DUSE_LOCALE).
+
+Sat Jan 17 23:58:52 MST 2004
+  gdtoa.tgz:  gethex.c:  supply missing parens in test for whether a
+denormal result should be zero, correct logic for rounding up when the
+result is denormal, and when returning zero or Infinity, set *bp = 0;
+strtod.c:  switch on gethex(...)  & STRTOG_Retmask rather than just on
+gethex(), and only copybits(..., bb) when bb is nonzero.  This
+mattered for underflows and overflows in 0x notation.
+
+Thu Mar 25 22:34:56 MST 2004
+ dtoa.c and gdtoa.c/misc.c:  change "(!x & 1)" to "(!x)" to avoid
+confusion by human readers -- the object code is unaffected (with
+reasonable compilers).
+
+Mon Apr 12 00:44:22 MDT 2004
+ dtoa.c and gdtoa.tar.gz:  update contact info. for dmg and correct
+page numbers in comment on Steele & White (1990).
+ gdtoa.tgz:  add strtodnrp.c for a variant of strtod that is slower
+but does not require 53-bit rounding precision on Intel IA32 systems.
+
+Tue Apr 13 00:28:14 MDT 2004
+ gdtoa.tgz: strtod.c: fix glitch when both INFNAN_CHECK and No_Hex_NaN
+are #defined.  Thanks to David Mendenhall for pointing this bug out.
+
+Wed Jan  5 22:39:17 MST 2005
+  gdtoa.tgz:
+    gethex.c:  fix the bug reported by Stefan Farfeleder of ignoring a
+binary-exponent-part if the converted number is zero.
+    strto[pr]x.c: fix bug reported by Stefan Farfeleder in setting the
+exponent of denormals (which should be 0, not 1).
+    g_xfmt.c: fix a corresponding bug with denormals.
+    strtodg.c: fix a bug under IBM (base 16) arithemtic reported
+by Greg Alexander:  a correction to the binary exponent for changes to
+the exponent of a native double value for avoiding overflow had to be
+multiplied by 4 ("e2 <<= 2;").
+    Various files: minor tweaks for portability.
+
+Sat Jan 15 15:36:03 MST 2005
+  gdtoa.tgz: gethex.c:  fix a glitch introduced last week (and reported
+by Stefan Farfelder) with 0x forms with no nonzero digits before the "."
+character, e.g., 0x.1 (which was rendered as 0 rather than .0625).
+  gdtoa.tgz: many files: add automatic computation of gd_qnan.h for
+giving the system-dependent format of a quiet NaN (the one generated
+for Infinity - Infinity).  Tweak test/makefile so differences in the
+spelling of Infinity ("INF" or "Inf" on some systems) do not matter.
+Fix bug in strtod.c and strtodg.c under which, e.g., -.nan was read
+as NaN rather than unacceptable input (causing return 0).  Adjust
+comments in README about nan(...).  Fix glitch in test/dt.c.
+
+Sun Jan 16 18:22:13 MST 2005
+  gdtoa.tgz: strtodg.c: fix long-standing bug in handling input
+that rounds up to 2^nbits, e.g., strtof("16777215.5").  Thanks to
+Edward Moy for reporting this problem.
+  gdtoa.tgz: Fix some bugs with -DJust_16.
+
+Thu Sep 22 22:40:16 MDT 2005
+gdtoa.tgz:
+  strtod.c: unless prevented by -DNO_FENV_H, include C99's fenv.h
+and with hex input, get the current rounding mode from fegetround().
+With decimal input, strtod honors the rounding mode automatically.
+Thanks to David Schultz (das at FreeBSD dot ORG) for pointing
+  strtodg.c: fix a bug with handling numbers very near the largest
+possible one, which were sometimes incorrectly converted to Infinity.
+Thanks to Edward Moy (emoy at apple dot com) for pointing this out.
+  g_Qfmt.c: change strcpy to strcp.  Thanks to J. T. Conklin
+(jtc at acorntoolworks dot com) for pointing this out.
+  test/xtest.c:  fix some subscript bugs.
+  test/x.ou0, test/x.ou1, test/xL.: update in response to the above fix to
+test/xtest.c.
+  test/makefile:  add -lm to some link lines (needed for fegetround).
+
+Sun Jan 21 20:26:44 MST 2007
+gdtoa.tgz:
+  strtodg.c:  fix a botch in the test of whether to increase rvbits
+before terminating the big for(;;) loop with dsign true:  change
+	if (hi0bits(rvb->x[(rvb->wds - 1) >> kshift])
+			!= j)
+		rvbits++;
+to
+	if (hi0bits(rvb->x[rvb->wds - 1]) != j)
+		rvbits++;
+Example of input where this bug bit:  1.9e27.  Thanks to Edward Moy
+ for providing this example.  Also, simplify the
+preceding computation of j.
+  test/README:  add comment that strtodt needs to operate with 53-bit
+rounding precision on Intel x86 systems, and add a pointer to Paxson's
+paper.
+
+Sat Mar 15 11:44:31 MDT 2008
+  dtoa.c and gdtoa.tgz:  with -DINFNAN_CHECK and without
+-DGDOTA_NON_PEDANTIC_NANCHECK, conform to the ill-advised prescription
+in the C99 standard of consuming (...)  in "nan(...)"  even when ...
+is not of the expected form.  Allow an optional 0x or 0X to precede
+the string of hex digits in the expected form of ... .
+  gdtoa.tgz: gethex.c: have, e.g., strtod("0xyz",&se) set se to "xyz".
+Previously it was incorrectly set to "0xyz".
+
+Thu Aug 28 22:37:35 MDT 2008
+  dtoa.c and gdtoa.tgz:  Fix a bug in strtod when compiled with
+-DHonor_FLT_ROUNDS:  in rounding modes other than "to nearest",
+strtod looped on input larger than and within a factor of 2 of
+the largest finite floating-point number.  Since FLT_ROUNDS is buggy
+on some (Linux) systems in that it does not reflect calls on
+fesetround(), when Honor_FLT_ROUNDS is #defined, get the curren
+rounding mode from fegetround() rather than FLT_ROUNDS, unless
+Trust_FLT_ROUNDS is also #defined.
+  gdtoa/test/getround.c in gdtoa.tgz: simply report the current
+rounding mode when the input line is "r" by itself.  (Previously it
+did so, but also complained of invalid input.)
+  gdtoa/gethex.c: fix an off-by-one bug in a rounding test; detect and
+deal with huge exponents (positive or negative).  This affected the
+reading of hexadecimal floating-point values (0x...).  Also set errno
+to ERANGE on out-of-range values (unless compiled with -DNO_ERRNO).
+  gdtoa/strtod.c: adjust scaling of tinytens[4] (as in dtoa.c) to
+avoid double rounding when dealing with numbers near the bottom of
+the exponent range.
+
+Sat Aug 30 23:37:07 MDT 2008
+  gdtoa/gethex.c: ensure *bp is set to something (NULL if nothing else).
+  Bring gdtoa/xsum0.out and gdtoa/test/xsum0.out up to date.
+
+Tue Sep  9 22:08:30 MDT 2008
+  gdtoa/strto*.c and gdtoa/*fmt.c:  if compiled with -DUSE_LOCALE, use
+the current locale's decimal point character string.
+  gdtoa/gdtoa.c: trim trailing zeros in a missed case (e.g., ndigits = 6
+on 1020302).
+  dtoa.c and gdtoa/strtod.c: on systems with IEEE arithmetic (and without
+NO_ERRNO being defined) set ERANGE for denormal values as well as real
+underflows.
+  gdtoa/strtodg.c:  fix an off-by-one bug in rounding to the largest
+representable magnitude when nbits is a multiple of 32.
+  gdtoa/*fmt.c and gdtoa/gdtoa.h:  bufsize changed from unsigned to size_t.
+  gdtoaimp.h, *fmt.c:  change in calling sequence to internal g__fmt(),
+which now explicitly checks bufsize.
+  Relevant routines (see README) honor the current rounding mode if
+compiled with -DHonor_FLT_ROUNDS on IEEE-arithmetic systems that provide
+the C99 fegetround() function.
+  gdtoa/test/getround.c can optionally be compiled with
+-DHonor_FLT_ROUNDS and/or -DUSE_MY_LOCALE for manual testing of gdtoa.a
+compiled with -DHonor_FLT_ROUNDS or -DUSE_LOCALE.
+
+Fri Oct 10 20:07:15 MDT 2008
+  gdtoa/gethex.c:  fix a bug reading hexadecimal floating-point values
+starting with "0xd" for a nonzero digit d (such as "0x1.0002p3").  The
+bug caused the values to be read as zero with endptr set incorrectly.
+
+Tue Oct 28 00:14:08 MDT 2008
+  gdtoa/strtod.c: fix a comment glitch (with commented {}).
+
+Tue Nov 11 23:05:25 MST 2008
+  gdtoa:  fix a glitch in the strto* routines when compiled with
+-DUSE_LOCALE and the locale's decimal-point string is two or more
+characters long.  Wrong conversions were then possible.
+
+Fri Dec  5 18:20:36 MST 2008
+  gdtoa.tgz: fix bugs with reading C99-style hexadecimal floating-point
+values when compiled with -DPack_16; on IEEE-arithmetic systems, make
+INFNAN_CHECK the default unless NO_INFNAN_CHECK is #defined.  (This is
+consistent with dtoa.c, which has worked this way for a while.)
+  dtoa.c:  add recognition of C99-style hexadecimal floating-point
+values (unless compiled with NO_HEX_FP is #defined).
+
+Thu Dec 11 23:10:23 MST 2008
+  dtoa.c: omit an unused variable.
+
+Fri Jan  2 22:45:33 MST 2009
+  dtoa.c: tweak to banish some compiler warnings.
+
+Sun Mar  1 20:57:22 MST 2009
+  dtoa.c, gdtoa/{g__fmt.c, gethex.c, strtod.c, strtodg.c}: change malloc
+to MALLOC.
+  dtoa.c and gdtoa/gdtoaimp.h and gdtoa/misc.c:  reduce Kmax, and use
+MALLOC and FREE or free for huge blocks, which are possible only in
+pathological cases, such as dtoa calls in mode 3 with thousands of
+digits requested, or strtod() calls with thousand of digits.  For the
+latter case, I have an alternate approach that runs much faster
+and uses less memory, but finding time to get it ready for distribution
+may take a while.
+
+Mon Mar 16 00:32:43 MDT 2009
+  dtoa.c:  Fix a bug under -DUSE_LOCALE in handling "decimal point"
+strings more than one character long.
+  dtoa.c and gdtoa/misc.c:  Remove a buggy test activated with
+-DDEBUG.
+  dtoa.c and gdtoa/gdtoa.c: simplify logic for "4 leading 0 bits".
+  dtoa.c:  Add logic (that can be disabled with -DNO_STRTOD_BIGCOMP
+and that) to strtod for more efficiently handling a very long input
+string.  It proceeds by initially truncating the input string, then if
+necessary comparing the whole string with a decimal expansion to
+decide close cases.  This logic is only used for input more than
+STRTOD_DIGLIM digits long (default 40), and for now only applies to
+IEEE arithmetic (for want of other kinds of platforms on which to run
+tests).  This only appears worthwhile for absurdly long input strings,
+so a corresponding update to gdtoa does not seem warranted.
+  dtoa.c, gdtoa.tgz:  tweaks (mostly adding unnecessary parens) to
+silence "gcc -Wall" warnings.  Aside from a couple of minor changes
+to banish erroneous warnings about uninitialized variables, the tweaks
+do not affect the generated object code.
+
+Sat Apr 11 23:25:58 MDT 2009
+  dtoa.c: fix glitch in compiling with -DNo_Hex_NaN and the bug of
+accepting (e.g.) ".nan" or ".inf" as NaN or Infinity.
+  gdtoa.tgz: tweaks to silence warnings from "gcc -Wstrict-aliasing=2";
+update xsum0.out files.
+
+Sun Apr 19 23:40:24 MDT 2009
+  dtoa.c, gdtoa/misc.c:  do not attempt to allocate large memory blocks
+from the private memory pool (which was an unlikely event, but a bug).
+  gdtoa/strtopx.c, gdtoa/strtopxL.c, gdtoa/strtorx.c, gdtoa/strtorxL.c:
+supply explicit bit for Infinity.  Note that the Q routines (which do
+not supply this bit) are appropriate for Sparc quad precision (probably
+known as long double with most current compilers).
+
+Wed Dec  9 08:14:52 MST 2009
+  gdtoa.tgz:  add gdtoa/printf.c* and modify makefile so "make Printf"
+adds a printf to gdtoa.a (to be accessed with #include "stdio1.h" to
+get gdtoa/stdio1.h, which you might install in some standard place).
+On Intel/AMD i386, x86_64, and Sparc systems, this adds formats %La,
+%Le, %Lf and %Lg to handle long double.  On x86_64 systems, it also
+adds %Lqa, %Lqe, %Lqf and %Lqg to handle 128-bit bit types (called
+__float128 by gcc and _Quad by the Intel compiler).  In gdtoa/test,
+"make pf_test" tests this printf (provided the system is an i386,
+x86_64, or Sparc system).  On x86_64 systems, "make pf_testLq" tests
+the %Lq...  formats (briefly).
+
+Mon Jan 11 22:25:17 MST 2010
+  dtoa.c: fix a minor performance bug and, under compilation with -DDEBUG,
+an erroneous error message "oversize b in quorem" in strtod's processing
+of some input that underflows to zero.  Also fix a bug in bigcomp()'s
+handling of numbers that will scale to denormal values.  The increments
+that bigcomp applied were ignoring the effects of denormalization.
+
+Sat Jan 23 00:25:54 MST 2010
+  dtoa.c:  Fix some glitches in recently introduced changes meant to
+speed up returns in pedantic cases.  In quorem, adjust #ifdef DEBUG
+stuff so it does not complain when bigcomp() calls quorem on input
+near the smallest representable number and rounding up by a bit causes
+a quorem return > 9 (which in this case is not a bug).  Fix a memory
+leak in the unlikely case of overflow only being detected after some
+high-precision integer computations.  Fix an off-by-one bug in
+handling a large number of digits with a few nonzero digits, followed
+by many zeros, and then some nonzero digits.  (This does not happen
+with sensible input.)  Fix an off-by-one bug in a recently introduced
+quick test for underflow (i.e., zero result) on input at the bottom of
+the exponent range.  Thanks to Mark Dickinson for pointing these bugs
+out.
+
+  dtoa.c and gdtoa/strtod.c:  Fix an obscure bug in strtod's handling
+of some inputs of many digits at the bottom of the exponent range:
+results were sometimes off by a bit when gdtoa/strtod.c or dtoa.c was
+compiled without -DNO_IEEE_SCALE and, for dtoa.c, when compiled with
+-DNO_STRTOD_BIGCOMP.
+
+  gdtoa/test/testnos3: add some examples that went wrong before
+the present changes.
+
+Sat Jan 23 23:29:02 MST 2010
+  dtoa.c: more tweaks relevant only to absurd input.
+
+Tue Feb  2 23:05:34 MST 2010
+  dtoa.c: add test for setting errno = ERANGE when input of many digits
+is rounded to Infinity or underflows to zero.  Fix a memory leak in
+such instances.
+  gdtoa/strtod.c: make some corresponding changes.
+
+Wed Jul  7 09:25:46 MDT 2010
+  dtoa.c:  adjust to use bigcomp when necessary when compiled with
+-DHonor_FLT_ROUNDS (and without -DNO_STRTOD_BIGCOMP), and the rounding
+mode is torwards +Infinity.  An input (supplied by Rick Regan
+) where this matters is
+1.100000000000000088817841970012523233890533447265626
+  gdtoa/strtod.c:  fix errors (introduced 20090411) when compiled
+with -DHonor_FLT_ROUNDS.
+
+Wed Sep 15 09:00:26 MDT 2010
+  dtoa.c, gdtoa/dtoa.c, gdtoa/gdtoa.c:  fix bugs with -DROUND_BIASED
+pointed out by Jay Foad.
+
+Mon Sep 27 13:43:30 MDT 2010
+  gdtoa/gdtoa.c: fix a glitch (not revealed by compilation) in the
+changes of 15 Sept. 2010.
+
+Fri Nov  5 13:02:41 MDT 2010
+  dtoa.c:  fix a bug related to bigcomp:  decimal strings with all
+zeros before the decimal point more than 40 significant digits that
+required use of bigcomp might be converted very incorrectly.
+Example: .010000000000000000057612911342378542997169 .
+Thanks to Rick Regan  for reporting the
+symptoms and providing an example.
+
+20110403:
+  dtoa.c, gdtoa/gdtoaimp.h, gdtoa/strtod.c:  if
+ROUND_BIASED_without_Round_Up is #defined, assume ROUND_BIASED and
+omit the quick computation that would use ordinary arithmetic to
+compute the correctly rounded result with one rounding error.  If you
+want biased rounding with IEEE-style format "double" and will operate
+with rounding toward +Infinity, it suffices to #define ROUND_BIASED
+(and thus retain the quick computation when it is appropriate).
+  gdtoa/gdtoa.h: change default Long from long to int (with the goal
+of portability when compiling without -DLong=... specified).  On some
+64-bit systems, long is a 64-bit type; we need a 32-bit type here.
+  dtoa.c, gdtoa/gdtoa.c: fix a glith with ndigits with mode = 4 at
+the bottom of the exponent range, e.g., 1e-323.

Modified: vendor/gdtoa/dist/dtoa.c
==============================================================================
--- vendor/gdtoa/dist/dtoa.c	Wed Mar  9 05:59:33 2011	(r219421)
+++ vendor/gdtoa/dist/dtoa.c	Wed Mar  9 06:14:33 2011	(r219422)
@@ -75,10 +75,10 @@ THIS SOFTWARE.
  char *
 dtoa
 #ifdef KR_headers
-	(d, mode, ndigits, decpt, sign, rve)
-	double d; int mode, ndigits, *decpt, *sign; char **rve;
+	(d0, mode, ndigits, decpt, sign, rve)
+	double d0; int mode, ndigits, *decpt, *sign; char **rve;
 #else
-	(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
+	(double d0, int mode, int ndigits, int *decpt, int *sign, char **rve)
 #endif
 {
  /*	Arguments ndigits, decpt, sign are similar to those
@@ -124,7 +124,8 @@ dtoa
 	ULong x;
 #endif
 	Bigint *b, *b1, *delta, *mlo, *mhi, *S;
-	double d2, ds, eps;
+	U d, d2, eps;
+	double ds;
 	char *s, *s0;
 #ifdef SET_INEXACT
 	int inexact, oldinexact;
@@ -149,35 +150,35 @@ dtoa
 		dtoa_result = 0;
 		}
 #endif
-
-	if (word0(d) & Sign_bit) {
+	d.d = d0;
+	if (word0(&d) & Sign_bit) {
 		/* set sign for everything, including 0's and NaNs */
 		*sign = 1;
-		word0(d) &= ~Sign_bit;	/* clear sign bit */
+		word0(&d) &= ~Sign_bit;	/* clear sign bit */
 		}
 	else
 		*sign = 0;
 
 #if defined(IEEE_Arith) + defined(VAX)
 #ifdef IEEE_Arith
-	if ((word0(d) & Exp_mask) == Exp_mask)
+	if ((word0(&d) & Exp_mask) == Exp_mask)
 #else
-	if (word0(d)  == 0x8000)
+	if (word0(&d)  == 0x8000)
 #endif
 		{
 		/* Infinity or NaN */
 		*decpt = 9999;
 #ifdef IEEE_Arith
-		if (!word1(d) && !(word0(d) & 0xfffff))
+		if (!word1(&d) && !(word0(&d) & 0xfffff))
 			return nrv_alloc("Infinity", rve, 8);
 #endif
 		return nrv_alloc("NaN", rve, 3);
 		}
 #endif
 #ifdef IBM
-	dval(d) += 0; /* normalize */
+	dval(&d) += 0; /* normalize */
 #endif
-	if (!dval(d)) {
+	if (!dval(&d)) {
 		*decpt = 1;
 		return nrv_alloc("0", rve, 1);
 		}
@@ -196,26 +197,26 @@ dtoa
 		}
 #endif
 
-	b = d2b(dval(d), &be, &bbits);
+	b = d2b(dval(&d), &be, &bbits);
 #ifdef Sudden_Underflow
-	i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
+	i = (int)(word0(&d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
 #else
-	if (( i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)) )!=0) {
+	if (( i = (int)(word0(&d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)) )!=0) {
 #endif
-		dval(d2) = dval(d);
-		word0(d2) &= Frac_mask1;
-		word0(d2) |= Exp_11;
+		dval(&d2) = dval(&d);
+		word0(&d2) &= Frac_mask1;
+		word0(&d2) |= Exp_11;
 #ifdef IBM
-		if (( j = 11 - hi0bits(word0(d2) & Frac_mask) )!=0)
-			dval(d2) /= 1 << j;
+		if (( j = 11 - hi0bits(word0(&d2) & Frac_mask) )!=0)
+			dval(&d2) /= 1 << j;
 #endif
 
 		/* log(x)	~=~ log(1.5) + (x-1.5)/1.5
 		 * log10(x)	 =  log(x) / log(10)
 		 *		~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10))
-		 * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2)
+		 * log10(&d) = (i-Bias)*log(2)/log(10) + log10(&d2)
 		 *
-		 * This suggests computing an approximation k to log10(d) by
+		 * This suggests computing an approximation k to log10(&d) by
 		 *
 		 * k = (i - Bias)*0.301029995663981
 		 *	+ ( (d2-1.5)*0.289529654602168 + 0.176091259055681 );
@@ -244,21 +245,21 @@ dtoa
 		/* d is denormalized */
 
 		i = bbits + be + (Bias + (P-1) - 1);
-		x = i > 32  ? word0(d) << 64 - i | word1(d) >> i - 32
-			    : word1(d) << 32 - i;
-		dval(d2) = x;
-		word0(d2) -= 31*Exp_msk1; /* adjust exponent */
+		x = i > 32  ? word0(&d) << (64 - i) | word1(&d) >> (i - 32)
+			    : word1(&d) << (32 - i);
+		dval(&d2) = x;
+		word0(&d2) -= 31*Exp_msk1; /* adjust exponent */
 		i -= (Bias + (P-1) - 1) + 1;
 		denorm = 1;
 		}
 #endif
-	ds = (dval(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
+	ds = (dval(&d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
 	k = (int)ds;
 	if (ds < 0. && ds != k)
 		k--;	/* want k = floor(ds) */
 	k_check = 1;
 	if (k >= 0 && k <= Ten_pmax) {
-		if (dval(d) < tens[k])
+		if (dval(&d) < tens[k])
 			k--;
 		k_check = 0;
 		}
@@ -297,10 +298,11 @@ dtoa
 		try_quick = 0;
 		}
 	leftright = 1;
+	ilim = ilim1 = -1;	/* Values for cases 0 and 1; done here to */
+				/* silence erroneous "gcc -Wall" warning. */
 	switch(mode) {
 		case 0:
 		case 1:
-			ilim = ilim1 = -1;
 			i = 18;
 			ndigits = 0;
 			break;
@@ -334,7 +336,7 @@ dtoa
 		/* Try to get by with floating-point arithmetic. */
 
 		i = 0;
-		dval(d2) = dval(d);
+		dval(&d2) = dval(&d);
 		k0 = k;
 		ilim0 = ilim;
 		ieps = 2; /* conservative */
@@ -344,7 +346,7 @@ dtoa
 			if (j & Bletch) {
 				/* prevent overflows */
 				j &= Bletch - 1;
-				dval(d) /= bigtens[n_bigtens-1];
+				dval(&d) /= bigtens[n_bigtens-1];
 				ieps++;
 				}
 			for(; j; j >>= 1, i++)
@@ -352,32 +354,32 @@ dtoa
 					ieps++;
 					ds *= bigtens[i];
 					}
-			dval(d) /= ds;
+			dval(&d) /= ds;
 			}
 		else if (( j1 = -k )!=0) {
-			dval(d) *= tens[j1 & 0xf];
+			dval(&d) *= tens[j1 & 0xf];
 			for(j = j1 >> 4; j; j >>= 1, i++)
 				if (j & 1) {
 					ieps++;
-					dval(d) *= bigtens[i];
+					dval(&d) *= bigtens[i];
 					}
 			}
-		if (k_check && dval(d) < 1. && ilim > 0) {
+		if (k_check && dval(&d) < 1. && ilim > 0) {
 			if (ilim1 <= 0)
 				goto fast_failed;
 			ilim = ilim1;
 			k--;
-			dval(d) *= 10.;
+			dval(&d) *= 10.;
 			ieps++;
 			}
-		dval(eps) = ieps*dval(d) + 7.;
-		word0(eps) -= (P-1)*Exp_msk1;
+		dval(&eps) = ieps*dval(&d) + 7.;
+		word0(&eps) -= (P-1)*Exp_msk1;
 		if (ilim == 0) {
 			S = mhi = 0;
-			dval(d) -= 5.;
-			if (dval(d) > dval(eps))
+			dval(&d) -= 5.;
+			if (dval(&d) > dval(&eps))
 				goto one_digit;
-			if (dval(d) < -dval(eps))
+			if (dval(&d) < -dval(&eps))
 				goto no_digits;
 			goto fast_failed;
 			}
@@ -386,34 +388,34 @@ dtoa
 			/* Use Steele & White method of only
 			 * generating digits needed.
 			 */
-			dval(eps) = 0.5/tens[ilim-1] - dval(eps);
+			dval(&eps) = 0.5/tens[ilim-1] - dval(&eps);
 			for(i = 0;;) {
-				L = dval(d);
-				dval(d) -= L;
+				L = dval(&d);
+				dval(&d) -= L;
 				*s++ = '0' + (int)L;
-				if (dval(d) < dval(eps))
+				if (dval(&d) < dval(&eps))
 					goto ret1;
-				if (1. - dval(d) < dval(eps))
+				if (1. - dval(&d) < dval(&eps))
 					goto bump_up;
 				if (++i >= ilim)
 					break;
-				dval(eps) *= 10.;
-				dval(d) *= 10.;
+				dval(&eps) *= 10.;
+				dval(&d) *= 10.;
 				}
 			}
 		else {
 #endif
 			/* Generate ilim digits, then fix them up. */
-			dval(eps) *= tens[ilim-1];
-			for(i = 1;; i++, dval(d) *= 10.) {
-				L = (Long)(dval(d));
-				if (!(dval(d) -= L))
+			dval(&eps) *= tens[ilim-1];
+			for(i = 1;; i++, dval(&d) *= 10.) {
+				L = (Long)(dval(&d));
+				if (!(dval(&d) -= L))
 					ilim = i;
 				*s++ = '0' + (int)L;
 				if (i == ilim) {
-					if (dval(d) > 0.5 + dval(eps))
+					if (dval(&d) > 0.5 + dval(&eps))
 						goto bump_up;
-					else if (dval(d) < 0.5 - dval(eps)) {
+					else if (dval(&d) < 0.5 - dval(&eps)) {
 						while(*--s == '0');
 						s++;
 						goto ret1;
@@ -426,7 +428,7 @@ dtoa
 #endif
  fast_failed:
 		s = s0;
-		dval(d) = dval(d2);
+		dval(&d) = dval(&d2);
 		k = k0;
 		ilim = ilim0;
 		}
@@ -438,22 +440,22 @@ dtoa
 		ds = tens[k];
 		if (ndigits < 0 && ilim <= 0) {
 			S = mhi = 0;
-			if (ilim < 0 || dval(d) <= 5*ds)
+			if (ilim < 0 || dval(&d) <= 5*ds)
 				goto no_digits;
 			goto one_digit;
 			}
-		for(i = 1;; i++, dval(d) *= 10.) {
-			L = (Long)(dval(d) / ds);
-			dval(d) -= L*ds;
+		for(i = 1;; i++, dval(&d) *= 10.) {
+			L = (Long)(dval(&d) / ds);
+			dval(&d) -= L*ds;
 #ifdef Check_FLT_ROUNDS
 			/* If FLT_ROUNDS == 2, L will usually be high by 1 */
-			if (dval(d) < 0) {
+			if (dval(&d) < 0) {
 				L--;
-				dval(d) += ds;
+				dval(&d) += ds;
 				}
 #endif
 			*s++ = '0' + (int)L;
-			if (!dval(d)) {
+			if (!dval(&d)) {
 #ifdef SET_INEXACT
 				inexact = 0;
 #endif
@@ -467,8 +469,13 @@ dtoa
 				  case 2: goto bump_up;
 				  }
 #endif
-				dval(d) += dval(d);
-				if (dval(d) > ds || dval(d) == ds && L & 1) {
+				dval(&d) += dval(&d);
+#ifdef ROUND_BIASED
+				if (dval(&d) >= ds)
+#else
+				if (dval(&d) > ds || (dval(&d) == ds && L & 1))
+#endif
+					{
  bump_up:

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 06:14:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 414A1106564A;
	Wed,  9 Mar 2011 06:14:58 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1793D8FC0A;
	Wed,  9 Mar 2011 06:14:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p296Ev4o098976;
	Wed, 9 Mar 2011 06:14:57 GMT (envelope-from das@svn.freebsd.org)
Received: (from das@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p296Evbs098975;
	Wed, 9 Mar 2011 06:14:57 GMT (envelope-from das@svn.freebsd.org)
Message-Id: <201103090614.p296Evbs098975@svn.freebsd.org>
From: David Schultz 
Date: Wed, 9 Mar 2011 06:14:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219423 - vendor/gdtoa/20110304
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 06:14:58 -0000

Author: das
Date: Wed Mar  9 06:14:57 2011
New Revision: 219423
URL: http://svn.freebsd.org/changeset/base/219423

Log:
  Tag gdtoa-20110304.

Added:
  vendor/gdtoa/20110304/
     - copied from r219422, vendor/gdtoa/dist/

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 07:43:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A58A3106564A;
	Wed,  9 Mar 2011 07:43:51 +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 951C38FC13;
	Wed,  9 Mar 2011 07:43:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p297hpGS001416;
	Wed, 9 Mar 2011 07:43:51 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p297hpe2001414;
	Wed, 9 Mar 2011 07:43:51 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103090743.p297hpe2001414@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Wed, 9 Mar 2011 07:43: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: r219424 - head/sbin/geom/class/eli
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 07:43:51 -0000

Author: pjd
Date: Wed Mar  9 07:43:51 2011
New Revision: 219424
URL: http://svn.freebsd.org/changeset/base/219424

Log:
  Change example to not be controversial.
  I'm sorry to anyone who felt offended by this.
  
  PR:		docs/155385
  Reported by:	maga_lena 
  MFC after:	1 week

Modified:
  head/sbin/geom/class/eli/geli.8

Modified: head/sbin/geom/class/eli/geli.8
==============================================================================
--- head/sbin/geom/class/eli/geli.8	Wed Mar  9 06:14:57 2011	(r219423)
+++ head/sbin/geom/class/eli/geli.8	Wed Mar  9 07:43:51 2011	(r219424)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 3, 2010
+.Dd March 9, 2011
 .Dt GELI 8
 .Os
 .Sh NAME
@@ -694,15 +694,17 @@ Enter passphrase:
 .Ed
 .Pp
 Create an encrypted provider, but use two keys:
-one for your girlfriend and one for
-you (so there will be no tragedy if she forgets her passphrase):
+one for your employee and one for you as company's security officer
+(so there is no tragedy if the employee
+.Qq accidentally
+forgets his passphrase):
 .Bd -literal -offset indent
 # geli init /dev/da2
-Enter new passphrase:	(enter your passphrase)
+Enter new passphrase:	(enter security officer passphrase)
 Reenter new passphrase:
 # geli setkey -n 1 /dev/da2
-Enter passphrase:	(enter your passphrase)
-Enter new passphrase:	(let your girlfriend enter her passphrase ...)
+Enter passphrase:	(enter security officer passphrase)
+Enter new passphrase:	(let your employee enter his passphrase ...)
 Reenter new passphrase:	(... twice)
 .Ed
 .Pp

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 08:10:38 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E0F9106564A;
	Wed,  9 Mar 2011 08:10:38 +0000 (UTC)
	(envelope-from sobomax@sippysoft.com)
Received: from mail.sippysoft.com (mail.sippysoft.com [4.59.13.245])
	by mx1.freebsd.org (Postfix) with ESMTP id 661078FC14;
	Wed,  9 Mar 2011 08:10:38 +0000 (UTC)
Received: from s0106005004e13421.vs.shawcable.net ([70.71.175.212]
	helo=[192.168.1.79])
	by mail.sippysoft.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.72 (FreeBSD)) (envelope-from )
	id 1PxE2O-000JZA-HT; Tue, 08 Mar 2011 23:42:28 -0800
Message-ID: <4D772F5B.5050508@FreeBSD.org>
Date: Tue, 08 Mar 2011 23:42:19 -0800
From: Maxim Sobolev 
Organization: Sippy Software, Inc.
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
To: Jaakko Heinonen 
References: <201103081700.p28H0V9A080455@svn.freebsd.org>
	<20110308173611.GA44635@ws64.jh.dy.fi>
In-Reply-To: <20110308173611.GA44635@ws64.jh.dy.fi>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sender: sobomax@sippysoft.com
X-ssp-trusted: yes
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219400 - head/sys/geom/label
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 08:10:38 -0000

On 3/8/2011 9:36 AM, Jaakko Heinonen wrote:
>>    Some linux distros put mount point into the ext2fs labels, such as '/', or
>> >     '/boot', which confuses the devfs code and can cause userland programs to
>> >     fail reading /dev/ext2fs directory with weird error code, such as any
>> >     program that uses pwlib.
> Do you still see such behavior after r214063?
>
>> >     Strip any leading slashes before feeding the label to the geom_label code.
> make_dev*() should strip redundant slashes since r213526.

I have only observed this issue with 7.4. It looks like r213526 might 
work as well, but unfortunately this revision is not directly applicable 
to the 7-STABLE. Do you have any plans to MFC it into 7.x?

-Maxim

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 08:38:05 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 9598C1065670; Wed,  9 Mar 2011 08:38:05 +0000 (UTC)
Date: Wed, 9 Mar 2011 08:38:05 +0000
From: Alexey Dokuchaev 
To: Pawel Jakub Dawidek 
Message-ID: <20110309083805.GA2005@FreeBSD.org>
References: <201103090743.p297hpe2001414@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <201103090743.p297hpe2001414@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: r219424 - head/sbin/geom/class/eli
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 08:38:05 -0000

On Wed, Mar 09, 2011 at 07:43:51AM +0000, Pawel Jakub Dawidek wrote:
> Author: pjd
> Date: Wed Mar  9 07:43:51 2011
> New Revision: 219424
> URL: http://svn.freebsd.org/changeset/base/219424
> 
> Log:
>   Change example to not be controversial.
>   I'm sorry to anyone who felt offended by this.
>   
>   PR:		docs/155385

Sorry to see these little jokes go, but Lena does have her merits.
However, there are still traces of "sexism" present in new version:
employee is assumed to be male.  :-)  Replacing "his" with "their"
is standard way out in cases like this, I believe.

./danfe

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 09:15:09 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A12681065673;
	Wed,  9 Mar 2011 09:15:09 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 877578FC14;
	Wed,  9 Mar 2011 09:15:07 +0000 (UTC)
Received: by wwc33 with SMTP id 33so339147wwc.31
	for ; Wed, 09 Mar 2011 01:15:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=tq/egbV3KIIjvnGx822eJLW1VD0br/k7t2uDEaeXIu4=;
	b=qN0HXFafmZTsZRu1bQSqN+O0UdaDzhgl4htIr5acZ1WBHVHKo7izbKgO40dpudhEGh
	lOtvVHEfhcPoLiXGfClcnhuE1bYG1puMvqRrxBRJp22xsM1mi8S+UuNgSOar5n6Zir/m
	TXHLf5CTD79LRB8UJAUY75Aly7xxYnMfIGECA=
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=C1bEXRDmcUB8kl/EiU4X8ZblZiB4zKinMArPIdDL9f0VlSWuE2NasM863mIbmstBlL
	B520oMc1gXxZtQIN1gSFDplul7a2MFwjsx+BNgH7KODJutsvRrzDHd36qq4KqzavPMeQ
	+4kqb78RbgKFScSKXQBluwxtrdVV6N5WEBiUo=
MIME-Version: 1.0
Received: by 10.216.122.193 with SMTP id t43mr5194624weh.60.1299661738702;
	Wed, 09 Mar 2011 01:08:58 -0800 (PST)
Sender: yanegomi@gmail.com
Received: by 10.216.172.7 with HTTP; Wed, 9 Mar 2011 01:08:58 -0800 (PST)
In-Reply-To: <20110309083805.GA2005@FreeBSD.org>
References: <201103090743.p297hpe2001414@svn.freebsd.org>
	<20110309083805.GA2005@FreeBSD.org>
Date: Wed, 9 Mar 2011 01:08:58 -0800
X-Google-Sender-Auth: RWn6Bd8De1XP9dzxP__CyAscppo
Message-ID: 
From: Garrett Cooper 
To: Alexey Dokuchaev 
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, Pawel Jakub Dawidek 
Subject: Re: svn commit: r219424 - head/sbin/geom/class/eli
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 09:15:09 -0000

2011/3/9 Alexey Dokuchaev :
> On Wed, Mar 09, 2011 at 07:43:51AM +0000, Pawel Jakub Dawidek wrote:
>> Author: pjd
>> Date: Wed Mar =A09 07:43:51 2011
>> New Revision: 219424
>> URL: http://svn.freebsd.org/changeset/base/219424
>>
>> Log:
>> =A0 Change example to not be controversial.
>> =A0 I'm sorry to anyone who felt offended by this.
>>
>> =A0 PR: =A0 =A0 =A0 =A0 docs/155385
>
> Sorry to see these little jokes go, but Lena does have her merits.
> However, there are still traces of "sexism" present in new version:
> employee is assumed to be male. =A0:-) =A0Replacing "his" with "their"
> is standard way out in cases like this, I believe.

    Actually the proper way is "his or her". It's grammatically
correct and doesn't necessarily imply gender supremacy.
Thanks,
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 12:14:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4A06106566C;
	Wed,  9 Mar 2011 12:14:49 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2CDE8FC1B;
	Wed,  9 Mar 2011 12:14: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 p29CEnGg008509;
	Wed, 9 Mar 2011 12:14:49 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29CEnsA008505;
	Wed, 9 Mar 2011 12:14:49 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201103091214.p29CEnsA008505@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Wed, 9 Mar 2011 12:14:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219425 - in stable/8/sys: amd64/amd64 vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 12:14:50 -0000

Author: pluknet
Date: Wed Mar  9 12:14:49 2011
New Revision: 219425
URL: http://svn.freebsd.org/changeset/base/219425

Log:
  MFC r202897,r208164,r212174: msgbufp mapping changes on amd64.
  
  r202897 by alc:
  
   Simplify the mapping of the system message buffer.  Use the direct map just
   like ia64 does.
  
  r208164 by alc:
  
   Correct an error of omission in r202897: Now that amd64 uses the direct map
   to access the message buffer, we must explicitly request that the underlying
   physical pages are included in a crash dump.
  
  r212174 by avg:
  
   vm_page.c: include opt_msgbuf.h for MSGBUF_SIZE use in vm_page_startup
  
  Approved by:	alc, kib (mentor), avg (mentor)

Modified:
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/pmap.c
  stable/8/sys/vm/vm_page.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Wed Mar  9 07:43:51 2011	(r219424)
+++ stable/8/sys/amd64/amd64/machdep.c	Wed Mar  9 12:14:49 2011	(r219425)
@@ -157,6 +157,8 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST,
 extern vm_offset_t ksym_start, ksym_end;
 #endif
 
+struct msgbuf *msgbufp;
+
 /* Intel ICH registers */
 #define ICH_PMBASE	0x400
 #define ICH_SMI_EN	ICH_PMBASE + 0x30
@@ -1288,7 +1290,7 @@ add_smap_entry(struct bios_smap *smap, v
 static void
 getmemsize(caddr_t kmdp, u_int64_t first)
 {
-	int i, off, physmap_idx, pa_indx, da_indx;
+	int i, physmap_idx, pa_indx, da_indx;
 	vm_paddr_t pa, physmap[PHYSMAP_SIZE];
 	u_long physmem_tunable;
 	pt_entry_t *pte;
@@ -1521,9 +1523,7 @@ do_next:
 	phys_avail[pa_indx] -= round_page(MSGBUF_SIZE);
 
 	/* Map the message buffer. */
-	for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE)
-		pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] +
-		    off);
+	msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]);
 }
 
 u_int64_t

Modified: stable/8/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/8/sys/amd64/amd64/pmap.c	Wed Mar  9 07:43:51 2011	(r219424)
+++ stable/8/sys/amd64/amd64/pmap.c	Wed Mar  9 12:14:49 2011	(r219425)
@@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$");
  *	and to when physical maps must be made correct.
  */
 
-#include "opt_msgbuf.h"
 #include "opt_pmap.h"
 #include "opt_vm.h"
 
@@ -116,7 +115,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -211,7 +209,6 @@ static int shpgperproc = PMAP_SHPGPERPRO
  */
 pt_entry_t *CMAP1 = 0;
 caddr_t CADDR1 = 0;
-struct msgbuf *msgbufp = 0;
 
 /*
  * Crashdump maps.
@@ -578,11 +575,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
 	 */
 	SYSMAP(caddr_t, unused, crashdumpmap, MAXDUMPPGS)
 
-	/*
-	 * msgbufp is used to map the system message buffer.
-	 */
-	SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE)))
-
 	virtual_avail = va;
 
 	*CMAP1 = 0;

Modified: stable/8/sys/vm/vm_page.c
==============================================================================
--- stable/8/sys/vm/vm_page.c	Wed Mar  9 07:43:51 2011	(r219424)
+++ stable/8/sys/vm/vm_page.c	Wed Mar  9 12:14:49 2011	(r219425)
@@ -100,6 +100,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_msgbuf.h"
 #include "opt_vm.h"
 
 #include 
@@ -108,6 +109,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -313,6 +315,19 @@ vm_page_startup(vm_offset_t vaddr)
 	    new_end + vm_page_dump_size, VM_PROT_READ | VM_PROT_WRITE);
 	bzero((void *)vm_page_dump, vm_page_dump_size);
 #endif
+#ifdef __amd64__
+	/*
+	 * Request that the physical pages underlying the message buffer be
+	 * included in a crash dump.  Since the message buffer is accessed
+	 * through the direct map, they are not automatically included.
+	 */
+	pa = DMAP_TO_PHYS((vm_offset_t)msgbufp->msg_ptr);
+	last_pa = pa + round_page(MSGBUF_SIZE);
+	while (pa < last_pa) {
+		dump_add_page(pa);
+		pa += PAGE_SIZE;
+	}
+#endif
 	/*
 	 * Compute the number of pages of memory that will be available for
 	 * use (taking into account the overhead of a page structure per

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 14:38:00 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9D959106566B;
	Wed,  9 Mar 2011 14:38:00 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B7728FC14;
	Wed,  9 Mar 2011 14:38: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 p29Ec0Bg011723;
	Wed, 9 Mar 2011 14:38:00 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29Ec0Jr011721;
	Wed, 9 Mar 2011 14:38:00 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201103091438.p29Ec0Jr011721@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 9 Mar 2011 14:38: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: r219426 - head/lib/libpam/modules/pam_ssh
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 14:38:00 -0000

Author: des
Date: Wed Mar  9 14:38:00 2011
New Revision: 219426
URL: http://svn.freebsd.org/changeset/base/219426

Log:
  No newline required.
  
  MFC after:	2 weeks

Modified:
  head/lib/libpam/modules/pam_ssh/pam_ssh.c

Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c
==============================================================================
--- head/lib/libpam/modules/pam_ssh/pam_ssh.c	Wed Mar  9 12:14:49 2011	(r219425)
+++ head/lib/libpam/modules/pam_ssh/pam_ssh.c	Wed Mar  9 14:38:00 2011	(r219426)
@@ -103,11 +103,11 @@ pam_ssh_load_key(const char *dir, const 
 	comment = NULL;
 	key = key_load_private(fn, passphrase, &comment);
 	if (key == NULL) {
-		openpam_log(PAM_LOG_DEBUG, "failed to load key from %s\n", fn);
+		openpam_log(PAM_LOG_DEBUG, "failed to load key from %s", fn);
 		return (NULL);
 	}
 
-	openpam_log(PAM_LOG_DEBUG, "loaded '%s' from %s\n", comment, fn);
+	openpam_log(PAM_LOG_DEBUG, "loaded '%s' from %s", comment, fn);
 	if ((psk = malloc(sizeof(*psk))) == NULL) {
 		key_free(key);
 		free(comment);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 15:02:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E3431065675;
	Wed,  9 Mar 2011 15:02:24 +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 1D6278FC15;
	Wed,  9 Mar 2011 15:02: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 p29F2OQ3012354;
	Wed, 9 Mar 2011 15:02:24 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29F2Ogl012352;
	Wed, 9 Mar 2011 15:02:24 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103091502.p29F2Ogl012352@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 9 Mar 2011 15:02: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: r219427 - head/release
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 15:02:24 -0000

Author: nwhitehorn
Date: Wed Mar  9 15:02:23 2011
New Revision: 219427
URL: http://svn.freebsd.org/changeset/base/219427

Log:
  Remove a redundant rm and avoiding tarring up work directories in ports
  trees.

Modified:
  head/release/Makefile.bsdinstall

Modified: head/release/Makefile.bsdinstall
==============================================================================
--- head/release/Makefile.bsdinstall	Wed Mar  9 14:38:00 2011	(r219426)
+++ head/release/Makefile.bsdinstall	Wed Mar  9 15:02:23 2011	(r219427)
@@ -59,7 +59,7 @@ src.txz:
 ports.txz:
 	-mkdir -p ${DISTDIR}/usr
 	ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
-	cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz --exclude usr/ports/distfiles --exclude usr/ports/packages --exclude 'usr/ports/INDEX*' usr/ports
+	cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz --exclude usr/ports/distfiles --exclude usr/ports/packages --exclude 'usr/ports/INDEX*' --exclude work usr/ports
 
 system: packagesystem
 # Install system
@@ -100,5 +100,4 @@ clean:
 	rm -f system
 	rm -rf ${.OBJDIR}/release
 	rm -f ${.OBJDIR}/release.iso
-	rm -f ${.OBJDIR}/*.txz
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 15:03:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 379AA1065670;
	Wed,  9 Mar 2011 15:03: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 E27A18FC22;
	Wed,  9 Mar 2011 15:03: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 p29F3g8t012441;
	Wed, 9 Mar 2011 15:03:42 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29F3gmm012439;
	Wed, 9 Mar 2011 15:03:42 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103091503.p29F3gmm012439@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 9 Mar 2011 15:03: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: r219428 - head/sys/powerpc/ofw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 15:03:43 -0000

Author: nwhitehorn
Date: Wed Mar  9 15:03:42 2011
New Revision: 219428
URL: http://svn.freebsd.org/changeset/base/219428

Log:
  Fix whitespace nit.

Modified:
  head/sys/powerpc/ofw/ofw_machdep.c

Modified: head/sys/powerpc/ofw/ofw_machdep.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_machdep.c	Wed Mar  9 15:02:23 2011	(r219427)
+++ head/sys/powerpc/ofw/ofw_machdep.c	Wed Mar  9 15:03:42 2011	(r219428)
@@ -436,7 +436,7 @@ openfirmware_core(void *args)
 	isync();
 #endif
 
-       	result = ofwcall(args);
+	result = ofwcall(args);
 	ofw_sprg_restore();
 
 	intr_restore(oldmsr);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 15:19:44 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BF507106566B;
	Wed,  9 Mar 2011 15:19:44 +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 7D3B78FC19;
	Wed,  9 Mar 2011 15:19:44 +0000 (UTC)
Received: from a91-153-123-205.elisa-laajakaista.fi
	(a91-153-123-205.elisa-laajakaista.fi [91.153.123.205])
	by gw03.mail.saunalahti.fi (Postfix) with SMTP id B6DDA2168A2;
	Wed,  9 Mar 2011 17:19:38 +0200 (EET)
Date: Wed, 9 Mar 2011 17:19:38 +0200
From: Jaakko Heinonen 
To: Maxim Sobolev 
Message-ID: <20110309151938.GA1526@a91-153-123-205.elisa-laajakaista.fi>
References: <201103081700.p28H0V9A080455@svn.freebsd.org>
	<20110308173611.GA44635@ws64.jh.dy.fi>
	<4D772F5B.5050508@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4D772F5B.5050508@FreeBSD.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219400 - head/sys/geom/label
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 15:19:44 -0000

On 2011-03-08, Maxim Sobolev wrote:
> On 3/8/2011 9:36 AM, Jaakko Heinonen wrote:
> >>   Some linux distros put mount point into the ext2fs labels, such as '/', or
> >>>     '/boot', which confuses the devfs code and can cause userland programs to
> >>>     fail reading /dev/ext2fs directory with weird error code, such as any
> >>>     program that uses pwlib.
> 
> I have only observed this issue with 7.4.

OK, good to know. Head version of devfs should not have the problems you
described in the commit message.

> It looks like r213526 might work as well, but unfortunately this
> revision is not directly applicable to the 7-STABLE. Do you have any
> plans to MFC it into 7.x?

I don't have plans to MFC it to stable/7. r213526 is related to larger
set of devfs changes I committed last year.

-- 
Jaakko

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 15:27:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2B0A11065670;
	Wed,  9 Mar 2011 15:27:12 +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 18D108FC0C;
	Wed,  9 Mar 2011 15:27: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 p29FRB3I013018;
	Wed, 9 Mar 2011 15:27:11 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29FRB82013015;
	Wed, 9 Mar 2011 15:27:11 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103091527.p29FRB82013015@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 9 Mar 2011 15:27:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219429 - in stable/8: share/man/man5 sys/fs/tmpfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 15:27:12 -0000

Author: jh
Date: Wed Mar  9 15:27:11 2011
New Revision: 219429
URL: http://svn.freebsd.org/changeset/base/219429

Log:
  MFC r203164:
  
  Add "maxfilesize" mount option for tmpfs to allow specifying the
  maximum file size limit. Default is UINT64_MAX when the option is
  not specified. It was useless to set the limit to the total amount of
  memory and swap in the system.
  
  Use tmpfs_mem_info() rather than get_swpgtotal() in tmpfs_mount() to
  check if there is enough memory available.
  
  Remove now unused get_swpgtotal().
  
  MFC r203169:
  
  Bump .Dd for r203164.

Modified:
  stable/8/share/man/man5/tmpfs.5
  stable/8/sys/fs/tmpfs/tmpfs_vfsops.c
Directory Properties:
  stable/8/share/man/man5/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/share/man/man5/tmpfs.5
==============================================================================
--- stable/8/share/man/man5/tmpfs.5	Wed Mar  9 15:03:42 2011	(r219428)
+++ stable/8/share/man/man5/tmpfs.5	Wed Mar  9 15:27:11 2011	(r219429)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 12, 2008
+.Dd January 29, 2010
 .Dt TMPFS 5
 .Os
 .Sh NAME
@@ -70,6 +70,8 @@ permissions in octal format.
 maximum number of inodes.
 .It Cm size
 maximum size (in bytes) for the file system.
+.It Cm maxfilesize
+maximum file size (in bytes).
 .El
 .Sh EXAMPLES
 To mount a

Modified: stable/8/sys/fs/tmpfs/tmpfs_vfsops.c
==============================================================================
--- stable/8/sys/fs/tmpfs/tmpfs_vfsops.c	Wed Mar  9 15:03:42 2011	(r219428)
+++ stable/8/sys/fs/tmpfs/tmpfs_vfsops.c	Wed Mar  9 15:27:11 2011	(r219429)
@@ -77,62 +77,12 @@ static int	tmpfs_statfs(struct mount *, 
 /* --------------------------------------------------------------------- */
 
 static const char *tmpfs_opts[] = {
-	"from", "size", "inodes", "uid", "gid", "mode", "export",
+	"from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export",
 	NULL
 };
 
 /* --------------------------------------------------------------------- */
 
-#define SWI_MAXMIB	3
-
-static u_int
-get_swpgtotal(void)
-{
-	struct xswdev xsd;
-	char *sname = "vm.swap_info";
-	int soid[SWI_MAXMIB], oid[2];
-	u_int unswdev, total, dmmax, nswapdev;
-	size_t mibi, len;
-
-	total = 0;
-
-	len = sizeof(dmmax);
-	if (kernel_sysctlbyname(curthread, "vm.dmmax", &dmmax, &len,
-				NULL, 0, NULL, 0) != 0)
-		return total;
-
-	len = sizeof(nswapdev);
-	if (kernel_sysctlbyname(curthread, "vm.nswapdev",
-				&nswapdev, &len,
-				NULL, 0, NULL, 0) != 0)
-		return total;
-
-	mibi = (SWI_MAXMIB - 1) * sizeof(int);
-	oid[0] = 0;
-	oid[1] = 3;
-
-	if (kernel_sysctl(curthread, oid, 2,
-			soid, &mibi, (void *)sname, strlen(sname),
-			NULL, 0) != 0)
-		return total;
-
-	mibi = (SWI_MAXMIB - 1);
-	for (unswdev = 0; unswdev < nswapdev; ++unswdev) {
-		soid[mibi] = unswdev;
-		len = sizeof(struct xswdev);
-		if (kernel_sysctl(curthread,
-				soid, mibi + 1, &xsd, &len, NULL, 0,
-				NULL, 0) != 0)
-			return total;
-		if (len == sizeof(struct xswdev))
-			total += (xsd.xsw_nblks - dmmax);
-	}
-
-	/* Not Reached */
-	return total;
-}
-
-/* --------------------------------------------------------------------- */
 static int
 tmpfs_node_ctor(void *mem, int size, void *arg, int flags)
 {
@@ -181,12 +131,12 @@ tmpfs_mount(struct mount *mp)
 {
 	struct tmpfs_mount *tmp;
 	struct tmpfs_node *root;
-	size_t pages, mem_size;
+	size_t pages;
 	uint32_t nodes;
 	int error;
 	/* Size counters. */
 	u_int nodes_max;
-	u_quad_t size_max;
+	u_quad_t size_max, maxfilesize;
 
 	/* Root node attributes. */
 	uid_t root_uid;
@@ -227,12 +177,13 @@ tmpfs_mount(struct mount *mp)
 		nodes_max = 0;
 	if (vfs_scanopt(mp->mnt_optnew, "size", "%qu", &size_max) != 1)
 		size_max = 0;
+	if (vfs_scanopt(mp->mnt_optnew, "maxfilesize", "%qu",
+	    &maxfilesize) != 1)
+		maxfilesize = 0;
 
 	/* Do not allow mounts if we do not have enough memory to preserve
 	 * the minimum reserved pages. */
-	mem_size = cnt.v_free_count + cnt.v_inactive_count + get_swpgtotal();
-	mem_size -= mem_size > cnt.v_wire_count ? cnt.v_wire_count : mem_size;
-	if (mem_size < TMPFS_PAGES_RESERVED)
+	if (tmpfs_mem_info() < TMPFS_PAGES_RESERVED)
 		return ENOSPC;
 
 	/* Get the maximum number of memory pages this file system is
@@ -261,7 +212,7 @@ tmpfs_mount(struct mount *mp)
 	mtx_init(&tmp->allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF);
 	tmp->tm_nodes_max = nodes;
 	tmp->tm_nodes_inuse = 0;
-	tmp->tm_maxfilesize = (u_int64_t)(cnt.v_page_count + get_swpgtotal()) * PAGE_SIZE;
+	tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : UINT64_MAX;
 	LIST_INIT(&tmp->tm_nodes_used);
 
 	tmp->tm_pages_max = pages;

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 16:16:38 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E67D4106564A;
	Wed,  9 Mar 2011 16:16:38 +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 D52308FC0C;
	Wed,  9 Mar 2011 16:16: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 p29GGcou014138;
	Wed, 9 Mar 2011 16:16:38 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29GGc74014136;
	Wed, 9 Mar 2011 16:16:38 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103091616.p29GGc74014136@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 9 Mar 2011 16:16: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: r219430 - head/sys/compat/x86bios
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 16:16:39 -0000

Author: jkim
Date: Wed Mar  9 16:16:38 2011
New Revision: 219430
URL: http://svn.freebsd.org/changeset/base/219430

Log:
  Remove custom interrupt dispatcher.  This is a pointless micro-optimization
  and it may cause problems if SS and SP are modified by real-mode code.
  
  MFC after:	1 month

Modified:
  head/sys/compat/x86bios/x86bios.c

Modified: head/sys/compat/x86bios/x86bios.c
==============================================================================
--- head/sys/compat/x86bios/x86bios.c	Wed Mar  9 15:27:11 2011	(r219429)
+++ head/sys/compat/x86bios/x86bios.c	Wed Mar  9 16:16:38 2011	(r219430)
@@ -533,25 +533,6 @@ x86bios_emu_outl(struct x86emu *emu, uin
 	iodev_write_4(port, val);
 }
 
-static void
-x86bios_emu_get_intr(struct x86emu *emu, int intno)
-{
-	uint16_t *sp;
-	uint32_t iv;
-
-	emu->x86.R_SP -= 6;
-
-	sp = (uint16_t *)((vm_offset_t)x86bios_seg + emu->x86.R_SP);
-	sp[0] = htole16(emu->x86.R_IP);
-	sp[1] = htole16(emu->x86.R_CS);
-	sp[2] = htole16(emu->x86.R_FLG);
-
-	iv = x86bios_get_intr(intno);
-	emu->x86.R_IP = iv & 0xffff;
-	emu->x86.R_CS = (iv >> 16) & 0xffff;
-	emu->x86.R_FLG &= ~(F_IF | F_TF);
-}
-
 void *
 x86bios_alloc(uint32_t *offset, size_t size, int flags)
 {
@@ -764,7 +745,6 @@ fail:
 static int
 x86bios_init(void)
 {
-	int i;
 
 	mtx_init(&x86bios_lock, "x86bios lock", NULL, MTX_DEF);
 
@@ -787,9 +767,6 @@ x86bios_init(void)
 	x86bios_emu.emu_outw = x86bios_emu_outw;
 	x86bios_emu.emu_outl = x86bios_emu_outl;
 
-	for (i = 0; i < 256; i++)
-		x86bios_emu._x86emu_intrTab[i] = x86bios_emu_get_intr;
-
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 16:52:55 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C3F091065672;
	Wed,  9 Mar 2011 16:52:55 +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 B1DE08FC1D;
	Wed,  9 Mar 2011 16:52: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 p29GqtxI014979;
	Wed, 9 Mar 2011 16:52:55 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29Gqtn6014977;
	Wed, 9 Mar 2011 16:52:55 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103091652.p29Gqtn6014977@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 9 Mar 2011 16:52:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219431 - stable/8/share/man/man5
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 16:52:55 -0000

Author: jh
Date: Wed Mar  9 16:52:55 2011
New Revision: 219431
URL: http://svn.freebsd.org/changeset/base/219431

Log:
  MFC r203951 by delphij:
  
  Remove clause 3 from my license.

Modified:
  stable/8/share/man/man5/tmpfs.5
Directory Properties:
  stable/8/share/man/man5/   (props changed)

Modified: stable/8/share/man/man5/tmpfs.5
==============================================================================
--- stable/8/share/man/man5/tmpfs.5	Wed Mar  9 16:16:38 2011	(r219430)
+++ stable/8/share/man/man5/tmpfs.5	Wed Mar  9 16:52:55 2011	(r219431)
@@ -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-all@FreeBSD.ORG  Wed Mar  9 16:55:17 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B970C1065678;
	Wed,  9 Mar 2011 16:55:17 +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 A70198FC1C;
	Wed,  9 Mar 2011 16:55:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p29GtHDL015097;
	Wed, 9 Mar 2011 16:55:17 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29GtHtL015095;
	Wed, 9 Mar 2011 16:55:17 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103091655.p29GtHtL015095@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 9 Mar 2011 16:55:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219432 - stable/8/share/man/man5
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 16:55:17 -0000

Author: jh
Date: Wed Mar  9 16:55:17 2011
New Revision: 219432
URL: http://svn.freebsd.org/changeset/base/219432

Log:
  MFC r203966:
  
  Improve descriptions for tmpfs mount options. The descriptions have
  been mostly obtained from NetBSD mount_tmpfs(8) manual page.

Modified:
  stable/8/share/man/man5/tmpfs.5
Directory Properties:
  stable/8/share/man/man5/   (props changed)

Modified: stable/8/share/man/man5/tmpfs.5
==============================================================================
--- stable/8/share/man/man5/tmpfs.5	Wed Mar  9 16:52:55 2011	(r219431)
+++ stable/8/share/man/man5/tmpfs.5	Wed Mar  9 16:55:17 2011	(r219432)
@@ -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-all@FreeBSD.ORG  Wed Mar  9 16:56:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 88624106564A;
	Wed,  9 Mar 2011 16:56:51 +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 76A1A8FC1C;
	Wed,  9 Mar 2011 16:56:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p29GupN6015177;
	Wed, 9 Mar 2011 16:56:51 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29Gup5K015175;
	Wed, 9 Mar 2011 16:56:51 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103091656.p29Gup5K015175@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 9 Mar 2011 16:56:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219433 - stable/8/share/man/man5
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 16:56:51 -0000

Author: jh
Date: Wed Mar  9 16:56:51 2011
New Revision: 219433
URL: http://svn.freebsd.org/changeset/base/219433

Log:
  MFC r203967:
  
  Xref mdmfs(8).

Modified:
  stable/8/share/man/man5/tmpfs.5
Directory Properties:
  stable/8/share/man/man5/   (props changed)

Modified: stable/8/share/man/man5/tmpfs.5
==============================================================================
--- stable/8/share/man/man5/tmpfs.5	Wed Mar  9 16:55:17 2011	(r219432)
+++ stable/8/share/man/man5/tmpfs.5	Wed Mar  9 16:56:51 2011	(r219433)
@@ -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-all@FreeBSD.ORG  Wed Mar  9 17:07:37 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E43A10656AA;
	Wed,  9 Mar 2011 17:07:37 +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 3CF6B8FC1D;
	Wed,  9 Mar 2011 17:07: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 p29H7bXM015450;
	Wed, 9 Mar 2011 17:07:37 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29H7bUu015446;
	Wed, 9 Mar 2011 17:07:37 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <201103091707.p29H7bUu015446@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Wed, 9 Mar 2011 17:07: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: r219434 - head/usr.sbin/newsyslog
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 17:07:37 -0000

Author: ru
Date: Wed Mar  9 17:07:36 2011
New Revision: 219434
URL: http://svn.freebsd.org/changeset/base/219434

Log:
  Sync manpage's SYNOPSIS with program's usage.

Modified:
  head/usr.sbin/newsyslog/newsyslog.8
  head/usr.sbin/newsyslog/newsyslog.c

Modified: head/usr.sbin/newsyslog/newsyslog.8
==============================================================================
--- head/usr.sbin/newsyslog/newsyslog.8	Wed Mar  9 16:56:51 2011	(r219433)
+++ head/usr.sbin/newsyslog/newsyslog.8	Wed Mar  9 17:07:36 2011	(r219434)
@@ -26,13 +26,12 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl CFNPnrsv
-.Op Fl R Ar tagname
-.Op Fl S Ar pidfile
 .Op Fl a Ar directory
 .Op Fl d Ar directory
 .Op Fl f Ar config_file
+.Op Fl S Ar pidfile
 .Op Fl t Ar timefmt
-.Op Ar
+.Op Oo Fl R Ar tagname Oc Ar
 .Sh DESCRIPTION
 The
 .Nm

Modified: head/usr.sbin/newsyslog/newsyslog.c
==============================================================================
--- head/usr.sbin/newsyslog/newsyslog.c	Wed Mar  9 16:56:51 2011	(r219433)
+++ head/usr.sbin/newsyslog/newsyslog.c	Wed Mar  9 17:07:36 2011	(r219434)
@@ -775,8 +775,8 @@ usage(void)
 {
 
 	fprintf(stderr,
-	    "usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n"
-	    "                 [-S pidfile] [-t timefmt ] [ [-R requestor] filename ... ]\n");
+	    "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n"
+	    "                 [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n");
 	exit(1);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 17:09:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 973E01065677;
	Wed,  9 Mar 2011 17:09:19 +0000 (UTC)
	(envelope-from sobomax@sippysoft.com)
Received: from mail.sippysoft.com (mail.sippysoft.com [4.59.13.245])
	by mx1.freebsd.org (Postfix) with ESMTP id 3627F8FC14;
	Wed,  9 Mar 2011 17:09:19 +0000 (UTC)
Received: from s0106005004e13421.vs.shawcable.net ([70.71.175.212]
	helo=[192.168.1.79])
	by mail.sippysoft.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.72 (FreeBSD)) (envelope-from )
	id 1PxMsw-000Lmr-8n; Wed, 09 Mar 2011 09:09:18 -0800
Message-ID: <4D77B437.7090604@FreeBSD.org>
Date: Wed, 09 Mar 2011 09:09:11 -0800
From: Maxim Sobolev 
Organization: Sippy Software, Inc.
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
To: Jaakko Heinonen 
References: <201103081700.p28H0V9A080455@svn.freebsd.org>
	<20110308173611.GA44635@ws64.jh.dy.fi>
	<4D772F5B.5050508@FreeBSD.org>
	<20110309151938.GA1526@a91-153-123-205.elisa-laajakaista.fi>
In-Reply-To: <20110309151938.GA1526@a91-153-123-205.elisa-laajakaista.fi>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sender: sobomax@sippysoft.com
X-ssp-trusted: yes
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219400 - head/sys/geom/label
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 17:09:19 -0000

On 3/9/2011 7:19 AM, Jaakko Heinonen wrote:
> On 2011-03-08, Maxim Sobolev wrote:
>> >  On 3/8/2011 9:36 AM, Jaakko Heinonen wrote:
>>>> >  >>     Some linux distros put mount point into the ext2fs labels, such as '/', or
>>>>> >  >>>       '/boot', which confuses the devfs code and can cause userland programs to
>>>>> >  >>>       fail reading /dev/ext2fs directory with weird error code, such as any
>>>>> >  >>>       program that uses pwlib.
>> >
>> >  I have only observed this issue with 7.4.
> OK, good to know. Head version of devfs should not have the problems you
> described in the commit message.
>
>> >  It looks like r213526 might work as well, but unfortunately this
>> >  revision is not directly applicable to the 7-STABLE. Do you have any
>> >  plans to MFC it into 7.x?
> I don't have plans to MFC it to stable/7. r213526 is related to larger
> set of devfs changes I committed last year.

OK, so what should I do to resolve the issue in question? Should I go 
forward and MFC less generic patch to geom_label code to strip out the 
leading slashes from the ext2fs labels?

-Maxim

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 17:15:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1EB1D106566B;
	Wed,  9 Mar 2011 17:15:12 +0000 (UTC)
	(envelope-from julian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0C6F88FC15;
	Wed,  9 Mar 2011 17:15: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 p29HFBBZ015676;
	Wed, 9 Mar 2011 17:15:11 GMT (envelope-from julian@svn.freebsd.org)
Received: (from julian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29HFBTM015670;
	Wed, 9 Mar 2011 17:15:11 GMT (envelope-from julian@svn.freebsd.org)
Message-Id: <201103091715.p29HFBTM015670@svn.freebsd.org>
From: Julian Elischer 
Date: Wed, 9 Mar 2011 17:15: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: r219435 - in head/sys: amd64/conf i386/conf pc98/conf
	sparc64/conf sun4v/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 17:15:12 -0000

Author: julian
Date: Wed Mar  9 17:15:11 2011
New Revision: 219435
URL: http://svn.freebsd.org/changeset/base/219435

Log:
  Add a small change to the comment in the GENRIC config files that include udbp
  
  Submitted by:	Chris Forgron, cforgeron at acsi dot ca
  MFC after:	1 week

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC
  head/sys/pc98/conf/GENERIC
  head/sys/sparc64/conf/GENERIC
  head/sys/sun4v/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Wed Mar  9 17:07:36 2011	(r219434)
+++ head/sys/amd64/conf/GENERIC	Wed Mar  9 17:15:11 2011	(r219435)
@@ -287,7 +287,7 @@ device		uhci		# UHCI PCI->USB interface
 device		ohci		# OHCI PCI->USB interface
 device		ehci		# EHCI PCI->USB interface (USB 2.0)
 device		usb		# USB Bus (required)
-#device		udbp		# USB Double Bulk Pipe devices
+#device		udbp		# USB Double Bulk Pipe devices (needs netgraph)
 device		uhid		# "Human Interface Devices"
 device		ukbd		# Keyboard
 device		ulpt		# Printer

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Wed Mar  9 17:07:36 2011	(r219434)
+++ head/sys/i386/conf/GENERIC	Wed Mar  9 17:15:11 2011	(r219435)
@@ -300,7 +300,7 @@ device		uhci		# UHCI PCI->USB interface
 device		ohci		# OHCI PCI->USB interface
 device		ehci		# EHCI PCI->USB interface (USB 2.0)
 device		usb		# USB Bus (required)
-#device		udbp		# USB Double Bulk Pipe devices
+#device		udbp		# USB Double Bulk Pipe devices (needs netgraph)
 device		uhid		# "Human Interface Devices"
 device		ukbd		# Keyboard
 device		ulpt		# Printer

Modified: head/sys/pc98/conf/GENERIC
==============================================================================
--- head/sys/pc98/conf/GENERIC	Wed Mar  9 17:07:36 2011	(r219434)
+++ head/sys/pc98/conf/GENERIC	Wed Mar  9 17:15:11 2011	(r219435)
@@ -252,7 +252,7 @@ device		bpf		# Berkeley packet filter
 #device		ohci		# OHCI PCI->USB interface
 #device		ehci		# EHCI PCI->USB interface (USB 2.0)
 #device		usb		# USB Bus (required)
-#device		udbp		# USB Double Bulk Pipe devices
+#device		udbp		# USB Double Bulk Pipe devices (needs netgraph)
 #device		uhid		# "Human Interface Devices"
 #device		ukbd		# Keyboard
 #device		ulpt		# Printer

Modified: head/sys/sparc64/conf/GENERIC
==============================================================================
--- head/sys/sparc64/conf/GENERIC	Wed Mar  9 17:07:36 2011	(r219434)
+++ head/sys/sparc64/conf/GENERIC	Wed Mar  9 17:15:11 2011	(r219435)
@@ -231,7 +231,7 @@ device		uhci		# UHCI PCI->USB interface
 device		ohci		# OHCI PCI->USB interface
 device		ehci		# EHCI PCI->USB interface (USB 2.0)
 device		usb		# USB Bus (required)
-#device		udbp		# USB Double Bulk Pipe devices
+#device		udbp		# USB Double Bulk Pipe devices (needs netgraph)
 device		uhid		# "Human Interface Devices"
 device		ukbd		# Keyboard
 device		ulpt		# Printer

Modified: head/sys/sun4v/conf/GENERIC
==============================================================================
--- head/sys/sun4v/conf/GENERIC	Wed Mar  9 17:07:36 2011	(r219434)
+++ head/sys/sun4v/conf/GENERIC	Wed Mar  9 17:15:11 2011	(r219435)
@@ -187,7 +187,7 @@ options 	USB_DEBUG	# enable debug msgs
 #device		uhci		# UHCI PCI->USB interface
 #device		ohci		# OHCI PCI->USB interface
 device		usb		# USB Bus (required)
-#device		udbp		# USB Double Bulk Pipe devices
+#device		udbp		# USB Double Bulk Pipe devices (needs netgraph)
 device		uhid		# "Human Interface Devices"
 #device		ukbd		# Keyboard
 device		ulpt		# Printer

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 19:04:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 869221065670;
	Wed,  9 Mar 2011 19:04:11 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi
	[195.197.172.115])
	by mx1.freebsd.org (Postfix) with ESMTP id 421DA8FC0C;
	Wed,  9 Mar 2011 19:04:11 +0000 (UTC)
Received: from a91-153-123-205.elisa-laajakaista.fi
	(a91-153-123-205.elisa-laajakaista.fi [91.153.123.205])
	by gw01.mail.saunalahti.fi (Postfix) with SMTP id B09EA1517D9;
	Wed,  9 Mar 2011 21:04:05 +0200 (EET)
Date: Wed, 9 Mar 2011 21:04:05 +0200
From: Jaakko Heinonen 
To: Maxim Sobolev 
Message-ID: <20110309190405.GA2308@a91-153-123-205.elisa-laajakaista.fi>
References: <201103081700.p28H0V9A080455@svn.freebsd.org>
	<20110308173611.GA44635@ws64.jh.dy.fi>
	<4D772F5B.5050508@FreeBSD.org>
	<20110309151938.GA1526@a91-153-123-205.elisa-laajakaista.fi>
	<4D77B437.7090604@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4D77B437.7090604@FreeBSD.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219400 - head/sys/geom/label
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 19:04:12 -0000

On 2011-03-09, Maxim Sobolev wrote:
> OK, so what should I do to resolve the issue in question? Should I go 
> forward and MFC less generic patch to geom_label code to strip out the 
> leading slashes from the ext2fs labels?

I am not against merging it. Maybe revert the hack in head after
merging?

-- 
Jaakko

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 20:06:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 97E751065670;
	Wed,  9 Mar 2011 20:06:48 +0000 (UTC)
	(envelope-from sobomax@sippysoft.com)
Received: from mail.sippysoft.com (mail.sippysoft.com [4.59.13.245])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C2848FC0C;
	Wed,  9 Mar 2011 20:06:48 +0000 (UTC)
Received: from s0106005004e13421.vs.shawcable.net ([70.71.175.212]
	helo=[192.168.1.79])
	by mail.sippysoft.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.72 (FreeBSD)) (envelope-from )
	id 1PxPeh-000MRT-Dx; Wed, 09 Mar 2011 12:06:47 -0800
Message-ID: <4D77DDD1.1040608@FreeBSD.org>
Date: Wed, 09 Mar 2011 12:06:41 -0800
From: Maxim Sobolev 
Organization: Sippy Software, Inc.
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
To: Jaakko Heinonen 
References: <201103081700.p28H0V9A080455@svn.freebsd.org>
	<20110308173611.GA44635@ws64.jh.dy.fi>
	<4D772F5B.5050508@FreeBSD.org>
	<20110309151938.GA1526@a91-153-123-205.elisa-laajakaista.fi>
	<4D77B437.7090604@FreeBSD.org>
	<20110309190405.GA2308@a91-153-123-205.elisa-laajakaista.fi>
In-Reply-To: <20110309190405.GA2308@a91-153-123-205.elisa-laajakaista.fi>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sender: sobomax@sippysoft.com
X-ssp-trusted: yes
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219400 - head/sys/geom/label
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 20:06:48 -0000

On 3/9/2011 11:04 AM, Jaakko Heinonen wrote:
> On 2011-03-09, Maxim Sobolev wrote:
>> >  OK, so what should I do to resolve the issue in question? Should I go
>> >  forward and MFC less generic patch to geom_label code to strip out the
>> >  leading slashes from the ext2fs labels?
> I am not against merging it. Maybe revert the hack in head after
> merging?

OK, sure.

-Maxim

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 20:56:56 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7CA9B106566B;
	Wed,  9 Mar 2011 20:56:56 +0000 (UTC)
	(envelope-from uqs@spoerlein.net)
Received: from acme.spoerlein.net (acme.spoerlein.net
	[IPv6:2a01:4f8:131:23c2::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 0C3968FC08;
	Wed,  9 Mar 2011 20:56:55 +0000 (UTC)
Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1])
	by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p29KusGf085815
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 9 Mar 2011 21:56:54 +0100 (CET)
	(envelope-from uqs@spoerlein.net)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net;
	s=dkim200908; t=1299704215;
	bh=w8azoxzmeFu3HZ9XdmljgNqLk8rzbL+oUGAqXhUTVRc=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	Content-Type:In-Reply-To;
	b=VSjqan9usiiE5IugsreAe5XI+2J2IFJe16nm2NvBXQzFjk6Mnh4IYr48qwa+DSP3y
	3IUrsfY1b2UQsn8/IzzBSi+HTQ1bqt6v6+ZeB8lNcYmlXmS3EHp0UyaAKUFN5WoUxv
	4ajdf8pItt8OoZcvHOnuV87Ged4s2E6i60YXzXyw=
Date: Wed, 9 Mar 2011 21:56:54 +0100
From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= 
To: Xin LI 
Message-ID: <20110309205654.GD65811@acme.spoerlein.net>
Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= ,
	Xin LI , src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
References: <201102271228.p1RCS6qG087131@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201102271228.p1RCS6qG087131@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219084 - in head: bin/test
	tools/regression/bin/test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 20:56:56 -0000

On Sun, 27.02.2011 at 12:28:06 +0000, Xin LI wrote:
> Author: delphij
> Date: Sun Feb 27 12:28:06 2011
> New Revision: 219084
> URL: http://svn.freebsd.org/changeset/base/219084
> 
> Log:
>   Accept == as an alias of = which is a popular GNU extension.
>   
>   This is intentionally undocumented for now since it's not part
>   of any standard.
>   
>   MFC after:	1 month

So we are giving up the fight?

Uli

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 20:59:44 2011
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 21B991065677;
	Wed,  9 Mar 2011 20:59:44 +0000 (UTC)
	(envelope-from delphij@delphij.net)
Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1])
	by mx1.freebsd.org (Postfix) with ESMTP id B22308FC14;
	Wed,  9 Mar 2011 20:59:42 +0000 (UTC)
Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	by tarsier.geekcn.org (Postfix) with ESMTP id AFAFBA69BAD;
	Thu, 10 Mar 2011 04:59:41 +0800 (CST)
X-Virus-Scanned: amavisd-new at geekcn.org
Received: from tarsier.geekcn.org ([211.166.10.233])
	by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new,
	port 10024)
	with LMTP id mU5i3iz2odRN; Thu, 10 Mar 2011 04:59:35 +0800 (CST)
Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tarsier.geekcn.org (Postfix) with ESMTPSA id 09E93A5A8CF;
	Thu, 10 Mar 2011 04:59:33 +0800 (CST)
DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns;
	h=message-id:date:from:reply-to:organization:user-agent:
	mime-version:to:subject:references:in-reply-to:x-enigmail-version:openpgp:
	content-type:content-transfer-encoding;
	b=ukZBCkyHpd3psv1jm6IImoysKx8PIhSyrFb4o/uGxP70LNq/r0D5saKqnBut2wyk9
	Q0qoYaJdxmTBYgLTwz5ww==
Message-ID: <4D77EA31.1050705@delphij.net>
Date: Wed, 09 Mar 2011 12:59:29 -0800
From: Xin LI 
Organization: The FreeBSD Project
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.1.16) Gecko/20101210 Thunderbird/3.0.11 ThunderBrowse/3.3.5
MIME-Version: 1.0
To: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= , 
	Xin LI ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, 
	svn-src-head@FreeBSD.org
References: <201102271228.p1RCS6qG087131@svn.freebsd.org>
	<20110309205654.GD65811@acme.spoerlein.net>
In-Reply-To: <20110309205654.GD65811@acme.spoerlein.net>
X-Enigmail-Version: 1.0.1
OpenPGP: id=3FCA37C1;
	url=http://www.delphij.net/delphij.asc
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Cc: 
Subject: Re: svn commit: r219084 - in head: bin/test
	tools/regression/bin/test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: d@delphij.net
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 20:59:44 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 03/09/11 12:56, Ulrich Spörlein wrote:
> On Sun, 27.02.2011 at 12:28:06 +0000, Xin LI wrote:
>> Author: delphij
>> Date: Sun Feb 27 12:28:06 2011
>> New Revision: 219084
>> URL: http://svn.freebsd.org/changeset/base/219084
>>
>> Log:
>>   Accept == as an alias of = which is a popular GNU extension.
>>   
>>   This is intentionally undocumented for now since it's not part
>>   of any standard.
>>   
>>   MFC after:	1 month
> 
> So we are giving up the fight?

What fight?

Cheers,
- -- 
Xin LI 	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iQEcBAEBCAAGBQJNd+oxAAoJEATO+BI/yjfBQZIIALZogN4jojQkyKG8Cm+Tl14z
Njf7VmNgy7PV6y7Qpw6lual9N4GCp+iAZLjRIjjllrsn+DbOmWptulptLobho6nc
J8QDtbIjPyGmWNEE32FMFP/cuy4xZSHlLVSYCe73DFVXOYKoAVaqFuwywRYgis7M
VwnD/1Horjo1KMheM7eHsKj9SA4+6CxFknzMouUvCVvdA0kIBTqFnBVkwmRnrIhQ
q+wDsCR3rZulZsUUVQuiIGwRKKbc8zkCrou87b21sBc93ZDDhia/LKBzwOqVm5b2
ifS1ZGEtF6dHDSQH9/lAauQ/R+YCFgfEhTnogucqlZfwF2MNrxqMXHZHMQV18As=
=zHfO
-----END PGP SIGNATURE-----

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 21:07:10 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3B39106564A;
	Wed,  9 Mar 2011 21:07:09 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C94008FC13;
	Wed,  9 Mar 2011 21:07: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 p29L79gv020517;
	Wed, 9 Mar 2011 21:07:09 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29L792Q020515;
	Wed, 9 Mar 2011 21:07:09 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103092107.p29L792Q020515@svn.freebsd.org>
From: Navdeep Parhar 
Date: Wed, 9 Mar 2011 21:07: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: r219436 - head/sys/dev/cxgbe
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 21:07:10 -0000

Author: np
Date: Wed Mar  9 21:07:09 2011
New Revision: 219436
URL: http://svn.freebsd.org/changeset/base/219436

Log:
  Display holdoff timers and packet counts as a list of numbers.
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Wed Mar  9 17:15:11 2011	(r219435)
+++ head/sys/dev/cxgbe/t4_main.c	Wed Mar  9 21:07:09 2011	(r219436)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -272,6 +273,7 @@ static void t4_get_regs(struct adapter *
 static void cxgbe_tick(void *);
 static int t4_sysctls(struct adapter *);
 static int cxgbe_sysctls(struct port_info *);
+static int sysctl_int_array(SYSCTL_HANDLER_ARGS);
 static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS);
 static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS);
 static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS);
@@ -2294,15 +2296,13 @@ t4_sysctls(struct adapter *sc)
 	SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD,
 	    &sc->params.vpd.cclk, 0, "core clock frequency (in KHz)");
 
-	/* XXX: this doesn't seem to show up */
-	SYSCTL_ADD_OPAQUE(ctx, children, OID_AUTO, "holdoff_tmr",
-	    CTLFLAG_RD, &intr_timer, sizeof(intr_timer), "IU",
-	    "interrupt holdoff timer values (us)");
-
-	/* XXX: this doesn't seem to show up */
-	SYSCTL_ADD_OPAQUE(ctx, children, OID_AUTO, "holdoff_pktc",
-	    CTLFLAG_RD, &intr_pktcount, sizeof(intr_pktcount), "IU",
-	    "interrupt holdoff packet counter values");
+	SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers",
+	    CTLTYPE_STRING | CTLFLAG_RD, &intr_timer, sizeof(intr_timer),
+	    sysctl_int_array, "A", "interrupt holdoff timer values (us)");
+
+	SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts",
+	    CTLTYPE_STRING | CTLFLAG_RD, &intr_pktcount, sizeof(intr_pktcount),
+	    sysctl_int_array, "A", "interrupt holdoff packet counter values");
 
 	return (0);
 }
@@ -2505,6 +2505,22 @@ cxgbe_sysctls(struct port_info *pi)
 }
 
 static int
+sysctl_int_array(SYSCTL_HANDLER_ARGS)
+{
+	int rc, *i;
+	struct sbuf sb;
+
+	sbuf_new(&sb, NULL, 32, SBUF_AUTOEXTEND);
+	for (i = arg1; arg2; arg2 -= sizeof(int), i++)
+		sbuf_printf(&sb, "%d ", *i);
+	sbuf_trim(&sb);
+	sbuf_finish(&sb);
+	rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req);
+	sbuf_delete(&sb);
+	return (rc);
+}
+
+static int
 sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS)
 {
 	struct port_info *pi = arg1;

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 21:49:00 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D717106567A;
	Wed,  9 Mar 2011 21:49:00 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B6A98FC08;
	Wed,  9 Mar 2011 21:48:59 +0000 (UTC)
Received: by wyf23 with SMTP id 23so1090642wyf.13
	for ; Wed, 09 Mar 2011 13:48:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=iR51OhYTfAFIK5vUcj3z9RjmyBPOLOHPKcGgFw+8974=;
	b=kDNFclORqWoSJ70MZ7bAtqMVAsOTVqdy0MuYlckLFJ1yhvDtj3qIL/4+dzEpVkrGXP
	Fvkis4mS3Xk9M1MDHxIlgj8oaUUAoG72mRxBFXRbVx4w6Jh6FYezXusK9R6Rah+BX8vx
	Sf4sO/u+Lg04O76KdEUz9vFnroiFOfQfLeJIA=
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=jbw8kZhr6Rn8mVAeNJWHSwIJRDRCLXyoS2jShfZwAvM9hL/gYmdzK24O4bC77Zu+lV
	tril4kisWCy62JngFje3sR9RKGgztExv7bDh7OKrgGqtxV4Ud8M33ANUVvIzuKMU+7Hx
	FxfB4gGcAuxyPOx7DyBUOk0AW24SxxlqdsISk=
MIME-Version: 1.0
Received: by 10.216.155.205 with SMTP id j55mr4873043wek.90.1299707338343;
	Wed, 09 Mar 2011 13:48:58 -0800 (PST)
Sender: yanegomi@gmail.com
Received: by 10.216.172.7 with HTTP; Wed, 9 Mar 2011 13:48:58 -0800 (PST)
In-Reply-To: <4D77EA31.1050705@delphij.net>
References: <201102271228.p1RCS6qG087131@svn.freebsd.org>
	<20110309205654.GD65811@acme.spoerlein.net>
	<4D77EA31.1050705@delphij.net>
Date: Wed, 9 Mar 2011 13:48:58 -0800
X-Google-Sender-Auth: 3gGSslsBLPB7oxB6wzUUzHBlcd4
Message-ID: 
From: Garrett Cooper 
To: d@delphij.net
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: src-committers@freebsd.org,
	=?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= ,
	Xin LI , svn-src-head@freebsd.org,
	Xin LI , svn-src-all@freebsd.org
Subject: Re: svn commit: r219084 - in head: bin/test
	tools/regression/bin/test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 21:49:00 -0000

On Wed, Mar 9, 2011 at 12:59 PM, Xin LI  wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 03/09/11 12:56, Ulrich Sp=F6rlein wrote:
>> On Sun, 27.02.2011 at 12:28:06 +0000, Xin LI wrote:
>>> Author: delphij
>>> Date: Sun Feb 27 12:28:06 2011
>>> New Revision: 219084
>>> URL: http://svn.freebsd.org/changeset/base/219084
>>>
>>> Log:
>>> =A0 Accept =3D=3D as an alias of =3D which is a popular GNU extension.
>>>
>>> =A0 This is intentionally undocumented for now since it's not part
>>> =A0 of any standard.
>>>
>>> =A0 MFC after: 1 month
>>
>> So we are giving up the fight?
>
> What fight?

https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=3Dshow_archive.tpl=
&source=3DL&listname=3Daustin-group-l&id=3D15441

-Garrett

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 22:39:10 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F5DC1065670;
	Wed,  9 Mar 2011 22:39:10 +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 6D15C8FC1B;
	Wed,  9 Mar 2011 22:39: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 p29MdAFd022837;
	Wed, 9 Mar 2011 22:39:10 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29MdAmN022833;
	Wed, 9 Mar 2011 22:39:10 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103092239.p29MdAmN022833@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Wed, 9 Mar 2011 22:39: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: r219437 - in head/tools/regression/pjdfstest: .
	tests/chmod
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 22:39:10 -0000

Author: pjd
Date: Wed Mar  9 22:39:10 2011
New Revision: 219437
URL: http://svn.freebsd.org/changeset/base/219437

Log:
  Add support for the following syscalls:
  - fchmod(2),
  - fchown(2),
  - fchflags(2),
  - fstat(2),
  - ftruncate(2),
  - fpathconf(2),
  - lpathconf(2).
  Make write(2) syscall to take descriptor instead of file name.
  
  We implement descriptors by keeping track of open files and allowing to
  reference them by the following syscalls. Because pjdfstest already supports
  executing multiple syscalls from one command it works pretty well.
  
  For example, the following command:
  
  	pjdfstest open foo "O_CREAT,O_RDWR" 0 : open bar "O_CREAT,O_RDONLY" 640 : fchmod 0 0666 : fchown 0 -1 20 : fchmod 1 0444
  
  is equivalent of (error checking omitted):
  
  	int fd[2];
  
  	fd[0] = open("foo", O_CREAT | O_RDWR, 0);
  	fd[1] = open("bar", O_CREAT | O_RDONLY, 0640);
  	fchmod(fd[0], 0666);
  	fchown(fd[0], -1, 20);
  	fchmod(fd[1], 0444);

Modified:
  head/tools/regression/pjdfstest/Makefile
  head/tools/regression/pjdfstest/pjdfstest.c
  head/tools/regression/pjdfstest/tests/chmod/12.t

Modified: head/tools/regression/pjdfstest/Makefile
==============================================================================
--- head/tools/regression/pjdfstest/Makefile	Wed Mar  9 21:07:09 2011	(r219436)
+++ head/tools/regression/pjdfstest/Makefile	Wed Mar  9 22:39:10 2011	(r219437)
@@ -6,7 +6,7 @@ ${PROG}:	${PROG}.c
 	@OSTYPE=`uname`; \
 	CFLAGS=-D__OS_$${OSTYPE}__; \
 	if [ $$OSTYPE = "FreeBSD" ]; then \
-		CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL"; \
+		CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL"; \
 	elif [ $$OSTYPE = "SunOS" ]; then \
 		CFLAGS="$$CFLAGS -DHAS_TRUNCATE64 -DHAS_STAT64"; \
 		CFLAGS="$$CFLAGS -lsocket"; \

Modified: head/tools/regression/pjdfstest/pjdfstest.c
==============================================================================
--- head/tools/regression/pjdfstest/pjdfstest.c	Wed Mar  9 21:07:09 2011	(r219436)
+++ head/tools/regression/pjdfstest/pjdfstest.c	Wed Mar  9 22:39:10 2011	(r219437)
@@ -47,9 +47,11 @@
 
 #ifndef HAS_TRUNCATE64
 #define	truncate64	truncate
+#define	ftruncate64	ftruncate
 #endif
 #ifndef HAS_STAT64
 #define	stat64	stat
+#define	fstat64	fstat
 #define	lstat64	lstat
 #endif
 #ifdef HAS_FREEBSD_ACL
@@ -74,21 +76,30 @@ enum action {
 	ACTION_BIND,
 	ACTION_CONNECT,
 	ACTION_CHMOD,
+	ACTION_FCHMOD,
 #ifdef HAS_LCHMOD
 	ACTION_LCHMOD,
 #endif
 	ACTION_CHOWN,
+	ACTION_FCHOWN,
 	ACTION_LCHOWN,
 #ifdef HAS_CHFLAGS
 	ACTION_CHFLAGS,
 #endif
+#ifdef HAS_FCHFLAGS
+	ACTION_FCHFLAGS,
+#endif
 #ifdef HAS_LCHFLAGS
 	ACTION_LCHFLAGS,
 #endif
 	ACTION_TRUNCATE,
+	ACTION_FTRUNCATE,
 	ACTION_STAT,
+	ACTION_FSTAT,
 	ACTION_LSTAT,
 	ACTION_PATHCONF,
+	ACTION_FPATHCONF,
+	ACTION_LPATHCONF,
 #ifdef HAS_FREEBSD_ACL
 	ACTION_PREPENDACL,
 	ACTION_READACL,
@@ -124,26 +135,35 @@ static struct syscall_desc syscalls[] = 
 	{ "bind", ACTION_BIND, { TYPE_STRING, TYPE_NONE } },
 	{ "connect", ACTION_CONNECT, { TYPE_STRING, TYPE_NONE } },
 	{ "chmod", ACTION_CHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
+	{ "fchmod", ACTION_FCHMOD, { TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
 #ifdef HAS_LCHMOD
 	{ "lchmod", ACTION_LCHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
 #endif
 	{ "chown", ACTION_CHOWN, { TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
+	{ "fchown", ACTION_FCHOWN, { TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
 	{ "lchown", ACTION_LCHOWN, { TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
 #ifdef HAS_CHFLAGS
 	{ "chflags", ACTION_CHFLAGS, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 #endif
+#ifdef HAS_FCHFLAGS
+	{ "fchflags", ACTION_FCHFLAGS, { TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
+#endif
 #ifdef HAS_LCHFLAGS
 	{ "lchflags", ACTION_LCHFLAGS, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 #endif
 	{ "truncate", ACTION_TRUNCATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
+	{ "ftruncate", ACTION_FTRUNCATE, { TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
 	{ "stat", ACTION_STAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+	{ "fstat", ACTION_FSTAT, { TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
 	{ "lstat", ACTION_LSTAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 	{ "pathconf", ACTION_PATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+	{ "fpathconf", ACTION_FPATHCONF, { TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
+	{ "lpathconf", ACTION_LPATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 #ifdef HAS_FREEBSD_ACL
 	{ "prependacl", ACTION_PREPENDACL, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 	{ "readacl", ACTION_READACL, { TYPE_STRING, TYPE_NONE } },
 #endif
-	{ "write", ACTION_WRITE, { TYPE_STRING, TYPE_NONE } },
+	{ "write", ACTION_WRITE, { TYPE_NUMBER, TYPE_NONE } },
 	{ NULL, -1, { TYPE_NONE } }
 };
 
@@ -260,6 +280,9 @@ static struct name pathconf_names[] = {
 
 static const char *err2str(int error);
 
+static int *descriptors;
+static int ndescriptors;
+
 static void
 usage(void)
 {
@@ -415,6 +438,33 @@ show_stats(struct stat64 *sp, char *what
 	printf("\n");
 }
 
+static void
+descriptor_add(int fd)
+{
+
+	ndescriptors++;
+	if (descriptors == NULL) {
+		descriptors = malloc(sizeof(descriptors[0]) * ndescriptors);
+	} else {
+		descriptors = realloc(descriptors,
+		    sizeof(descriptors[0]) * ndescriptors);
+	}
+	assert(descriptors != NULL);
+	descriptors[ndescriptors - 1] = fd;
+}
+
+static int
+descriptor_get(int pos)
+{
+
+	if (pos < 0 || pos >= ndescriptors) {
+		fprintf(stderr, "invalid descriptor %d\n", pos);
+		exit(1);
+	}
+
+	return (descriptors[pos]);
+}
+
 static unsigned int
 call_syscall(struct syscall_desc *scall, char *argv[])
 {
@@ -470,6 +520,7 @@ call_syscall(struct syscall_desc *scall,
 	 */
 #define	NUM(n)	(args[(n)].num)
 #define	STR(n)	(args[(n)].str)
+#define	DESC(n)	(descriptor_get((int)NUM(n)))
 	switch (scall->sd_action) {
 	case ACTION_OPEN:
 		flags = str2flags(open_flags, STR(1));
@@ -486,6 +537,8 @@ call_syscall(struct syscall_desc *scall,
 			}
 			rval = open(STR(0), (int)flags);
 		}
+		if (rval >= 0)
+			descriptor_add(rval);
 		break;
 	case ACTION_CREATE:
 		rval = open(STR(0), O_CREAT | O_EXCL, (mode_t)NUM(1));
@@ -565,6 +618,9 @@ call_syscall(struct syscall_desc *scall,
 	case ACTION_CHMOD:
 		rval = chmod(STR(0), (mode_t)NUM(1));
 		break;
+	case ACTION_FCHMOD:
+		rval = fchmod(DESC(0), (mode_t)NUM(1));
+		break;
 #ifdef HAS_LCHMOD
 	case ACTION_LCHMOD:
 		rval = lchmod(STR(0), (mode_t)NUM(1));
@@ -573,6 +629,9 @@ call_syscall(struct syscall_desc *scall,
 	case ACTION_CHOWN:
 		rval = chown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2));
 		break;
+	case ACTION_FCHOWN:
+		rval = fchown(DESC(0), (uid_t)NUM(1), (gid_t)NUM(2));
+		break;
 	case ACTION_LCHOWN:
 		rval = lchown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2));
 		break;
@@ -581,6 +640,11 @@ call_syscall(struct syscall_desc *scall,
 		rval = chflags(STR(0), (unsigned long)str2flags(chflags_flags, STR(1)));
 		break;
 #endif
+#ifdef HAS_FCHFLAGS
+	case ACTION_FCHFLAGS:
+		rval = fchflags(DESC(0), (unsigned long)str2flags(chflags_flags, STR(1)));
+		break;
+#endif
 #ifdef HAS_LCHFLAGS
 	case ACTION_LCHFLAGS:
 		rval = lchflags(STR(0), (int)str2flags(chflags_flags, STR(1)));
@@ -589,6 +653,9 @@ call_syscall(struct syscall_desc *scall,
 	case ACTION_TRUNCATE:
 		rval = truncate64(STR(0), NUM(1));
 		break;
+	case ACTION_FTRUNCATE:
+		rval = ftruncate64(DESC(0), NUM(1));
+		break;
 	case ACTION_STAT:
 		rval = stat64(STR(0), &sb);
 		if (rval == 0) {
@@ -596,6 +663,13 @@ call_syscall(struct syscall_desc *scall,
 			return (i);
 		}
 		break;
+	case ACTION_FSTAT:
+		rval = fstat64(DESC(0), &sb);
+		if (rval == 0) {
+			show_stats(&sb, STR(1));
+			return (i);
+		}
+		break;
 	case ACTION_LSTAT:
 		rval = lstat64(STR(0), &sb);
 		if (rval == 0) {
@@ -604,6 +678,8 @@ call_syscall(struct syscall_desc *scall,
 		}
 		break;
 	case ACTION_PATHCONF:
+	case ACTION_FPATHCONF:
+	case ACTION_LPATHCONF:
 	    {
 		long lrval;
 
@@ -613,7 +689,19 @@ call_syscall(struct syscall_desc *scall,
 			exit(1);
 		}
 		errno = 0;
-		lrval = pathconf(STR(0), name);
+		switch (scall->sd_action) {
+		case ACTION_PATHCONF:
+			lrval = pathconf(STR(0), name);
+			break;
+		case ACTION_FPATHCONF:
+			lrval = fpathconf(DESC(0), name);
+			break;
+		case ACTION_LPATHCONF:
+			lrval = lpathconf(STR(0), name);
+			break;
+		default:
+			abort();
+		}
 		if (lrval == -1 && errno == 0) {
 			printf("unlimited\n");
 			return (i);
@@ -648,7 +736,6 @@ call_syscall(struct syscall_desc *scall,
 
 		rval = acl_set_file(STR(0), ACL_TYPE_NFS4, acl);
 		break;
-
 	case ACTION_READACL:
 		acl = acl_get_file(STR(0), ACL_TYPE_NFS4);
 		if (acl == NULL)
@@ -657,15 +744,9 @@ call_syscall(struct syscall_desc *scall,
 			rval = 0;
 		break;
 #endif
-
 	case ACTION_WRITE:
-		rval = open(STR(0), O_WRONLY);
-		if (rval < 0)
-			break;
-
-		rval = write(rval, "x", 1);
+		rval = write(DESC(0), "x", 1);
 		break;
-
 	default:
 		fprintf(stderr, "unsupported syscall\n");
 		exit(1);

Modified: head/tools/regression/pjdfstest/tests/chmod/12.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/chmod/12.t	Wed Mar  9 21:07:09 2011	(r219436)
+++ head/tools/regression/pjdfstest/tests/chmod/12.t	Wed Mar  9 22:39:10 2011	(r219437)
@@ -18,13 +18,13 @@ cd ${n2}
 
 # Check whether writing to the file by non-owner clears the SUID.
 expect 0 create ${n0} 04777
-expect 0 -u 65534 -g 65534 write ${n0}
+expect 0 -u 65534 -g 65534 write ${n0} x
 expect 0777 stat ${n0} mode
 expect 0 unlink ${n0}
 
 # Check whether writing to the file by non-owner clears the SGID.
 expect 0 create ${n0} 02777
-expect 0 -u 65534 -g 65534 write ${n0}
+expect 0 -u 65534 -g 65534 write ${n0} x
 expect 0777 stat ${n0} mode
 expect 0 unlink ${n0}
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 22:50:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 747211065689;
	Wed,  9 Mar 2011 22:50: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 49B5B8FC08;
	Wed,  9 Mar 2011 22:50: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 p29MoF0l023103;
	Wed, 9 Mar 2011 22:50:15 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29MoFdj023100;
	Wed, 9 Mar 2011 22:50:15 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103092250.p29MoFdj023100@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Wed, 9 Mar 2011 22:50: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: r219438 - in head/tools/regression/pjdfstest: .
	tests/chmod
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 22:50:15 -0000

Author: pjd
Date: Wed Mar  9 22:50:15 2011
New Revision: 219438
URL: http://svn.freebsd.org/changeset/base/219438

Log:
  Pass descriptor number to write(2), now that it is possible.

Modified:
  head/tools/regression/pjdfstest/pjdfstest.c
  head/tools/regression/pjdfstest/tests/chmod/12.t

Modified: head/tools/regression/pjdfstest/pjdfstest.c
==============================================================================
--- head/tools/regression/pjdfstest/pjdfstest.c	Wed Mar  9 22:39:10 2011	(r219437)
+++ head/tools/regression/pjdfstest/pjdfstest.c	Wed Mar  9 22:50:15 2011	(r219438)
@@ -163,7 +163,7 @@ static struct syscall_desc syscalls[] = 
 	{ "prependacl", ACTION_PREPENDACL, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 	{ "readacl", ACTION_READACL, { TYPE_STRING, TYPE_NONE } },
 #endif
-	{ "write", ACTION_WRITE, { TYPE_NUMBER, TYPE_NONE } },
+	{ "write", ACTION_WRITE, { TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
 	{ NULL, -1, { TYPE_NONE } }
 };
 
@@ -745,7 +745,7 @@ call_syscall(struct syscall_desc *scall,
 		break;
 #endif
 	case ACTION_WRITE:
-		rval = write(DESC(0), "x", 1);
+		rval = write(DESC(0), STR(1), strlen(STR(1)));
 		break;
 	default:
 		fprintf(stderr, "unsupported syscall\n");

Modified: head/tools/regression/pjdfstest/tests/chmod/12.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/chmod/12.t	Wed Mar  9 22:39:10 2011	(r219437)
+++ head/tools/regression/pjdfstest/tests/chmod/12.t	Wed Mar  9 22:50:15 2011	(r219438)
@@ -18,13 +18,13 @@ cd ${n2}
 
 # Check whether writing to the file by non-owner clears the SUID.
 expect 0 create ${n0} 04777
-expect 0 -u 65534 -g 65534 write ${n0} x
+expect 0 -u 65534 -g 65534 open ${n0} O_WRONLY : write 0 x
 expect 0777 stat ${n0} mode
 expect 0 unlink ${n0}
 
 # Check whether writing to the file by non-owner clears the SGID.
 expect 0 create ${n0} 02777
-expect 0 -u 65534 -g 65534 write ${n0} x
+expect 0 -u 65534 -g 65534 open ${n0} O_RDWR : write 0 x
 expect 0777 stat ${n0} mode
 expect 0 unlink ${n0}
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  9 23:11:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C7161065678;
	Wed,  9 Mar 2011 23:11: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 01C0C8FC1F;
	Wed,  9 Mar 2011 23:11:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p29NBUUu023652;
	Wed, 9 Mar 2011 23:11:30 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p29NBUOG023651;
	Wed, 9 Mar 2011 23:11:30 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103092311.p29NBUOG023651@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Wed, 9 Mar 2011 23:11: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: r219439 -
	head/tools/regression/pjdfstest/tests/ftruncate
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 09 Mar 2011 23:11:31 -0000

Author: pjd
Date: Wed Mar  9 23:11:30 2011
New Revision: 219439
URL: http://svn.freebsd.org/changeset/base/219439

Log:
  Few initial ftruncate(2) tests. One of them covers stand/154873.
  
  PR:	stand/154873

Added:
  head/tools/regression/pjdfstest/tests/ftruncate/
  head/tools/regression/pjdfstest/tests/ftruncate/00.t   (contents, props changed)

Added: head/tools/regression/pjdfstest/tests/ftruncate/00.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/pjdfstest/tests/ftruncate/00.t	Wed Mar  9 23:11:30 2011	(r219439)
@@ -0,0 +1,58 @@
+#!/bin/sh
+# $FreeBSD$
+
+desc="ftruncate descrease/increase file size"
+
+dir=`dirname $0`
+. ${dir}/../misc.sh
+
+echo "1..21"
+
+n0=`namegen`
+n1=`namegen`
+
+expect 0 mkdir ${n1} 0755
+cdir=`pwd`
+cd ${n1}
+
+expect 0 create ${n0} 0644
+expect 0 open ${n0} O_RDWR : ftruncate 0 1234567
+expect 1234567 lstat ${n0} size
+expect 0 open ${n0} O_WRONLY : ftruncate 0 567
+expect 567 lstat ${n0} size
+expect 0 unlink ${n0}
+
+dd if=/dev/random of=${n0} bs=12345 count=1 >/dev/null 2>&1
+expect 0 open ${n0} O_RDWR : ftruncate 0 23456
+expect 23456 lstat ${n0} size
+expect 0 open ${n0} O_WRONLY : ftruncate 0 1
+expect 1 lstat ${n0} size
+expect 0 unlink ${n0}
+
+# successful ftruncate(2) updates ctime.
+expect 0 create ${n0} 0644
+ctime1=`${fstest} stat ${n0} ctime`
+sleep 1
+expect 0 open ${n0} O_RDWR : ftruncate 0 123
+ctime2=`${fstest} stat ${n0} ctime`
+test_check $ctime1 -lt $ctime2
+expect 0 unlink ${n0}
+
+# unsuccessful ftruncate(2) does not update ctime.
+expect 0 create ${n0} 0644
+ctime1=`${fstest} stat ${n0} ctime`
+sleep 1
+expect EINVAL -u 65534 open ${n0} O_RDONLY : ftruncate 0 123
+ctime2=`${fstest} stat ${n0} ctime`
+test_check $ctime1 -eq $ctime2
+expect 0 unlink ${n0}
+
+# third argument should not affect permission.
+expect 0 open ${n0} O_CREAT,O_RDWR 0 : ftruncate 0 0
+expect 0 unlink ${n0}
+expect 0 chmod . 0777
+expect 0 -u 65534 open ${n0} O_CREAT,O_RDWR 0 : ftruncate 0 0
+expect 0 unlink ${n0}
+
+cd ${cdir}
+expect 0 rmdir ${n1}

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 01:02:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2D3D106566C;
	Thu, 10 Mar 2011 01:02:54 +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 7506D8FC17;
	Thu, 10 Mar 2011 01:02: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 p2A12sT0026154;
	Thu, 10 Mar 2011 01:02:54 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A12sS3026152;
	Thu, 10 Mar 2011 01:02:54 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201103100102.p2A12sS3026152@svn.freebsd.org>
From: Xin LI 
Date: Thu, 10 Mar 2011 01:02:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219440 - in stable: 7/usr.sbin/diskinfo
	8/usr.sbin/diskinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 01:02:54 -0000

Author: delphij
Date: Thu Mar 10 01:02:53 2011
New Revision: 219440
URL: http://svn.freebsd.org/changeset/base/219440

Log:
  MFC r218432:
  
  Don't consider ioctl returning error as a fatal error and move on to next
  disk.  When multiple devices are specified, a non-supporting ioctl will
  cause diskinfo(8) to stop at the point which does not seem to be necessary.

Modified:
  stable/8/usr.sbin/diskinfo/diskinfo.c
Directory Properties:
  stable/8/usr.sbin/diskinfo/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/7/usr.sbin/diskinfo/diskinfo.c
Directory Properties:
  stable/7/usr.sbin/diskinfo/   (props changed)

Modified: stable/8/usr.sbin/diskinfo/diskinfo.c
==============================================================================
--- stable/8/usr.sbin/diskinfo/diskinfo.c	Wed Mar  9 23:11:30 2011	(r219439)
+++ stable/8/usr.sbin/diskinfo/diskinfo.c	Thu Mar 10 01:02:53 2011	(r219440)
@@ -56,7 +56,7 @@ static void commandtime(int fd, off_t me
 int
 main(int argc, char **argv)
 {
-	int i, ch, fd, error;
+	int i, ch, fd, error, exitval = 0;
 	char buf[BUFSIZ], ident[DISK_IDENT_SIZE];
 	off_t	mediasize, stripesize, stripeoffset;
 	u_int	sectorsize, fwsectors, fwheads;
@@ -90,14 +90,23 @@ main(int argc, char **argv)
 			sprintf(buf, "%s%s", _PATH_DEV, argv[i]);
 			fd = open(buf, O_RDONLY);
 		}
-		if (fd < 0)
-			err(1, argv[i]);
+		if (fd < 0) {
+			warn("%s", argv[i]);
+			exitval = 1;
+			goto out;
+		}
 		error = ioctl(fd, DIOCGMEDIASIZE, &mediasize);
-		if (error)
-			err(1, "%s: ioctl(DIOCGMEDIASIZE) failed, probably not a disk.", argv[i]);
+		if (error) {
+			warn("%s: ioctl(DIOCGMEDIASIZE) failed, probably not a disk.", argv[i]);
+			exitval = 1;
+			goto out;
+		}
 		error = ioctl(fd, DIOCGSECTORSIZE, §orsize);
-		if (error)
-			err(1, "%s: DIOCGSECTORSIZE failed, probably not a disk.", argv[i]);
+		if (error) {
+			warn("%s: DIOCGSECTORSIZE failed, probably not a disk.", argv[i]);
+			exitval = 1;
+			goto out;
+		}
 		error = ioctl(fd, DIOCGFWSECTORS, &fwsectors);
 		if (error)
 			fwsectors = 0;
@@ -148,9 +157,10 @@ main(int argc, char **argv)
 			commandtime(fd, mediasize, sectorsize);
 		if (opt_t)
 			speeddisk(fd, mediasize, sectorsize);
+out:
 		close(fd);
 	}
-	exit (0);
+	exit (exitval);
 }
 
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 01:02:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CDE091065670;
	Thu, 10 Mar 2011 01:02:54 +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 A11778FC18;
	Thu, 10 Mar 2011 01:02: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 p2A12sSp026160;
	Thu, 10 Mar 2011 01:02:54 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A12sAj026158;
	Thu, 10 Mar 2011 01:02:54 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201103100102.p2A12sAj026158@svn.freebsd.org>
From: Xin LI 
Date: Thu, 10 Mar 2011 01:02:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219440 - in stable: 7/usr.sbin/diskinfo
	8/usr.sbin/diskinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 01:02:54 -0000

Author: delphij
Date: Thu Mar 10 01:02:53 2011
New Revision: 219440
URL: http://svn.freebsd.org/changeset/base/219440

Log:
  MFC r218432:
  
  Don't consider ioctl returning error as a fatal error and move on to next
  disk.  When multiple devices are specified, a non-supporting ioctl will
  cause diskinfo(8) to stop at the point which does not seem to be necessary.

Modified:
  stable/7/usr.sbin/diskinfo/diskinfo.c
Directory Properties:
  stable/7/usr.sbin/diskinfo/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/8/usr.sbin/diskinfo/diskinfo.c
Directory Properties:
  stable/8/usr.sbin/diskinfo/   (props changed)

Modified: stable/7/usr.sbin/diskinfo/diskinfo.c
==============================================================================
--- stable/7/usr.sbin/diskinfo/diskinfo.c	Wed Mar  9 23:11:30 2011	(r219439)
+++ stable/7/usr.sbin/diskinfo/diskinfo.c	Thu Mar 10 01:02:53 2011	(r219440)
@@ -56,7 +56,7 @@ static void commandtime(int fd, off_t me
 int
 main(int argc, char **argv)
 {
-	int i, ch, fd, error;
+	int i, ch, fd, error, exitval = 0;
 	char buf[BUFSIZ], ident[DISK_IDENT_SIZE];
 	off_t	mediasize;
 	u_int	sectorsize, fwsectors, fwheads;
@@ -90,14 +90,23 @@ main(int argc, char **argv)
 			sprintf(buf, "%s%s", _PATH_DEV, argv[i]);
 			fd = open(buf, O_RDONLY);
 		}
-		if (fd < 0)
-			err(1, argv[i]);
+		if (fd < 0) {
+			warn("%s", argv[i]);
+			exitval = 1;
+			goto out;
+		}
 		error = ioctl(fd, DIOCGMEDIASIZE, &mediasize);
-		if (error)
-			err(1, "%s: ioctl(DIOCGMEDIASIZE) failed, probably not a disk.", argv[i]);
+		if (error) {
+			warn("%s: ioctl(DIOCGMEDIASIZE) failed, probably not a disk.", argv[i]);
+			exitval = 1;
+			goto out;
+		}
 		error = ioctl(fd, DIOCGSECTORSIZE, §orsize);
-		if (error)
-			err(1, "%s: DIOCGSECTORSIZE failed, probably not a disk.", argv[i]);
+		if (error) {
+			warn("%s: DIOCGSECTORSIZE failed, probably not a disk.", argv[i]);
+			exitval = 1;
+			goto out;
+		}
 		error = ioctl(fd, DIOCGFWSECTORS, &fwsectors);
 		if (error)
 			fwsectors = 0;
@@ -141,9 +150,10 @@ main(int argc, char **argv)
 			commandtime(fd, mediasize, sectorsize);
 		if (opt_t)
 			speeddisk(fd, mediasize, sectorsize);
+out:
 		close(fd);
 	}
-	exit (0);
+	exit (exitval);
 }
 
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 02:09:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 65CA51065678;
	Thu, 10 Mar 2011 02:09:06 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 52D698FC22;
	Thu, 10 Mar 2011 02:09: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 p2A296Er028049;
	Thu, 10 Mar 2011 02:09:06 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A296lP028043;
	Thu, 10 Mar 2011 02:09:06 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103100209.p2A296lP028043@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 10 Mar 2011 02:09: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: r219441 - in head/sys/dev/ath/ath_hal: . ar5416 ar9002
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 02:09:06 -0000

Author: adrian
Date: Thu Mar 10 02:09:06 2011
New Revision: 219441
URL: http://svn.freebsd.org/changeset/base/219441

Log:
  Introduce the Merlin PWDCLKIND workaround.
  
  This is something bus clock related from what I can gather. It is needed for
  the AR9220 based Ubiquiti SR71-12 and SR71-15 Mini-PCI NICs.
  
  (Note: those NICs don't work right now because of earlier changes to handle
  power table offset correctly. That'll be resolved in a follow-up commit.)

Modified:
  head/sys/dev/ath/ath_hal/ah_eeprom.h
  head/sys/dev/ath/ath_hal/ah_eeprom_v14.c
  head/sys/dev/ath/ath_hal/ah_eeprom_v14.h
  head/sys/dev/ath/ath_hal/ar5416/ar5416.h
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_eeprom.h	Thu Mar 10 01:02:53 2011	(r219440)
+++ head/sys/dev/ath/ath_hal/ah_eeprom.h	Thu Mar 10 02:09:06 2011	(r219441)
@@ -100,7 +100,8 @@ enum {
 	AR_EEP_ANTGAINMAX_5,	/* int8_t* */
 	AR_EEP_ANTGAINMAX_2,	/* int8_t* */
 	AR_EEP_WRITEPROTECT,	/* use ath_hal_eepromGetFlag */
-	AR_EEP_PWR_TABLE_OFFSET	/* int8_t* */
+	AR_EEP_PWR_TABLE_OFFSET,/* int8_t* */
+	AR_EEP_PWDCLKIND	/* uint8_t* */
 };
 
 typedef struct {

Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c	Thu Mar 10 01:02:53 2011	(r219440)
+++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c	Thu Mar 10 02:09:06 2011	(r219441)
@@ -132,6 +132,12 @@ v14EepromGet(struct ath_hal *ah, int par
 		else
 			*(int8_t *) val = AR5416_PWR_TABLE_OFFSET_DB;
 		return HAL_OK;
+	case AR_EEP_PWDCLKIND:
+		if (IS_VERS(>=, AR5416_EEP_MINOR_VER_10)) {
+			*(uint8_t *) val = pBase->pwdclkind;
+			return HAL_OK;
+		}
+		return HAL_EIO;
 		
         default:
 		HALASSERT(0);

Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_eeprom_v14.h	Thu Mar 10 01:02:53 2011	(r219440)
+++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.h	Thu Mar 10 02:09:06 2011	(r219441)
@@ -49,6 +49,7 @@
 #define AR5416_EEP_MINOR_VER_3		0x3
 #define AR5416_EEP_MINOR_VER_7		0x7
 #define AR5416_EEP_MINOR_VER_9		0x9
+#define AR5416_EEP_MINOR_VER_10		0xa
 #define AR5416_EEP_MINOR_VER_16		0x10
 #define AR5416_EEP_MINOR_VER_17		0x11
 #define AR5416_EEP_MINOR_VER_19		0x13

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416.h	Thu Mar 10 01:02:53 2011	(r219440)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h	Thu Mar 10 02:09:06 2011	(r219441)
@@ -105,6 +105,8 @@ struct ath_hal_5416 {
 	struct ar5416NfLimits nf_5g;
 
 	int		initPDADC;
+
+	int		ah_need_an_top2_fixup;	/* merlin or later chips that may need this workaround */
 };
 #define	AH5416(_ah)	((struct ath_hal_5416 *)(_ah))
 

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Thu Mar 10 01:02:53 2011	(r219440)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Thu Mar 10 02:09:06 2011	(r219441)
@@ -114,6 +114,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s
 	HAL_STATUS ecode;
 	HAL_BOOL rfStatus;
 	int8_t pwr_table_offset;
+	uint8_t pwr;
 
 	HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n",
 	    __func__, sc, (void*) st, (void*) sh);
@@ -246,6 +247,20 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s
 		goto bad;
 	}
 
+	/* Enable fixup for AR_AN_TOP2 if necessary */
+	/*
+	 * The v14 EEPROM layer returns HAL_EIO if PWDCLKIND isn't supported
+	 * by the EEPROM version.
+	 *
+	 * ath9k checks the EEPROM minor version is >= 0x0a here, instead of
+	 * the abstracted EEPROM access layer.
+	 */
+	ecode = ath_hal_eepromGet(ah, AR_EEP_PWDCLKIND, &pwr);
+	if (AR_SREV_MERLIN_20_OR_LATER(ah) && ecode == HAL_OK && pwr == 0) {
+		printf("[ath] enabling AN_TOP2_FIXUP\n");
+		AH5416(ah)->ah_need_an_top2_fixup = 1;
+	}
+
         /*
          * Check whether the power table offset isn't the default.
          * This can occur with eeprom minor V21 or greater on Merlin.
@@ -362,6 +377,8 @@ ar9280WriteIni(struct ath_hal *ah, const
 {
 	u_int modesIndex, freqIndex;
 	int regWrites = 0;
+	int i;
+	const HAL_INI_ARRAY *ia;
 
 	/* Setup the indices for the next set of register array writes */
 	/* XXX Ignore 11n dynamic mode on the AR5416 for the moment */
@@ -386,10 +403,33 @@ ar9280WriteIni(struct ath_hal *ah, const
 	OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
 	OS_REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_INTERNAL_ADDAC);
 
-	/* XXX Merlin ini fixups */
-	/* XXX Merlin 100us delay for shift registers */
+	/*
+	 * This is unwound because at the moment, there's a requirement
+	 * for Merlin (and later, perhaps) to have a specific bit fixed
+	 * in the AR_AN_TOP2 register before writing it.
+	 */
+	ia = &AH5212(ah)->ah_ini_modes;
+#if 0
 	regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_modes,
 	    modesIndex, regWrites);
+#endif
+	HALASSERT(modesIndex < ia->cols);
+	for (i = 0; i < ia->rows; i++) {
+		uint32_t reg = HAL_INI_VAL(ia, i, 0);
+		uint32_t val = HAL_INI_VAL(ia, i, modesIndex);
+
+		if (reg == AR_AN_TOP2 && AH5416(ah)->ah_need_an_top2_fixup)
+			val &= ~AR_AN_TOP2_PWDCLKIND;
+
+		OS_REG_WRITE(ah, reg, val);
+
+		/* Analog shift register delay seems needed for Merlin - PR kern/154220 */
+		if (reg >= 0x7800 && reg < 0x78a0)
+			OS_DELAY(100);
+
+		DMA_YIELD(regWrites);
+	}
+
 	if (AR_SREV_MERLIN_20_OR_LATER(ah)) {
 		regWrites = ath_hal_ini_write(ah, &AH9280(ah)->ah_ini_rxgain,
 		    modesIndex, regWrites);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 03:13:56 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 997B4106566B;
	Thu, 10 Mar 2011 03:13:56 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8470D8FC0A;
	Thu, 10 Mar 2011 03:13: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 p2A3DuSV029699;
	Thu, 10 Mar 2011 03:13:56 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A3Duxh029696;
	Thu, 10 Mar 2011 03:13:56 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103100313.p2A3Duxh029696@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 10 Mar 2011 03:13:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219442 - in head/sys/dev/ath/ath_hal: . ah_regdomain
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 03:13:56 -0000

Author: adrian
Date: Thu Mar 10 03:13:56 2011
New Revision: 219442
URL: http://svn.freebsd.org/changeset/base/219442

Log:
  Migrate the regulatory database definitions into separate header files
  to both make things clearer, and to make it easier to write userland
  code which pulls in these definitions without needing to pull in the
  rest of the HAL.
  
  This stuff should be deprecated at some point in the future once
  the net80211 regulatory domain support encapsulates all of the
  defintions here.

Added:
  head/sys/dev/ath/ath_hal/ah_regdomain/
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_ctry.h   (contents, props changed)
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h   (contents, props changed)
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_freqbands.h   (contents, props changed)
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h   (contents, props changed)
  head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regmap.h   (contents, props changed)
Modified:
  head/sys/dev/ath/ath_hal/ah_regdomain.c
  head/sys/dev/ath/ath_hal/ah_regdomain.h

Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_regdomain.c	Thu Mar 10 02:09:06 2011	(r219441)
+++ head/sys/dev/ath/ath_hal/ah_regdomain.c	Thu Mar 10 03:13:56 2011	(r219442)
@@ -40,46 +40,6 @@
 #define HAL_MODE_11A_TURBO	HAL_MODE_108A
 #define HAL_MODE_11G_TURBO	HAL_MODE_108G
 
-/* 
- * BMLEN defines the size of the bitmask used to hold frequency
- * band specifications.  Note this must agree with the BM macro
- * definition that's used to setup initializers.  See also further
- * comments below.
- */
-/* BMLEN is now defined in ah_regdomain.h */
-#define	W0(_a) \
-	(((_a) >= 0 && (_a) < 64 ? (((uint64_t) 1)<<(_a)) : (uint64_t) 0))
-#define	W1(_a) \
-	(((_a) > 63 && (_a) < 128 ? (((uint64_t) 1)<<((_a)-64)) : (uint64_t) 0))
-#define BM1(_fa)	{ W0(_fa), W1(_fa) }
-#define BM2(_fa, _fb)	{ W0(_fa) | W0(_fb), W1(_fa) | W1(_fb) }
-#define BM3(_fa, _fb, _fc) \
-	{ W0(_fa) | W0(_fb) | W0(_fc), W1(_fa) | W1(_fb) | W1(_fc) }
-#define BM4(_fa, _fb, _fc, _fd)						\
-	{ W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd),			\
-	  W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) }
-#define BM5(_fa, _fb, _fc, _fd, _fe)					\
-	{ W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe),		\
-	  W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) }
-#define BM6(_fa, _fb, _fc, _fd, _fe, _ff)				\
-	{ W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe) | W0(_ff),	\
-	  W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) | W1(_ff) }
-#define BM7(_fa, _fb, _fc, _fd, _fe, _ff, _fg)	\
-	{ W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe) | W0(_ff) |	\
-	  W0(_fg),\
-	  W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) | W1(_ff) |	\
-	  W1(_fg) }
-#define BM8(_fa, _fb, _fc, _fd, _fe, _ff, _fg, _fh)	\
-	{ W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe) | W0(_ff) |	\
-	  W0(_fg) | W0(_fh) ,	\
-	  W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) | W1(_ff) |	\
-	  W1(_fg) | W1(_fh) }
-#define BM9(_fa, _fb, _fc, _fd, _fe, _ff, _fg, _fh, _fi)	\
-	{ W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe) | W0(_ff) |	\
-	  W0(_fg) | W0(_fh) | W0(_fi) ,	\
-	  W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) | W1(_ff) |	\
-	  W1(_fg) | W1(_fh) | W1(_fi) }
-
 /*
  * Mask to check whether a domain is a multidomain or a single domain
  */
@@ -91,331 +51,16 @@
  * are the real unitary regdomains and are the only ones which have the
  * frequency bitmasks and flags set.
  */
-enum {
-	/*
-	 * The following regulatory domain definitions are
-	 * found in the EEPROM. Each regulatory domain
-	 * can operate in either a 5GHz or 2.4GHz wireless mode or
-	 * both 5GHz and 2.4GHz wireless modes.
-	 * In general, the value holds no special
-	 * meaning and is used to decode into either specific
-	 * 2.4GHz or 5GHz wireless mode for that particular
-	 * regulatory domain.
-	 */
-	NO_ENUMRD	= 0x00,
-	NULL1_WORLD	= 0x03,		/* For 11b-only countries (no 11a allowed) */
-	NULL1_ETSIB	= 0x07,		/* Israel */
-	NULL1_ETSIC	= 0x08,
-	FCC1_FCCA	= 0x10,		/* USA */
-	FCC1_WORLD	= 0x11,		/* Hong Kong */
-	FCC4_FCCA	= 0x12,		/* USA - Public Safety */
-	FCC5_FCCB	= 0x13,		/* USA w/ 1/2 and 1/4 width channels */
-
-	FCC2_FCCA	= 0x20,		/* Canada */
-	FCC2_WORLD	= 0x21,		/* Australia & HK */
-	FCC2_ETSIC	= 0x22,
-	FRANCE_RES	= 0x31,		/* Legacy France for OEM */
-	FCC3_FCCA	= 0x3A,		/* USA & Canada w/5470 band, 11h, DFS enabled */
-	FCC3_WORLD	= 0x3B,		/* USA & Canada w/5470 band, 11h, DFS enabled */
-
-	ETSI1_WORLD	= 0x37,
-	ETSI3_ETSIA	= 0x32,		/* France (optional) */
-	ETSI2_WORLD	= 0x35,		/* Hungary & others */
-	ETSI3_WORLD	= 0x36,		/* France & others */
-	ETSI4_WORLD	= 0x30,
-	ETSI4_ETSIC	= 0x38,
-	ETSI5_WORLD	= 0x39,
-	ETSI6_WORLD	= 0x34,		/* Bulgaria */
-	ETSI_RESERVED	= 0x33,		/* Reserved (Do not used) */
-
-	MKK1_MKKA	= 0x40,		/* Japan (JP1) */
-	MKK1_MKKB	= 0x41,		/* Japan (JP0) */
-	APL4_WORLD	= 0x42,		/* Singapore */
-	MKK2_MKKA	= 0x43,		/* Japan with 4.9G channels */
-	APL_RESERVED	= 0x44,		/* Reserved (Do not used)  */
-	APL2_WORLD	= 0x45,		/* Korea */
-	APL2_APLC	= 0x46,
-	APL3_WORLD	= 0x47,
-	MKK1_FCCA	= 0x48,		/* Japan (JP1-1) */
-	APL2_APLD	= 0x49,		/* Korea with 2.3G channels */
-	MKK1_MKKA1	= 0x4A,		/* Japan (JE1) */
-	MKK1_MKKA2	= 0x4B,		/* Japan (JE2) */
-	MKK1_MKKC	= 0x4C,		/* Japan (MKK1_MKKA,except Ch14) */
-
-	APL3_FCCA       = 0x50,
-	APL1_WORLD	= 0x52,		/* Latin America */
-	APL1_FCCA	= 0x53,
-	APL1_APLA	= 0x54,
-	APL1_ETSIC	= 0x55,
-	APL2_ETSIC	= 0x56,		/* Venezuela */
-	APL5_WORLD	= 0x58,		/* Chile */
-	APL6_WORLD	= 0x5B,		/* Singapore */
-	APL7_FCCA   	= 0x5C,     	/* Taiwan 5.47 Band */
-	APL8_WORLD  	= 0x5D,     	/* Malaysia 5GHz */
-	APL9_WORLD  	= 0x5E,     	/* Korea 5GHz */
-
-	/*
-	 * World mode SKUs
-	 */
-	WOR0_WORLD	= 0x60,		/* World0 (WO0 SKU) */
-	WOR1_WORLD	= 0x61,		/* World1 (WO1 SKU) */
-	WOR2_WORLD	= 0x62,		/* World2 (WO2 SKU) */
-	WOR3_WORLD	= 0x63,		/* World3 (WO3 SKU) */
-	WOR4_WORLD	= 0x64,		/* World4 (WO4 SKU) */	
-	WOR5_ETSIC	= 0x65,		/* World5 (WO5 SKU) */    
-
-	WOR01_WORLD	= 0x66,		/* World0-1 (WW0-1 SKU) */
-	WOR02_WORLD	= 0x67,		/* World0-2 (WW0-2 SKU) */
-	EU1_WORLD	= 0x68,		/* Same as World0-2 (WW0-2 SKU), except active scan ch1-13. No ch14 */
-
-	WOR9_WORLD	= 0x69,		/* World9 (WO9 SKU) */	
-	WORA_WORLD	= 0x6A,		/* WorldA (WOA SKU) */	
-	WORB_WORLD	= 0x6B,		/* WorldB (WOB SKU) */
-
-	MKK3_MKKB	= 0x80,		/* Japan UNI-1 even + MKKB */
-	MKK3_MKKA2	= 0x81,		/* Japan UNI-1 even + MKKA2 */
-	MKK3_MKKC	= 0x82,		/* Japan UNI-1 even + MKKC */
-
-	MKK4_MKKB	= 0x83,		/* Japan UNI-1 even + UNI-2 + MKKB */
-	MKK4_MKKA2	= 0x84,		/* Japan UNI-1 even + UNI-2 + MKKA2 */
-	MKK4_MKKC	= 0x85,		/* Japan UNI-1 even + UNI-2 + MKKC */
-
-	MKK5_MKKB	= 0x86,		/* Japan UNI-1 even + UNI-2 + mid-band + MKKB */
-	MKK5_MKKA2	= 0x87,		/* Japan UNI-1 even + UNI-2 + mid-band + MKKA2 */
-	MKK5_MKKC	= 0x88,		/* Japan UNI-1 even + UNI-2 + mid-band + MKKC */
-
-	MKK6_MKKB	= 0x89,		/* Japan UNI-1 even + UNI-1 odd MKKB */
-	MKK6_MKKA2	= 0x8A,		/* Japan UNI-1 even + UNI-1 odd + MKKA2 */
-	MKK6_MKKC	= 0x8B,		/* Japan UNI-1 even + UNI-1 odd + MKKC */
-
-	MKK7_MKKB	= 0x8C,		/* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKB */
-	MKK7_MKKA2	= 0x8D,		/* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKA2 */
-	MKK7_MKKC	= 0x8E,		/* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKC */
-
-	MKK8_MKKB	= 0x8F,		/* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKB */
-	MKK8_MKKA2	= 0x90,		/* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKA2 */
-	MKK8_MKKC	= 0x91,		/* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKC */
-
-	/* Following definitions are used only by s/w to map old
- 	 * Japan SKUs.
-	 */
-	MKK3_MKKA       = 0xF0,         /* Japan UNI-1 even + MKKA */
-	MKK3_MKKA1      = 0xF1,         /* Japan UNI-1 even + MKKA1 */
-	MKK3_FCCA       = 0xF2,         /* Japan UNI-1 even + FCCA */
-	MKK4_MKKA       = 0xF3,         /* Japan UNI-1 even + UNI-2 + MKKA */
-	MKK4_MKKA1      = 0xF4,         /* Japan UNI-1 even + UNI-2 + MKKA1 */
-	MKK4_FCCA       = 0xF5,         /* Japan UNI-1 even + UNI-2 + FCCA */
-	MKK9_MKKA       = 0xF6,         /* Japan UNI-1 even + 4.9GHz */
-	MKK10_MKKA      = 0xF7,         /* Japan UNI-1 even + UNI-2 + 4.9GHz */
-
-	/*
-	 * Regulator domains ending in a number (e.g. APL1,
-	 * MK1, ETSI4, etc) apply to 5GHz channel and power
-	 * information.  Regulator domains ending in a letter
-	 * (e.g. APLA, FCCA, etc) apply to 2.4GHz channel and
-	 * power information.
-	 */
-	APL1		= 0x0150,	/* LAT & Asia */
-	APL2		= 0x0250,	/* LAT & Asia */
-	APL3		= 0x0350,	/* Taiwan */
-	APL4		= 0x0450,	/* Jordan */
-	APL5		= 0x0550,	/* Chile */
-	APL6		= 0x0650,	/* Singapore */
-	APL8		= 0x0850,	/* Malaysia */
-	APL9		= 0x0950,	/* Korea (South) ROC 3 */
-
-	ETSI1		= 0x0130,	/* Europe & others */
-	ETSI2		= 0x0230,	/* Europe & others */
-	ETSI3		= 0x0330,	/* Europe & others */
-	ETSI4		= 0x0430,	/* Europe & others */
-	ETSI5		= 0x0530,	/* Europe & others */
-	ETSI6		= 0x0630,	/* Europe & others */
-	ETSIA		= 0x0A30,	/* France */
-	ETSIB		= 0x0B30,	/* Israel */
-	ETSIC		= 0x0C30,	/* Latin America */
-
-	FCC1		= 0x0110,	/* US & others */
-	FCC2		= 0x0120,	/* Canada, Australia & New Zealand */
-	FCC3		= 0x0160,	/* US w/new middle band & DFS */    
-	FCC4          	= 0x0165,     	/* US Public Safety */
-	FCC5          	= 0x0166,     	/* US w/ 1/2 and 1/4 width channels */
-	FCCA		= 0x0A10,	 
-	FCCB		= 0x0A11,	/* US w/ 1/2 and 1/4 width channels */
-
-	APLD		= 0x0D50,	/* South Korea */
-
-	MKK1		= 0x0140,	/* Japan (UNI-1 odd)*/
-	MKK2		= 0x0240,	/* Japan (4.9 GHz + UNI-1 odd) */
-	MKK3		= 0x0340,	/* Japan (UNI-1 even) */
-	MKK4		= 0x0440,	/* Japan (UNI-1 even + UNI-2) */
-	MKK5		= 0x0540,	/* Japan (UNI-1 even + UNI-2 + mid-band) */
-	MKK6		= 0x0640,	/* Japan (UNI-1 odd + UNI-1 even) */
-	MKK7		= 0x0740,	/* Japan (UNI-1 odd + UNI-1 even + UNI-2 */
-	MKK8		= 0x0840,	/* Japan (UNI-1 odd + UNI-1 even + UNI-2 + mid-band) */
-	MKK9            = 0x0940,       /* Japan (UNI-1 even + 4.9 GHZ) */
-	MKK10           = 0x0B40,       /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */
-	MKKA		= 0x0A40,	/* Japan */
-	MKKC		= 0x0A50,
-
-	NULL1		= 0x0198,
-	WORLD		= 0x0199,
-	DEBUG_REG_DMN	= 0x01ff,
-};
+#include "ah_regdomain/ah_rd_regenum.h"
 
 #define	WORLD_SKU_MASK		0x00F0
 #define	WORLD_SKU_PREFIX	0x0060
 
-enum {					/* conformance test limits */
-	FCC	= 0x10,
-	MKK	= 0x40,
-	ETSI	= 0x30,
-};
-
-/*
- * The following are flags for different requirements per reg domain.
- * These requirements are either inhereted from the reg domain pair or
- * from the unitary reg domain if the reg domain pair flags value is 0
- */
-enum {
-	NO_REQ			= 0x00000000,	/* NB: must be zero */
-	DISALLOW_ADHOC_11A	= 0x00000001,	/* adhoc not allowed in 5GHz */
-	DISALLOW_ADHOC_11A_TURB	= 0x00000002,	/* not allowed w/ 5GHz turbo */
-	NEED_NFC		= 0x00000004,	/* need noise floor check */
-	ADHOC_PER_11D		= 0x00000008,	/* must receive 11d beacon */
-	LIMIT_FRAME_4MS 	= 0x00000020,	/* 4msec tx burst limit */
-	NO_HOSTAP		= 0x00000040,	/* No HOSTAP mode opereation */
-};
-
-/*
- * The following describe the bit masks for different passive scan
- * capability/requirements per regdomain.
- */
-#define	NO_PSCAN	0x0ULL			/* NB: must be zero */
-#define	PSCAN_FCC	0x0000000000000001ULL
-#define	PSCAN_FCC_T	0x0000000000000002ULL
-#define	PSCAN_ETSI	0x0000000000000004ULL
-#define	PSCAN_MKK1	0x0000000000000008ULL
-#define	PSCAN_MKK2	0x0000000000000010ULL
-#define	PSCAN_MKKA	0x0000000000000020ULL
-#define	PSCAN_MKKA_G	0x0000000000000040ULL
-#define	PSCAN_ETSIA	0x0000000000000080ULL
-#define	PSCAN_ETSIB	0x0000000000000100ULL
-#define	PSCAN_ETSIC	0x0000000000000200ULL
-#define	PSCAN_WWR	0x0000000000000400ULL
-#define	PSCAN_MKKA1	0x0000000000000800ULL
-#define	PSCAN_MKKA1_G	0x0000000000001000ULL
-#define	PSCAN_MKKA2	0x0000000000002000ULL
-#define	PSCAN_MKKA2_G	0x0000000000004000ULL
-#define	PSCAN_MKK3	0x0000000000008000ULL
-#define	PSCAN_DEFER	0x7FFFFFFFFFFFFFFFULL
-#define	IS_ECM_CHAN	0x8000000000000000ULL
-
 /*
  * THE following table is the mapping of regdomain pairs specified by
  * an 8 bit regdomain value to the individual unitary reg domains
  */
-static REG_DMN_PAIR_MAPPING regDomainPairs[] = {
-	{NO_ENUMRD,	DEBUG_REG_DMN,	DEBUG_REG_DMN, NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{NULL1_WORLD,	NULL1,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{NULL1_ETSIB,	NULL1,		ETSIB,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{NULL1_ETSIC,	NULL1,		ETSIC,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-
-	{FCC2_FCCA,	FCC2,		FCCA,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{FCC2_WORLD,	FCC2,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{FCC2_ETSIC,	FCC2,		ETSIC,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{FCC3_FCCA,	FCC3,		FCCA,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{FCC3_WORLD,	FCC3,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{FCC4_FCCA,	FCC4,		FCCA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{FCC5_FCCB,	FCC5,		FCCB,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-
-	{ETSI1_WORLD,	ETSI1,		WORLD,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{ETSI2_WORLD,	ETSI2,		WORLD,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{ETSI3_WORLD,	ETSI3,		WORLD,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{ETSI4_WORLD,	ETSI4,		WORLD,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{ETSI5_WORLD,	ETSI5,		WORLD,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{ETSI6_WORLD,	ETSI6,		WORLD,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-
-	{ETSI3_ETSIA,	ETSI3,		WORLD,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{FRANCE_RES,	ETSI3,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-
-	{FCC1_WORLD,	FCC1,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{FCC1_FCCA,	FCC1,		FCCA,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL1_WORLD,	APL1,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL2_WORLD,	APL2,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL3_WORLD,	APL3,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL4_WORLD,	APL4,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL5_WORLD,	APL5,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL6_WORLD,	APL6,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL8_WORLD,	APL8,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL9_WORLD,	APL9,		WORLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-
-	{APL3_FCCA,	APL3,		FCCA,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL1_ETSIC,	APL1,		ETSIC,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL2_ETSIC,	APL2,		ETSIC,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{APL2_APLD,	APL2,		APLD,		NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-
-	{MKK1_MKKA,	MKK1,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKKA, CTRY_JAPAN },
-	{MKK1_MKKB,	MKK1,		MKKA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC| LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN1 },
-	{MKK1_FCCA,	MKK1,		FCCA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC| LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1, CTRY_JAPAN2 },
-	{MKK1_MKKA1,	MKK1,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC| LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN4 },
-	{MKK1_MKKA2,	MKK1,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC| LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN5 },
-	{MKK1_MKKC,	MKK1,		MKKC,		DISALLOW_ADHOC_11A_TURB | NEED_NFC| LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1, CTRY_JAPAN6 },
-
-	/* MKK2 */
-	{MKK2_MKKA,	MKK2,		MKKA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC| LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK2 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN3 },
-
-	/* MKK3 */
-	{MKK3_MKKA,	MKK3,	MKKA,	DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC , PSCAN_MKKA, CTRY_DEFAULT },
-	{MKK3_MKKB,	MKK3,		MKKA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN7 },
-	{MKK3_MKKA1,	MKK3,	MKKA,	DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_DEFAULT },
-	{MKK3_MKKA2,MKK3,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN8 },
-	{MKK3_MKKC,	MKK3,		MKKC,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, NO_PSCAN, CTRY_JAPAN9 },
-	{MKK3_FCCA,	MKK3,	FCCA,	DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, NO_PSCAN, CTRY_DEFAULT },
-
-	/* MKK4 */
-	{MKK4_MKKB,	MKK4,		MKKA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN10 },
-	{MKK4_MKKA1,	MKK4,	MKKA,	DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_DEFAULT },
-	{MKK4_MKKA2,	MKK4,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 |PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN11 },
-	{MKK4_MKKC,	MKK4,		MKKC,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3, CTRY_JAPAN12 },
-	{MKK4_FCCA,	MKK4,	FCCA,	DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3, CTRY_DEFAULT },
-
-	/* MKK5 */
-	{MKK5_MKKB,	MKK5,		MKKA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN13 },
-	{MKK5_MKKA2,MKK5,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN14 },
-	{MKK5_MKKC,	MKK5,		MKKC,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3, CTRY_JAPAN15 },
-
-	/* MKK6 */
-	{MKK6_MKKB,	MKK6,		MKKA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN16 },
-	{MKK6_MKKA2,	MKK6,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN17 },
-	{MKK6_MKKC,	MKK6,		MKKC,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1, CTRY_JAPAN18 },
-
-	/* MKK7 */
-	{MKK7_MKKB,	MKK7,		MKKA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN19 },
-	{MKK7_MKKA2, MKK7,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN20 },
-	{MKK7_MKKC,	MKK7,		MKKC,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKK3, CTRY_JAPAN21 },
-
-	/* MKK8 */
-	{MKK8_MKKB,	MKK8,		MKKA,		DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN22 },
-	{MKK8_MKKA2,MKK8,		MKKA,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN23 },
-	{MKK8_MKKC,	MKK8,		MKKC,		DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKK3 , CTRY_JAPAN24 },
-
-	{MKK9_MKKA,	MKK9,	MKKA,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_DEFAULT },
-	{MKK10_MKKA,	MKK10,	MKKA,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_DEFAULT },
-
-		/* These are super domains */
-	{WOR0_WORLD,	WOR0_WORLD,	WOR0_WORLD,	NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WOR1_WORLD,	WOR1_WORLD,	WOR1_WORLD,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WOR2_WORLD,	WOR2_WORLD,	WOR2_WORLD,	DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WOR3_WORLD,	WOR3_WORLD,	WOR3_WORLD,	NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WOR4_WORLD,	WOR4_WORLD,	WOR4_WORLD,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WOR5_ETSIC,	WOR5_ETSIC,	WOR5_ETSIC,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WOR01_WORLD,	WOR01_WORLD,	WOR01_WORLD,	NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WOR02_WORLD,	WOR02_WORLD,	WOR02_WORLD,	NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{EU1_WORLD,	EU1_WORLD,	EU1_WORLD,	NO_REQ, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WOR9_WORLD,	WOR9_WORLD,	WOR9_WORLD,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WORA_WORLD,	WORA_WORLD,	WORA_WORLD,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-	{WORB_WORLD,	WORB_WORLD,	WORB_WORLD,	DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, CTRY_DEFAULT },
-};
+#include "ah_regdomain/ah_rd_regmap.h"
 
 /* 
  * The following tables are the master list for all different freqeuncy
@@ -423,1237 +68,35 @@ static REG_DMN_PAIR_MAPPING regDomainPai
  * for each band if it is used in ANY reg domain.
  */
 
-#define DEF_REGDMN		FCC1_FCCA
 #define	COUNTRY_ERD_FLAG        0x8000
 #define WORLDWIDE_ROAMING_FLAG  0x4000
 
-static COUNTRY_CODE_TO_ENUM_RD allCountries[] = {
-	{ CTRY_DEBUG,       NO_ENUMRD },
-	{ CTRY_DEFAULT,     DEF_REGDMN },
-	{ CTRY_ALBANIA,     NULL1_WORLD },
-	{ CTRY_ALGERIA,     NULL1_WORLD },
-	{ CTRY_ARGENTINA,   APL3_WORLD },
-	{ CTRY_ARMENIA,     ETSI4_WORLD },
-	{ CTRY_AUSTRALIA,   FCC2_WORLD },
-	{ CTRY_AUSTRIA,     ETSI1_WORLD },
-	{ CTRY_AZERBAIJAN,  ETSI4_WORLD },
-	{ CTRY_BAHRAIN,     APL6_WORLD },
-	{ CTRY_BELARUS,     NULL1_WORLD },
-	{ CTRY_BELGIUM,     ETSI1_WORLD },
-	{ CTRY_BELIZE,      APL1_ETSIC },
-	{ CTRY_BOLIVIA,     APL1_ETSIC },
-	{ CTRY_BRAZIL,      FCC3_WORLD },
-	{ CTRY_BRUNEI_DARUSSALAM,APL1_WORLD },
-	{ CTRY_BULGARIA,    ETSI6_WORLD },
-	{ CTRY_CANADA,      FCC2_FCCA },
-	{ CTRY_CHILE,       APL6_WORLD },
-	{ CTRY_CHINA,       APL1_WORLD },
-	{ CTRY_COLOMBIA,    FCC1_FCCA },
-	{ CTRY_COSTA_RICA,  NULL1_WORLD },
-	{ CTRY_CROATIA,     ETSI3_WORLD },
-	{ CTRY_CYPRUS,      ETSI1_WORLD },
-	{ CTRY_CZECH,       ETSI1_WORLD },
-	{ CTRY_DENMARK,     ETSI1_WORLD },
-	{ CTRY_DOMINICAN_REPUBLIC,FCC1_FCCA },
-	{ CTRY_ECUADOR,     NULL1_WORLD },
-	{ CTRY_EGYPT,       ETSI3_WORLD },
-	{ CTRY_EL_SALVADOR, NULL1_WORLD },
-	{ CTRY_ESTONIA,     ETSI1_WORLD },
-	{ CTRY_FINLAND,     ETSI1_WORLD },
-	{ CTRY_FRANCE,      ETSI1_WORLD },
-	{ CTRY_FRANCE2,     ETSI3_WORLD },
-	{ CTRY_GEORGIA,     ETSI4_WORLD },
-	{ CTRY_GERMANY,     ETSI1_WORLD },
-	{ CTRY_GREECE,      ETSI1_WORLD },
-	{ CTRY_GUATEMALA,   FCC1_FCCA },
-	{ CTRY_HONDURAS,    NULL1_WORLD },
-	{ CTRY_HONG_KONG,   FCC2_WORLD },
-	{ CTRY_HUNGARY,     ETSI1_WORLD },
-	{ CTRY_ICELAND,     ETSI1_WORLD },
-	{ CTRY_INDIA,       APL6_WORLD },
-	{ CTRY_INDONESIA,   APL1_WORLD },
-	{ CTRY_IRAN,        APL1_WORLD },
-	{ CTRY_IRELAND,     ETSI1_WORLD },
-	{ CTRY_ISRAEL,      NULL1_WORLD },
-	{ CTRY_ITALY,       ETSI1_WORLD },
-	{ CTRY_JAPAN,       MKK1_MKKA },
-	{ CTRY_JAPAN1,      MKK1_MKKB },
-	{ CTRY_JAPAN2,      MKK1_FCCA },
-	{ CTRY_JAPAN3,      MKK2_MKKA },
-	{ CTRY_JAPAN4,      MKK1_MKKA1 },
-	{ CTRY_JAPAN5,      MKK1_MKKA2 },
-	{ CTRY_JAPAN6,      MKK1_MKKC },
-
-	{ CTRY_JAPAN7,      MKK3_MKKB },
-	{ CTRY_JAPAN8,      MKK3_MKKA2 },
-	{ CTRY_JAPAN9,      MKK3_MKKC },
-
-	{ CTRY_JAPAN10,     MKK4_MKKB },
-	{ CTRY_JAPAN11,     MKK4_MKKA2 },
-	{ CTRY_JAPAN12,     MKK4_MKKC },
-
-	{ CTRY_JAPAN13,     MKK5_MKKB },
-	{ CTRY_JAPAN14,     MKK5_MKKA2 },
-	{ CTRY_JAPAN15,     MKK5_MKKC },
-
-	{ CTRY_JAPAN16,     MKK6_MKKB },
-	{ CTRY_JAPAN17,     MKK6_MKKA2 },
-	{ CTRY_JAPAN18,     MKK6_MKKC },
-
-	{ CTRY_JAPAN19,     MKK7_MKKB },
-	{ CTRY_JAPAN20,     MKK7_MKKA2 },
-	{ CTRY_JAPAN21,     MKK7_MKKC },
-
-	{ CTRY_JAPAN22,     MKK8_MKKB },
-	{ CTRY_JAPAN23,     MKK8_MKKA2 },
-	{ CTRY_JAPAN24,     MKK8_MKKC },
-
-	{ CTRY_JORDAN,      APL4_WORLD },
-	{ CTRY_KAZAKHSTAN,  NULL1_WORLD },
-	{ CTRY_KOREA_NORTH, APL2_WORLD },
-	{ CTRY_KOREA_ROC,   APL2_WORLD },
-	{ CTRY_KOREA_ROC2,  APL2_WORLD },
-	{ CTRY_KOREA_ROC3,  APL9_WORLD },
-	{ CTRY_KUWAIT,      NULL1_WORLD },
-	{ CTRY_LATVIA,      ETSI1_WORLD },
-	{ CTRY_LEBANON,     NULL1_WORLD },
-	{ CTRY_LIECHTENSTEIN,ETSI1_WORLD },
-	{ CTRY_LITHUANIA,   ETSI1_WORLD },
-	{ CTRY_LUXEMBOURG,  ETSI1_WORLD },
-	{ CTRY_MACAU,       FCC2_WORLD },
-	{ CTRY_MACEDONIA,   NULL1_WORLD },
-	{ CTRY_MALAYSIA,    APL8_WORLD },
-	{ CTRY_MALTA,       ETSI1_WORLD },
-	{ CTRY_MEXICO,      FCC1_FCCA },
-	{ CTRY_MONACO,      ETSI4_WORLD },
-	{ CTRY_MOROCCO,     NULL1_WORLD },
-	{ CTRY_NETHERLANDS, ETSI1_WORLD },
-	{ CTRY_NEW_ZEALAND, FCC2_ETSIC },
-	{ CTRY_NORWAY,      ETSI1_WORLD },
-	{ CTRY_OMAN,        APL6_WORLD },
-	{ CTRY_PAKISTAN,    NULL1_WORLD },
-	{ CTRY_PANAMA,      FCC1_FCCA },
-	{ CTRY_PERU,        APL1_WORLD },
-	{ CTRY_PHILIPPINES, FCC3_WORLD },
-	{ CTRY_POLAND,      ETSI1_WORLD },
-	{ CTRY_PORTUGAL,    ETSI1_WORLD },
-	{ CTRY_PUERTO_RICO, FCC1_FCCA },
-	{ CTRY_QATAR,       NULL1_WORLD },
-	{ CTRY_ROMANIA,     NULL1_WORLD },
-	{ CTRY_RUSSIA,      NULL1_WORLD },
-	{ CTRY_SAUDI_ARABIA,FCC2_WORLD },
-	{ CTRY_SINGAPORE,   APL6_WORLD },
-	{ CTRY_SLOVAKIA,    ETSI1_WORLD },
-	{ CTRY_SLOVENIA,    ETSI1_WORLD },
-	{ CTRY_SOUTH_AFRICA,FCC3_WORLD },
-	{ CTRY_SPAIN,       ETSI1_WORLD },
-	{ CTRY_SWEDEN,      ETSI1_WORLD },
-	{ CTRY_SWITZERLAND, ETSI1_WORLD },
-	{ CTRY_SYRIA,       NULL1_WORLD },
-	{ CTRY_TAIWAN,      APL3_FCCA },
-	{ CTRY_THAILAND,    FCC3_WORLD },
-	{ CTRY_TRINIDAD_Y_TOBAGO,ETSI4_WORLD },
-	{ CTRY_TUNISIA,     ETSI3_WORLD },
-	{ CTRY_TURKEY,      ETSI3_WORLD },
-	{ CTRY_UKRAINE,     NULL1_WORLD },
-	{ CTRY_UAE,         NULL1_WORLD },
-	{ CTRY_UNITED_KINGDOM, ETSI1_WORLD },
-	{ CTRY_UNITED_STATES, FCC1_FCCA },
-	{ CTRY_UNITED_STATES_FCC49,FCC4_FCCA },
-	{ CTRY_URUGUAY,     FCC1_WORLD },
-	{ CTRY_UZBEKISTAN,  FCC3_FCCA },
-	{ CTRY_VENEZUELA,   APL2_ETSIC },
-	{ CTRY_VIET_NAM,    NULL1_WORLD },
-	{ CTRY_ZIMBABWE,    NULL1_WORLD }
-};
-
-/* Bit masks for DFS per regdomain */
-enum {
-	NO_DFS   = 0x0000000000000000ULL,	/* NB: must be zero */
-	DFS_FCC3 = 0x0000000000000001ULL,
-	DFS_ETSI = 0x0000000000000002ULL,
-	DFS_MKK4 = 0x0000000000000004ULL,
-};
-
-#define	AFTER(x)	((x)+1)
-
-/*
- * Frequency band collections are defined using bitmasks.  Each bit
- * in a mask is the index of an entry in one of the following tables.
- * Bitmasks are BMLEN*64 bits so if a table grows beyond that the bit
- * vectors must be enlarged or the tables split somehow (e.g. split
- * 1/2 and 1/4 rate channels into a separate table).
- *
- * Beware of ordering; the indices are defined relative to the preceding
- * entry so if things get off there will be confusion.  A good way to
- * check the indices is to collect them in a switch statement in a stub
- * function so the compiler checks for duplicates.
- */
-
 /*
- * 5GHz 11A channel tags
+ * This table maps country ISO codes from net80211 into regulatory
+ * domains which the ath regulatory domain code understands.
  */
-static REG_DMN_FREQ_BAND regDmn5GhzFreq[] = {
-	{ 4915, 4925, 23, 0, 10,  5, NO_DFS, PSCAN_MKK2 },
-#define	F1_4915_4925	0
-	{ 4935, 4945, 23, 0, 10,  5, NO_DFS, PSCAN_MKK2 },
-#define	F1_4935_4945	AFTER(F1_4915_4925)
-	{ 4920, 4980, 23, 0, 20, 20, NO_DFS, PSCAN_MKK2 },
-#define	F1_4920_4980	AFTER(F1_4935_4945)
-	{ 4942, 4987, 27, 6,  5,  5, NO_DFS, PSCAN_FCC },
-#define	F1_4942_4987	AFTER(F1_4920_4980)
-	{ 4945, 4985, 30, 6, 10,  5, NO_DFS, PSCAN_FCC },
-#define	F1_4945_4985	AFTER(F1_4942_4987)
-	{ 4950, 4980, 33, 6, 20,  5, NO_DFS, PSCAN_FCC },
-#define	F1_4950_4980	AFTER(F1_4945_4985)
-	{ 5035, 5040, 23, 0, 10,  5, NO_DFS, PSCAN_MKK2 },
-#define	F1_5035_5040	AFTER(F1_4950_4980)
-	{ 5040, 5080, 23, 0, 20, 20, NO_DFS, PSCAN_MKK2 },
-#define	F1_5040_5080	AFTER(F1_5035_5040)
-	{ 5055, 5055, 23, 0, 10,  5, NO_DFS, PSCAN_MKK2 },
-#define	F1_5055_5055	AFTER(F1_5040_5080)
-
-	{ 5120, 5240, 5,  6, 20, 20, NO_DFS, NO_PSCAN },
-#define	F1_5120_5240	AFTER(F1_5055_5055)
-	{ 5120, 5240, 5,  6, 10, 10, NO_DFS, NO_PSCAN },
-#define	F2_5120_5240	AFTER(F1_5120_5240)
-	{ 5120, 5240, 5,  6,  5,  5, NO_DFS, NO_PSCAN },
-#define	F3_5120_5240	AFTER(F2_5120_5240)
-
-	{ 5170, 5230, 23, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK2 },
-#define	F1_5170_5230	AFTER(F3_5120_5240)
-	{ 5170, 5230, 20, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK2 },
-#define	F2_5170_5230	AFTER(F1_5170_5230)
-
-	{ 5180, 5240, 15, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI },
-#define	F1_5180_5240	AFTER(F2_5170_5230)
-	{ 5180, 5240, 17, 6, 20, 20, NO_DFS, PSCAN_FCC },
-#define	F2_5180_5240	AFTER(F1_5180_5240)
-	{ 5180, 5240, 18, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI },
-#define	F3_5180_5240	AFTER(F2_5180_5240)
-	{ 5180, 5240, 20, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI },
-#define	F4_5180_5240	AFTER(F3_5180_5240)
-	{ 5180, 5240, 23, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI },
-#define	F5_5180_5240	AFTER(F4_5180_5240)
-	{ 5180, 5240, 23, 6, 20, 20, NO_DFS, PSCAN_FCC },
-#define	F6_5180_5240	AFTER(F5_5180_5240)
-	{ 5180, 5240, 17, 6, 20, 10, NO_DFS, PSCAN_FCC },
-#define	F7_5180_5240	AFTER(F6_5180_5240)
-	{ 5180, 5240, 17, 6, 20,  5, NO_DFS, PSCAN_FCC },
-#define	F8_5180_5240	AFTER(F7_5180_5240)
-	{ 5180, 5320, 20, 6, 20, 20, DFS_ETSI, PSCAN_ETSI },
-
-#define	F1_5180_5320	AFTER(F8_5180_5240)
-	{ 5240, 5280, 23, 0, 20, 20, DFS_FCC3, PSCAN_FCC | PSCAN_ETSI },
-
-#define	F1_5240_5280	AFTER(F1_5180_5320)
-	{ 5260, 5280, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI },
-
-#define	F1_5260_5280	AFTER(F1_5240_5280)
-	{ 5260, 5320, 18, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI },
-
-#define	F1_5260_5320	AFTER(F1_5260_5280)
-	{ 5260, 5320, 20, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4, PSCAN_FCC | PSCAN_ETSI | PSCAN_MKK3  },
-#define	F2_5260_5320	AFTER(F1_5260_5320)
-
-	{ 5260, 5320, 20, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC },
-#define	F3_5260_5320	AFTER(F2_5260_5320)
-	{ 5260, 5320, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC },
-#define	F4_5260_5320	AFTER(F3_5260_5320)
-	{ 5260, 5320, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC },
-#define	F5_5260_5320	AFTER(F4_5260_5320)
-	{ 5260, 5320, 30, 0, 20, 20, NO_DFS, NO_PSCAN },
-#define	F6_5260_5320	AFTER(F5_5260_5320)
-	{ 5260, 5320, 23, 6, 20, 10, DFS_FCC3 | DFS_ETSI, PSCAN_FCC },
-#define	F7_5260_5320	AFTER(F6_5260_5320)
-	{ 5260, 5320, 23, 6, 20,  5, DFS_FCC3 | DFS_ETSI, PSCAN_FCC },
-#define	F8_5260_5320	AFTER(F7_5260_5320)
-
-	{ 5260, 5700, 5,  6, 20, 20, DFS_FCC3 | DFS_ETSI, NO_PSCAN },
-#define	F1_5260_5700	AFTER(F8_5260_5320)
-	{ 5260, 5700, 5,  6, 10, 10, DFS_FCC3 | DFS_ETSI, NO_PSCAN },
-#define	F2_5260_5700	AFTER(F1_5260_5700)
-	{ 5260, 5700, 5,  6,  5,  5, DFS_FCC3 | DFS_ETSI, NO_PSCAN },
-#define	F3_5260_5700	AFTER(F2_5260_5700)
-
-	{ 5280, 5320, 17, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC },
-#define	F1_5280_5320	AFTER(F3_5260_5700)
-
-	{ 5500, 5620, 30, 6, 20, 20, DFS_ETSI, PSCAN_ETSI },
-#define	F1_5500_5620	AFTER(F1_5280_5320)
-
-	{ 5500, 5700, 20, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC },
-#define	F1_5500_5700	AFTER(F1_5500_5620)
-	{ 5500, 5700, 27, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI },
-#define	F2_5500_5700	AFTER(F1_5500_5700)
-	{ 5500, 5700, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI },
-#define	F3_5500_5700	AFTER(F2_5500_5700)
-	{ 5500, 5700, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4, PSCAN_MKK3 | PSCAN_FCC },
-#define	F4_5500_5700	AFTER(F3_5500_5700)
-
-	{ 5745, 5805, 23, 0, 20, 20, NO_DFS, NO_PSCAN },
-#define	F1_5745_5805	AFTER(F4_5500_5700)
-	{ 5745, 5805, 30, 6, 20, 20, NO_DFS, NO_PSCAN },
-#define	F2_5745_5805	AFTER(F1_5745_5805)
-	{ 5745, 5805, 30, 6, 20, 20, DFS_ETSI, PSCAN_ETSI },
-#define	F3_5745_5805	AFTER(F2_5745_5805)
-	{ 5745, 5825, 5,  6, 20, 20, NO_DFS, NO_PSCAN },
-#define	F1_5745_5825	AFTER(F3_5745_5805)
-	{ 5745, 5825, 17, 0, 20, 20, NO_DFS, NO_PSCAN },
-#define	F2_5745_5825	AFTER(F1_5745_5825)
-	{ 5745, 5825, 20, 0, 20, 20, NO_DFS, NO_PSCAN },
-#define	F3_5745_5825	AFTER(F2_5745_5825)
-	{ 5745, 5825, 30, 0, 20, 20, NO_DFS, NO_PSCAN },
-#define	F4_5745_5825	AFTER(F3_5745_5825)
-	{ 5745, 5825, 30, 6, 20, 20, NO_DFS, NO_PSCAN },
-#define	F5_5745_5825	AFTER(F4_5745_5825)
-	{ 5745, 5825, 30, 6, 20, 20, NO_DFS, NO_PSCAN },
-#define	F6_5745_5825	AFTER(F5_5745_5825)
-	{ 5745, 5825, 5,  6, 10, 10, NO_DFS, NO_PSCAN },
-#define	F7_5745_5825	AFTER(F6_5745_5825)
-	{ 5745, 5825, 5,  6,  5,  5, NO_DFS, NO_PSCAN },
-#define	F8_5745_5825	AFTER(F7_5745_5825)
-	{ 5745, 5825, 30, 6, 20, 10, NO_DFS, NO_PSCAN },
-#define	F9_5745_5825	AFTER(F8_5745_5825)
-	{ 5745, 5825, 30, 6, 20,  5, NO_DFS, NO_PSCAN },
-#define	F10_5745_5825	AFTER(F9_5745_5825)
-
-	/*
-	 * Below are the world roaming channels
-	 * All WWR domains have no power limit, instead use the card's CTL
-	 * or max power settings.
-	 */
-	{ 4920, 4980, 30, 0, 20, 20, NO_DFS, PSCAN_WWR },
-#define	W1_4920_4980	AFTER(F10_5745_5825)
-	{ 5040, 5080, 30, 0, 20, 20, NO_DFS, PSCAN_WWR },
-#define	W1_5040_5080	AFTER(W1_4920_4980)
-	{ 5170, 5230, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR },
-#define	W1_5170_5230	AFTER(W1_5040_5080)
-	{ 5180, 5240, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR },
-#define	W1_5180_5240	AFTER(W1_5170_5230)
-	{ 5260, 5320, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR },
-#define	W1_5260_5320	AFTER(W1_5180_5240)
-	{ 5745, 5825, 30, 0, 20, 20, NO_DFS, PSCAN_WWR },
-#define	W1_5745_5825	AFTER(W1_5260_5320)
-	{ 5500, 5700, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR },
-#define	W1_5500_5700	AFTER(W1_5745_5825)
-	{ 5260, 5320, 30, 0, 20, 20, NO_DFS, NO_PSCAN },
-#define	W2_5260_5320	AFTER(W1_5500_5700)
-	{ 5180, 5240, 30, 0, 20, 20, NO_DFS, NO_PSCAN },
-#define	W2_5180_5240	AFTER(W2_5260_5320)
-	{ 5825, 5825, 30, 0, 20, 20, NO_DFS, PSCAN_WWR },
-#define	W2_5825_5825	AFTER(W2_5180_5240)
-};
+#include "ah_regdomain/ah_rd_ctry.h"
 
 /*
- * 5GHz Turbo (dynamic & static) tags
- */
-static REG_DMN_FREQ_BAND regDmn5GhzTurboFreq[] = {
-	{ 5130, 5210, 5,  6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_5130_5210	0
-	{ 5250, 5330, 5,  6, 40, 40, DFS_FCC3, NO_PSCAN },
-#define	T1_5250_5330	AFTER(T1_5130_5210)
-	{ 5370, 5490, 5,  6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_5370_5490	AFTER(T1_5250_5330)
-	{ 5530, 5650, 5,  6, 40, 40, DFS_FCC3, NO_PSCAN },
-#define	T1_5530_5650	AFTER(T1_5370_5490)
-
-	{ 5150, 5190, 5,  6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_5150_5190	AFTER(T1_5530_5650)
-	{ 5230, 5310, 5,  6, 40, 40, DFS_FCC3, NO_PSCAN },
-#define	T1_5230_5310	AFTER(T1_5150_5190)
-	{ 5350, 5470, 5,  6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_5350_5470	AFTER(T1_5230_5310)
-	{ 5510, 5670, 5,  6, 40, 40, DFS_FCC3, NO_PSCAN },
-#define	T1_5510_5670	AFTER(T1_5350_5470)
-
-	{ 5200, 5240, 17, 6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_5200_5240	AFTER(T1_5510_5670)
-	{ 5200, 5240, 23, 6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T2_5200_5240	AFTER(T1_5200_5240)
-	{ 5210, 5210, 17, 6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_5210_5210	AFTER(T2_5200_5240)
-	{ 5210, 5210, 23, 0, 40, 40, NO_DFS, NO_PSCAN },
-#define	T2_5210_5210	AFTER(T1_5210_5210)
-
-	{ 5280, 5280, 23, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T },
-#define	T1_5280_5280	AFTER(T2_5210_5210)
-	{ 5280, 5280, 20, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T },
-#define	T2_5280_5280	AFTER(T1_5280_5280)
-	{ 5250, 5250, 17, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T },
-#define	T1_5250_5250	AFTER(T2_5280_5280)
-	{ 5290, 5290, 20, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T },
-#define	T1_5290_5290	AFTER(T1_5250_5250)
-	{ 5250, 5290, 20, 0, 40, 40, DFS_FCC3, PSCAN_FCC_T },
-#define	T1_5250_5290	AFTER(T1_5290_5290)
-	{ 5250, 5290, 23, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T },
-#define	T2_5250_5290	AFTER(T1_5250_5290)
-
-	{ 5540, 5660, 20, 6, 40, 40, DFS_FCC3, PSCAN_FCC_T },
-#define	T1_5540_5660	AFTER(T2_5250_5290)
-	{ 5760, 5800, 20, 0, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_5760_5800	AFTER(T1_5540_5660)
-	{ 5760, 5800, 30, 6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T2_5760_5800	AFTER(T1_5760_5800)
-
-	{ 5765, 5805, 30, 6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_5765_5805	AFTER(T2_5760_5800)
-
-	/*
-	 * Below are the WWR frequencies
-	 */
-	{ 5210, 5250, 15, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR },
-#define	WT1_5210_5250	AFTER(T1_5765_5805)
-	{ 5290, 5290, 18, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR },
-#define	WT1_5290_5290	AFTER(WT1_5210_5250)
-	{ 5540, 5660, 20, 0, 40, 40, DFS_FCC3 | DFS_ETSI, PSCAN_WWR },
-#define	WT1_5540_5660	AFTER(WT1_5290_5290)
-	{ 5760, 5800, 20, 0, 40, 40, NO_DFS, PSCAN_WWR },
-#define	WT1_5760_5800	AFTER(WT1_5540_5660)
-};
-
-/*
- * 2GHz 11b channel tags
- */
-static REG_DMN_FREQ_BAND regDmn2GhzFreq[] = {
-	{ 2312, 2372, 5,  6, 20, 5, NO_DFS, NO_PSCAN },
-#define	F1_2312_2372	0
-	{ 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	F2_2312_2372	AFTER(F1_2312_2372)
-
-	{ 2412, 2472, 5,  6, 20, 5, NO_DFS, NO_PSCAN },
-#define	F1_2412_2472	AFTER(F2_2312_2372)
-	{ 2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA },
-#define	F2_2412_2472	AFTER(F1_2412_2472)
-	{ 2412, 2472, 30, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	F3_2412_2472	AFTER(F2_2412_2472)
-
-	{ 2412, 2462, 27, 6, 20, 5, NO_DFS, NO_PSCAN },
-#define	F1_2412_2462	AFTER(F3_2412_2472)
-	{ 2412, 2462, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA },
-#define	F2_2412_2462	AFTER(F1_2412_2462)
-
-	{ 2432, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	F1_2432_2442	AFTER(F2_2412_2462)
-
-	{ 2457, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	F1_2457_2472	AFTER(F1_2432_2442)
-
-	{ 2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA2 | PSCAN_MKKA },
-#define	F1_2467_2472	AFTER(F1_2457_2472)
-
-	{ 2484, 2484, 5,  6, 20, 5, NO_DFS, NO_PSCAN },
-#define	F1_2484_2484	AFTER(F1_2467_2472)
-	{ 2484, 2484, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA | PSCAN_MKKA1 | PSCAN_MKKA2 },
-#define	F2_2484_2484	AFTER(F1_2484_2484)
-
-	{ 2512, 2732, 5,  6, 20, 5, NO_DFS, NO_PSCAN },
-#define	F1_2512_2732	AFTER(F2_2484_2484)
-
-	/*
-	 * WWR have powers opened up to 20dBm.
-	 * Limits should often come from CTL/Max powers
-	 */
-	{ 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	W1_2312_2372	AFTER(F1_2512_2732)
-	{ 2412, 2412, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	W1_2412_2412	AFTER(W1_2312_2372)
-	{ 2417, 2432, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	W1_2417_2432	AFTER(W1_2412_2412)
-	{ 2437, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	W1_2437_2442	AFTER(W1_2417_2432)
-	{ 2447, 2457, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	W1_2447_2457	AFTER(W1_2437_2442)
-	{ 2462, 2462, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	W1_2462_2462	AFTER(W1_2447_2457)
-	{ 2467, 2467, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN },
-#define	W1_2467_2467	AFTER(W1_2462_2462)
-	{ 2467, 2467, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN },
-#define	W2_2467_2467	AFTER(W1_2467_2467)
-	{ 2472, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN },
-#define	W1_2472_2472	AFTER(W2_2467_2467)
-	{ 2472, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN },
-#define	W2_2472_2472	AFTER(W1_2472_2472)
-	{ 2484, 2484, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN },
-#define	W1_2484_2484	AFTER(W2_2472_2472)
-	{ 2484, 2484, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN },
-#define	W2_2484_2484	AFTER(W1_2484_2484)
-};
-
-/*
- * 2GHz 11g channel tags
+ * The frequency band collections are a set of frequency ranges
+ * with shared properties - max tx power, max antenna gain, channel width,
+ * channel spacing, DFS requirements and passive scanning requirements.
+ *
+ * These are represented as entries in a frequency band bitmask.
+ * Each regulatory domain entry in ah_regdomain_domains.h uses one
+ * or more frequency band entries for each of the channel modes
+ * supported (11bg, 11a, half, quarter, turbo, etc.)
+ *
  */
-static REG_DMN_FREQ_BAND regDmn2Ghz11gFreq[] = {
-	{ 2312, 2372, 5,  6, 20, 5, NO_DFS, NO_PSCAN },
-#define	G1_2312_2372	0
-	{ 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	G2_2312_2372	AFTER(G1_2312_2372)
-	{ 2312, 2372, 5,  6, 10, 5, NO_DFS, NO_PSCAN },
-#define	G3_2312_2372	AFTER(G2_2312_2372)
-	{ 2312, 2372, 5,  6,  5, 5, NO_DFS, NO_PSCAN },
-#define	G4_2312_2372	AFTER(G3_2312_2372)
-
-	{ 2412, 2472, 5,  6, 20, 5, NO_DFS, NO_PSCAN },
-#define	G1_2412_2472	AFTER(G4_2312_2372)
-	{ 2412, 2472, 20, 0, 20, 5,  NO_DFS, PSCAN_MKKA_G },
-#define	G2_2412_2472	AFTER(G1_2412_2472)
-	{ 2412, 2472, 30, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	G3_2412_2472	AFTER(G2_2412_2472)
-	{ 2412, 2472, 5,  6, 10, 5, NO_DFS, NO_PSCAN },
-#define	G4_2412_2472	AFTER(G3_2412_2472)
-	{ 2412, 2472, 5,  6,  5, 5, NO_DFS, NO_PSCAN },
-#define	G5_2412_2472	AFTER(G4_2412_2472)
-
-	{ 2412, 2462, 27, 6, 20, 5, NO_DFS, NO_PSCAN },
-#define	G1_2412_2462	AFTER(G5_2412_2472)
-	{ 2412, 2462, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G },
-#define	G2_2412_2462	AFTER(G1_2412_2462)
-	{ 2412, 2462, 27, 6, 10, 5, NO_DFS, NO_PSCAN },
-#define	G3_2412_2462	AFTER(G2_2412_2462)
-	{ 2412, 2462, 27, 6,  5, 5, NO_DFS, NO_PSCAN },
-#define	G4_2412_2462	AFTER(G3_2412_2462)
-	
-	{ 2432, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	G1_2432_2442	AFTER(G4_2412_2462)
-
-	{ 2457, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	G1_2457_2472	AFTER(G1_2432_2442)
-
-	{ 2512, 2732, 5,  6, 20, 5, NO_DFS, NO_PSCAN },
-#define	G1_2512_2732	AFTER(G1_2457_2472)
-	{ 2512, 2732, 5,  6, 10, 5, NO_DFS, NO_PSCAN },
-#define	G2_2512_2732	AFTER(G1_2512_2732)
-	{ 2512, 2732, 5,  6,  5, 5, NO_DFS, NO_PSCAN },
-#define	G3_2512_2732	AFTER(G2_2512_2732)
-
-	{ 2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA2 | PSCAN_MKKA },
-#define	G1_2467_2472	AFTER(G3_2512_2732)
-
-	/*
-	 * WWR open up the power to 20dBm
-	 */
-	{ 2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	WG1_2312_2372	AFTER(G1_2467_2472)
-	{ 2412, 2412, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	WG1_2412_2412	AFTER(WG1_2312_2372)
-	{ 2417, 2432, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	WG1_2417_2432	AFTER(WG1_2412_2412)
-	{ 2437, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	WG1_2437_2442	AFTER(WG1_2417_2432)
-	{ 2447, 2457, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	WG1_2447_2457	AFTER(WG1_2437_2442)
-	{ 2462, 2462, 20, 0, 20, 5, NO_DFS, NO_PSCAN },
-#define	WG1_2462_2462	AFTER(WG1_2447_2457)
-	{ 2467, 2467, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN },
-#define	WG1_2467_2467	AFTER(WG1_2462_2462)
-	{ 2467, 2467, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN },
-#define	WG2_2467_2467	AFTER(WG1_2467_2467)
-	{ 2472, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN },
-#define	WG1_2472_2472	AFTER(WG2_2467_2467)
-	{ 2472, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN },
-#define	WG2_2472_2472	AFTER(WG1_2472_2472)
-};
+#include "ah_regdomain/ah_rd_freqbands.h"
 
 /*
- * 2GHz Dynamic turbo tags
+ * This is the main regulatory database. It defines the supported
+ * set of features and requirements for each of the defined regulatory
+ * zones. It uses combinations of frequency ranges - represented in
+ * a bitmask - to determine the requirements and limitations needed.
  */
-static REG_DMN_FREQ_BAND regDmn2Ghz11gTurboFreq[] = {
-	{ 2312, 2372, 5,  6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_2312_2372	0
-	{ 2437, 2437, 5,  6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_2437_2437	AFTER(T1_2312_2372)
-	{ 2437, 2437, 20, 6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T2_2437_2437	AFTER(T1_2437_2437)
-	{ 2437, 2437, 18, 6, 40, 40, NO_DFS, PSCAN_WWR },
-#define	T3_2437_2437	AFTER(T2_2437_2437)
-	{ 2512, 2732, 5,  6, 40, 40, NO_DFS, NO_PSCAN },
-#define	T1_2512_2732	AFTER(T3_2437_2437)
-};
-
-static REG_DOMAIN regDomains[] = {
-
-	{.regDmnEnum		= DEBUG_REG_DMN,
-	 .conformanceTestLimit	= FCC,
-	 .dfsMask		= DFS_FCC3,
-	 .chan11a		= BM4(F1_4950_4980,
-				      F1_5120_5240,
-				      F1_5260_5700,
-				      F1_5745_5825),
-	 .chan11a_half		= BM4(F1_4945_4985,
-				      F2_5120_5240,
-				      F2_5260_5700,
-				      F7_5745_5825),
-	 .chan11a_quarter	= BM4(F1_4942_4987,
-				      F3_5120_5240,
-				      F3_5260_5700,
-				      F8_5745_5825),
-	 .chan11a_turbo		= BM8(T1_5130_5210,
-				      T1_5250_5330,
-				      T1_5370_5490,
-				      T1_5530_5650,
-				      T1_5150_5190,
-				      T1_5230_5310,
-				      T1_5350_5470,
-				      T1_5510_5670),
-	 .chan11a_dyn_turbo	= BM4(T1_5200_5240,
-				      T1_5280_5280,
-				      T1_5540_5660,
-				      T1_5765_5805),
-	 .chan11b		= BM4(F1_2312_2372,
-				      F1_2412_2472,
-				      F1_2484_2484,
-				      F1_2512_2732),
-	 .chan11g		= BM3(G1_2312_2372, G1_2412_2472, G1_2512_2732),
-	 .chan11g_turbo		= BM3(T1_2312_2372, T1_2437_2437, T1_2512_2732),
-	 .chan11g_half		= BM3(G2_2312_2372, G4_2412_2472, G2_2512_2732),
-	 .chan11g_quarter	= BM3(G3_2312_2372, G5_2412_2472, G3_2512_2732),
-	},
-
-	{.regDmnEnum		= APL1,
-	 .conformanceTestLimit	= FCC,
-	 .chan11a		= BM1(F4_5745_5825),
-	},
-
-	{.regDmnEnum		= APL2,
-	 .conformanceTestLimit	= FCC,
-	 .chan11a		= BM1(F1_5745_5805),
-	},
-

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 06:06:27 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CE4C106564A;
	Thu, 10 Mar 2011 06:06:27 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B3B18FC08;
	Thu, 10 Mar 2011 06:06: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 p2A66RAo033278;
	Thu, 10 Mar 2011 06:06:27 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A66RWN033276;
	Thu, 10 Mar 2011 06:06:27 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103100606.p2A66RWN033276@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 10 Mar 2011 06:06: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: r219443 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 06:06:27 -0000

Author: adrian
Date: Thu Mar 10 06:06:26 2011
New Revision: 219443
URL: http://svn.freebsd.org/changeset/base/219443

Log:
  Merlin fix - first pdadc gain index is 0 - minpwr/2 .
  
  Obtained from:	Linux ath9k

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu Mar 10 03:13:56 2011	(r219442)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu Mar 10 06:06:26 2011	(r219443)
@@ -2236,7 +2236,10 @@ ar5416GetGainBoundariesAndPdadcs(struct 
 
         /* Find starting index for this pdGain */
         if (i == 0) {
-            ss = 0; /* for the first pdGain, start from index 0 */
+            if (AR_SREV_MERLIN_20_OR_LATER(ah))
+                ss = (int16_t)(0 - (minPwrT4[i] / 2));
+            else
+                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);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 06:08:25 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4B0C3106566B;
	Thu, 10 Mar 2011 06:08:25 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3911E8FC14;
	Thu, 10 Mar 2011 06:08: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 p2A68PZi033351;
	Thu, 10 Mar 2011 06:08:25 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A68PKt033349;
	Thu, 10 Mar 2011 06:08:25 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103100608.p2A68PKt033349@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 10 Mar 2011 06:08: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: r219444 - head/sys/dev/ath/ath_hal/ar9002
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 06:08:25 -0000

Author: adrian
Date: Thu Mar 10 06:08:24 2011
New Revision: 219444
URL: http://svn.freebsd.org/changeset/base/219444

Log:
  Port over the v14 eeprom PDADC curve changes from ath9k.
  
  It looks like these apply in both open and closed loop TX power control,
  but the only merlin boards i have either have OL -or- a non-default power
  offset, not both.

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c	Thu Mar 10 06:06:26 2011	(r219443)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c	Thu Mar 10 06:08:24 2011	(r219444)
@@ -160,6 +160,72 @@ ar9280olcTemperatureCompensation(struct 
 	}
 }
 
+
+static int16_t
+ar9280ChangeGainBoundarySettings(struct ath_hal *ah, uint16_t *gb,
+    uint16_t numXpdGain, uint16_t pdGainOverlap_t2, int8_t pwr_table_offset,
+    int16_t *diff)
+{
+	uint16_t k;
+
+	/* Prior to writing the boundaries or the pdadc vs. power table
+	 * into the chip registers the default starting point on the pdadc
+	 * vs. power table needs to be checked and the curve boundaries
+	 * adjusted accordingly
+	 */
+	if (AR_SREV_MERLIN_20_OR_LATER(ah)) {
+		uint16_t gb_limit;
+
+		if (AR5416_PWR_TABLE_OFFSET_DB != pwr_table_offset) {
+			/* get the difference in dB */
+			*diff = (uint16_t)(pwr_table_offset - AR5416_PWR_TABLE_OFFSET_DB);
+			/* get the number of half dB steps */
+			*diff *= 2;
+			/* change the original gain boundary settings
+			 * by the number of half dB steps
+			 */
+			for (k = 0; k < numXpdGain; k++)
+				gb[k] = (uint16_t)(gb[k] - *diff);
+		}
+		/* Because of a hardware limitation, ensure the gain boundary
+		 * is not larger than (63 - overlap)
+		 */
+		gb_limit = (uint16_t)(AR5416_MAX_RATE_POWER - pdGainOverlap_t2);
+
+		for (k = 0; k < numXpdGain; k++)
+			gb[k] = (uint16_t)min(gb_limit, gb[k]);
+	}
+
+	return *diff;
+}
+
+static void
+ar9280AdjustPDADCValues(struct ath_hal *ah, int8_t pwr_table_offset,
+    int16_t diff, uint8_t *pdadcValues)
+{
+#define NUM_PDADC(diff) (AR5416_NUM_PDADC_VALUES - diff)
+	uint16_t k;
+
+	/* If this is a board that has a pwrTableOffset that differs from
+	 * the default AR5416_PWR_TABLE_OFFSET_DB then the start of the
+	 * pdadc vs pwr table needs to be adjusted prior to writing to the
+	 * chip.
+	 */
+	if (AR_SREV_MERLIN_20_OR_LATER(ah)) {
+		if (AR5416_PWR_TABLE_OFFSET_DB != pwr_table_offset) {
+			/* shift the table to start at the new offset */
+			for (k = 0; k < (uint16_t)NUM_PDADC(diff); k++ ) {
+				pdadcValues[k] = pdadcValues[k + diff];
+			}
+
+			/* fill the back of the table */
+			for (k = (uint16_t)NUM_PDADC(diff); k < NUM_PDADC(0); k++) {
+				pdadcValues[k] = pdadcValues[NUM_PDADC(diff)];
+			}
+		}
+	}
+#undef NUM_PDADC
+}
 /*
  * This effectively disables the gain boundaries leaving it
  * to the open-loop TX power control.
@@ -210,11 +276,15 @@ ar9280SetPowerCalTable(struct ath_hal *a
 	uint16_t numXpdGain, xpdMask;
 	uint16_t xpdGainValues[AR5416_NUM_PD_GAINS];
 	uint32_t regChainOffset;
+	int8_t pwr_table_offset;
 
 	OS_MEMZERO(xpdGainValues, sizeof(xpdGainValues));
 	    
 	xpdMask = pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].xpdGain;
 
+	(void) ath_hal_eepromGet(ah, AR_EEP_PWR_TABLE_OFFSET, &pwr_table_offset);
+
+
 	if (IS_EEP_MINOR_V2(ah)) {
 		pdGainOverlap_t2 = pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].pdGainOverlap;
 	} else { 
@@ -256,6 +326,8 @@ ar9280SetPowerCalTable(struct ath_hal *a
 	for (i = 0; i < AR5416_MAX_CHAINS; i++) {
 		regChainOffset = ar5416GetRegChainOffset(ah, i);
 		if (pEepData->baseEepHeader.txMask & (1 << i)) {
+			uint16_t diff;
+
 			if (IEEE80211_IS_CHAN_2GHZ(chan)) {
 				pRawDataset = pEepData->calPierData2G[i];
 			} else {
@@ -285,7 +357,9 @@ ar9280SetPowerCalTable(struct ath_hal *a
 			 * vs. power table needs to be checked and the curve boundaries
 			 * adjusted accordingly
 			 */
-			// XXX ath9k_change_gain_boundary_setting();
+			diff = ar9280ChangeGainBoundarySettings(ah,
+			    gainBoundaries, numXpdGain, pdGainOverlap_t2,
+			    pwr_table_offset, &diff);
 
 			if ((i == 0) || AR_SREV_OWL_20_OR_LATER(ah)) {
 				/* Set gain boundaries for either open- or closed-loop TPC */
@@ -306,7 +380,7 @@ ar9280SetPowerCalTable(struct ath_hal *a
 			 * pdadc vs pwr table needs to be adjusted prior to writing to the
 			 * chip.
 			 */
-			/* XXX ath9k_adjust_pdadc_values() */
+			ar9280AdjustPDADCValues(ah, pwr_table_offset, diff, pdadcValues);
 
 			/* Write the power values into the baseband power table */
 			ar5416WritePdadcValues(ah, regChainOffset, pdadcValues);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 06:09:56 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 32DDF1065672;
	Thu, 10 Mar 2011 06:09:56 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 215028FC1E;
	Thu, 10 Mar 2011 06:09: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 p2A69tDF033412;
	Thu, 10 Mar 2011 06:09:55 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A69tjZ033410;
	Thu, 10 Mar 2011 06:09:55 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103100609.p2A69tjZ033410@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 10 Mar 2011 06:09: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: r219445 - head/sys/dev/ath/ath_hal/ar9002
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 06:09:56 -0000

Author: adrian
Date: Thu Mar 10 06:09:55 2011
New Revision: 219445
URL: http://svn.freebsd.org/changeset/base/219445

Log:
  Now that the power curve adjustment code is in, disable the error check
  I introduced earlier, and turn it into debugging output.

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Thu Mar 10 06:08:24 2011	(r219444)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c	Thu Mar 10 06:09:55 2011	(r219445)
@@ -266,12 +266,9 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s
          * This can occur with eeprom minor V21 or greater on Merlin.
          */
 	(void) ath_hal_eepromGet(ah, AR_EEP_PWR_TABLE_OFFSET, &pwr_table_offset);
-	if (pwr_table_offset != AR5416_PWR_TABLE_OFFSET_DB) {
-		ath_hal_printf(ah, "ERROR: default pwr offset: %d dBm != EEPROM pwr offset: %d dBm\n",
+	if (pwr_table_offset != AR5416_PWR_TABLE_OFFSET_DB)
+		ath_hal_printf(ah, "[ath]: default pwr offset: %d dBm != EEPROM pwr offset: %d dBm; curves will be adjusted.\n",
 		    AR5416_PWR_TABLE_OFFSET_DB, (int) pwr_table_offset);
-		ecode = HAL_ENOTSUPP;
-		goto bad;
-	}
 
 	if (AR_SREV_MERLIN_20_OR_LATER(ah)) {
 		/* setup rxgain table */

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 08:23:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B8AB91065673;
	Thu, 10 Mar 2011 08:23:58 +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 A80A88FC21;
	Thu, 10 Mar 2011 08:23: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 p2A8NwLW036339;
	Thu, 10 Mar 2011 08:23:58 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A8NwUh036336;
	Thu, 10 Mar 2011 08:23:58 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201103100823.p2A8NwUh036336@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 10 Mar 2011 08:23:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219446 - head/sbin/bsdlabel
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 08:23:58 -0000

Author: uqs
Date: Thu Mar 10 08:23:58 2011
New Revision: 219446
URL: http://svn.freebsd.org/changeset/base/219446

Log:
  Remove bsdlabel.5, which hasn't been installed in over 7 years
  and contains little more than an out-dated copy of 

Deleted:
  head/sbin/bsdlabel/bsdlabel.5
Modified:
  head/sbin/bsdlabel/Makefile
  head/sbin/bsdlabel/bsdlabel.8

Modified: head/sbin/bsdlabel/Makefile
==============================================================================
--- head/sbin/bsdlabel/Makefile	Thu Mar 10 06:09:55 2011	(r219445)
+++ head/sbin/bsdlabel/Makefile	Thu Mar 10 08:23:58 2011	(r219446)
@@ -5,7 +5,6 @@
 
 PROG=	bsdlabel
 SRCS=	bsdlabel.c geom_bsd_enc.c
-#MAN=	bsdlabel.5
 MAN+=	bsdlabel.8
 
 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"

Modified: head/sbin/bsdlabel/bsdlabel.8
==============================================================================
--- head/sbin/bsdlabel/bsdlabel.8	Thu Mar 10 06:09:55 2011	(r219445)
+++ head/sbin/bsdlabel/bsdlabel.8	Thu Mar 10 08:23:58 2011	(r219446)
@@ -493,7 +493,6 @@ are not generally compatible.
 .Xr ccd 4 ,
 .Xr geom 4 ,
 .Xr md 4 ,
-.\" Xr bsdlabel 5 ,
 .Xr disktab 5 ,
 .Xr boot0cfg 8 ,
 .Xr fdisk 8 ,

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 08:24:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2AFEF1065713;
	Thu, 10 Mar 2011 08:24:11 +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 19FBD8FC1D;
	Thu, 10 Mar 2011 08:24: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 p2A8OAqx036387;
	Thu, 10 Mar 2011 08:24:11 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A8OAts036385;
	Thu, 10 Mar 2011 08:24:10 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201103100824.p2A8OAts036385@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 10 Mar 2011 08:24: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: r219447 - head/sbin/bsdlabel
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 08:24:11 -0000

Author: uqs
Date: Thu Mar 10 08:24:10 2011
New Revision: 219447
URL: http://svn.freebsd.org/changeset/base/219447

Log:
  Remove bsdlabel test-script that was full of broken assumptions.
  
  - the default label now includes an a: partition by default
  - the c: partition is no longer exported via devfs
  - writing of the labels usually works in all cases, though the script
    assumes half of them have to fail

Deleted:
  head/sbin/bsdlabel/runtest.sh
Modified:
  head/sbin/bsdlabel/Makefile

Modified: head/sbin/bsdlabel/Makefile
==============================================================================
--- head/sbin/bsdlabel/Makefile	Thu Mar 10 08:23:58 2011	(r219446)
+++ head/sbin/bsdlabel/Makefile	Thu Mar 10 08:24:10 2011	(r219447)
@@ -17,9 +17,3 @@ DPADD=	${LIBGEOM} ${LIBBSDXML} ${LIBSBUF
 LDADD=	-lgeom -lbsdxml -lsbuf
 
 .include 
-
-test: ${PROG}
-	sh ${.CURDIR}/runtest.sh
-
-testx: ${PROG}
-	sh -x ${.CURDIR}/runtest.sh

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 08:24:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 935B71065680;
	Thu, 10 Mar 2011 08:24: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 787E48FC08;
	Thu, 10 Mar 2011 08:24: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 p2A8OLXf036428;
	Thu, 10 Mar 2011 08:24:21 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A8OL5G036425;
	Thu, 10 Mar 2011 08:24:21 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201103100824.p2A8OL5G036425@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 10 Mar 2011 08:24: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: r219448 - head/sbin/bsdlabel
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 08:24:21 -0000

Author: uqs
Date: Thu Mar 10 08:24:21 2011
New Revision: 219448
URL: http://svn.freebsd.org/changeset/base/219448

Log:
  Remove dead code in bsdlabel depending on __alpha__

Modified:
  head/sbin/bsdlabel/bsdlabel.8
  head/sbin/bsdlabel/bsdlabel.c

Modified: head/sbin/bsdlabel/bsdlabel.8
==============================================================================
--- head/sbin/bsdlabel/bsdlabel.8	Thu Mar 10 08:24:10 2011	(r219447)
+++ head/sbin/bsdlabel/bsdlabel.8	Thu Mar 10 08:24:21 2011	(r219448)
@@ -31,7 +31,7 @@
 .\"	@(#)disklabel.8	8.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd December 8, 2007
+.Dd March 5, 2011
 .Dt BSDLABEL 8
 .Os
 .Sh NAME
@@ -109,9 +109,9 @@ argument forces
 .Nm
 to use a layout suitable for a different architecture.
 Current valid values are
-.Cm i386 , amd64 , ia64 , pc98 ,
+.Cm i386 , amd64 , ia64 ,
 and
-.Cm alpha .
+.Cm pc98 .
 If this option is omitted,
 .Nm
 will use a layout suitable for the current machine.

Modified: head/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- head/sbin/bsdlabel/bsdlabel.c	Thu Mar 10 08:24:10 2011	(r219447)
+++ head/sbin/bsdlabel/bsdlabel.c	Thu Mar 10 08:24:21 2011	(r219448)
@@ -129,12 +129,6 @@ static uint32_t lba_offset;
 static int labelsoffset = LABELSECTOR;
 static int labeloffset = LABELOFFSET;
 static int bbsize = BBSIZE;
-static int alphacksum =
-#if defined(__alpha__)
-	1;
-#else
-	0;
-#endif
 
 enum	{
 	UNSPEC, EDIT, READ, RESTORE, WRITE, WRITEBOOT
@@ -176,12 +170,6 @@ main(int argc, char *argv[])
 					labelsoffset = 1;
 					labeloffset = 0;
 					bbsize = 8192;
-					alphacksum = 0;
-				} else if (!strcmp(optarg, "alpha")) {
-					labelsoffset = 0;
-					labeloffset = 64;
-					bbsize = 8192;
-					alphacksum = 1;
 				} else {
 					errx(1, "Unsupported architecture");
 				}
@@ -350,7 +338,6 @@ readboot(void)
 {
 	int fd;
 	struct stat st;
-	uint64_t *p;
 
 	if (xxboot == NULL)
 		xxboot = "/boot/boot";
@@ -358,21 +345,7 @@ readboot(void)
 	if (fd < 0)
 		err(1, "cannot open %s", xxboot);
 	fstat(fd, &st);
-	if (alphacksum && st.st_size <= BBSIZE - 512) {
-		if (read(fd, bootarea + 512, st.st_size) != st.st_size)
-			err(1, "read error %s", xxboot);
-
-		/*
-		 * Set the location and length so SRM can find the
-		 * boot blocks.
-		 */
-		p = (uint64_t *)bootarea;
-		p[60] = (st.st_size + secsize - 1) / secsize;
-		p[61] = 1;
-		p[62] = 0;
-		close(fd);
-		return;
-	} else if ((!alphacksum) && st.st_size <= BBSIZE) {
+	if (st.st_size <= BBSIZE) {
 		if (read(fd, bootarea, st.st_size) != st.st_size)
 			err(1, "read error %s", xxboot);
 		close(fd);
@@ -407,7 +380,6 @@ geom_bsd_available(void)
 static int
 writelabel(void)
 {
-	uint64_t *p, sum;
 	int i, fd, serrno;
 	struct gctl_req *grq;
 	char const *errstr;
@@ -430,12 +402,6 @@ writelabel(void)
 			lab.d_partitions[i].p_offset += lba_offset;
 	bsd_disklabel_le_enc(bootarea + labeloffset + labelsoffset * secsize,
 	    lp);
-	if (alphacksum) {
-		/* Generate the bootblock checksum for the SRM console.  */
-		for (p = (uint64_t *)bootarea, i = 0, sum = 0; i < 63; i++)
-			sum += p[i];
-		p[63] = sum;
-	}
 
 	fd = open(specname, O_RDWR);
 	if (fd < 0) {

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 08:24:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A3FDE106566B;
	Thu, 10 Mar 2011 08:24:33 +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 7A0748FC14;
	Thu, 10 Mar 2011 08: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 p2A8OXA1036469;
	Thu, 10 Mar 2011 08:24:33 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A8OX4q036466;
	Thu, 10 Mar 2011 08:24:33 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201103100824.p2A8OX4q036466@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 10 Mar 2011 08: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: r219449 - head/sbin/bsdlabel
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 08:24:33 -0000

Author: uqs
Date: Thu Mar 10 08:24:33 2011
New Revision: 219449
URL: http://svn.freebsd.org/changeset/base/219449

Log:
  Widen fields that display partition offset/length.
  
  This makes partitions between 50GiB and 2TiB (16TiB for 4k drives) print
  correctly aligned.
  
  While here, fix type of secsize. g_sectorsize() returns ssize_t, don't
  store this in an unsigned var. Bump WARNS to 6.
  
  MFC after:	4 weeks

Modified:
  head/sbin/bsdlabel/Makefile
  head/sbin/bsdlabel/bsdlabel.c

Modified: head/sbin/bsdlabel/Makefile
==============================================================================
--- head/sbin/bsdlabel/Makefile	Thu Mar 10 08:24:21 2011	(r219448)
+++ head/sbin/bsdlabel/Makefile	Thu Mar 10 08:24:33 2011	(r219449)
@@ -12,7 +12,6 @@ LINKS=	${BINDIR}/bsdlabel ${BINDIR}/disk
 MLINKS=	bsdlabel.8 disklabel.8
 .endif
 
-WARNS?=	2
 DPADD=	${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
 LDADD=	-lgeom -lbsdxml -lsbuf
 

Modified: head/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- head/sbin/bsdlabel/bsdlabel.c	Thu Mar 10 08:24:21 2011	(r219448)
+++ head/sbin/bsdlabel/bsdlabel.c	Thu Mar 10 08:24:33 2011	(r219449)
@@ -105,7 +105,7 @@ static char	tmpfil[] = PATH_TMPFILE;
 static struct	disklabel lab;
 static u_char	bootarea[BBSIZE];
 static off_t	mediasize;
-static u_int	secsize;
+static ssize_t	secsize;
 static char	blank[] = "";
 static char	unknown[] = "unknown";
 
@@ -589,11 +589,11 @@ display(FILE *f, const struct disklabel 
 	}
 	fprintf(f, "%u partitions:\n", lp->d_npartitions);
 	fprintf(f,
-	    "#        size   offset    fstype   [fsize bsize bps/cpg]\n");
+	    "#          size     offset    fstype   [fsize bsize bps/cpg]\n");
 	pp = lp->d_partitions;
 	for (i = 0; i < lp->d_npartitions; i++, pp++) {
 		if (pp->p_size) {
-			fprintf(f, "  %c: %8lu %8lu  ", 'a' + i,
+			fprintf(f, "  %c: %10lu %10lu  ", 'a' + i,
 			   (u_long)pp->p_size, (u_long)pp->p_offset);
 			if (pp->p_fstype < FSMAXTYPES)
 				fprintf(f, "%8.8s", fstypenames[pp->p_fstype]);
@@ -602,13 +602,13 @@ display(FILE *f, const struct disklabel 
 			switch (pp->p_fstype) {
 
 			case FS_UNUSED:				/* XXX */
-				fprintf(f, "    %5lu %5lu %5.5s ",
+				fprintf(f, "    %5lu %5lu %2s",
 				    (u_long)pp->p_fsize,
 				    (u_long)(pp->p_fsize * pp->p_frag), "");
 				break;
 
 			case FS_BSDFFS:
-				fprintf(f, "    %5lu %5lu %5u ",
+				fprintf(f, "    %5lu %5lu %5u",
 				    (u_long)pp->p_fsize,
 				    (u_long)(pp->p_fsize * pp->p_frag),
 				    pp->p_cpg);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 11:23:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA774106564A;
	Thu, 10 Mar 2011 11:23:43 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A81ED8FC0C;
	Thu, 10 Mar 2011 11:23:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2ABNha1042467;
	Thu, 10 Mar 2011 11:23:43 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ABNhxC042465;
	Thu, 10 Mar 2011 11:23:43 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103101123.p2ABNhxC042465@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 10 Mar 2011 11:23:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219450 - head/sys/dev/ath/ath_hal/ar9002
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 11:23:43 -0000

Author: adrian
Date: Thu Mar 10 11:23:43 2011
New Revision: 219450
URL: http://svn.freebsd.org/changeset/base/219450

Log:
  Kite is a 1x1 stream device.

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Thu Mar 10 08:24:33 2011	(r219449)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Thu Mar 10 11:23:43 2011	(r219450)
@@ -360,8 +360,8 @@ ar9285FillCapabilityInfo(struct ath_hal 
 	pCap->halWowMatchPatternDword = AH_TRUE;
 #endif
 	/* AR9285 has 2 antennas but is a 1x1 stream device */
-	pCap->halTxStreams = 2;
-	pCap->halRxStreams = 2;
+	pCap->halTxStreams = 1;
+	pCap->halRxStreams = 1;
 
 	pCap->halCSTSupport = AH_TRUE;
 	pCap->halRifsRxSupport = AH_TRUE;

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 13:59:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A9F8106566C;
	Thu, 10 Mar 2011 13:59:19 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E92358FC13;
	Thu, 10 Mar 2011 13: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 p2ADxI8k045890;
	Thu, 10 Mar 2011 13:59:18 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ADxHTW045856;
	Thu, 10 Mar 2011 13:59:17 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103101359.p2ADxHTW045856@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 10 Mar 2011 13:59:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219451 - in vendor/gcc/dist: gcc gcc/config/mips
	gcc/config/rs6000 gcc/config/s390 gcc/cp gcc/doc libstdc++
	libstdc++/include/std libstdc++/include/tr1
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 13:59:19 -0000

Author: mm
Date: Thu Mar 10 13:59:17 2011
New Revision: 219451
URL: http://svn.freebsd.org/changeset/base/219451

Log:
  Vendor upgrade of gcc 4.2 to last GPLv2 revision.
  
  PR:		gnu/153298
  Obtained from:	gcc (gcc-4_2-branch, rev. 127959)

Modified:
  vendor/gcc/dist/gcc/BASE-VER
  vendor/gcc/dist/gcc/ChangeLog
  vendor/gcc/dist/gcc/DATESTAMP
  vendor/gcc/dist/gcc/DEV-PHASE
  vendor/gcc/dist/gcc/config/mips/predicates.md
  vendor/gcc/dist/gcc/config/rs6000/rs6000.c
  vendor/gcc/dist/gcc/config/s390/s390.md
  vendor/gcc/dist/gcc/cp/ChangeLog
  vendor/gcc/dist/gcc/cp/call.c
  vendor/gcc/dist/gcc/cp/cp-tree.h
  vendor/gcc/dist/gcc/cp/cxx-pretty-print.c
  vendor/gcc/dist/gcc/cp/decl.c
  vendor/gcc/dist/gcc/cp/decl2.c
  vendor/gcc/dist/gcc/cp/error.c
  vendor/gcc/dist/gcc/cp/lex.c
  vendor/gcc/dist/gcc/cp/name-lookup.c
  vendor/gcc/dist/gcc/cp/pt.c
  vendor/gcc/dist/gcc/cp/semantics.c
  vendor/gcc/dist/gcc/cp/typeck.c
  vendor/gcc/dist/gcc/doc/contrib.texi
  vendor/gcc/dist/gcc/dwarf2out.c
  vendor/gcc/dist/gcc/expr.c
  vendor/gcc/dist/gcc/fold-const.c
  vendor/gcc/dist/gcc/gimplify.c
  vendor/gcc/dist/gcc/reload1.c
  vendor/gcc/dist/gcc/simplify-rtx.c
  vendor/gcc/dist/gcc/target-def.h
  vendor/gcc/dist/gcc/target.h
  vendor/gcc/dist/gcc/targhooks.c
  vendor/gcc/dist/gcc/targhooks.h
  vendor/gcc/dist/gcc/tree-if-conv.c
  vendor/gcc/dist/gcc/tree-ssa-structalias.c
  vendor/gcc/dist/gcc/tree-vect-analyze.c
  vendor/gcc/dist/gcc/tree-vect-patterns.c
  vendor/gcc/dist/gcc/tree.c
  vendor/gcc/dist/gcc/tree.h
  vendor/gcc/dist/libstdc++/ChangeLog
  vendor/gcc/dist/libstdc++/include/std/std_valarray.h
  vendor/gcc/dist/libstdc++/include/tr1/random

Modified: vendor/gcc/dist/gcc/BASE-VER
==============================================================================
--- vendor/gcc/dist/gcc/BASE-VER	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/BASE-VER	Thu Mar 10 13:59:17 2011	(r219451)
@@ -1 +1 @@
-4.2.1
+4.2.2

Modified: vendor/gcc/dist/gcc/ChangeLog
==============================================================================
--- vendor/gcc/dist/gcc/ChangeLog	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/ChangeLog	Thu Mar 10 13:59:17 2011	(r219451)
@@ -1,3 +1,121 @@
+2007-08-31  Jakub Jelinek  
+
+	PR rtl-optimization/33148
+	* simplify-rtx.c (simplify_unary_operation_1): Only optimize
+	(neg (lt X 0)) if X has scalar int mode.
+
+	PR debug/32914
+	* dwarf2out.c (rtl_for_decl_init): If vector decl has CONSTRUCTOR
+	initializer, use build_vector_from_ctor if possible to create
+	VECTOR_CST out of it.  If vector initializer is not VECTOR_CST
+	even after this, return NULL.
+
+2007-08-27  Jason Merrill  
+
+	PR c++/31337
+	* gimplify.c (gimplify_modify_expr): Discard the assignment of 
+	zero-sized types after calling gimplify_modify_expr_rhs.
+
+2007-08-24  Jakub Jelinek  
+
+	PR debug/32610
+	* dwarf2out.c (gen_decl_die): Don't call
+	gen_tagged_type_instantiation_die if decl doesn't have tagged type.
+
+2007-08-24  Richard Guenther  
+
+	* expr.c (get_inner_reference): Remove unused variable.
+
+2007-08-24  Richard Guenther  
+
+	* expr.c (get_inner_reference): Do computation of bitoffset
+	from offset in a way we can detect overflow reliably.
+
+2007-08-22  Richard Guenther  
+
+	PR middle-end/32563
+	* tree.c (host_integerp): Treat sizetype as signed as it is
+	sign-extended.
+
+2007-08-20  Adam Nemet  
+
+	* config/mips/predicates.md (const_call_insn_operand): Invoke
+	SYMBOL_REF_LONG_CALL_P only on SYMBOL_REFs.
+
+2007-08-17  Chen liqin  
+
+        * config/score/score.md : Update pattern tablejump.
+        * config/score/score.c : Update score_initialize_trampoline 
+        function.
+        * config/score/score.h (TRAMPOLINE_TEMPLATE): Added macro.
+        (TRAMPOLINE_INSNS, TRAMPOLINE_SIZE) Update macro.
+        * doc/contrib.texi: Add my entry.
+
+2007-08-02  Andreas Krebbel  
+
+	* config/s390/s390.md ("*xordi3_cconly"): Change xr to xg.
+
+2007-08-01  Andreas Krebbel  
+
+	* config/s390/s390.md (TF in GPR splitter): Change operand_subword
+	parameter to TFmode.
+
+2007-07-30  Mark Mitchell  
+
+	* BASE-VER: Bump.
+	* DEV-PHASE: Mark as prerelease.
+
+2007-07-25  Steve Ellcey  
+
+	PR target/32218
+	* tree-vect-patterns.c (vect_pattern_recog_1): Check for valid type.
+
+2007-07-25  Dorit Nuzman  
+	    Devang Patel  
+
+	PR tree-optimization/25413
+	* targhooks.c (default_builtin_vector_alignment_reachable): New.
+	* targhooks.h (default_builtin_vector_alignment_reachable): New.
+	* tree.h (contains_packed_reference): New.
+	* expr.c (contains_packed_reference): New.
+	* tree-vect-analyze.c (vector_alignment_reachable_p): New.
+	(vect_enhance_data_refs_alignment): Call
+	vector_alignment_reachable_p.
+	* target.h (vector_alignment_reachable): New builtin.
+	* target-def.h (TARGET_VECTOR_ALIGNMENT_REACHABLE): New.
+	* config/rs6000/rs6000.c (rs6000_vector_alignment_reachable): New.
+	(TARGET_VECTOR_ALIGNMENT_REACHABLE): Define.
+
+2007-07-24  Richard Guenther  
+
+	Backport from mainline:
+	2007-07-16  Richard Guenther  
+		    Uros Bizjak  
+
+	* tree-if-conv.c (find_phi_replacement_condition): Unshare "*cond"
+	before forcing it to gimple operand.
+
+2007-07-24  Richard Guenther  
+
+	PR tree-optimization/32723
+	Backport from mainline:
+	2007-03-09  Daniel Berlin  
+
+        * tree-ssa-structalias.c (shared_bitmap_info_t): New structure.
+        (shared_bitmap_table): New variable.
+        (shared_bitmap_hash): New function.
+        (shared_bitmap_eq): Ditto
+        (shared_bitmap_lookup): Ditto.
+        (shared_bitmap_add): Ditto.
+        (find_what_p_points_to): Rewrite to use shared bitmap hashtable.
+        (init_alias_vars): Init shared bitmap hashtable.
+        (delete_points_to_sets): Delete shared bitmap hashtable.
+
+2007-07-23  Bernd Schmidt  
+
+	* reload1.c (choose_reload_regs): Set reload_spill_index for regs
+	chosen during find_reloads.
+
 2007-07-19  Release Manager
 
 	* GCC 4.2.1 released.

Modified: vendor/gcc/dist/gcc/DATESTAMP
==============================================================================
--- vendor/gcc/dist/gcc/DATESTAMP	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/DATESTAMP	Thu Mar 10 13:59:17 2011	(r219451)
@@ -1 +1 @@
-20070719
+20070831

Modified: vendor/gcc/dist/gcc/DEV-PHASE
==============================================================================
--- vendor/gcc/dist/gcc/DEV-PHASE	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/DEV-PHASE	Thu Mar 10 13:59:17 2011	(r219451)
@@ -0,0 +1 @@
+prerelease

Modified: vendor/gcc/dist/gcc/config/mips/predicates.md
==============================================================================
--- vendor/gcc/dist/gcc/config/mips/predicates.md	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/config/mips/predicates.md	Thu Mar 10 13:59:17 2011	(r219451)
@@ -116,7 +116,9 @@
       /* If -mlong-calls, force all calls to use register addressing.  Also,
 	 if this function has the long_call attribute, we must use register
 	 addressing.  */
-      return !TARGET_LONG_CALLS && !SYMBOL_REF_LONG_CALL_P (op);
+      return (!TARGET_LONG_CALLS
+	      && !(GET_CODE (op) == SYMBOL_REF
+		   && SYMBOL_REF_LONG_CALL_P (op)));
 
     case SYMBOL_GOT_GLOBAL:
       /* Without explicit relocs, there is no special syntax for

Modified: vendor/gcc/dist/gcc/config/rs6000/rs6000.c
==============================================================================
--- vendor/gcc/dist/gcc/config/rs6000/rs6000.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/config/rs6000/rs6000.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -664,6 +664,7 @@ static int rs6000_use_sched_lookahead (v
 static tree rs6000_builtin_mask_for_load (void);
 
 static void def_builtin (int, const char *, tree, int);
+static bool rs6000_vector_alignment_reachable (tree, bool);
 static void rs6000_init_builtins (void);
 static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx);
 static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx);
@@ -915,6 +916,9 @@ static const char alt_reg_names[][8] =
 #undef TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD
 #define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD rs6000_builtin_mask_for_load
 
+#undef TARGET_VECTOR_ALIGNMENT_REACHABLE
+#define TARGET_VECTOR_ALIGNMENT_REACHABLE rs6000_vector_alignment_reachable
+
 #undef TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS rs6000_init_builtins
 
@@ -1584,6 +1588,37 @@ rs6000_builtin_mask_for_load (void)
     return 0;
 }
 
+
+/* Return true iff, data reference of TYPE can reach vector alignment (16)
+   after applying N number of iterations.  This routine does not determine
+   how may iterations are required to reach desired alignment.  */
+
+static bool
+rs6000_vector_alignment_reachable (tree type ATTRIBUTE_UNUSED, bool is_packed)
+{
+  if (is_packed)
+    return false;
+
+  if (TARGET_32BIT)
+    {
+      if (rs6000_alignment_flags == MASK_ALIGN_NATURAL)
+        return true;
+
+      if (rs6000_alignment_flags ==  MASK_ALIGN_POWER)
+        return true;
+
+      return false;
+    }
+  else
+    {
+      if (TARGET_MACHO)
+        return false;
+
+      /* Assuming that all other types are naturally aligned. CHECKME!  */
+      return true;
+    }
+}
+
 /* Handle generic options of the form -mfoo=yes/no.
    NAME is the option name.
    VALUE is the option value.

Modified: vendor/gcc/dist/gcc/config/s390/s390.md
==============================================================================
--- vendor/gcc/dist/gcc/config/s390/s390.md	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/config/s390/s390.md	Thu Mar 10 13:59:17 2011	(r219451)
@@ -1500,7 +1500,7 @@
    && !s_operand (operands[1], VOIDmode)"
   [(set (match_dup 0) (match_dup 1))]
 {
-  rtx addr = operand_subword (operands[0], 1, 0, DFmode);
+  rtx addr = operand_subword (operands[0], 1, 0, TFmode);
   s390_load_address (addr, XEXP (operands[1], 0));
   operands[1] = replace_equiv_address (operands[1], addr);
 })
@@ -5624,7 +5624,7 @@
   "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
   "@
    xgr\t%0,%2
-   xr\t%0,%2"
+   xg\t%0,%2"
   [(set_attr "op_type"  "RRE,RXY")])
 
 (define_insn "*xordi3_extimm"

Modified: vendor/gcc/dist/gcc/cp/ChangeLog
==============================================================================
--- vendor/gcc/dist/gcc/cp/ChangeLog	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/ChangeLog	Thu Mar 10 13:59:17 2011	(r219451)
@@ -1,3 +1,66 @@
+2007-08-24  Jakub Jelinek  
+
+	PR c++/31941
+	* error.c (resolve_virtual_fun_from_obj_type_ref): Handle
+	TARGET_VTABLE_USES_DESCRIPTORS targets properly.
+
+	PR c++/32898
+	* name-lookup.c (set_decl_namespace): lookup_qualified_name failure
+	is error_mark_node rather than NULL_TREE.
+	* pt.c (check_explicit_specialization): Likewise.
+
+2007-08-22  Jason Merrill  
+
+	PR c++/29365
+	* pt.c (outermost_tinst_level): New function.
+	* lex.c (in_main_input_context): New function.
+	* cp-tree.h: Declare it.
+	* decl2.c (constrain_class_visibility): Use it to avoid warning
+	about uses of the anonymous namespace in the main input file.
+
+2007-08-20  Jakub Jelinek  
+
+	PR c++/32992
+	* typeck.c (check_return_expr): Don't NRV optimize vars in
+	anonymous unions.
+	* decl.c (finish_function): Comment fix.
+
+2007-08-18  Paolo Carlini  
+
+	PR c++/32112
+	* error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
+	* cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
+
+2007-08-10  Paolo Carlini  
+
+	PR c++/17763
+	* error.c (dump_expr): Consistently use the *_cxx_*
+	variants of the pretty-print functions.
+
+2007-07-30  Paolo Carlini  
+
+	PR c++/32108
+	* semantics.c (finish_label_stmt): Reject the __label__
+	extension outside function scopes.
+
+2007-07-28  Simon Martin  
+	    Mark Mitchell  
+
+	PR c++/30917
+	* name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
+	hidden due to friend declarations in local classes.
+
+2007-07-27  Mark Mitchell  
+
+	PR c++/32346
+	* call.c (convert_for_arg_passing): Only widen bitfields to their
+	declared types if necessary.
+
+2007-07-24  Paolo Carlini  
+
+	PR c++/30535
+	* pt.c (unify): Never pass error_mark_node to template_decl_level.
+
 2007-07-19  Release Manager
 
 	* GCC 4.2.1 released.

Modified: vendor/gcc/dist/gcc/cp/call.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/call.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/call.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -4674,7 +4674,27 @@ type_passed_as (tree type)
 tree
 convert_for_arg_passing (tree type, tree val)
 {
-  val = convert_bitfield_to_declared_type (val);
+  tree bitfield_type;
+
+  /* If VAL is a bitfield, then -- since it has already been converted
+     to TYPE -- it cannot have a precision greater than TYPE.  
+
+     If it has a smaller precision, we must widen it here.  For
+     example, passing "int f:3;" to a function expecting an "int" will
+     not result in any conversion before this point.
+
+     If the precision is the same we must not risk widening.  For
+     example, the COMPONENT_REF for a 32-bit "long long" bitfield will
+     often have type "int", even though the C++ type for the field is
+     "long long".  If the value is being passed to a function
+     expecting an "int", then no conversions will be required.  But,
+     if we call convert_bitfield_to_declared_type, the bitfield will
+     be converted to "long long".  */
+  bitfield_type = is_bitfield_expr_with_lowered_type (val);
+  if (bitfield_type 
+      && TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type))
+    val = convert_to_integer (TYPE_MAIN_VARIANT (bitfield_type), val);
+
   if (val == error_mark_node)
     ;
   /* Pass classes with copy ctors by invisible reference.  */

Modified: vendor/gcc/dist/gcc/cp/cp-tree.h
==============================================================================
--- vendor/gcc/dist/gcc/cp/cp-tree.h	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/cp-tree.h	Thu Mar 10 13:59:17 2011	(r219451)
@@ -4079,6 +4079,7 @@ extern void yyerror				(const char *);
 extern void yyhook				(int);
 extern bool cxx_init				(void);
 extern void cxx_finish				(void);
+extern bool in_main_input_context		(void);
 
 /* in method.c */
 extern void init_method				(void);
@@ -4161,6 +4162,7 @@ extern tree build_non_dependent_args		(t
 extern bool reregister_specialization		(tree, tree, tree);
 extern tree fold_non_dependent_expr		(tree);
 extern bool explicit_class_specialization_p     (tree);
+extern tree outermost_tinst_level		(void);
 
 /* in repo.c */
 extern void init_repo				(void);

Modified: vendor/gcc/dist/gcc/cp/cxx-pretty-print.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/cxx-pretty-print.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/cxx-pretty-print.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -204,6 +204,10 @@ pp_cxx_unqualified_id (cxx_pretty_printe
       pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t));
       break;
 
+    case UNBOUND_CLASS_TEMPLATE:
+      pp_cxx_unqualified_id (pp, TYPE_NAME (t));
+      break;
+
     default:
       pp_unsupported_tree (pp, t);
       break;

Modified: vendor/gcc/dist/gcc/cp/decl.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/decl.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/decl.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -11273,7 +11273,7 @@ finish_function (int flags)
   gcc_assert (stmts_are_full_exprs_p ());
 
   /* Set up the named return value optimization, if we can.  Candidate
-     variables are selected in check_return_value.  */
+     variables are selected in check_return_expr.  */
   if (current_function_return_value)
     {
       tree r = current_function_return_value;

Modified: vendor/gcc/dist/gcc/cp/decl2.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/decl2.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/decl2.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -1860,9 +1860,12 @@ constrain_class_visibility (tree type)
 	int subvis = type_visibility (ftype);
 
 	if (subvis == VISIBILITY_ANON)
-	  warning (0, "\
+	  {
+	    if (!in_main_input_context ())
+	      warning (0, "\
 %qT has a field %qD whose type uses the anonymous namespace",
 		   type, t);
+	  }
 	else if (IS_AGGR_TYPE (ftype)
 		 && vis < VISIBILITY_HIDDEN
 		 && subvis >= VISIBILITY_HIDDEN)
@@ -1877,9 +1880,12 @@ constrain_class_visibility (tree type)
       int subvis = type_visibility (TREE_TYPE (t));
 
       if (subvis == VISIBILITY_ANON)
-	warning (0, "\
+        {
+	  if (!in_main_input_context())
+	    warning (0, "\
 %qT has a base %qT whose type uses the anonymous namespace",
 		 type, TREE_TYPE (t));
+	}
       else if (vis < VISIBILITY_HIDDEN
 	       && subvis >= VISIBILITY_HIDDEN)
 	warning (OPT_Wattributes, "\

Modified: vendor/gcc/dist/gcc/cp/error.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/error.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/error.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -901,6 +901,10 @@ dump_decl (tree t, int flags)
 	pp_type_id (cxx_pp, t);
       break;
 
+    case UNBOUND_CLASS_TEMPLATE:
+      dump_type (t, flags);
+      break;
+
     default:
       pp_unsupported_tree (cxx_pp, t);
       /* Fall through to error.  */
@@ -1301,10 +1305,14 @@ static tree
 resolve_virtual_fun_from_obj_type_ref (tree ref)
 {
   tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (ref));
-  int index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
+  HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
   tree fun = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type)));
-    while (index--)
+  while (index)
+    {
       fun = TREE_CHAIN (fun);
+      index -= (TARGET_VTABLE_USES_DESCRIPTORS
+		? TARGET_VTABLE_USES_DESCRIPTORS : 1);
+    }
 
   return BV_FN (fun);
 }
@@ -1420,13 +1428,13 @@ dump_expr (tree t, int flags)
 	    if (TREE_CODE (ob) == ADDR_EXPR)
 	      {
 		dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS);
-		pp_dot (cxx_pp);
+		pp_cxx_dot (cxx_pp);
 	      }
 	    else if (TREE_CODE (ob) != PARM_DECL
 		     || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this"))
 	      {
 		dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
-		pp_arrow (cxx_pp);
+		pp_cxx_arrow (cxx_pp);
 	      }
 	    args = TREE_CHAIN (args);
 	  }

Modified: vendor/gcc/dist/gcc/cp/lex.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/lex.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/lex.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -827,3 +827,18 @@ make_aggr_type (enum tree_code code)
 
   return t;
 }
+
+/* Returns true if we are currently in the main source file, or in a
+   template instantiation started from the main source file.  */
+
+bool
+in_main_input_context (void)
+{
+  tree tl = outermost_tinst_level();
+
+  if (tl)
+    return strcmp (main_input_filename,
+		   LOCATION_FILE (TINST_LOCATION (tl))) == 0;
+  else
+    return strcmp (main_input_filename, input_filename) == 0;
+}

Modified: vendor/gcc/dist/gcc/cp/name-lookup.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/name-lookup.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/name-lookup.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -2924,7 +2924,7 @@ set_decl_namespace (tree decl, tree scop
 
   /* See whether this has been declared in the namespace.  */
   old = lookup_qualified_name (scope, DECL_NAME (decl), false, true);
-  if (!old)
+  if (old == error_mark_node)
     /* No old declaration at all.  */
     goto complain;
   if (!is_overloaded_fn (decl))
@@ -3996,8 +3996,49 @@ lookup_name_real (tree name, int prefer_
 
 	if (binding)
 	  {
-	    /* Only namespace-scope bindings can be hidden.  */
-	    gcc_assert (!hidden_name_p (binding));
+	    if (hidden_name_p (binding))
+	      {
+		/* A non namespace-scope binding can only be hidden if
+		   we are in a local class, due to friend declarations.
+		   In particular, consider:
+
+		   void f() {
+		     struct A {
+		       friend struct B;
+		       void g() { B* b; } // error: B is hidden
+		     }
+		     struct B {};
+		   }
+
+		   The standard says that "B" is a local class in "f"
+		   (but not nested within "A") -- but that name lookup
+		   for "B" does not find this declaration until it is
+		   declared directly with "f".
+
+		   In particular:
+
+		   [class.friend]
+
+		   If a friend declaration appears in a local class and
+		   the name specified is an unqualified name, a prior
+		   declaration is looked up without considering scopes
+		   that are outside the innermost enclosing non-class
+		   scope. For a friend class declaration, if there is no
+		   prior declaration, the class that is specified 
+		   belongs to the innermost enclosing non-class scope,
+		   but if it is subsequently referenced, its name is not
+		   found by name lookup until a matching declaration is
+		   provided in the innermost enclosing nonclass scope.
+		*/
+		gcc_assert (current_class_type &&
+			    LOCAL_CLASS_P (current_class_type));
+
+		/* This binding comes from a friend declaration in the local
+		   class. The standard (11.4.8) states that the lookup can
+		   only succeed if there is a non-hidden declaration in the
+		   current scope, which is not the case here.  */
+		POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
+	      }
 	    val = binding;
 	    break;
 	  }

Modified: vendor/gcc/dist/gcc/cp/pt.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/pt.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/pt.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -1971,7 +1971,7 @@ check_explicit_specialization (tree decl
 		 context.  */
 	      fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname,
 					   false, true);
-	      if (!fns || !is_overloaded_fn (fns))
+	      if (fns == error_mark_node || !is_overloaded_fn (fns))
 		{
 		  error ("%qD is not a template function", dname);
 		  fns = error_mark_node;
@@ -5288,6 +5288,15 @@ reopen_tinst_level (tree level)
   pop_tinst_level ();
 }
 
+/* Returns the TINST_LEVEL which gives the original instantiation
+   context.  */
+
+tree
+outermost_tinst_level (void)
+{
+  return tree_last (current_tinst_level);
+}
+
 /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL.  ARGS is the
    vector of template arguments, as for tsubst.
 
@@ -10453,6 +10462,8 @@ unify (tree tparms, tree targs, tree par
     case TEMPLATE_TEMPLATE_PARM:
     case BOUND_TEMPLATE_TEMPLATE_PARM:
       tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 0));
+      if (tparm == error_mark_node)
+	return 1;
 
       if (TEMPLATE_TYPE_LEVEL (parm)
 	  != template_decl_level (tparm))

Modified: vendor/gcc/dist/gcc/cp/semantics.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/semantics.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/semantics.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -1320,8 +1320,13 @@ finish_label_stmt (tree name)
 void
 finish_label_decl (tree name)
 {
-  tree decl = declare_local_label (name);
-  add_decl_expr (decl);
+  if (!at_function_scope_p ())
+    {
+      error ("__label__ declarations are only allowed in function scopes");
+      return;
+    }
+
+  add_decl_expr (declare_local_label (name));
 }
 
 /* When DECL goes out of scope, make sure that CLEANUP is executed.  */

Modified: vendor/gcc/dist/gcc/cp/typeck.c
==============================================================================
--- vendor/gcc/dist/gcc/cp/typeck.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/cp/typeck.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -6604,6 +6604,7 @@ check_return_expr (tree retval, bool *no
 	  && TREE_CODE (retval) == VAR_DECL
 	  && DECL_CONTEXT (retval) == current_function_decl
 	  && ! TREE_STATIC (retval)
+	  && ! DECL_ANON_UNION_VAR_P (retval)
 	  && (DECL_ALIGN (retval)
 	      >= DECL_ALIGN (DECL_RESULT (current_function_decl)))
 	  && same_type_p ((TYPE_MAIN_VARIANT

Modified: vendor/gcc/dist/gcc/doc/contrib.texi
==============================================================================
--- vendor/gcc/dist/gcc/doc/contrib.texi	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/doc/contrib.texi	Thu Mar 10 13:59:17 2011	(r219451)
@@ -514,6 +514,10 @@ patches.
 Robert Lipe for OpenServer support, new testsuites, testing, etc.
 
 @item
+Chen Liqin for various S+core related fixes/improvement, and for
+maintaining the S+core port.
+
+@item
 Weiwen Liu for testing and various bug fixes.
 
 @item

Modified: vendor/gcc/dist/gcc/dwarf2out.c
==============================================================================
--- vendor/gcc/dist/gcc/dwarf2out.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/dwarf2out.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -10065,6 +10065,43 @@ rtl_for_decl_init (tree init, tree type)
   else if (initializer_constant_valid_p (init, type)
 	   && ! walk_tree (&init, reference_to_unused, NULL, NULL))
     {
+      /* Convert vector CONSTRUCTOR initializers to VECTOR_CST if
+	 possible.  */
+      if (TREE_CODE (type) == VECTOR_TYPE)
+	switch (TREE_CODE (init))
+	  {
+	  case VECTOR_CST:
+	    break;
+	  case CONSTRUCTOR:
+	    if (TREE_CONSTANT (init))
+	      {
+		VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (init);
+		bool constant_p = true;
+		tree value;
+		unsigned HOST_WIDE_INT ix;
+
+		/* Even when ctor is constant, it might contain non-*_CST
+		   elements (e.g. { 1.0/0.0 - 1.0/0.0, 0.0 }) and those don't
+		   belong into VECTOR_CST nodes.  */
+		FOR_EACH_CONSTRUCTOR_VALUE (elts, ix, value)
+		  if (!CONSTANT_CLASS_P (value))
+		    {
+		      constant_p = false;
+		      break;
+		    }
+
+		if (constant_p)
+		  {
+		    init = build_vector_from_ctor (type, elts);
+		    break;
+		  }
+	      }
+	    /* FALLTHRU */
+
+	  default:
+	    return NULL;
+	  }
+
       rtl = expand_expr (init, NULL_RTX, VOIDmode, EXPAND_INITIALIZER);
 
       /* If expand_expr returns a MEM, it wasn't immediate.  */
@@ -13197,7 +13234,8 @@ gen_decl_die (tree decl, dw_die_ref cont
 	 was generated within the original definition of an inline function) we
 	 have to generate a special (abbreviated) DW_TAG_structure_type,
 	 DW_TAG_union_type, or DW_TAG_enumeration_type DIE here.  */
-      if (TYPE_DECL_IS_STUB (decl) && decl_ultimate_origin (decl) != NULL_TREE)
+      if (TYPE_DECL_IS_STUB (decl) && decl_ultimate_origin (decl) != NULL_TREE
+	  && is_tagged_type (TREE_TYPE (decl)))
 	{
 	  gen_tagged_type_instantiation_die (TREE_TYPE (decl), context_die);
 	  break;

Modified: vendor/gcc/dist/gcc/expr.c
==============================================================================
--- vendor/gcc/dist/gcc/expr.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/expr.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -5654,7 +5654,6 @@ get_inner_reference (tree exp, HOST_WIDE
   enum machine_mode mode = VOIDmode;
   tree offset = size_zero_node;
   tree bit_offset = bitsize_zero_node;
-  tree tem;
 
   /* First get the mode, signedness, and size.  We do this from just the
      outermost expression.  */
@@ -5690,6 +5689,8 @@ get_inner_reference (tree exp, HOST_WIDE
 	*pbitsize = tree_low_cst (size_tree, 1);
     }
 
+  *pmode = mode;
+
   /* Compute cumulative bit-offset for nested component-refs and array-refs,
      and find the ultimate containing object.  */
   while (1)
@@ -5774,21 +5775,69 @@ get_inner_reference (tree exp, HOST_WIDE
  done:
 
   /* If OFFSET is constant, see if we can return the whole thing as a
-     constant bit position.  Otherwise, split it up.  */
-  if (host_integerp (offset, 0)
-      && 0 != (tem = size_binop (MULT_EXPR,
-				 fold_convert (bitsizetype, offset),
-				 bitsize_unit_node))
-      && 0 != (tem = size_binop (PLUS_EXPR, tem, bit_offset))
-      && host_integerp (tem, 0))
-    *pbitpos = tree_low_cst (tem, 0), *poffset = 0;
-  else
-    *pbitpos = tree_low_cst (bit_offset, 0), *poffset = offset;
+     constant bit position.  Make sure to handle overflow during
+     this conversion.  */
+  if (host_integerp (offset, 0))
+    {
+      double_int tem = double_int_mul (tree_to_double_int (offset),
+				       uhwi_to_double_int (BITS_PER_UNIT));
+      tem = double_int_add (tem, tree_to_double_int (bit_offset));
+      if (double_int_fits_in_shwi_p (tem))
+	{
+	  *pbitpos = double_int_to_shwi (tem);
+	  *poffset = NULL_TREE;
+	  return exp;
+	}
+    }
+
+  /* Otherwise, split it up.  */
+  *pbitpos = tree_low_cst (bit_offset, 0);
+  *poffset = offset;
 
-  *pmode = mode;
   return exp;
 }
 
+/* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
+   look for whether EXP or any nested component-refs within EXP is marked
+   as PACKED.  */
+
+bool
+contains_packed_reference (tree exp)
+{
+  bool packed_p = false;
+
+  while (1)
+    {
+      switch (TREE_CODE (exp))
+	{
+	case COMPONENT_REF:
+	  {
+	    tree field = TREE_OPERAND (exp, 1);
+	    packed_p = DECL_PACKED (field) 
+		       || TYPE_PACKED (TREE_TYPE (field))
+		       || TYPE_PACKED (TREE_TYPE (exp));
+	    if (packed_p)
+	      goto done;
+	  }
+	  break;
+
+	case BIT_FIELD_REF:
+	case ARRAY_REF:
+	case ARRAY_RANGE_REF:
+	case REALPART_EXPR:
+	case IMAGPART_EXPR:
+	case VIEW_CONVERT_EXPR:
+	  break;
+
+	default:
+	  goto done;
+	}
+      exp = TREE_OPERAND (exp, 0);
+    }
+ done:
+  return packed_p;
+}
+
 /* Return a tree of sizetype representing the size, in bytes, of the element
    of EXP, an ARRAY_REF.  */
 

Modified: vendor/gcc/dist/gcc/fold-const.c
==============================================================================
--- vendor/gcc/dist/gcc/fold-const.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/fold-const.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -9387,6 +9387,7 @@ fold_binary (enum tree_code code, tree t
 
       /* ~X | X is -1.  */
       if (TREE_CODE (arg0) == BIT_NOT_EXPR
+	  && INTEGRAL_TYPE_P (TREE_TYPE (arg1))
 	  && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0))
 	{
 	  t1 = build_int_cst (type, -1);
@@ -9396,6 +9397,7 @@ fold_binary (enum tree_code code, tree t
 
       /* X | ~X is -1.  */
       if (TREE_CODE (arg1) == BIT_NOT_EXPR
+	  && INTEGRAL_TYPE_P (TREE_TYPE (arg0))
 	  && operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0))
 	{
 	  t1 = build_int_cst (type, -1);
@@ -9503,6 +9505,7 @@ fold_binary (enum tree_code code, tree t
 
       /* ~X ^ X is -1.  */
       if (TREE_CODE (arg0) == BIT_NOT_EXPR
+	  && INTEGRAL_TYPE_P (TREE_TYPE (arg1))
 	  && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0))
 	{
 	  t1 = build_int_cst (type, -1);
@@ -9512,6 +9515,7 @@ fold_binary (enum tree_code code, tree t
 
       /* X ^ ~X is -1.  */
       if (TREE_CODE (arg1) == BIT_NOT_EXPR
+	  && INTEGRAL_TYPE_P (TREE_TYPE (arg0))
 	  && operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0))
 	{
 	  t1 = build_int_cst (type, -1);

Modified: vendor/gcc/dist/gcc/gimplify.c
==============================================================================
--- vendor/gcc/dist/gcc/gimplify.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/gimplify.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -3532,8 +3532,16 @@ gimplify_modify_expr (tree *expr_p, tree
   gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
 	      || TREE_CODE (*expr_p) == INIT_EXPR);
 
-  /* For zero sized types only gimplify the left hand side and right hand side
-     as statements and throw away the assignment.  */
+  /* See if any simplifications can be done based on what the RHS is.  */
+  ret = gimplify_modify_expr_rhs (expr_p, from_p, to_p, pre_p, post_p,
+				  want_value);
+  if (ret != GS_UNHANDLED)
+    return ret;
+
+  /* For zero sized types only gimplify the left hand side and right hand
+     side as statements and throw away the assignment.  Do this after
+     gimplify_modify_expr_rhs so we handle TARGET_EXPRs of addressable
+     types properly.  */
   if (zero_sized_type (TREE_TYPE (*from_p)))
     {
       gimplify_stmt (from_p);
@@ -3544,12 +3552,6 @@ gimplify_modify_expr (tree *expr_p, tree
       return GS_ALL_DONE;
     }
 
-  /* See if any simplifications can be done based on what the RHS is.  */
-  ret = gimplify_modify_expr_rhs (expr_p, from_p, to_p, pre_p, post_p,
-				  want_value);
-  if (ret != GS_UNHANDLED)
-    return ret;
-
   /* If the value being copied is of variable width, compute the length
      of the copy into a WITH_SIZE_EXPR.   Note that we need to do this
      before gimplifying any of the operands so that we can resolve any

Modified: vendor/gcc/dist/gcc/reload1.c
==============================================================================
--- vendor/gcc/dist/gcc/reload1.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/reload1.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -5451,7 +5451,14 @@ choose_reload_regs (struct insn_chain *c
   for (j = 0; j < n_reloads; j++)
     {
       reload_order[j] = j;
-      reload_spill_index[j] = -1;
+      if (rld[j].reg_rtx != NULL_RTX)
+	{
+	  gcc_assert (REG_P (rld[j].reg_rtx)
+		      && HARD_REGISTER_P (rld[j].reg_rtx));
+	  reload_spill_index[j] = REGNO (rld[j].reg_rtx);
+	}
+      else
+	reload_spill_index[j] = -1;
 
       if (rld[j].nregs > 1)
 	{

Modified: vendor/gcc/dist/gcc/simplify-rtx.c
==============================================================================
--- vendor/gcc/dist/gcc/simplify-rtx.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/simplify-rtx.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -589,7 +589,8 @@ simplify_unary_operation_1 (enum rtx_cod
       /* (neg (lt x 0)) is (ashiftrt X C) if STORE_FLAG_VALUE is 1.  */
       /* (neg (lt x 0)) is (lshiftrt X C) if STORE_FLAG_VALUE is -1.  */
       if (GET_CODE (op) == LT
-	  && XEXP (op, 1) == const0_rtx)
+	  && XEXP (op, 1) == const0_rtx
+	  && SCALAR_INT_MODE_P (GET_MODE (XEXP (op, 0))))
 	{
 	  enum machine_mode inner = GET_MODE (XEXP (op, 0));
 	  int isize = GET_MODE_BITSIZE (inner);

Modified: vendor/gcc/dist/gcc/target-def.h
==============================================================================
--- vendor/gcc/dist/gcc/target-def.h	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/target-def.h	Thu Mar 10 13:59:17 2011	(r219451)
@@ -337,9 +337,12 @@ Foundation, 51 Franklin Street, Fifth Fl
    TARGET_SCHED_SET_SCHED_FLAGS}
 
 #define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD 0
+#define TARGET_VECTOR_ALIGNMENT_REACHABLE \
+  default_builtin_vector_alignment_reachable
 
 #define TARGET_VECTORIZE                                                \
-  {TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD}
+  {TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD,				\
+   TARGET_VECTOR_ALIGNMENT_REACHABLE}
 
 #define TARGET_DEFAULT_TARGET_FLAGS 0
 

Modified: vendor/gcc/dist/gcc/target.h
==============================================================================
--- vendor/gcc/dist/gcc/target.h	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/target.h	Thu Mar 10 13:59:17 2011	(r219451)
@@ -375,6 +375,10 @@ struct gcc_target
        by the vectorizer, and return the decl of the target builtin
        function.  */
     tree (* builtin_mask_for_load) (void);
+
+    /* Return true if vector alignment is reachable (by peeling N
+      interations) for the given type.  */
+     bool (* vector_alignment_reachable) (tree, bool);
   } vectorize;
 
   /* The initial value of target_flags.  */

Modified: vendor/gcc/dist/gcc/targhooks.c
==============================================================================
--- vendor/gcc/dist/gcc/targhooks.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/targhooks.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -604,4 +604,20 @@ default_reloc_rw_mask (void)
   return flag_pic ? 3 : 0;
 }
 
+bool
+default_builtin_vector_alignment_reachable (tree type, bool is_packed)
+{
+  if (is_packed)
+    return false;
+
+  /* Assuming that types whose size is > pointer-size are not guaranteed to be
+     naturally aligned.  */
+  if (tree_int_cst_compare (TYPE_SIZE (type), bitsize_int (POINTER_SIZE)) > 0)
+    return false;
+
+  /* Assuming that types whose size is <= pointer-size
+     are naturally aligned.  */
+  return true;
+}
+
 #include "gt-targhooks.h"

Modified: vendor/gcc/dist/gcc/targhooks.h
==============================================================================
--- vendor/gcc/dist/gcc/targhooks.h	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/targhooks.h	Thu Mar 10 13:59:17 2011	(r219451)
@@ -57,6 +57,8 @@ extern const char * default_invalid_with
 
 extern bool default_narrow_bitfield (void);
 
+extern bool default_builtin_vector_alignment_reachable (tree, bool);
+
 /* These are here, and not in hooks.[ch], because not all users of
    hooks.h include tm.h, and thus we don't have CUMULATIVE_ARGS.  */
 

Modified: vendor/gcc/dist/gcc/tree-if-conv.c
==============================================================================
--- vendor/gcc/dist/gcc/tree-if-conv.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/tree-if-conv.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -743,7 +743,7 @@ find_phi_replacement_condition (struct l
       if (TREE_CODE (*cond) == TRUTH_NOT_EXPR)
 	/* We can be smart here and choose inverted
 	   condition without switching bbs.  */
-	  *cond = invert_truthvalue (*cond);
+	*cond = invert_truthvalue (*cond);
       else
 	/* Select non loop header bb.  */
 	first_edge = second_edge;
@@ -762,9 +762,11 @@ find_phi_replacement_condition (struct l
 
   /* Create temp. for the condition. Vectorizer prefers to have gimple
      value as condition. Various targets use different means to communicate
-     condition in vector compare operation. Using gimple value allows compiler
-     to emit vector compare and select RTL without exposing compare's result.  */
-  *cond = force_gimple_operand (*cond, &new_stmts, false, NULL_TREE);
+     condition in vector compare operation. Using gimple value allows
+     compiler to emit vector compare and select RTL without exposing
+     compare's result.  */
+  *cond = force_gimple_operand (unshare_expr (*cond), &new_stmts,
+				false, NULL_TREE);
   if (new_stmts)
     bsi_insert_before (bsi, new_stmts, BSI_SAME_STMT);
   if (!is_gimple_reg (*cond) && !is_gimple_condexpr (*cond))

Modified: vendor/gcc/dist/gcc/tree-ssa-structalias.c
==============================================================================
--- vendor/gcc/dist/gcc/tree-ssa-structalias.c	Thu Mar 10 11:23:43 2011	(r219450)
+++ vendor/gcc/dist/gcc/tree-ssa-structalias.c	Thu Mar 10 13:59:17 2011	(r219451)
@@ -4350,6 +4350,75 @@ intra_create_variable_infos (void)
   process_constraint (new_constraint (lhs, rhs));
 }
 
+/* Structure used to put solution bitmaps in a hashtable so they can
+   be shared among variables with the same points-to set.  */
+
+typedef struct shared_bitmap_info
+{
+  bitmap pt_vars;
+  hashval_t hashcode;
+} *shared_bitmap_info_t;
+
+static htab_t shared_bitmap_table;
+
+/* Hash function for a shared_bitmap_info_t */
+
+static hashval_t
+shared_bitmap_hash (const void *p)
+{
+  const shared_bitmap_info_t bi = (shared_bitmap_info_t) p;
+  return bi->hashcode;
+}
+
+/* Equality function for two shared_bitmap_info_t's. */
+
+static int
+shared_bitmap_eq (const void *p1, const void *p2)
+{
+  const shared_bitmap_info_t sbi1 = (shared_bitmap_info_t) p1;
+  const shared_bitmap_info_t sbi2 = (shared_bitmap_info_t) p2;
+  return bitmap_equal_p (sbi1->pt_vars, sbi2->pt_vars);
+}
+
+/* Lookup a bitmap in the shared bitmap hashtable, and return an already
+   existing instance if there is one, NULL otherwise.  */
+
+static bitmap
+shared_bitmap_lookup (bitmap pt_vars)
+{
+  void **slot;
+  struct shared_bitmap_info sbi;
+
+  sbi.pt_vars = pt_vars;
+  sbi.hashcode = bitmap_hash (pt_vars);
+  
+  slot = htab_find_slot_with_hash (shared_bitmap_table, &sbi,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 16:40:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86556106567B;
	Thu, 10 Mar 2011 16:40:13 +0000 (UTC)
	(envelope-from rdivacky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 745888FC21;
	Thu, 10 Mar 2011 16:40:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2AGeD0O049515;
	Thu, 10 Mar 2011 16:40:13 GMT
	(envelope-from rdivacky@svn.freebsd.org)
Received: (from rdivacky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AGeDe4049512;
	Thu, 10 Mar 2011 16:40:13 GMT
	(envelope-from rdivacky@svn.freebsd.org)
Message-Id: <201103101640.p2AGeDe4049512@svn.freebsd.org>
From: Roman Divacky 
Date: Thu, 10 Mar 2011 16:40: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: r219452 - in head/sys/boot: common i386/boot2
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 16:40:13 -0000

Author: rdivacky
Date: Thu Mar 10 16:40:13 2011
New Revision: 219452
URL: http://svn.freebsd.org/changeset/base/219452

Log:
  Some more shrinking.
  
     o    bunch of variables are turned into uint8_t
  
     o    initial setting of namep[] in lookup() is removed
          as it's only overwritten a few lines down
  
     o    kname is explicitly initialized in main() as BSS
          in boot2 is not zeroed
  
     o    the setting and reading of "fmt" in load() is removed
  
     o    buf in printf() is made static to save space
  
  Reviewed by:    jhb
  Tested by:      me and Fabian Keil 

Modified:
  head/sys/boot/common/ufsread.c
  head/sys/boot/i386/boot2/boot2.c

Modified: head/sys/boot/common/ufsread.c
==============================================================================
--- head/sys/boot/common/ufsread.c	Thu Mar 10 13:59:17 2011	(r219451)
+++ head/sys/boot/common/ufsread.c	Thu Mar 10 16:40:13 2011	(r219452)
@@ -87,7 +87,7 @@ static struct dmadat *dmadat;
 static ino_t lookup(const char *);
 static ssize_t fsread(ino_t, void *, size_t);
 
-static int ls, dsk_meta;
+static uint8_t ls, dsk_meta;
 static uint32_t fs_off;
 
 static __inline int
@@ -126,8 +126,6 @@ lookup(const char *path)
 
 	ino = ROOTINO;
 	dt = DT_DIR;
-	name[0] = '/';
-	name[1] = '\0';
 	for (;;) {
 		if (*path == '/')
 			path++;

Modified: head/sys/boot/i386/boot2/boot2.c
==============================================================================
--- head/sys/boot/i386/boot2/boot2.c	Thu Mar 10 13:59:17 2011	(r219451)
+++ head/sys/boot/i386/boot2/boot2.c	Thu Mar 10 16:40:13 2011	(r219452)
@@ -125,17 +125,17 @@ static struct dsk {
     unsigned drive;
     unsigned type;
     unsigned unit;
-    unsigned slice;
-    unsigned part;
+    uint8_t slice;
+    uint8_t part;
     unsigned start;
     int init;
 } dsk;
 static char cmd[512], cmddup[512];
-static const char *kname = NULL;
+static const char *kname;
 static uint32_t opts;
 static int comspeed = SIOSPD;
 static struct bootinfo bootinfo;
-static unsigned ioctrl = IO_KEYBOARD;
+static uint8_t ioctrl = IO_KEYBOARD;
 
 void exit(int);
 static void load(void);
@@ -226,6 +226,7 @@ main(void)
     uint8_t autoboot;
     ino_t ino;
 
+    kname = NULL;
     dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base);
     v86.ctl = V86_FLAGS;
     v86.efl = PSL_RESERVED_DEFAULT | PSL_I;
@@ -306,9 +307,8 @@ load(void)
     static Elf32_Shdr es[2];
     caddr_t p;
     ino_t ino;
-    uint32_t addr, x;
+    uint32_t addr;
     int i, j;
-    uint8_t fmt;
 
     if (!(ino = lookup(kname))) {
 	if (!ls)
@@ -317,15 +317,8 @@ load(void)
     }
     if (xfsread(ino, &hdr, sizeof(hdr)))
 	return;
-    if (N_GETMAGIC(hdr.ex) == ZMAGIC)
-	fmt = 0;
-    else if (IS_ELF(hdr.eh))
-	fmt = 1;
-    else {
-	printf("Invalid %s\n", "format");
-	return;
-    }
-    if (fmt == 0) {
+
+    if (N_GETMAGIC(hdr.ex) == ZMAGIC) {
 	addr = hdr.ex.a_entry & 0xffffff;
 	p = PTOV(addr);
 	fs_off = PAGE_SIZE;
@@ -334,7 +327,7 @@ load(void)
 	p += roundup2(hdr.ex.a_text, PAGE_SIZE);
 	if (xfsread(ino, p, hdr.ex.a_data))
 	    return;
-    } else {
+    } else if (IS_ELF(hdr.eh)) {
 	fs_off = hdr.eh.e_phoff;
 	for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) {
 	    if (xfsread(ino, ep + j, sizeof(ep[0])))
@@ -366,7 +359,11 @@ load(void)
 	}
 	addr = hdr.eh.e_entry & 0xffffff;
 	bootinfo.bi_esymtab = VTOP(p);
+    } else {
+	printf("Invalid %s\n", "format");
+	return;
     }
+
     bootinfo.bi_kernelname = VTOP(kname);
     bootinfo.bi_bios_dev = dsk.drive;
     __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
@@ -474,7 +471,8 @@ dskread(void *buf, unsigned lba, unsigne
     struct dos_partition *dp;
     struct disklabel *d;
     char *sec;
-    unsigned sl, i;
+    unsigned i;
+    uint8_t sl;
 
     if (!dsk_meta) {
 	sec = dmadat->secbuf;
@@ -534,7 +532,7 @@ static void
 printf(const char *fmt,...)
 {
     va_list ap;
-    char buf[10];
+    static char buf[10];
     char *s;
     unsigned u;
     int c;

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 16:51:28 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 80147106564A;
	Thu, 10 Mar 2011 16:51:28 +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 6CD488FC16;
	Thu, 10 Mar 2011 16:51: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 p2AGpSXZ049772;
	Thu, 10 Mar 2011 16:51:28 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AGpSmC049770;
	Thu, 10 Mar 2011 16:51:28 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103101651.p2AGpSmC049770@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Thu, 10 Mar 2011 16:51:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219453 - stable/7/sys/fs/devfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 16:51:28 -0000

Author: jh
Date: Thu Mar 10 16:51:28 2011
New Revision: 219453
URL: http://svn.freebsd.org/changeset/base/219453

Log:
  MFC r179926 by gonzo:
  
  Get pointer to devfs_ruleset struct after garbage collection has been
  performed. Otherwise if ruleset is used by given mountpoint and is empty
  it's freed by devfs_ruleset_reap and pointer becomes bogus.
  
  PR:		kern/124853

Modified:
  stable/7/sys/fs/devfs/devfs_rule.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/fs/devfs/devfs_rule.c
==============================================================================
--- stable/7/sys/fs/devfs/devfs_rule.c	Thu Mar 10 16:40:13 2011	(r219452)
+++ stable/7/sys/fs/devfs/devfs_rule.c	Thu Mar 10 16:51:28 2011	(r219453)
@@ -735,15 +735,15 @@ devfs_ruleset_use(devfs_rsnum rsnum, str
 {
 	struct devfs_ruleset *cds, *ds;
 
-	ds = devfs_ruleset_bynum(rsnum);
-	if (ds == NULL)
-		ds = devfs_ruleset_create(rsnum);
 	if (dm->dm_ruleset != 0) {
 		cds = devfs_ruleset_bynum(dm->dm_ruleset);
 		--cds->ds_refcount;
 		devfs_ruleset_reap(cds);
 	}
 
+	ds = devfs_ruleset_bynum(rsnum);
+	if (ds == NULL)
+		ds = devfs_ruleset_create(rsnum);
 	/* These should probably be made atomic somehow. */
 	++ds->ds_refcount;
 	dm->dm_ruleset = rsnum;

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 17:26:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 63C1C106564A;
	Thu, 10 Mar 2011 17:26:36 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 520EE8FC17;
	Thu, 10 Mar 2011 17:26: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 p2AHQaKg050458;
	Thu, 10 Mar 2011 17:26:36 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AHQaxd050456;
	Thu, 10 Mar 2011 17:26:36 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201103101726.p2AHQaxd050456@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 10 Mar 2011 17:26:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219454 - stable/8/sys/mips/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 17:26:36 -0000

Author: pluknet
Date: Thu Mar 10 17:26:36 2011
New Revision: 219454
URL: http://svn.freebsd.org/changeset/base/219454

Log:
  Unbreak mips OCTEON1: there's no options MALLOC_DEBUG_MAXZONES in stable/8.
  
  This is a direct commit to 8.
  
  Approved by:	avg (mentor)

Modified:
  stable/8/sys/mips/conf/OCTEON1

Modified: stable/8/sys/mips/conf/OCTEON1
==============================================================================
--- stable/8/sys/mips/conf/OCTEON1	Thu Mar 10 16:51:28 2011	(r219453)
+++ stable/8/sys/mips/conf/OCTEON1	Thu Mar 10 17:26:36 2011	(r219454)
@@ -91,7 +91,6 @@ options 	INVARIANTS		# Enable calls of e
 options 	INVARIANT_SUPPORT	# Extra sanity checks of internal structures, required by INVARIANTS
 options 	WITNESS			# Enable checks to detect deadlocks and cycles
 options 	WITNESS_SKIPSPIN	# Don't run witness on spinlocks for speed
-options 	MALLOC_DEBUG_MAXZONES=8	# Separate malloc(9) zones
 
 # Make an SMP-capable kernel by default
 options 	SMP			# Symmetric MultiProcessor Kernel

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 18:00:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E9F60106566B;
	Thu, 10 Mar 2011 18:00:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D97C48FC0C;
	Thu, 10 Mar 2011 18:00: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 p2AI0l9J051604;
	Thu, 10 Mar 2011 18:00:47 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AI0lpb051602;
	Thu, 10 Mar 2011 18:00:47 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103101800.p2AI0lpb051602@svn.freebsd.org>
From: Glen Barber 
Date: Thu, 10 Mar 2011 18:00: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: r219455 - head/usr.bin/find
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 18:00:48 -0000

Author: gjb (doc committer)
Date: Thu Mar 10 18:00:47 2011
New Revision: 219455
URL: http://svn.freebsd.org/changeset/base/219455

Log:
  Move the explanation of using arguments for the PRIMARIES above
  the list of PRIMARIES.
  
  PR:		151812
  Submitted by:	Jay (jouellette of gmail com)
  Patch by:	eadler
  MFC after:	1 week

Modified:
  head/usr.bin/find/find.1

Modified: head/usr.bin/find/find.1
==============================================================================
--- head/usr.bin/find/find.1	Thu Mar 10 17:26:36 2011	(r219454)
+++ head/usr.bin/find/find.1	Thu Mar 10 18:00:47 2011	(r219455)
@@ -177,6 +177,18 @@ This option is equivalent to the depreca
 primary.
 .El
 .Sh PRIMARIES
+.Pp
+All primaries which take a numeric argument allow the number to be
+preceded by a plus sign
+.Pq Dq Li +
+or a minus sign
+.Pq Dq Li - .
+A preceding plus sign means
+.Dq more than n ,
+a preceding minus sign means
+.Dq less than n
+and neither means
+.Dq exactly n .
 .Bl -tag -width indent
 .It Ic -Bmin Ar n
 True if the difference between the time of a file's inode creation
@@ -815,18 +827,6 @@ The same thing as 
 .Ic -path ,
 for GNU find compatibility.
 .El
-.Pp
-All primaries which take a numeric argument allow the number to be
-preceded by a plus sign
-.Pq Dq Li +
-or a minus sign
-.Pq Dq Li - .
-A preceding plus sign means
-.Dq more than n ,
-a preceding minus sign means
-.Dq less than n
-and neither means
-.Dq exactly n .
 .Sh OPERATORS
 The primaries may be combined using the following operators.
 The operators are listed in order of decreasing precedence.

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 18:17:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8CD1C106564A;
	Thu, 10 Mar 2011 18:17:24 +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 7A9CD8FC0C;
	Thu, 10 Mar 2011 18:17: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 p2AIHOas052089;
	Thu, 10 Mar 2011 18:17:24 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AIHOT8052084;
	Thu, 10 Mar 2011 18:17:24 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201103101817.p2AIHOT8052084@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Thu, 10 Mar 2011 18:17: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: r219456 - head/sys/net80211
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 18:17:24 -0000

Author: bschmidt
Date: Thu Mar 10 18:17:24 2011
New Revision: 219456
URL: http://svn.freebsd.org/changeset/base/219456

Log:
  Complete the MCS rate table based on the final 802.11n std. While here
  adjust the IEEE80211_HTRATE_MAXSIZE constant, only MCS0 - 76 are valid
  the other bits in the mcsset IE (77 - 127) are either reserved or used
  for TX parameters.

Modified:
  head/sys/net80211/_ieee80211.h
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_ht.h

Modified: head/sys/net80211/_ieee80211.h
==============================================================================
--- head/sys/net80211/_ieee80211.h	Thu Mar 10 18:00:47 2011	(r219455)
+++ head/sys/net80211/_ieee80211.h	Thu Mar 10 18:17:24 2011	(r219456)
@@ -335,7 +335,7 @@ struct ieee80211_rateset {
  * the structure such that it can be used interchangeably
  * with an ieee80211_rateset (modulo structure size).
  */
-#define	IEEE80211_HTRATE_MAXSIZE 127
+#define	IEEE80211_HTRATE_MAXSIZE	77
 
 struct ieee80211_htrateset {
 	uint8_t		rs_nrates;

Modified: head/sys/net80211/ieee80211.c
==============================================================================
--- head/sys/net80211/ieee80211.c	Thu Mar 10 18:00:47 2011	(r219455)
+++ head/sys/net80211/ieee80211.c	Thu Mar 10 18:17:24 2011	(r219456)
@@ -1513,6 +1513,67 @@ ieee80211_rate2media(struct ieee80211com
 		{  13, IFM_IEEE80211_MCS },
 		{  14, IFM_IEEE80211_MCS },
 		{  15, IFM_IEEE80211_MCS },
+		{  16, IFM_IEEE80211_MCS },
+		{  17, IFM_IEEE80211_MCS },
+		{  18, IFM_IEEE80211_MCS },
+		{  19, IFM_IEEE80211_MCS },
+		{  20, IFM_IEEE80211_MCS },
+		{  21, IFM_IEEE80211_MCS },
+		{  22, IFM_IEEE80211_MCS },
+		{  23, IFM_IEEE80211_MCS },
+		{  24, IFM_IEEE80211_MCS },
+		{  25, IFM_IEEE80211_MCS },
+		{  26, IFM_IEEE80211_MCS },
+		{  27, IFM_IEEE80211_MCS },
+		{  28, IFM_IEEE80211_MCS },
+		{  29, IFM_IEEE80211_MCS },
+		{  30, IFM_IEEE80211_MCS },
+		{  31, IFM_IEEE80211_MCS },
+		{  32, IFM_IEEE80211_MCS },
+		{  33, IFM_IEEE80211_MCS },
+		{  34, IFM_IEEE80211_MCS },
+		{  35, IFM_IEEE80211_MCS },
+		{  36, IFM_IEEE80211_MCS },
+		{  37, IFM_IEEE80211_MCS },
+		{  38, IFM_IEEE80211_MCS },
+		{  39, IFM_IEEE80211_MCS },
+		{  40, IFM_IEEE80211_MCS },
+		{  41, IFM_IEEE80211_MCS },
+		{  42, IFM_IEEE80211_MCS },
+		{  43, IFM_IEEE80211_MCS },
+		{  44, IFM_IEEE80211_MCS },
+		{  45, IFM_IEEE80211_MCS },
+		{  46, IFM_IEEE80211_MCS },
+		{  47, IFM_IEEE80211_MCS },
+		{  48, IFM_IEEE80211_MCS },
+		{  49, IFM_IEEE80211_MCS },
+		{  50, IFM_IEEE80211_MCS },
+		{  51, IFM_IEEE80211_MCS },
+		{  52, IFM_IEEE80211_MCS },
+		{  53, IFM_IEEE80211_MCS },
+		{  54, IFM_IEEE80211_MCS },
+		{  55, IFM_IEEE80211_MCS },
+		{  56, IFM_IEEE80211_MCS },
+		{  57, IFM_IEEE80211_MCS },
+		{  58, IFM_IEEE80211_MCS },
+		{  59, IFM_IEEE80211_MCS },
+		{  60, IFM_IEEE80211_MCS },
+		{  61, IFM_IEEE80211_MCS },
+		{  62, IFM_IEEE80211_MCS },
+		{  63, IFM_IEEE80211_MCS },
+		{  64, IFM_IEEE80211_MCS },
+		{  65, IFM_IEEE80211_MCS },
+		{  66, IFM_IEEE80211_MCS },
+		{  67, IFM_IEEE80211_MCS },
+		{  68, IFM_IEEE80211_MCS },
+		{  69, IFM_IEEE80211_MCS },
+		{  70, IFM_IEEE80211_MCS },
+		{  71, IFM_IEEE80211_MCS },
+		{  72, IFM_IEEE80211_MCS },
+		{  73, IFM_IEEE80211_MCS },
+		{  74, IFM_IEEE80211_MCS },
+		{  75, IFM_IEEE80211_MCS },
+		{  76, IFM_IEEE80211_MCS },
 	};
 	int m;
 

Modified: head/sys/net80211/ieee80211_ht.c
==============================================================================
--- head/sys/net80211/ieee80211_ht.c	Thu Mar 10 18:00:47 2011	(r219455)
+++ head/sys/net80211/ieee80211_ht.c	Thu Mar 10 18:17:24 2011	(r219456)
@@ -54,24 +54,84 @@ __FBSDID("$FreeBSD$");
 #define	MS(_v, _f)	(((_v) & _f) >> _f##_S)
 #define	SM(_v, _f)	(((_v) << _f##_S) & _f)
 
-const struct ieee80211_mcs_rates ieee80211_htrates[16] = {
-    /*  20Mhz  SGI 40Mhz  SGI */
-	{  13,  14,  27,  30 },	/* MCS 0 */
-	{  26,  29,  54,  60 },	/* MCS 1 */
-	{  39,  43,  81,  90 },	/* MCS 2 */
-	{  52,  58, 108, 120 },	/* MCS 3 */
-	{  78,  87, 162, 180 },	/* MCS 4 */
-	{ 104, 116, 216, 240 },	/* MCS 5 */
-	{ 117, 130, 243, 270 },	/* MCS 6 */
-	{ 130, 144, 270, 300 },	/* MCS 7 */
-	{  26,  29,  54,  60 },	/* MCS 8 */
-	{  52,  58, 108, 120 },	/* MCS 9 */
-	{  78,  87, 162, 180 },	/* MCS 10 */
-	{ 104, 116, 216, 240 },	/* MCS 11 */
-	{ 156, 173, 324, 360 },	/* MCS 12 */
-	{ 208, 231, 432, 480 },	/* MCS 13 */
-	{ 234, 260, 486, 540 },	/* MCS 14 */
-	{ 260, 289, 540, 600 }	/* MCS 15 */
+const struct ieee80211_mcs_rates ieee80211_htrates[IEEE80211_HTRATE_MAXSIZE] = {
+	{  13,  14,   27,   30 },	/* MCS 0 */
+	{  26,  29,   54,   60 },	/* MCS 1 */
+	{  39,  43,   81,   90 },	/* MCS 2 */
+	{  52,  58,  108,  120 },	/* MCS 3 */
+	{  78,  87,  162,  180 },	/* MCS 4 */
+	{ 104, 116,  216,  240 },	/* MCS 5 */
+	{ 117, 130,  243,  270 },	/* MCS 6 */
+	{ 130, 144,  270,  300 },	/* MCS 7 */
+	{  26,  29,   54,   60 },	/* MCS 8 */
+	{  52,  58,  108,  120 },	/* MCS 9 */
+	{  78,  87,  162,  180 },	/* MCS 10 */
+	{ 104, 116,  216,  240 },	/* MCS 11 */
+	{ 156, 173,  324,  360 },	/* MCS 12 */
+	{ 208, 231,  432,  480 },	/* MCS 13 */
+	{ 234, 260,  486,  540 },	/* MCS 14 */
+	{ 260, 289,  540,  600 },	/* MCS 15 */
+	{  39,  43,   81,   90 },	/* MCS 16 */
+	{  78,  87,  162,  180 },	/* MCS 17 */
+	{ 117, 130,  243,  270 },	/* MCS 18 */
+	{ 156, 173,  324,  360 },	/* MCS 19 */
+	{ 234, 260,  486,  540 },	/* MCS 20 */
+	{ 312, 347,  648,  720 },	/* MCS 21 */
+	{ 351, 390,  729,  810 },	/* MCS 22 */
+	{ 390, 433,  810,  900 },	/* MCS 23 */
+	{  52,  58,  108,  120 },	/* MCS 24 */
+	{ 104, 116,  216,  240 },	/* MCS 25 */
+	{ 156, 173,  324,  360 },	/* MCS 26 */
+	{ 208, 231,  432,  480 },	/* MCS 27 */
+	{ 312, 347,  648,  720 },	/* MCS 28 */
+	{ 416, 462,  864,  960 },	/* MCS 29 */
+	{ 468, 520,  972, 1080 },	/* MCS 30 */
+	{ 520, 578, 1080, 1200 },	/* MCS 31 */
+	{   0,   0,   12,   13 },	/* MCS 32 */
+	{  78,  87,  162,  180 },	/* MCS 33 */
+	{ 104, 116,  216,  240 },	/* MCS 34 */
+	{ 130, 144,  270,  300 },	/* MCS 35 */
+	{ 117, 130,  243,  270 },	/* MCS 36 */
+	{ 156, 173,  324,  360 },	/* MCS 37 */
+	{ 195, 217,  405,  450 },	/* MCS 38 */
+	{ 104, 116,  216,  240 },	/* MCS 39 */
+	{ 130, 144,  270,  300 },	/* MCS 40 */
+	{ 130, 144,  270,  300 },	/* MCS 41 */
+	{ 156, 173,  324,  360 },	/* MCS 42 */
+	{ 182, 202,  378,  420 },	/* MCS 43 */
+	{ 182, 202,  378,  420 },	/* MCS 44 */
+	{ 208, 231,  432,  480 },	/* MCS 45 */
+	{ 156, 173,  324,  360 },	/* MCS 46 */
+	{ 195, 217,  405,  450 },	/* MCS 47 */
+	{ 195, 217,  405,  450 },	/* MCS 48 */
+	{ 234, 260,  486,  540 },	/* MCS 49 */
+	{ 273, 303,  567,  630 },	/* MCS 50 */
+	{ 273, 303,  567,  630 },	/* MCS 51 */
+	{ 312, 347,  648,  720 },	/* MCS 52 */
+	{ 130, 144,  270,  300 },	/* MCS 53 */
+	{ 156, 173,  324,  360 },	/* MCS 54 */
+	{ 182, 202,  378,  420 },	/* MCS 55 */
+	{ 156, 173,  324,  360 },	/* MCS 56 */
+	{ 182, 202,  378,  420 },	/* MCS 57 */
+	{ 208, 231,  432,  480 },	/* MCS 58 */
+	{ 234, 260,  486,  540 },	/* MCS 59 */
+	{ 208, 231,  432,  480 },	/* MCS 60 */
+	{ 234, 260,  486,  540 },	/* MCS 61 */
+	{ 260, 289,  540,  600 },	/* MCS 62 */
+	{ 260, 289,  540,  600 },	/* MCS 63 */
+	{ 286, 318,  594,  660 },	/* MCS 64 */
+	{ 195, 217,  405,  450 },	/* MCS 65 */
+	{ 234, 260,  486,  540 },	/* MCS 66 */
+	{ 273, 303,  567,  630 },	/* MCS 67 */
+	{ 234, 260,  486,  540 },	/* MCS 68 */
+	{ 273, 303,  567,  630 },	/* MCS 69 */
+	{ 312, 347,  648,  720 },	/* MCS 70 */
+	{ 351, 390,  729,  810 },	/* MCS 71 */
+	{ 312, 347,  648,  720 },	/* MCS 72 */
+	{ 351, 390,  729,  810 },	/* MCS 73 */
+	{ 390, 433,  810,  900 },	/* MCS 74 */
+	{ 390, 433,  810,  900 },	/* MCS 75 */
+	{ 429, 477,  891,  990 },	/* MCS 76 */
 };
 
 static const struct ieee80211_htrateset ieee80211_rateset_11n =

Modified: head/sys/net80211/ieee80211_ht.h
==============================================================================
--- head/sys/net80211/ieee80211_ht.h	Thu Mar 10 18:00:47 2011	(r219455)
+++ head/sys/net80211/ieee80211_ht.h	Thu Mar 10 18:17:24 2011	(r219456)
@@ -159,7 +159,7 @@ struct ieee80211_mcs_rates {
 	uint16_t	ht40_rate_800ns;
 	uint16_t	ht40_rate_400ns;
 };
-extern const struct ieee80211_mcs_rates ieee80211_htrates[16];
+extern const struct ieee80211_mcs_rates ieee80211_htrates[];
 const struct ieee80211_htrateset *ieee80211_get_suphtrates(
 		struct ieee80211com *, const struct ieee80211_channel *);
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 18:49:16 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B439106567C;
	Thu, 10 Mar 2011 18:49:16 +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 49FB38FC08;
	Thu, 10 Mar 2011 18:49: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 p2AInGvU052779;
	Thu, 10 Mar 2011 18:49:16 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AInGfD052768;
	Thu, 10 Mar 2011 18:49:16 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103101849.p2AInGfD052768@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 10 Mar 2011 18:49:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219457 - head/sys/contrib/altq/altq
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 18:49:16 -0000

Author: jkim
Date: Thu Mar 10 18:49:15 2011
New Revision: 219457
URL: http://svn.freebsd.org/changeset/base/219457

Log:
  Remove support for FreeBSD 4.x and below.

Modified:
  head/sys/contrib/altq/altq/altq_cbq.c
  head/sys/contrib/altq/altq/altq_cdnr.c
  head/sys/contrib/altq/altq/altq_hfsc.c
  head/sys/contrib/altq/altq/altq_priq.c
  head/sys/contrib/altq/altq/altq_red.c
  head/sys/contrib/altq/altq/altq_rio.c
  head/sys/contrib/altq/altq/altq_rmclass.c
  head/sys/contrib/altq/altq/altq_subr.c
  head/sys/contrib/altq/altq/altq_var.h
  head/sys/contrib/altq/altq/if_altq.h

Modified: head/sys/contrib/altq/altq/altq_cbq.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_cbq.c	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_cbq.c	Thu Mar 10 18:49:15 2011	(r219457)
@@ -33,12 +33,10 @@
 
 #if defined(__FreeBSD__) || defined(__NetBSD__)
 #include "opt_altq.h"
-#if (__FreeBSD__ != 2)
 #include "opt_inet.h"
 #ifdef __FreeBSD__
 #include "opt_inet6.h"
 #endif
-#endif
 #endif /* __FreeBSD__ || __NetBSD__ */
 #ifdef ALTQ_CBQ	/* cbq is enabled by ALTQ_CBQ option in opt_altq.h */
 
@@ -508,14 +506,8 @@ cbq_enqueue(struct ifaltq *ifq, struct m
 	/* grab class set by classifier */
 	if ((m->m_flags & M_PKTHDR) == 0) {
 		/* should not happen */
-#if defined(__NetBSD__) || defined(__OpenBSD__)\
-    || (defined(__FreeBSD__) && __FreeBSD_version >= 501113)
 		printf("altq: packet for %s does not have pkthdr\n",
 		    ifq->altq_ifp->if_xname);
-#else
-		printf("altq: packet for %s%d does not have pkthdr\n",
-		    ifq->altq_ifp->if_name, ifq->altq_ifp->if_unit);
-#endif
 		m_freem(m);
 		return (ENOBUFS);
 	}
@@ -1027,13 +1019,7 @@ cbqclose(dev, flag, fmt, p)
 
 	while (cbq_list) {
 		ifp = cbq_list->ifnp.ifq_->altq_ifp;
-#if defined(__NetBSD__) || defined(__OpenBSD__)\
-    || (defined(__FreeBSD__) && __FreeBSD_version >= 501113)
 		sprintf(iface.cbq_ifacename, "%s", ifp->if_xname);
-#else
-		sprintf(iface.cbq_ifacename,
-			"%s%d", ifp->if_name, ifp->if_unit);
-#endif
 		err = cbq_ifdetach(&iface);
 		if (err != 0 && error == 0)
 			error = err;

Modified: head/sys/contrib/altq/altq/altq_cdnr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_cdnr.c	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_cdnr.c	Thu Mar 10 18:49:15 2011	(r219457)
@@ -1,5 +1,5 @@
 /*	$FreeBSD$	*/
-/*	$KAME: altq_cdnr.c,v 1.14 2003/09/05 22:40:36 itojun Exp $	*/
+/*	$KAME: altq_cdnr.c,v 1.15 2005/04/13 03:44:24 suz Exp $	*/
 
 /*
  * Copyright (C) 1999-2002
@@ -29,12 +29,10 @@
 
 #if defined(__FreeBSD__) || defined(__NetBSD__)
 #include "opt_altq.h"
-#if (__FreeBSD__ != 2)
 #include "opt_inet.h"
 #ifdef __FreeBSD__
 #include "opt_inet6.h"
 #endif
-#endif
 #endif /* __FreeBSD__ || __NetBSD__ */
 
 #include 

Modified: head/sys/contrib/altq/altq/altq_hfsc.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_hfsc.c	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_hfsc.c	Thu Mar 10 18:49:15 2011	(r219457)
@@ -44,12 +44,10 @@
 
 #if defined(__FreeBSD__) || defined(__NetBSD__)
 #include "opt_altq.h"
-#if (__FreeBSD__ != 2)
 #include "opt_inet.h"
 #ifdef __FreeBSD__
 #include "opt_inet6.h"
 #endif
-#endif
 #endif /* __FreeBSD__ || __NetBSD__ */
 
 #ifdef ALTQ_HFSC  /* hfsc is enabled by ALTQ_HFSC option in opt_altq.h */
@@ -698,14 +696,8 @@ hfsc_enqueue(struct ifaltq *ifq, struct 
 	/* grab class set by classifier */
 	if ((m->m_flags & M_PKTHDR) == 0) {
 		/* should not happen */
-#if defined(__NetBSD__) || defined(__OpenBSD__)\
-    || (defined(__FreeBSD__) && __FreeBSD_version >= 501113)
 		printf("altq: packet for %s does not have pkthdr\n",
 		    ifq->altq_ifp->if_xname);
-#else
-		printf("altq: packet for %s%d does not have pkthdr\n",
-		    ifq->altq_ifp->if_name, ifq->altq_ifp->if_unit);
-#endif
 		m_freem(m);
 		return (ENOBUFS);
 	}

Modified: head/sys/contrib/altq/altq/altq_priq.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_priq.c	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_priq.c	Thu Mar 10 18:49:15 2011	(r219457)
@@ -31,12 +31,10 @@
 
 #if defined(__FreeBSD__) || defined(__NetBSD__)
 #include "opt_altq.h"
-#if (__FreeBSD__ != 2)
 #include "opt_inet.h"
 #ifdef __FreeBSD__
 #include "opt_inet6.h"
 #endif
-#endif
 #endif /* __FreeBSD__ || __NetBSD__ */
 
 #ifdef ALTQ_PRIQ  /* priq is enabled by ALTQ_PRIQ option in opt_altq.h */
@@ -469,14 +467,8 @@ priq_enqueue(struct ifaltq *ifq, struct 
 	/* grab class set by classifier */
 	if ((m->m_flags & M_PKTHDR) == 0) {
 		/* should not happen */
-#if defined(__NetBSD__) || defined(__OpenBSD__)\
-    || (defined(__FreeBSD__) && __FreeBSD_version >= 501113)
 		printf("altq: packet for %s does not have pkthdr\n",
 		    ifq->altq_ifp->if_xname);
-#else
-		printf("altq: packet for %s%d does not have pkthdr\n",
-		    ifq->altq_ifp->if_name, ifq->altq_ifp->if_unit);
-#endif
 		m_freem(m);
 		return (ENOBUFS);
 	}

Modified: head/sys/contrib/altq/altq/altq_red.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_red.c	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_red.c	Thu Mar 10 18:49:15 2011	(r219457)
@@ -62,12 +62,10 @@
 
 #if defined(__FreeBSD__) || defined(__NetBSD__)
 #include "opt_altq.h"
-#if (__FreeBSD__ != 2)
 #include "opt_inet.h"
 #ifdef __FreeBSD__
 #include "opt_inet6.h"
 #endif
-#endif
 #endif /* __FreeBSD__ || __NetBSD__ */
 #ifdef ALTQ_RED	/* red is enabled by ALTQ_RED option in opt_altq.h */
 

Modified: head/sys/contrib/altq/altq/altq_rio.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_rio.c	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_rio.c	Thu Mar 10 18:49:15 2011	(r219457)
@@ -61,12 +61,10 @@
 
 #if defined(__FreeBSD__) || defined(__NetBSD__)
 #include "opt_altq.h"
-#if (__FreeBSD__ != 2)
 #include "opt_inet.h"
 #ifdef __FreeBSD__
 #include "opt_inet6.h"
 #endif
-#endif
 #endif /* __FreeBSD__ || __NetBSD__ */
 #ifdef ALTQ_RIO	/* rio is enabled by ALTQ_RIO option in opt_altq.h */
 

Modified: head/sys/contrib/altq/altq/altq_rmclass.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_rmclass.c	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_rmclass.c	Thu Mar 10 18:49:15 2011	(r219457)
@@ -1,5 +1,5 @@
 /*	$FreeBSD$	*/
-/*	$KAME: altq_rmclass.c,v 1.18 2003/11/06 06:32:53 kjc Exp $	*/
+/*	$KAME: altq_rmclass.c,v 1.19 2005/04/13 03:44:25 suz Exp $	*/
 
 /*
  * Copyright (c) 1991-1997 Regents of the University of California.
@@ -41,12 +41,10 @@
 
 #if defined(__FreeBSD__) || defined(__NetBSD__)
 #include "opt_altq.h"
-#if (__FreeBSD__ != 2)
 #include "opt_inet.h"
 #ifdef __FreeBSD__
 #include "opt_inet6.h"
 #endif
-#endif
 #endif /* __FreeBSD__ || __NetBSD__ */
 #ifdef ALTQ_CBQ	/* cbq is enabled by ALTQ_CBQ option in opt_altq.h */
 

Modified: head/sys/contrib/altq/altq/altq_subr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_subr.c	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_subr.c	Thu Mar 10 18:49:15 2011	(r219457)
@@ -72,9 +72,6 @@
 
 /* machine dependent clock related includes */
 #ifdef __FreeBSD__
-#if __FreeBSD__ < 3
-#include "opt_cpu.h"	/* for FreeBSD-2.2.8 to get i586_ctr_freq */
-#endif
 #include 
 #include 
 #include 
@@ -449,7 +446,7 @@ static void
 tbr_timeout(arg)
 	void *arg;
 {
-#if defined(__FreeBSD__)
+#ifdef __FreeBSD__
 	VNET_ITERATOR_DECL(vnet_iter);
 #endif
 	struct ifnet *ifp;
@@ -461,7 +458,7 @@ tbr_timeout(arg)
 #else
 	s = splimp();
 #endif
-#if defined(__FreeBSD__) && (__FreeBSD_version >= 500000)
+#ifdef __FreeBSD__
 	IFNET_RLOCK_NOSLEEP();
 	VNET_LIST_RLOCK_NOSLEEP();
 	VNET_FOREACH(vnet_iter) {
@@ -477,7 +474,7 @@ tbr_timeout(arg)
 			    ifp->if_start != NULL)
 				(*ifp->if_start)(ifp);
 		}
-#if defined(__FreeBSD__) && (__FreeBSD_version >= 500000)
+#ifdef __FreeBSD__
 		CURVNET_RESTORE();
 	}
 	VNET_LIST_RUNLOCK_NOSLEEP();
@@ -985,11 +982,7 @@ init_machclk(void)
 	 */
 #ifdef __i386__
 #ifdef __FreeBSD__
-#if (__FreeBSD_version > 300000)
 	machclk_freq = tsc_freq;
-#else
-	machclk_freq = i586_ctr_freq;
-#endif
 #elif defined(__NetBSD__)
 	machclk_freq = (u_int32_t)cpu_tsc_freq;
 #elif defined(__OpenBSD__) && (defined(I586_CPU) || defined(I686_CPU))

Modified: head/sys/contrib/altq/altq/altq_var.h
==============================================================================
--- head/sys/contrib/altq/altq/altq_var.h	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/altq_var.h	Thu Mar 10 18:49:15 2011	(r219457)
@@ -141,11 +141,7 @@ extern u_int64_t read_machclk(void);
  * misc stuff for compatibility
  */
 /* ioctl cmd type */
-#if defined(__FreeBSD__) && (__FreeBSD__ < 3)
-typedef int ioctlcmd_t;
-#else
 typedef u_long ioctlcmd_t;
-#endif
 
 /*
  * queue macros:

Modified: head/sys/contrib/altq/altq/if_altq.h
==============================================================================
--- head/sys/contrib/altq/altq/if_altq.h	Thu Mar 10 18:17:24 2011	(r219456)
+++ head/sys/contrib/altq/altq/if_altq.h	Thu Mar 10 18:49:15 2011	(r219457)
@@ -1,5 +1,5 @@
 /*	$FreeBSD$	*/
-/*	$KAME: if_altq.h,v 1.11 2003/07/10 12:07:50 kjc Exp $	*/
+/*	$KAME: if_altq.h,v 1.12 2005/04/13 03:44:25 suz Exp $	*/
 
 /*
  * Copyright (C) 1997-2003
@@ -29,7 +29,7 @@
 #ifndef _ALTQ_IF_ALTQ_H_
 #define	_ALTQ_IF_ALTQ_H_
 
-#if (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
+#ifdef __FreeBSD__
 #include 		/* XXX */
 #include 		/* XXX */
 #include 		/* XXX */
@@ -51,7 +51,7 @@ struct	ifaltq {
 	int	ifq_len;
 	int	ifq_maxlen;
 	int	ifq_drops;
-#if (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
+#ifdef __FreeBSD__
 	struct	mtx ifq_mtx;
 #endif
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 18:58:40 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C58E61065670;
	Thu, 10 Mar 2011 18:58:40 +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 9BD3A8FC0A;
	Thu, 10 Mar 2011 18:58:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2AIwesT053009;
	Thu, 10 Mar 2011 18:58:40 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AIweXg053007;
	Thu, 10 Mar 2011 18:58:40 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103101858.p2AIweXg053007@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 10 Mar 2011 18:58: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: r219458 - head/sys/contrib/altq/altq
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 18:58:40 -0000

Author: jkim
Date: Thu Mar 10 18:58:40 2011
New Revision: 219458
URL: http://svn.freebsd.org/changeset/base/219458

Log:
  Consistently add TSC support for amd64.

Modified:
  head/sys/contrib/altq/altq/altq_subr.c

Modified: head/sys/contrib/altq/altq/altq_subr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_subr.c	Thu Mar 10 18:49:15 2011	(r219457)
+++ head/sys/contrib/altq/altq/altq_subr.c	Thu Mar 10 18:58:40 2011	(r219458)
@@ -77,7 +77,7 @@
 #include 
 #include 
 #endif
-#if defined(__i386__)
+#if defined(__amd64__) || defined(__i386__)
 #include 		/* for pentium tsc */
 #include 		/* for CPUID_TSC */
 #ifdef __FreeBSD__
@@ -85,7 +85,7 @@
 #elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 		/* for cpu_feature */
 #endif
-#endif /* __i386__ */
+#endif /* __amd64 || __i386__ */
 
 /*
  * internal function prototypes
@@ -938,7 +938,8 @@ init_machclk_setup(void)
 
 	machclk_usepcc = 1;
 
-#if (!defined(__i386__) && !defined(__alpha__)) || defined(ALTQ_NOPCC)
+#if (!defined(__alpha__) && !defined(__amd64__) && !defined(__i386__)) || \
+    defined(ALTQ_NOPCC)
 	machclk_usepcc = 0;
 #endif
 #if defined(__FreeBSD__) && defined(SMP)
@@ -947,7 +948,7 @@ init_machclk_setup(void)
 #if defined(__NetBSD__) && defined(MULTIPROCESSOR)
 	machclk_usepcc = 0;
 #endif
-#ifdef __i386__
+#if defined(__amd64__) || defined(__i386__)
 	/* check if TSC is available */
 	if (machclk_usepcc == 1 && ((cpu_feature & CPUID_TSC) == 0 ||
 	    tsc_is_broken))
@@ -980,7 +981,7 @@ init_machclk(void)
 	 * if the clock frequency (of Pentium TSC or Alpha PCC) is
 	 * accessible, just use it.
 	 */
-#ifdef __i386__
+#if defined(__amd64__) || defined(__i386__)
 #ifdef __FreeBSD__
 	machclk_freq = tsc_freq;
 #elif defined(__NetBSD__)
@@ -1040,7 +1041,7 @@ read_machclk(void)
 	u_int64_t val;
 
 	if (machclk_usepcc) {
-#if defined(__i386__)
+#if defined(__amd64__) || defined(__i386__)
 		val = rdtsc();
 #elif defined(__alpha__)
 		static u_int32_t last_pcc, upper;

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 19:04:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C2FC7106566B;
	Thu, 10 Mar 2011 19:04:18 +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 9976D8FC20;
	Thu, 10 Mar 2011 19:04: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 p2AJ4IoF053166;
	Thu, 10 Mar 2011 19:04:18 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AJ4IhD053164;
	Thu, 10 Mar 2011 19:04:18 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103101904.p2AJ4IhD053164@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 10 Mar 2011 19:04: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: r219459 - head/sys/contrib/altq/altq
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 19:04:18 -0000

Author: jkim
Date: Thu Mar 10 19:04:18 2011
New Revision: 219459
URL: http://svn.freebsd.org/changeset/base/219459

Log:
  Remove alpha reminiscence from altq.

Modified:
  head/sys/contrib/altq/altq/altq_subr.c

Modified: head/sys/contrib/altq/altq/altq_subr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_subr.c	Thu Mar 10 18:58:40 2011	(r219458)
+++ head/sys/contrib/altq/altq/altq_subr.c	Thu Mar 10 19:04:18 2011	(r219459)
@@ -485,20 +485,6 @@ tbr_timeout(arg)
 		CALLOUT_RESET(&tbr_callout, 1, tbr_timeout, (void *)0);
 	else
 		tbr_timer = 0;	/* don't need tbr_timer anymore */
-#if defined(__alpha__) && !defined(ALTQ_NOPCC)
-	{
-		/*
-		 * XXX read out the machine dependent clock once a second
-		 * to detect counter wrap-around.
-		 */
-		static u_int cnt;
-
-		if (++cnt >= hz) {
-			(void)read_machclk();
-			cnt = 0;
-		}
-	}
-#endif /* __alpha__ && !ALTQ_NOPCC */
 }
 
 /*
@@ -896,16 +882,9 @@ int machclk_usepcc;
 u_int32_t machclk_freq;
 u_int32_t machclk_per_tick;
 
-#ifdef __alpha__
-#ifdef __FreeBSD__
-extern u_int32_t cycles_per_sec;	/* alpha cpu clock frequency */
-#elif defined(__NetBSD__) || defined(__OpenBSD__)
-extern u_int64_t cycles_per_usec;	/* alpha cpu clock frequency */
-#endif
-#endif /* __alpha__ */
 #if defined(__i386__) && defined(__NetBSD__)
 extern u_int64_t cpu_tsc_freq;
-#endif /* __alpha__ */
+#endif
 
 #if (__FreeBSD_version >= 700035)
 /* Update TSC freq with the value indicated by the caller. */
@@ -938,8 +917,7 @@ init_machclk_setup(void)
 
 	machclk_usepcc = 1;
 
-#if (!defined(__alpha__) && !defined(__amd64__) && !defined(__i386__)) || \
-    defined(ALTQ_NOPCC)
+#if (!defined(__amd64__) && !defined(__i386__)) || defined(ALTQ_NOPCC)
 	machclk_usepcc = 0;
 #endif
 #if defined(__FreeBSD__) && defined(SMP)
@@ -989,13 +967,7 @@ init_machclk(void)
 #elif defined(__OpenBSD__) && (defined(I586_CPU) || defined(I686_CPU))
 	machclk_freq = pentium_mhz * 1000000;
 #endif
-#elif defined(__alpha__)
-#ifdef __FreeBSD__
-	machclk_freq = cycles_per_sec;
-#elif defined(__NetBSD__) || defined(__OpenBSD__)
-	machclk_freq = (u_int32_t)(cycles_per_usec * 1000000);
 #endif
-#endif /* __alpha__ */
 
 	/*
 	 * if we don't know the clock frequency, measure it.
@@ -1043,23 +1015,6 @@ read_machclk(void)
 	if (machclk_usepcc) {
 #if defined(__amd64__) || defined(__i386__)
 		val = rdtsc();
-#elif defined(__alpha__)
-		static u_int32_t last_pcc, upper;
-		u_int32_t pcc;
-
-		/*
-		 * for alpha, make a 64bit counter value out of the 32bit
-		 * alpha processor cycle counter.
-		 * read_machclk must be called within a half of its
-		 * wrap-around cycle (about 5 sec for 400MHz cpu) to properly
-		 * detect a counter wrap-around.
-		 * tbr_timeout calls read_machclk once a second.
-		 */
-		pcc = (u_int32_t)alpha_rpcc();
-		if (pcc <= last_pcc)
-			upper++;
-		last_pcc = pcc;
-		val = ((u_int64_t)upper << 32) + pcc;
 #else
 		panic("read_machclk");
 #endif

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 19:50:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C61E1065675;
	Thu, 10 Mar 2011 19:50:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1C99F8FC17;
	Thu, 10 Mar 2011 19:50:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2AJoDKa054108;
	Thu, 10 Mar 2011 19:50:13 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AJoDt5054106;
	Thu, 10 Mar 2011 19:50:13 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103101950.p2AJoDt5054106@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 10 Mar 2011 19:50:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219460 - head/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 19:50:13 -0000

Author: jhb
Date: Thu Mar 10 19:50:12 2011
New Revision: 219460
URL: http://svn.freebsd.org/changeset/base/219460

Log:
  Remove now-obsolete comment.
  
  Submitted by:	netchild
  MFC after:	1 week

Modified:
  head/sys/compat/linux/linux_futex.c

Modified: head/sys/compat/linux/linux_futex.c
==============================================================================
--- head/sys/compat/linux/linux_futex.c	Thu Mar 10 19:04:18 2011	(r219459)
+++ head/sys/compat/linux/linux_futex.c	Thu Mar 10 19:50:12 2011	(r219460)
@@ -400,7 +400,7 @@ futex_atomic_op(struct thread *td, int e
 		       "cmparg = %x, uaddr = %p\n",
 		       op, cmp, oparg, cmparg, uaddr);
 #endif
-	/* XXX: linux verifies access here and returns EFAULT */
+	/* XXX: Linux verifies access here and returns EFAULT */
 
 	switch (op) {
 	case FUTEX_OP_SET:
@@ -521,11 +521,6 @@ linux_sys_futex(struct thread *td, struc
 		LINUX_CTR3(sys_futex, "WAKE uaddr %p val % d val3 %d",
 		    args->uaddr, args->val, args->val3);
 
-		/*
-		 * XXX: Linux is able to cope with different addresses
-		 * corresponding to the same mapped memory in the sleeping
-		 * and waker process(es).
-		 */
 #ifdef DEBUG
 		if (ldebug(sys_futex))
 			printf(ARGS(sys_futex, "futex_wake uaddr %p val %d val3 %d"),

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 20:02:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B06BC106566B;
	Thu, 10 Mar 2011 20:02:58 +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 967A88FC15;
	Thu, 10 Mar 2011 20:02: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 p2AK2wDi054461;
	Thu, 10 Mar 2011 20:02:58 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AK2w1M054449;
	Thu, 10 Mar 2011 20:02:58 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103102002.p2AK2w1M054449@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 10 Mar 2011 20:02:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219461 - in head/sys: amd64/amd64 amd64/include
	contrib/altq/altq i386/i386 i386/include i386/isa pc98/pc98
	x86/isa x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 20:02:58 -0000

Author: jkim
Date: Thu Mar 10 20:02:58 2011
New Revision: 219461
URL: http://svn.freebsd.org/changeset/base/219461

Log:
  Deprecate rarely used tsc_is_broken.  Instead, we zero out tsc_freq because
  it is almost always used with tsc_freq any way.

Modified:
  head/sys/amd64/amd64/identcpu.c
  head/sys/amd64/amd64/prof_machdep.c
  head/sys/amd64/include/clock.h
  head/sys/contrib/altq/altq/altq_subr.c
  head/sys/i386/i386/identcpu.c
  head/sys/i386/i386/machdep.c
  head/sys/i386/include/clock.h
  head/sys/i386/isa/prof_machdep.c
  head/sys/pc98/pc98/machdep.c
  head/sys/x86/isa/clock.c
  head/sys/x86/x86/tsc.c

Modified: head/sys/amd64/amd64/identcpu.c
==============================================================================
--- head/sys/amd64/amd64/identcpu.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/amd64/amd64/identcpu.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -193,10 +193,12 @@ printcpuinfo(void)
 	printf("%s (", cpu_model);
 	switch(cpu_class) {
 	case CPUCLASS_K8:
-		hw_clockrate = (tsc_freq + 5000) / 1000000;
-		printf("%jd.%02d-MHz ",
-		       (intmax_t)(tsc_freq + 4999) / 1000000,
-		       (u_int)((tsc_freq + 4999) / 10000) % 100);
+		if (tsc_freq != 0) {
+			hw_clockrate = (tsc_freq + 5000) / 1000000;
+			printf("%jd.%02d-MHz ",
+			       (intmax_t)(tsc_freq + 4999) / 1000000,
+			       (u_int)((tsc_freq + 4999) / 10000) % 100);
+		}
 		printf("K8");
 		break;
 	default:

Modified: head/sys/amd64/amd64/prof_machdep.c
==============================================================================
--- head/sys/amd64/amd64/prof_machdep.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/amd64/amd64/prof_machdep.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -319,7 +319,7 @@ startguprof(gp)
 	if (cputime_clock == CPUTIME_CLOCK_UNINITIALIZED) {
 		cputime_clock = CPUTIME_CLOCK_I8254;
 #if defined(I586_CPU) || defined(I686_CPU)
-		if (tsc_freq != 0 && !tsc_is_broken && mp_ncpus == 1)
+		if (tsc_freq != 0 && mp_ncpus == 1)
 			cputime_clock = CPUTIME_CLOCK_TSC;
 #endif
 	}

Modified: head/sys/amd64/include/clock.h
==============================================================================
--- head/sys/amd64/include/clock.h	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/amd64/include/clock.h	Thu Mar 10 20:02:58 2011	(r219461)
@@ -18,7 +18,6 @@ extern int	clkintr_pending;
 extern u_int	i8254_freq;
 extern int	i8254_max_count;
 extern uint64_t	tsc_freq;
-extern int	tsc_is_broken;
 extern int	tsc_is_invariant;
 
 void	i8254_init(void);

Modified: head/sys/contrib/altq/altq/altq_subr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_subr.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/contrib/altq/altq/altq_subr.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -79,10 +79,8 @@
 #endif
 #if defined(__amd64__) || defined(__i386__)
 #include 		/* for pentium tsc */
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 #include 		/* for CPUID_TSC */
-#ifdef __FreeBSD__
-#include 		/* for cpu_feature */
-#elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 		/* for cpu_feature */
 #endif
 #endif /* __amd64 || __i386__ */
@@ -928,8 +926,11 @@ init_machclk_setup(void)
 #endif
 #if defined(__amd64__) || defined(__i386__)
 	/* check if TSC is available */
-	if (machclk_usepcc == 1 && ((cpu_feature & CPUID_TSC) == 0 ||
-	    tsc_is_broken))
+#ifdef __FreeBSD__
+	if (tsc_freq == 0)
+#else
+	if ((cpu_feature & CPUID_TSC) == 0)
+#endif
 		machclk_usepcc = 0;
 #endif
 }

Modified: head/sys/i386/i386/identcpu.c
==============================================================================
--- head/sys/i386/i386/identcpu.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/i386/i386/identcpu.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -372,7 +372,7 @@ printcpuinfo(void)
 			break;
 		case 0x500:
 			strcat(cpu_model, "K5 model 0");
-			tsc_is_broken = 1;
+			tsc_freq = 0;
 			break;
 		case 0x510:
 			strcat(cpu_model, "K5 model 1");
@@ -570,7 +570,7 @@ printcpuinfo(void)
 		switch (cpu_id & 0xff0) {
 		case 0x540:
 			strcpy(cpu_model, "IDT WinChip C6");
-			tsc_is_broken = 1;
+			tsc_freq = 0;
 			break;
 		case 0x580:
 			strcpy(cpu_model, "IDT WinChip 2");
@@ -607,7 +607,7 @@ printcpuinfo(void)
 		case 0x540:
 			strcpy(cpu_model, "Geode SC1100");
 			cpu = CPU_GEODE1100;
-			tsc_is_broken = 1;
+			tsc_freq = 0;
 			break;
 		default:
 			strcpy(cpu_model, "Geode/NSC unknown");
@@ -640,19 +640,23 @@ printcpuinfo(void)
 #endif
 #if defined(I586_CPU)
 	case CPUCLASS_586:
-		hw_clockrate = (tsc_freq + 5000) / 1000000;
-		printf("%jd.%02d-MHz ",
-		       (intmax_t)(tsc_freq + 4999) / 1000000,
-		       (u_int)((tsc_freq + 4999) / 10000) % 100);
+		if (tsc_freq != 0) {
+			hw_clockrate = (tsc_freq + 5000) / 1000000;
+			printf("%jd.%02d-MHz ",
+			       (intmax_t)(tsc_freq + 4999) / 1000000,
+			       (u_int)((tsc_freq + 4999) / 10000) % 100);
+		}
 		printf("586");
 		break;
 #endif
 #if defined(I686_CPU)
 	case CPUCLASS_686:
-		hw_clockrate = (tsc_freq + 5000) / 1000000;
-		printf("%jd.%02d-MHz ",
-		       (intmax_t)(tsc_freq + 4999) / 1000000,
-		       (u_int)((tsc_freq + 4999) / 10000) % 100);
+		if (tsc_freq != 0) {
+			hw_clockrate = (tsc_freq + 5000) / 1000000;
+			printf("%jd.%02d-MHz ",
+			       (intmax_t)(tsc_freq + 4999) / 1000000,
+			       (u_int)((tsc_freq + 4999) / 10000) % 100);
+		}
 		printf("686");
 		break;
 #endif

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/i386/i386/machdep.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -1172,7 +1172,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 #endif
 
 	tsc2 -= tsc1;
-	if (tsc_freq != 0 && !tsc_is_broken) {
+	if (tsc_freq != 0) {
 		*rate = tsc2 * 1000;
 		return (0);
 	}

Modified: head/sys/i386/include/clock.h
==============================================================================
--- head/sys/i386/include/clock.h	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/i386/include/clock.h	Thu Mar 10 20:02:58 2011	(r219461)
@@ -18,7 +18,6 @@ extern int	clkintr_pending;
 extern u_int	i8254_freq;
 extern int	i8254_max_count;
 extern uint64_t	tsc_freq;
-extern int	tsc_is_broken;
 extern int	tsc_is_invariant;
 
 void	i8254_init(void);

Modified: head/sys/i386/isa/prof_machdep.c
==============================================================================
--- head/sys/i386/isa/prof_machdep.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/i386/isa/prof_machdep.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -289,7 +289,7 @@ startguprof(gp)
 	if (cputime_clock == CPUTIME_CLOCK_UNINITIALIZED) {
 		cputime_clock = CPUTIME_CLOCK_I8254;
 #if defined(I586_CPU) || defined(I686_CPU)
-		if (tsc_freq != 0 && !tsc_is_broken && mp_ncpus == 1)
+		if (tsc_freq != 0 && mp_ncpus == 1)
 			cputime_clock = CPUTIME_CLOCK_TSC;
 #endif
 	}

Modified: head/sys/pc98/pc98/machdep.c
==============================================================================
--- head/sys/pc98/pc98/machdep.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/pc98/pc98/machdep.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -1103,7 +1103,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 #endif
 
 	tsc2 -= tsc1;
-	if (tsc_freq != 0 && !tsc_is_broken) {
+	if (tsc_freq != 0) {
 		*rate = tsc2 * 1000;
 		return (0);
 	}

Modified: head/sys/x86/isa/clock.c
==============================================================================
--- head/sys/x86/isa/clock.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/x86/isa/clock.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -261,7 +261,7 @@ DELAY(int n)
 	static int state = 0;
 #endif
 
-	if (tsc_freq != 0 && !tsc_is_broken) {
+	if (tsc_freq != 0) {
 		uint64_t start, end, now;
 
 		sched_pin();

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c	Thu Mar 10 19:50:12 2011	(r219460)
+++ head/sys/x86/x86/tsc.c	Thu Mar 10 20:02:58 2011	(r219461)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include "cpufreq_if.h"
 
 uint64_t	tsc_freq;
-int		tsc_is_broken;
 int		tsc_is_invariant;
 int		tsc_present;
 static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag;
@@ -181,7 +180,7 @@ init_TSC_tc(void)
 		tsc_timecounter.tc_quality = -100;
 #endif
 
-	if (tsc_freq != 0 && !tsc_is_broken) {
+	if (tsc_freq != 0) {
 		tsc_timecounter.tc_frequency = tsc_freq;
 		tc_init(&tsc_timecounter);
 	}

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 20:37:55 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55DD8106567B;
	Thu, 10 Mar 2011 20:37: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 462268FC21;
	Thu, 10 Mar 2011 20:37: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 p2AKbtlg055291;
	Thu, 10 Mar 2011 20:37:55 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AKbtOK055288;
	Thu, 10 Mar 2011 20:37:55 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103102037.p2AKbtOK055288@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Thu, 10 Mar 2011 20:37:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-svnadmin@freebsd.org
X-SVN-Group: svnadmin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219462 - svnadmin/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 20:37:55 -0000

Author: pjd
Date: Thu Mar 10 20:37:54 2011
New Revision: 219462
URL: http://svn.freebsd.org/changeset/base/219462

Log:
  Please welcome Mikolaj Golub as a new src committer.
  Mikolaj will be working on HAST and I'm sure lots of other stuff.
  I'll be his mentor and kib@ will help me.
  
  Approved by:	core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==============================================================================
--- svnadmin/conf/access	Thu Mar 10 20:02:58 2011	(r219461)
+++ svnadmin/conf/access	Thu Mar 10 20:37:54 2011	(r219462)
@@ -227,6 +227,7 @@ thompsa
 ticso
 tijl
 trasz
+trociny
 trhodes
 truckman
 tuexen

Modified: svnadmin/conf/mentors
==============================================================================
--- svnadmin/conf/mentors	Thu Mar 10 20:02:58 2011	(r219461)
+++ svnadmin/conf/mentors	Thu Mar 10 20:37:54 2011	(r219462)
@@ -30,6 +30,7 @@ sbruno		scottl
 snb		dwmalone
 sson		gnn
 tijl		kib
+trociny		pjd		Co-mentor: kib
 versus		gavin		Co-mentor: fjoe
 will		ken
 zack		zml

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 20:59:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67EE0106564A;
	Thu, 10 Mar 2011 20:59: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 57E5B8FC1B;
	Thu, 10 Mar 2011 20:59: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 p2AKx2nP055792;
	Thu, 10 Mar 2011 20:59:02 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AKx2YH055790;
	Thu, 10 Mar 2011 20:59:02 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103102059.p2AKx2YH055790@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Thu, 10 Mar 2011 20:59: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: r219463 - head/tools/regression/pjdfstest/tests/chmod
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 20:59:02 -0000

Author: pjd
Date: Thu Mar 10 20:59:02 2011
New Revision: 219463
URL: http://svn.freebsd.org/changeset/base/219463

Log:
  Improve test a bit, now that we have fstat(2) support.
  The test was support to check if SUID/SGID bits are removed on first
  write, but actually we were checking if they were removed after close.
  Now we can check if SUID/SGID bits are gone after first write.
  
  While here add checks to see if when both SUID and SGID bits are set they are
  both cleared on first write.

Modified:
  head/tools/regression/pjdfstest/tests/chmod/12.t

Modified: head/tools/regression/pjdfstest/tests/chmod/12.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/chmod/12.t	Thu Mar 10 20:37:54 2011	(r219462)
+++ head/tools/regression/pjdfstest/tests/chmod/12.t	Thu Mar 10 20:59:02 2011	(r219463)
@@ -6,7 +6,7 @@ desc="verify SUID/SGID bit behaviour"
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..10"
+echo "1..14"
 
 n0=`namegen`
 n1=`namegen`
@@ -18,13 +18,19 @@ cd ${n2}
 
 # Check whether writing to the file by non-owner clears the SUID.
 expect 0 create ${n0} 04777
-expect 0 -u 65534 -g 65534 open ${n0} O_WRONLY : write 0 x
+expect 0777 -u 65534 -g 65534 open ${n0} O_WRONLY : write 0 x : fstat 0 mode
 expect 0777 stat ${n0} mode
 expect 0 unlink ${n0}
 
 # Check whether writing to the file by non-owner clears the SGID.
 expect 0 create ${n0} 02777
-expect 0 -u 65534 -g 65534 open ${n0} O_RDWR : write 0 x
+expect 0777 -u 65534 -g 65534 open ${n0} O_RDWR : write 0 x : fstat 0 mode
+expect 0777 stat ${n0} mode
+expect 0 unlink ${n0}
+
+# Check whether writing to the file by non-owner clears the SUID+SGID.
+expect 0 create ${n0} 06777
+expect 0777 -u 65534 -g 65534 open ${n0} O_RDWR : write 0 x : fstat 0 mode
 expect 0777 stat ${n0} mode
 expect 0 unlink ${n0}
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 21:00:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6E361106564A;
	Thu, 10 Mar 2011 21:00:30 +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 5CDBB8FC0C;
	Thu, 10 Mar 2011 21:00: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 p2AL0UTN055900;
	Thu, 10 Mar 2011 21:00:30 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AL0Ukh055898;
	Thu, 10 Mar 2011 21:00:30 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103102100.p2AL0Ukh055898@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Thu, 10 Mar 2011 21:00:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219464 - head/tools/regression/pjdfstest
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 21:00:30 -0000

Author: pjd
Date: Thu Mar 10 21:00:30 2011
New Revision: 219464
URL: http://svn.freebsd.org/changeset/base/219464

Log:
  Add support for *at syscalls:
  - openat(2)
  - unlinkat(2)
  - mkdirat(2)
  - linkat(2)
  - symlinkat(2)
  - renameat(2)
  - mkfifoat(2)
  - mknodat(2)
  - fchmodat(2)
  - fchownat(2)
  - fstatat(2)

Modified:
  head/tools/regression/pjdfstest/pjdfstest.c

Modified: head/tools/regression/pjdfstest/pjdfstest.c
==============================================================================
--- head/tools/regression/pjdfstest/pjdfstest.c	Thu Mar 10 20:59:02 2011	(r219463)
+++ head/tools/regression/pjdfstest/pjdfstest.c	Thu Mar 10 21:00:30 2011	(r219464)
@@ -64,15 +64,23 @@
 
 enum action {
 	ACTION_OPEN,
+	ACTION_OPENAT,
 	ACTION_CREATE,
 	ACTION_UNLINK,
+	ACTION_UNLINKAT,
 	ACTION_MKDIR,
+	ACTION_MKDIRAT,
 	ACTION_RMDIR,
 	ACTION_LINK,
+	ACTION_LINKAT,
 	ACTION_SYMLINK,
+	ACTION_SYMLINKAT,
 	ACTION_RENAME,
+	ACTION_RENAMEAT,
 	ACTION_MKFIFO,
+	ACTION_MKFIFOAT,
 	ACTION_MKNOD,
+	ACTION_MKNODAT,
 	ACTION_BIND,
 	ACTION_CONNECT,
 	ACTION_CHMOD,
@@ -80,9 +88,11 @@ enum action {
 #ifdef HAS_LCHMOD
 	ACTION_LCHMOD,
 #endif
+	ACTION_FCHMODAT,
 	ACTION_CHOWN,
 	ACTION_FCHOWN,
 	ACTION_LCHOWN,
+	ACTION_FCHOWNAT,
 #ifdef HAS_CHFLAGS
 	ACTION_CHFLAGS,
 #endif
@@ -97,6 +107,7 @@ enum action {
 	ACTION_STAT,
 	ACTION_FSTAT,
 	ACTION_LSTAT,
+	ACTION_FSTATAT,
 	ACTION_PATHCONF,
 	ACTION_FPATHCONF,
 	ACTION_LPATHCONF,
@@ -110,6 +121,8 @@ enum action {
 #define	TYPE_NONE	0x0000
 #define	TYPE_STRING	0x0001
 #define	TYPE_NUMBER	0x0002
+#define	TYPE_DESCRIPTOR	0x0003
+#define	TYPE_MASK	0x000f
 
 #define	TYPE_OPTIONAL	0x0100
 
@@ -123,47 +136,58 @@ struct syscall_desc {
 
 static struct syscall_desc syscalls[] = {
 	{ "open", ACTION_OPEN, { TYPE_STRING, TYPE_STRING, TYPE_NUMBER | TYPE_OPTIONAL, TYPE_NONE } },
+	{ "openat", ACTION_OPENAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NUMBER | TYPE_OPTIONAL, TYPE_NONE } },
 	{ "create", ACTION_CREATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
 	{ "unlink", ACTION_UNLINK, { TYPE_STRING, TYPE_NONE } },
+	{ "unlinkat", ACTION_UNLINKAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 	{ "mkdir", ACTION_MKDIR, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
+	{ "mkdirat", ACTION_MKDIRAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
 	{ "rmdir", ACTION_RMDIR, { TYPE_STRING, TYPE_NONE } },
 	{ "link", ACTION_LINK, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+	{ "linkat", ACTION_LINKAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 	{ "symlink", ACTION_SYMLINK, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+	{ "symlinkat", ACTION_SYMLINKAT, { TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
 	{ "rename", ACTION_RENAME, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+	{ "renameat", ACTION_RENAMEAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
 	{ "mkfifo", ACTION_MKFIFO, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
+	{ "mkfifoat", ACTION_MKFIFOAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
 	{ "mknod", ACTION_MKNOD, { TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} },
+	{ "mknodat", ACTION_MKNODAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} },
 	{ "bind", ACTION_BIND, { TYPE_STRING, TYPE_NONE } },
 	{ "connect", ACTION_CONNECT, { TYPE_STRING, TYPE_NONE } },
 	{ "chmod", ACTION_CHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
-	{ "fchmod", ACTION_FCHMOD, { TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
+	{ "fchmod", ACTION_FCHMOD, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NONE } },
 #ifdef HAS_LCHMOD
 	{ "lchmod", ACTION_LCHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
 #endif
+	{ "fchmodat", ACTION_FCHMODAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
 	{ "chown", ACTION_CHOWN, { TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
-	{ "fchown", ACTION_FCHOWN, { TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
+	{ "fchown", ACTION_FCHOWN, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
 	{ "lchown", ACTION_LCHOWN, { TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
+	{ "fchownat", ACTION_FCHOWNAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
 #ifdef HAS_CHFLAGS
 	{ "chflags", ACTION_CHFLAGS, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 #endif
 #ifdef HAS_FCHFLAGS
-	{ "fchflags", ACTION_FCHFLAGS, { TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
+	{ "fchflags", ACTION_FCHFLAGS, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
 #endif
 #ifdef HAS_LCHFLAGS
 	{ "lchflags", ACTION_LCHFLAGS, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 #endif
 	{ "truncate", ACTION_TRUNCATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
-	{ "ftruncate", ACTION_FTRUNCATE, { TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } },
+	{ "ftruncate", ACTION_FTRUNCATE, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NONE } },
 	{ "stat", ACTION_STAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
-	{ "fstat", ACTION_FSTAT, { TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
+	{ "fstat", ACTION_FSTAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
 	{ "lstat", ACTION_LSTAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
+	{ "fstatat", ACTION_FSTATAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 	{ "pathconf", ACTION_PATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
-	{ "fpathconf", ACTION_FPATHCONF, { TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
+	{ "fpathconf", ACTION_FPATHCONF, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
 	{ "lpathconf", ACTION_LPATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 #ifdef HAS_FREEBSD_ACL
 	{ "prependacl", ACTION_PREPENDACL, { TYPE_STRING, TYPE_STRING, TYPE_NONE } },
 	{ "readacl", ACTION_READACL, { TYPE_STRING, TYPE_NONE } },
 #endif
-	{ "write", ACTION_WRITE, { TYPE_NUMBER, TYPE_STRING, TYPE_NONE } },
+	{ "write", ACTION_WRITE, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
 	{ NULL, -1, { TYPE_NONE } }
 };
 
@@ -218,6 +242,9 @@ static struct flag open_flags[] = {
 #ifdef O_NOCTTY
 	{ O_NOCTTY, "O_NOCTTY" },
 #endif
+#ifdef O_DIRECTORY
+	{ O_DIRECTORY, "O_DIRECTORY" },
+#endif
 	{ 0, NULL }
 };
 
@@ -257,6 +284,31 @@ static struct flag chflags_flags[] = {
 };
 #endif
 
+static struct flag unlinkat_flags[] = {
+	{ AT_REMOVEDIR, "AT_REMOVEDIR" },
+	{ 0, NULL }
+};
+
+static struct flag linkat_flags[] = {
+	{ AT_SYMLINK_FOLLOW, "AT_SYMLINK_FOLLOW" },
+	{ 0, NULL }
+};
+
+static struct flag fchmodat_flags[] = {
+	{ AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
+	{ 0, NULL }
+};
+
+static struct flag fchownat_flags[] = {
+	{ AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
+	{ 0, NULL }
+};
+
+static struct flag fstatat_flags[] = {
+	{ AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
+	{ 0, NULL }
+};
+
 struct name {
 	int	 n_name;
 	char	*n_str;
@@ -499,19 +551,38 @@ call_syscall(struct syscall_desc *scall,
 				fprintf(stderr, "too few arguments\n");
 				exit(1);
 			}
-			if (scall->sd_args[i] & TYPE_STRING) {
+			if ((scall->sd_args[i] & TYPE_MASK) == TYPE_STRING) {
 				if (strcmp(argv[i], "NULL") == 0)
 					args[i].str = NULL;
 				else if (strcmp(argv[i], "DEADCODE") == 0)
 					args[i].str = (void *)0xdeadc0de;
 				else
 					args[i].str = argv[i];
-			} else if (scall->sd_args[i] & TYPE_NUMBER) {
+			} else if ((scall->sd_args[i] & TYPE_MASK) == TYPE_NUMBER) {
 				args[i].num = strtoll(argv[i], &endp, 0);
 				if (*endp != '\0' && !isspace((unsigned char)*endp)) {
 					fprintf(stderr, "invalid argument %u, number expected [%s]\n", i, endp);
 					exit(1);
 				}
+			} else if ((scall->sd_args[i] & TYPE_MASK) == TYPE_DESCRIPTOR) {
+				if (strcmp(argv[i], "AT_FDCWD") == 0) {
+					args[i].num = AT_FDCWD;
+				} else if (strcmp(argv[i], "BADFD") == 0) {
+					/* In case AT_FDCWD is -1 on some systems... */
+					if (AT_FDCWD == -1)
+						args[i].num = -2;
+					else
+						args[i].num = -1;
+				} else {
+					int pos;
+
+					pos = strtoll(argv[i], &endp, 0);
+					if (*endp != '\0' && !isspace((unsigned char)*endp)) {
+						fprintf(stderr, "invalid argument %u, number expected [%s]\n", i, endp);
+						exit(1);
+					}
+					args[i].num = descriptor_get(pos);
+				}
 			}
 		}
 	}
@@ -520,7 +591,6 @@ call_syscall(struct syscall_desc *scall,
 	 */
 #define	NUM(n)	(args[(n)].num)
 #define	STR(n)	(args[(n)].str)
-#define	DESC(n)	(descriptor_get((int)NUM(n)))
 	switch (scall->sd_action) {
 	case ACTION_OPEN:
 		flags = str2flags(open_flags, STR(1));
@@ -540,6 +610,24 @@ call_syscall(struct syscall_desc *scall,
 		if (rval >= 0)
 			descriptor_add(rval);
 		break;
+	case ACTION_OPENAT:
+		flags = str2flags(open_flags, STR(2));
+		if (flags & O_CREAT) {
+			if (i == 3) {
+				fprintf(stderr, "too few arguments\n");
+				exit(1);
+			}
+			rval = openat(NUM(0), STR(1), (int)flags, (mode_t)NUM(3));
+		} else {
+			if (i == 4) {
+				fprintf(stderr, "too many arguments\n");
+				exit(1);
+			}
+			rval = openat(NUM(0), STR(1), (int)flags);
+		}
+		if (rval >= 0)
+			descriptor_add(rval);
+		break;
 	case ACTION_CREATE:
 		rval = open(STR(0), O_CREAT | O_EXCL, (mode_t)NUM(1));
 		if (rval >= 0)
@@ -548,45 +636,87 @@ call_syscall(struct syscall_desc *scall,
 	case ACTION_UNLINK:
 		rval = unlink(STR(0));
 		break;
+	case ACTION_UNLINKAT:
+		rval = unlinkat(NUM(0), STR(1),
+		    (int)str2flags(unlinkat_flags, STR(2)));
+		break;
 	case ACTION_MKDIR:
 		rval = mkdir(STR(0), (mode_t)NUM(1));
 		break;
+	case ACTION_MKDIRAT:
+		rval = mkdirat(NUM(0), STR(1), (mode_t)NUM(2));
+		break;
 	case ACTION_RMDIR:
 		rval = rmdir(STR(0));
 		break;
 	case ACTION_LINK:
 		rval = link(STR(0), STR(1));
 		break;
+	case ACTION_LINKAT:
+		rval = linkat(NUM(0), STR(1), NUM(2), STR(3),
+		    (int)str2flags(linkat_flags, STR(4)));
+		break;
 	case ACTION_SYMLINK:
 		rval = symlink(STR(0), STR(1));
 		break;
+	case ACTION_SYMLINKAT:
+		rval = symlinkat(STR(0), NUM(1), STR(2));
+		break;
 	case ACTION_RENAME:
 		rval = rename(STR(0), STR(1));
 		break;
+	case ACTION_RENAMEAT:
+		rval = renameat(NUM(0), STR(1), NUM(2), STR(3));
+		break;
 	case ACTION_MKFIFO:
 		rval = mkfifo(STR(0), (mode_t)NUM(1));
 		break;
+	case ACTION_MKFIFOAT:
+		rval = mkfifoat(NUM(0), STR(1), (mode_t)NUM(2));
+		break;
 	case ACTION_MKNOD:
+	case ACTION_MKNODAT:
 	    {
 		mode_t ntype;
 		dev_t dev;
+		int fa;
 
-		dev = makedev(NUM(3), NUM(4));
-		if (strcmp(STR(1), "c") == 0)		/* character device */
+		switch (scall->sd_action) {
+		case ACTION_MKNOD:
+			fa = 0;
+			break;
+		case ACTION_MKNODAT:
+			fa = 1;
+			break;
+		default:
+			abort();
+		}
+
+		dev = makedev(NUM(fa + 3), NUM(fa + 4));
+		if (strcmp(STR(fa + 1), "c") == 0)		/* character device */
 			ntype = S_IFCHR;
-		else if (strcmp(STR(1), "b") == 0)	/* block device */
+		else if (strcmp(STR(fa + 1), "b") == 0)	/* block device */
 			ntype = S_IFBLK;
-		else if (strcmp(STR(1), "f") == 0)	/* fifo special */
+		else if (strcmp(STR(fa + 1), "f") == 0)	/* fifo special */
 			ntype = S_IFIFO;
-		else if (strcmp(STR(1), "d") == 0)	/* directory */
+		else if (strcmp(STR(fa + 1), "d") == 0)	/* directory */
 			ntype = S_IFDIR;
-		else if (strcmp(STR(1), "o") == 0)	/* regular file */
+		else if (strcmp(STR(fa + 1), "o") == 0)	/* regular file */
 			ntype = S_IFREG;
 		else {
 			fprintf(stderr, "wrong argument 1\n");
 			exit(1);
 		}
-		rval = mknod(STR(0), ntype | NUM(2), dev);
+		switch (scall->sd_action) {
+		case ACTION_MKNOD:
+			rval = mknod(STR(0), ntype | NUM(2), dev);
+			break;
+		case ACTION_MKNODAT:
+			rval = mknodat(NUM(0), STR(1), ntype | NUM(3), dev);
+			break;
+		default:
+			abort();
+		}
 		break;
 	    }
 	case ACTION_BIND:
@@ -619,30 +749,40 @@ call_syscall(struct syscall_desc *scall,
 		rval = chmod(STR(0), (mode_t)NUM(1));
 		break;
 	case ACTION_FCHMOD:
-		rval = fchmod(DESC(0), (mode_t)NUM(1));
+		rval = fchmod(NUM(0), (mode_t)NUM(1));
 		break;
 #ifdef HAS_LCHMOD
 	case ACTION_LCHMOD:
 		rval = lchmod(STR(0), (mode_t)NUM(1));
 		break;
 #endif
+	case ACTION_FCHMODAT:
+		rval = fchmodat(NUM(0), STR(1), (mode_t)NUM(2),
+		    str2flags(fchmodat_flags, STR(3)));
+		break;
 	case ACTION_CHOWN:
 		rval = chown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2));
 		break;
 	case ACTION_FCHOWN:
-		rval = fchown(DESC(0), (uid_t)NUM(1), (gid_t)NUM(2));
+		rval = fchown(NUM(0), (uid_t)NUM(1), (gid_t)NUM(2));
 		break;
 	case ACTION_LCHOWN:
 		rval = lchown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2));
 		break;
+	case ACTION_FCHOWNAT:
+		rval = fchownat(NUM(0), STR(1), (uid_t)NUM(2), (gid_t)NUM(3),
+		    (int)str2flags(fchownat_flags, STR(4)));
+		break;
 #ifdef HAS_CHFLAGS
 	case ACTION_CHFLAGS:
-		rval = chflags(STR(0), (unsigned long)str2flags(chflags_flags, STR(1)));
+		rval = chflags(STR(0),
+		    (unsigned long)str2flags(chflags_flags, STR(1)));
 		break;
 #endif
 #ifdef HAS_FCHFLAGS
 	case ACTION_FCHFLAGS:
-		rval = fchflags(DESC(0), (unsigned long)str2flags(chflags_flags, STR(1)));
+		rval = fchflags(NUM(0),
+		    (unsigned long)str2flags(chflags_flags, STR(1)));
 		break;
 #endif
 #ifdef HAS_LCHFLAGS
@@ -654,7 +794,7 @@ call_syscall(struct syscall_desc *scall,
 		rval = truncate64(STR(0), NUM(1));
 		break;
 	case ACTION_FTRUNCATE:
-		rval = ftruncate64(DESC(0), NUM(1));
+		rval = ftruncate64(NUM(0), NUM(1));
 		break;
 	case ACTION_STAT:
 		rval = stat64(STR(0), &sb);
@@ -664,7 +804,7 @@ call_syscall(struct syscall_desc *scall,
 		}
 		break;
 	case ACTION_FSTAT:
-		rval = fstat64(DESC(0), &sb);
+		rval = fstat64(NUM(0), &sb);
 		if (rval == 0) {
 			show_stats(&sb, STR(1));
 			return (i);
@@ -677,6 +817,14 @@ call_syscall(struct syscall_desc *scall,
 			return (i);
 		}
 		break;
+	case ACTION_FSTATAT:
+		rval = fstatat(NUM(0), STR(1), &sb,
+		    (int)str2flags(fstatat_flags, STR(2)));
+		if (rval == 0) {
+			show_stats(&sb, STR(3));
+			return (i);
+		}
+		break;
 	case ACTION_PATHCONF:
 	case ACTION_FPATHCONF:
 	case ACTION_LPATHCONF:
@@ -694,7 +842,7 @@ call_syscall(struct syscall_desc *scall,
 			lrval = pathconf(STR(0), name);
 			break;
 		case ACTION_FPATHCONF:
-			lrval = fpathconf(DESC(0), name);
+			lrval = fpathconf(NUM(0), name);
 			break;
 		case ACTION_LPATHCONF:
 			lrval = lpathconf(STR(0), name);
@@ -745,7 +893,7 @@ call_syscall(struct syscall_desc *scall,
 		break;
 #endif
 	case ACTION_WRITE:
-		rval = write(DESC(0), STR(1), strlen(STR(1)));
+		rval = write(NUM(0), STR(1), strlen(STR(1)));
 		break;
 	default:
 		fprintf(stderr, "unsupported syscall\n");

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 22:20:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 537F2106566C;
	Thu, 10 Mar 2011 22:20:12 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 42B598FC18;
	Thu, 10 Mar 2011 22:20: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 p2AMKCwN057615;
	Thu, 10 Mar 2011 22:20:12 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AMKCGd057613;
	Thu, 10 Mar 2011 22:20:12 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103102220.p2AMKCGd057613@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 10 Mar 2011 22:20: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: r219467 - head/sys/i386/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 22:20:12 -0000

Author: jkim
Date: Thu Mar 10 22:20:11 2011
New Revision: 219467
URL: http://svn.freebsd.org/changeset/base/219467

Log:
  Detect NSC/AMD Geode SC1100 properly, not just Stepping 0.  Although it is
  unclear that "TSC stops ticking with HLT instruction" problem is present
  with other steppings, it is limited to Stepping 0 for now.

Modified:
  head/sys/i386/i386/identcpu.c

Modified: head/sys/i386/i386/identcpu.c
==============================================================================
--- head/sys/i386/i386/identcpu.c	Thu Mar 10 21:56:31 2011	(r219466)
+++ head/sys/i386/i386/identcpu.c	Thu Mar 10 22:20:11 2011	(r219467)
@@ -603,11 +603,12 @@ printcpuinfo(void)
 	} else if (cpu_vendor_id == CPU_VENDOR_IBM) {
 		strcpy(cpu_model, "Blue Lightning CPU");
 	} else if (cpu_vendor_id == CPU_VENDOR_NSC) {
-		switch (cpu_id & 0xfff) {
+		switch (cpu_id & 0xff0) {
 		case 0x540:
 			strcpy(cpu_model, "Geode SC1100");
 			cpu = CPU_GEODE1100;
-			tsc_freq = 0;
+			if ((cpu_id & CPUID_STEPPING) == 0)
+				tsc_freq = 0;
 			break;
 		default:
 			strcpy(cpu_model, "Geode/NSC unknown");

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 22:56:00 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C391B1065676;
	Thu, 10 Mar 2011 22:56:00 +0000 (UTC) (envelope-from mdf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B06FE8FC15;
	Thu, 10 Mar 2011 22:56: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 p2AMu0n5058459;
	Thu, 10 Mar 2011 22:56:00 GMT (envelope-from mdf@svn.freebsd.org)
Received: (from mdf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AMu0ww058452;
	Thu, 10 Mar 2011 22:56:00 GMT (envelope-from mdf@svn.freebsd.org)
Message-Id: <201103102256.p2AMu0ww058452@svn.freebsd.org>
From: Matthew D Fleming 
Date: Thu, 10 Mar 2011 22:56: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: r219468 - in head/sys: amd64/amd64 ia64/ia64
	powerpc/aim sparc64/sparc64 sun4v/sun4v sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 22:56:01 -0000

Author: mdf
Date: Thu Mar 10 22:56:00 2011
New Revision: 219468
URL: http://svn.freebsd.org/changeset/base/219468

Log:
  Use MAXPATHLEN rather than the size of an extern array when copying the
  kernel name.  Also consistenly use strlcpy().
  
  Suggested by:	Warner Losh

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/ia64/ia64/machdep.c
  head/sys/powerpc/aim/machdep.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/sun4v/sun4v/machdep.c
  head/sys/sys/kernel.h

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Thu Mar 10 22:20:11 2011	(r219467)
+++ head/sys/amd64/amd64/machdep.c	Thu Mar 10 22:56:00 2011	(r219468)
@@ -1741,7 +1741,7 @@ hammer_time(u_int64_t modulep, u_int64_t
 
         env = getenv("kernelname");
 	if (env != NULL)
-		strlcpy(kernelname, env, sizeof(kernelname));
+		strlcpy(kernelname, env, MAXPATHLEN);
 
 #ifdef XENHVM
 	if (inw(0x10) == 0x49d2) {

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Thu Mar 10 22:20:11 2011	(r219467)
+++ head/sys/ia64/ia64/machdep.c	Thu Mar 10 22:56:00 2011	(r219468)
@@ -792,7 +792,7 @@ ia64_init(void)
 
 	p = getenv("kernelname");
 	if (p != NULL) {
-		strncpy(kernelname, p, sizeof(kernelname) - 1);
+		strlcpy(kernelname, p, MAXPATHLEN);
 		freeenv(p);
 	}
 

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Thu Mar 10 22:20:11 2011	(r219467)
+++ head/sys/powerpc/aim/machdep.c	Thu Mar 10 22:56:00 2011	(r219468)
@@ -540,7 +540,7 @@ powerpc_init(vm_offset_t startkernel, vm
 	 */
         env = getenv("kernelname");
         if (env != NULL) {
-		strlcpy(kernelname, env, sizeof(kernelname));
+		strlcpy(kernelname, env, MAXPATHLEN);
 		freeenv(env);
 	}
 

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Thu Mar 10 22:20:11 2011	(r219467)
+++ head/sys/sparc64/sparc64/machdep.c	Thu Mar 10 22:56:00 2011	(r219468)
@@ -532,7 +532,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 	init_param2(physmem);
 	env = getenv("kernelname");
 	if (env != NULL) {
-		strlcpy(kernelname, env, sizeof(kernelname));
+		strlcpy(kernelname, env, MAXPATHLEN);
 		freeenv(env);
 	}
 

Modified: head/sys/sun4v/sun4v/machdep.c
==============================================================================
--- head/sys/sun4v/sun4v/machdep.c	Thu Mar 10 22:20:11 2011	(r219467)
+++ head/sys/sun4v/sun4v/machdep.c	Thu Mar 10 22:56:00 2011	(r219468)
@@ -425,7 +425,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 
 	env = getenv("kernelname");
 	if (env != NULL) {
-		strlcpy(kernelname, env, sizeof(kernelname));
+		strlcpy(kernelname, env, MAXPATHLEN);
 		freeenv(env);
 	}
 

Modified: head/sys/sys/kernel.h
==============================================================================
--- head/sys/sys/kernel.h	Thu Mar 10 22:20:11 2011	(r219467)
+++ head/sys/sys/kernel.h	Thu Mar 10 22:56:00 2011	(r219468)
@@ -55,7 +55,7 @@
 /* Global variables for the kernel. */
 
 /* 1.1 */
-extern char kernelname[MAXPATHLEN];
+extern char kernelname[/*MAXPATHLEN*/];
 
 extern int tick;			/* usec per tick (1000000 / hz) */
 extern int hz;				/* system clock's frequency */

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 23:06:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7A099106564A;
	Thu, 10 Mar 2011 23:06:13 +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 683D58FC16;
	Thu, 10 Mar 2011 23:06:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2AN6DL7058697;
	Thu, 10 Mar 2011 23:06:13 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2AN6DOV058695;
	Thu, 10 Mar 2011 23:06:13 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103102306.p2AN6DOV058695@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 10 Mar 2011 23:06: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: r219469 - head/sys/x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 23:06:13 -0000

Author: jkim
Date: Thu Mar 10 23:06:13 2011
New Revision: 219469
URL: http://svn.freebsd.org/changeset/base/219469

Log:
  Turn off pointless P-state invariant TSC detection based on CPU model
  on a virtual machine.

Modified:
  head/sys/x86/x86/tsc.c

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c	Thu Mar 10 22:56:00 2011	(r219468)
+++ head/sys/x86/x86/tsc.c	Thu Mar 10 23:06:13 2011	(r219469)
@@ -105,20 +105,23 @@ init_TSC(void)
 
 	switch (cpu_vendor_id) {
 	case CPU_VENDOR_AMD:
-		if ((amd_pminfo & AMDPM_TSC_INVARIANT) ||
-		    CPUID_TO_FAMILY(cpu_id) >= 0x10)
+		if ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 ||
+		    (vm_guest == VM_GUEST_NO &&
+		    CPUID_TO_FAMILY(cpu_id) >= 0x10))
 			tsc_is_invariant = 1;
 		break;
 	case CPU_VENDOR_INTEL:
-		if ((amd_pminfo & AMDPM_TSC_INVARIANT) ||
-		    (CPUID_TO_FAMILY(cpu_id) == 0x6 &&
+		if ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 ||
+		    (vm_guest == VM_GUEST_NO &&
+		    ((CPUID_TO_FAMILY(cpu_id) == 0x6 &&
 		    CPUID_TO_MODEL(cpu_id) >= 0xe) ||
 		    (CPUID_TO_FAMILY(cpu_id) == 0xf &&
-		    CPUID_TO_MODEL(cpu_id) >= 0x3))
+		    CPUID_TO_MODEL(cpu_id) >= 0x3))))
 			tsc_is_invariant = 1;
 		break;
 	case CPU_VENDOR_CENTAUR:
-		if (CPUID_TO_FAMILY(cpu_id) == 0x6 &&
+		if (vm_guest == VM_GUEST_NO &&
+		    CPUID_TO_FAMILY(cpu_id) == 0x6 &&
 		    CPUID_TO_MODEL(cpu_id) >= 0xf &&
 		    (rdmsr(0x1203) & 0x100000000ULL) == 0)
 			tsc_is_invariant = 1;

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 23:20:32 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F153F106564A;
	Thu, 10 Mar 2011 23:20:32 +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 C5B2E8FC16;
	Thu, 10 Mar 2011 23:20: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 p2ANKWJ8059032;
	Thu, 10 Mar 2011 23:20:32 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ANKW68059029;
	Thu, 10 Mar 2011 23:20:32 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201103102320.p2ANKW68059029@svn.freebsd.org>
From: Gavin Atkinson 
Date: Thu, 10 Mar 2011 23:20: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: r219470 - head/share/misc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 23:20:33 -0000

Author: gavin
Date: Thu Mar 10 23:20:32 2011
New Revision: 219470
URL: http://svn.freebsd.org/changeset/base/219470

Log:
  Add a couple of nodes and edges in order to reduce the number of unattached
  committers in the rendered output.
  While here, add versus@ as being mentered by myself and fjoe@

Modified:
  head/share/misc/committers-doc.dot
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-doc.dot
==============================================================================
--- head/share/misc/committers-doc.dot	Thu Mar 10 23:06:13 2011	(r219469)
+++ head/share/misc/committers-doc.dot	Thu Mar 10 23:20:32 2011	(r219470)
@@ -58,7 +58,7 @@ delphij [label="Xin Li\ndelphij@FreeBSD.
 gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2007/02/02"]
 ganbold [label="Ganbold Tsagaankhuu\nganbold@FreeBSD.org\n2008/02/26"]
 gjb [label="Glen Barber\ngjb@FreeBSD.org\n2010/09/01"]
-
+hrs [label="Hiroki Sato\nhrs@FreeBSD.org\n2000/07/06"]
 jkois [label="Johann Kois\njkois@FreeBSD.org\n2004/11/11"]
 joel [label="Joel Dahl\njoel@FreeBSD.org\n2005/04/05"]
 keramida [label="Giorgos Keramidas\nkeramida@FreeBSD.org\n2001/10/12"]
@@ -102,6 +102,8 @@ gabor -> pgj
 gabor -> manolis
 gabor -> taras
 
+hrs -> ryusuke
+
 jesusr -> jcamou
 
 jim -> trhodes

Modified: head/share/misc/committers-src.dot
==============================================================================
--- head/share/misc/committers-src.dot	Thu Mar 10 23:06:13 2011	(r219469)
+++ head/share/misc/committers-src.dot	Thu Mar 10 23:20:32 2011	(r219470)
@@ -113,6 +113,7 @@ cognet [label="Olivier Houchard\ncognet@
 cokane [label="Coleman Kane\ncokane@FreeBSD.org\n2000/06/19"]
 cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"]
 csjp [label="Christian S.J. Peron\ncsjp@FreeBSD.org\n2004/05/04"]
+das [label="David Schultz\ndas@FreeBSD.org\n2003/02/21"]
 davidxu [label="David Xu\ndavidxu@FreeBSD.org\n2002/09/02"]
 dchagin [label="Dmitry Chagin\ndchagin@FreeBSD.org\n2009/02/28"]
 delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"]
@@ -333,8 +334,12 @@ emaste -> rstone
 
 emax -> markus
 
+fjoe -> versus
+
 gallatin -> ticso
 
+gavin -> versus
+
 gibbs -> mjacob
 gibbs -> njl
 
@@ -443,6 +448,8 @@ mav -> ae
 
 mdodd -> jake
 
+mike -> das
+
 mlaier -> benjsc
 mlaier -> dhartmei
 mlaier -> thompsa

From owner-svn-src-all@FreeBSD.ORG  Thu Mar 10 23:53:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A4A410656D5;
	Thu, 10 Mar 2011 23:53:02 +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 17A418FC18;
	Thu, 10 Mar 2011 23:53:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2ANr1OI059756;
	Thu, 10 Mar 2011 23:53:01 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2ANr1Jp059754;
	Thu, 10 Mar 2011 23:53:01 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201103102353.p2ANr1Jp059754@svn.freebsd.org>
From: Matt Jacob 
Date: Thu, 10 Mar 2011 23:53:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219471 - head/sys/dev/isp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 10 Mar 2011 23:53:02 -0000

Author: mjacob
Date: Thu Mar 10 23:53:01 2011
New Revision: 219471
URL: http://svn.freebsd.org/changeset/base/219471

Log:
  Add support QLE220 card- an 2500 lookalike.
  
  Obtained mostly from:	Roman && Konstantin
  MFC after:	1 week

Modified:
  head/sys/dev/isp/isp_pci.c

Modified: head/sys/dev/isp/isp_pci.c
==============================================================================
--- head/sys/dev/isp/isp_pci.c	Thu Mar 10 23:20:32 2011	(r219470)
+++ head/sys/dev/isp/isp_pci.c	Thu Mar 10 23:53:01 2011	(r219471)
@@ -272,6 +272,12 @@ static struct ispmdvec mdvec_2500 = {
 #define	PCI_PRODUCT_QLOGIC_ISP6322	0x6322
 #endif
 
+#ifndef        PCI_PRODUCT_QLOGIC_ISP5432
+#define        PCI_PRODUCT_QLOGIC_ISP5432      0x5432
+#endif
+
+#define        PCI_QLOGIC_ISP5432      \
+       ((PCI_PRODUCT_QLOGIC_ISP5432 << 16) | PCI_VENDOR_QLOGIC)
 
 #define	PCI_QLOGIC_ISP1020	\
 	((PCI_PRODUCT_QLOGIC_ISP1020 << 16) | PCI_VENDOR_QLOGIC)
@@ -412,6 +418,9 @@ isp_pci_probe(device_t dev)
 	case PCI_QLOGIC_ISP2532:
 		device_set_desc(dev, "Qlogic ISP 2532 PCI FC-AL Adapter");
 		break;
+	case PCI_QLOGIC_ISP5432:
+		device_set_desc(dev, "Qlogic ISP 5432 PCI FC-AL Adapter");
+		break;
 	case PCI_QLOGIC_ISP6312:
 		device_set_desc(dev, "Qlogic ISP 6312 PCI FC-AL Adapter");
 		break;
@@ -804,6 +813,12 @@ isp_pci_attach(device_t dev)
 		isp->isp_type = ISP_HA_FC_2500;
 		pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF;
 		break;
+	case PCI_QLOGIC_ISP5432:
+		did = 0x2500;
+		isp->isp_mdvec = &mdvec_2500;
+		isp->isp_type = ISP_HA_FC_2500;
+		pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF;
+		break;
 	default:
 		device_printf(dev, "unknown device type\n");
 		goto bad;

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 00:38:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B4BE1065672;
	Fri, 11 Mar 2011 00:38:07 +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 6ECA68FC0C;
	Fri, 11 Mar 2011 00:38: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 p2B0c7nc060851;
	Fri, 11 Mar 2011 00:38:07 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2B0c7CL060849;
	Fri, 11 Mar 2011 00:38:07 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201103110038.p2B0c7CL060849@svn.freebsd.org>
From: Xin LI 
Date: Fri, 11 Mar 2011 00:38: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: r219472 - head/contrib/libpcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 00:38:07 -0000

Author: delphij
Date: Fri Mar 11 00:38:07 2011
New Revision: 219472
URL: http://svn.freebsd.org/changeset/base/219472

Log:
  Merge my change against libpcap trunk revision
  c65292b04b98d6a76d58c5a54ca8f81463bf24de to support new SIOCGIFDESCR
  ioctl interface which was too late for libpcap 1.1.1.
  
  Reported by:	brucec
  Noticed by:	wxs

Modified:
  head/contrib/libpcap/inet.c

Modified: head/contrib/libpcap/inet.c
==============================================================================
--- head/contrib/libpcap/inet.c	Thu Mar 10 23:53:01 2011	(r219471)
+++ head/contrib/libpcap/inet.c	Fri Mar 11 00:38:07 2011	(r219472)
@@ -431,26 +431,54 @@ add_addr_to_iflist(pcap_if_t **alldevs, 
 	strlcpy(ifrdesc.ifr_name, name, sizeof ifrdesc.ifr_name);
 	s = socket(AF_INET, SOCK_DGRAM, 0);
 	if (s >= 0) {
+#ifdef __FreeBSD__
+		/*
+		 * On FreeBSD, if the buffer isn't big enough for the
+		 * description, the ioctl succeeds, but the description
+		 * isn't copied, ifr_buffer.length is set to the description
+		 * length, and ifr_buffer.buffer is set to NULL.
+		 */
 		for (;;) {
 			free(description);
 			if ((description = malloc(descrlen)) != NULL) {
-#ifdef __FreeBSD__
 				ifrdesc.ifr_buffer.buffer = description;
 				ifrdesc.ifr_buffer.length = descrlen;
-#else /* __FreeBSD__ */
-				ifrdesc.ifr_data = (caddr_t)description;
-#endif /* __FreeBSD__ */
-				if (ioctl(s, SIOCGIFDESCR, &ifrdesc) == 0)
-					break;
-#ifdef __FreeBSD__
-				else if (errno == ENAMETOOLONG)
-					descrlen = ifrdesc.ifr_buffer.length;
-#endif /* __FreeBSD__ */
-				else
+				if (ioctl(s, SIOCGIFDESCR, &ifrdesc) == 0) {
+					if (ifrdesc.ifr_buffer.buffer ==
+					    description)
+						break;
+					else
+						descrlen = ifrdesc.ifr_buffer.length;
+				} else {
+					/*
+					 * Failed to get interface description.
+					 */
+					free(description);
+					description = NULL;
 					break;
+				}
 			} else
 				break;
 		}
+#else /* __FreeBSD__ */
+		/*
+		 * The only other OS that currently supports
+		 * SIOCGIFDESCR is OpenBSD, and it has no way
+		 * to get the description length - it's clamped
+		 * to a maximum of IFDESCRSIZE.
+		 */
+		if ((description = malloc(descrlen)) != NULL) {
+			ifrdesc.ifr_data = (caddr_t)description;
+			if (ioctl(s, SIOCGIFDESCR, &ifrdesc) != 0) {
+				/*
+				 * Failed to get interface description.
+				 */
+				free(description);
+				description = NULL;
+			}
+		} else
+			break;
+#endif /* __FreeBSD__ */
 		close(s);
 		if (description != NULL && strlen(description) == 0) {
 			free(description);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 00:44:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 29A58106567D;
	Fri, 11 Mar 2011 00:44:33 +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 153ED8FC19;
	Fri, 11 Mar 2011 00:44: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 p2B0iWTw061032;
	Fri, 11 Mar 2011 00:44:32 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2B0iWKM061026;
	Fri, 11 Mar 2011 00:44:32 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103110044.p2B0iWKM061026@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 11 Mar 2011 00:44:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219473 - in head/sys: amd64/amd64 contrib/altq/altq
	i386/i386 pc98/pc98 x86/x86
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 00:44:33 -0000

Author: jkim
Date: Fri Mar 11 00:44:32 2011
New Revision: 219473
URL: http://svn.freebsd.org/changeset/base/219473

Log:
  Add a tunable "machdep.disable_tsc" to turn off TSC.  Specifically, it turns
  off boot-time CPU frequency calibration, DELAY(9) with TSC, and using TSC as
  a CPU ticker.  Note tsc_present does not change by this tunable.

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/contrib/altq/altq/altq_subr.c
  head/sys/i386/i386/machdep.c
  head/sys/pc98/pc98/machdep.c
  head/sys/x86/x86/tsc.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Fri Mar 11 00:38:07 2011	(r219472)
+++ head/sys/amd64/amd64/machdep.c	Fri Mar 11 00:44:32 2011	(r219473)
@@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SMP
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -544,20 +547,22 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 		return (EINVAL);
 
 	/* If TSC is P-state invariant, DELAY(9) based logic fails. */
-	if (tsc_is_invariant)
+	if (tsc_is_invariant && tsc_freq != 0)
 		return (EOPNOTSUPP);
 
 	/* If we're booting, trust the rate calibrated moments ago. */
-	if (cold) {
+	if (cold && tsc_freq != 0) {
 		*rate = tsc_freq;
 		return (0);
 	}
 
 #ifdef SMP
-	/* Schedule ourselves on the indicated cpu. */
-	thread_lock(curthread);
-	sched_bind(curthread, cpu_id);
-	thread_unlock(curthread);
+	if (smp_cpus > 1) {
+		/* Schedule ourselves on the indicated cpu. */
+		thread_lock(curthread);
+		sched_bind(curthread, cpu_id);
+		thread_unlock(curthread);
+	}
 #endif
 
 	/* Calibrate by measuring a short delay. */
@@ -568,12 +573,24 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 	intr_restore(reg);
 
 #ifdef SMP
-	thread_lock(curthread);
-	sched_unbind(curthread);
-	thread_unlock(curthread);
+	if (smp_cpus > 1) {
+		thread_lock(curthread);
+		sched_unbind(curthread);
+		thread_unlock(curthread);
+	}
 #endif
 
-	*rate = (tsc2 - tsc1) * 1000;
+	tsc2 -= tsc1;
+	if (tsc_freq != 0) {
+		*rate = tsc2 * 1000;
+		return (0);
+	}
+
+	/*
+	 * Subtract 0.5% of the total.  Empirical testing has shown that
+	 * overhead in DELAY() works out to approximately this value.
+	 */
+	*rate = tsc2 * 1000 - tsc2 * 5;
 	return (0);
 }
 

Modified: head/sys/contrib/altq/altq/altq_subr.c
==============================================================================
--- head/sys/contrib/altq/altq/altq_subr.c	Fri Mar 11 00:38:07 2011	(r219472)
+++ head/sys/contrib/altq/altq/altq_subr.c	Fri Mar 11 00:44:32 2011	(r219473)
@@ -78,10 +78,10 @@
 #include 
 #endif
 #if defined(__amd64__) || defined(__i386__)
+#include 		/* for cpu_feature or tsc_present */
 #include 		/* for pentium tsc */
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 #include 		/* for CPUID_TSC */
-#include 		/* for cpu_feature */
 #endif
 #endif /* __amd64 || __i386__ */
 
@@ -927,7 +927,7 @@ init_machclk_setup(void)
 #if defined(__amd64__) || defined(__i386__)
 	/* check if TSC is available */
 #ifdef __FreeBSD__
-	if (tsc_freq == 0)
+	if (!tsc_present || tsc_freq == 0)
 #else
 	if ((cpu_feature & CPUID_TSC) == 0)
 #endif

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Fri Mar 11 00:38:07 2011	(r219472)
+++ head/sys/i386/i386/machdep.c	Fri Mar 11 00:44:32 2011	(r219473)
@@ -79,6 +79,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SMP
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -1142,20 +1145,22 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 		return (EOPNOTSUPP);
 
 	/* If TSC is P-state invariant, DELAY(9) based logic fails. */
-	if (tsc_is_invariant)
+	if (tsc_is_invariant && tsc_freq != 0)
 		return (EOPNOTSUPP);
 
 	/* If we're booting, trust the rate calibrated moments ago. */
-	if (cold) {
+	if (cold && tsc_freq != 0) {
 		*rate = tsc_freq;
 		return (0);
 	}
 
 #ifdef SMP
-	/* Schedule ourselves on the indicated cpu. */
-	thread_lock(curthread);
-	sched_bind(curthread, cpu_id);
-	thread_unlock(curthread);
+	if (smp_cpus > 1) {
+		/* Schedule ourselves on the indicated cpu. */
+		thread_lock(curthread);
+		sched_bind(curthread, cpu_id);
+		thread_unlock(curthread);
+	}
 #endif
 
 	/* Calibrate by measuring a short delay. */
@@ -1166,9 +1171,11 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 	intr_restore(reg);
 
 #ifdef SMP
-	thread_lock(curthread);
-	sched_unbind(curthread);
-	thread_unlock(curthread);
+	if (smp_cpus > 1) {
+		thread_lock(curthread);
+		sched_unbind(curthread);
+		thread_unlock(curthread);
+	}
 #endif
 
 	tsc2 -= tsc1;

Modified: head/sys/pc98/pc98/machdep.c
==============================================================================
--- head/sys/pc98/pc98/machdep.c	Fri Mar 11 00:38:07 2011	(r219472)
+++ head/sys/pc98/pc98/machdep.c	Fri Mar 11 00:44:32 2011	(r219473)
@@ -77,6 +77,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SMP
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -1077,16 +1080,18 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 		return (EOPNOTSUPP);
 
 	/* If we're booting, trust the rate calibrated moments ago. */
-	if (cold) {
+	if (cold && tsc_freq != 0) {
 		*rate = tsc_freq;
 		return (0);
 	}
 
 #ifdef SMP
-	/* Schedule ourselves on the indicated cpu. */
-	thread_lock(curthread);
-	sched_bind(curthread, cpu_id);
-	thread_unlock(curthread);
+	if (smp_cpus > 1) {
+		/* Schedule ourselves on the indicated cpu. */
+		thread_lock(curthread);
+		sched_bind(curthread, cpu_id);
+		thread_unlock(curthread);
+	}
 #endif
 
 	/* Calibrate by measuring a short delay. */
@@ -1097,9 +1102,11 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 	intr_restore(reg);
 
 #ifdef SMP
-	thread_lock(curthread);
-	sched_unbind(curthread);
-	thread_unlock(curthread);
+	if (smp_cpus > 1) {
+		thread_lock(curthread);
+		sched_unbind(curthread);
+		thread_unlock(curthread);
+	}
 #endif
 
 	tsc2 -= tsc1;

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c	Fri Mar 11 00:38:07 2011	(r219472)
+++ head/sys/x86/x86/tsc.c	Fri Mar 11 00:44:32 2011	(r219473)
@@ -63,6 +63,11 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, 
 TUNABLE_INT("kern.timecounter.smp_tsc", &smp_tsc);
 #endif
 
+static int	tsc_disabled;
+SYSCTL_INT(_machdep, OID_AUTO, disable_tsc, CTLFLAG_RDTUN, &tsc_disabled, 0,
+    "Disable x86 Time Stamp Counter");
+TUNABLE_INT("machdep.disable_tsc", &tsc_disabled);
+
 static void tsc_freq_changed(void *arg, const struct cf_level *level,
     int status);
 static void tsc_freq_changing(void *arg, const struct cf_level *level,
@@ -84,12 +89,11 @@ init_TSC(void)
 {
 	u_int64_t tscval[2];
 
-	if (cpu_feature & CPUID_TSC)
-		tsc_present = 1;
-	else
-		tsc_present = 0;
+	if ((cpu_feature & CPUID_TSC) == 0)
+		return;
+	tsc_present = 1;
 
-	if (!tsc_present) 
+	if (tsc_disabled)
 		return;
 
 	if (bootverbose)
@@ -151,7 +155,7 @@ void
 init_TSC_tc(void)
 {
 
-	if (!tsc_present) 
+	if (!tsc_present || tsc_disabled)
 		return;
 
 	/*
@@ -248,7 +252,7 @@ tsc_freq_changed(void *arg, const struct
 {
 
 	/* If there was an error during the transition, don't do anything. */
-	if (status != 0)
+	if (tsc_disabled || status != 0)
 		return;
 
 	/* Total setting for this level gives the new frequency in MHz. */

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 01:31:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CE4B1065672;
	Fri, 11 Mar 2011 01:31:58 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au
	[211.29.132.189])
	by mx1.freebsd.org (Postfix) with ESMTP id DBBA08FC0A;
	Fri, 11 Mar 2011 01:31:57 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2B1VrO5007662
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 11 Mar 2011 12:31:55 +1100
Date: Fri, 11 Mar 2011 12:31:53 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Roman Divacky 
In-Reply-To: <201103101640.p2AGeDe4049512@svn.freebsd.org>
Message-ID: <20110311112515.M1003@besplex.bde.org>
References: <201103101640.p2AGeDe4049512@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: r219452 - in head/sys/boot: common i386/boot2
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 01:31:58 -0000

On Thu, 10 Mar 2011, Roman Divacky wrote:

> Log:
>  Some more shrinking.
> ...
>     o    kname is explicitly initialized in main() as BSS
>          in boot2 is not zeroed

Not zeroing the bss is very fragile and broken, and would save a negative
amount of space once other bugs are fixed:
- many other variables depend on the BSS being zeroed.  One is the critical
   `opts' variable -- this is only accessed by read-modify-write instructions
   which always read garbage unless the BSS is zeroed.
- -fno-zero-initialized-in-bss is missing in CFLAGS.  This confuses naive
   compilers into believing that the BSS actually works so that it is safe
   for them to translate bogus explicit initializations to zero like
   `char *kname = NULL;' from zero-data in the data section to
   implicitly-zeroed data in the BSS.
- fixing CFLAGS gives no change in boot2.o, except in the old version with
   "char *kname = NULL;" it moves kname from the BSS to the data section,
   thus expanding boot2.o by 4 bytes.
- initializing kname in main() takes a lot of code (10 bytes).  10 is
   because the code is pessimized for space.  It is "movl $0,kname".
   Good code in main() would take 7 bytes for the first zero-initialized
   variable and 5 bytes for each additional one
   ("xorl %eax,%eax; movl %eax,kname; movl %eax,opts; ...").  But this
   would still be bad code.  It takes 15 bytes for 2 variables and may miss
   many.  Initializing the whole BSS would takes at most 14 bytes for
   "movl $edata,%edi; movl $end-edata,%ecx; xorl %eax,%eax; rep stosb"
   (less if %eax is already 0 (only need %al) or the 0 in it or %ecx can
   be reused; less if the high word of %edi or %ecx is already 0 so that
   only the low word needs to be loaded).

Bruce

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 03:09:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08967106564A;
	Fri, 11 Mar 2011 03:09:36 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au
	[211.29.132.183])
	by mx1.freebsd.org (Postfix) with ESMTP id 97F098FC12;
	Fri, 11 Mar 2011 03:09:35 +0000 (UTC)
Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80])
	by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p2B39Urs017224
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 11 Mar 2011 14:09:32 +1100
Date: Fri, 11 Mar 2011 14:09:30 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Matthew D Fleming 
In-Reply-To: <201103102256.p2AMu0ww058452@svn.freebsd.org>
Message-ID: <20110311140109.L1003@besplex.bde.org>
References: <201103102256.p2AMu0ww058452@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: r219468 - in head/sys: amd64/amd64 ia64/ia64
 powerpc/aim sparc64/sparc64 sun4v/sun4v sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 03:09:36 -0000

On Thu, 10 Mar 2011, Matthew D Fleming wrote:

> Log:
>  Use MAXPATHLEN rather than the size of an extern array when copying the
>  kernel name.  Also consistenly use strlcpy().
>
>  Suggested by:	Warner Losh

Seems backwards to me.

> Modified: head/sys/amd64/amd64/machdep.c
> ==============================================================================
> --- head/sys/amd64/amd64/machdep.c	Thu Mar 10 22:20:11 2011	(r219467)
> +++ head/sys/amd64/amd64/machdep.c	Thu Mar 10 22:56:00 2011	(r219468)
> @@ -1741,7 +1741,7 @@ hammer_time(u_int64_t modulep, u_int64_t
>
>         env = getenv("kernelname");
> 	if (env != NULL)
> -		strlcpy(kernelname, env, sizeof(kernelname));
> +		strlcpy(kernelname, env, MAXPATHLEN);
>
> #ifdef XENHVM
> 	if (inw(0x10) == 0x49d2) {
>

The strlcpy() won't save you if the size of the array changes, since the
size is now hard-coded.

> ...
> Modified: head/sys/sys/kernel.h
> ==============================================================================
> --- head/sys/sys/kernel.h	Thu Mar 10 22:20:11 2011	(r219467)
> +++ head/sys/sys/kernel.h	Thu Mar 10 22:56:00 2011	(r219468)
> @@ -55,7 +55,7 @@
> /* Global variables for the kernel. */
>
> /* 1.1 */
> -extern char kernelname[MAXPATHLEN];
> +extern char kernelname[/*MAXPATHLEN*/];
>
> extern int tick;			/* usec per tick (1000000 / hz) */
> extern int hz;				/* system clock's frequency */
>

This commit seems to be part of reducing namespace pollution, but MAXPATHLEN
is always available in the kernel since it is in  which is a
prerequisite for almost all kernel headers.  This is one reason why PATH_MAX
is spelled MAXPATHLEN in the kernel.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 03:46:28 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55A511065673;
	Fri, 11 Mar 2011 03:46:28 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 44FFA8FC1D;
	Fri, 11 Mar 2011 03:46: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 p2B3kSpU064962;
	Fri, 11 Mar 2011 03:46:28 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2B3kSGj064960;
	Fri, 11 Mar 2011 03:46:28 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103110346.p2B3kSGj064960@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 11 Mar 2011 03:46: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: r219474 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 03:46:28 -0000

Author: adrian
Date: Fri Mar 11 03:46:27 2011
New Revision: 219474
URL: http://svn.freebsd.org/changeset/base/219474

Log:
  Don't call ar5416SetTransmitPower() directly from ar5416SetTxPowerLimit();
  this is incorrect for Kite (AR9285) and any future chipsets that
  override the EEPROM related routines.
  
  It meant that a direct call to set the TX power would call the v14 EEPROM
  AR5416/AR9280 calibration routines, rather than the v4k EEPROM routines
  for the AR9285. It thus read the incorrect values from the EEPROM and
  programmed garbage PDADC and TX power values into the hardware.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Mar 11 00:44:32 2011	(r219473)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Mar 11 03:46:27 2011	(r219474)
@@ -405,7 +405,7 @@ ar5416ChannelChange(struct ath_hal *ah, 
 		return AH_FALSE;
 
 	/* 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__);
 		return AH_FALSE;
@@ -748,7 +748,7 @@ ar5416SetTxPowerLimit(struct ath_hal *ah
 	uint16_t dummyXpdGains[2];
 
 	AH_PRIVATE(ah)->ah_powerLimit = AH_MIN(limit, MAX_RATE_POWER);
-	return ar5416SetTransmitPower(ah, AH_PRIVATE(ah)->ah_curchan,
+	return ah->ah_setTxPower(ah, AH_PRIVATE(ah)->ah_curchan,
 			dummyXpdGains);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 04:31:01 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1AD96106564A;
	Fri, 11 Mar 2011 04:31:01 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A1F38FC13;
	Fri, 11 Mar 2011 04:31: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 p2B4V0cs065859;
	Fri, 11 Mar 2011 04:31:00 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2B4V0mt065857;
	Fri, 11 Mar 2011 04:31:00 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103110431.p2B4V0mt065857@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 11 Mar 2011 04:31: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: r219475 - head/sys/dev/ath/ath_hal/ar9002
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 04:31:01 -0000

Author: adrian
Date: Fri Mar 11 04:31:00 2011
New Revision: 219475
URL: http://svn.freebsd.org/changeset/base/219475

Log:
  Bring over the same fix from the AR5416 PDADC calibration code.
  
  The ath9k driver has a unified boundary/pdadc function, whereas
  ours is split into two (one for each EEPROM type.) This is why
  the AR9280 check is done here where we could safely assume it'll
  always be AR9280 or later.

Modified:
  head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c	Fri Mar 11 03:46:27 2011	(r219474)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c	Fri Mar 11 04:31:00 2011	(r219475)
@@ -727,7 +727,10 @@ ar9285GetGainBoundariesAndPdadcs(struct 
 
         /* Find starting index for this pdGain */
         if (i == 0) {
-            ss = 0; /* for the first pdGain, start from index 0 */
+            if (AR_SREV_MERLIN_20_OR_LATER(ah))
+                ss = (int16_t)(0 - (minPwrT4[i] / 2));
+            else
+                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);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 07:07:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0E81C106566C;
	Fri, 11 Mar 2011 07:07:49 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F04B28FC0A;
	Fri, 11 Mar 2011 07:07: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 p2B77mMQ069039;
	Fri, 11 Mar 2011 07:07:48 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2B77mYx069034;
	Fri, 11 Mar 2011 07:07:48 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201103110707.p2B77mYx069034@svn.freebsd.org>
From: Alan Cox 
Date: Fri, 11 Mar 2011 07:07: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: r219476 - head/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 07:07:49 -0000

Author: alc
Date: Fri Mar 11 07:07:48 2011
New Revision: 219476
URL: http://svn.freebsd.org/changeset/base/219476

Log:
  Eliminate duplication of the fake page code and zone by the device and sg
  pagers.
  
  Reviewed by:	jhb

Modified:
  head/sys/vm/device_pager.c
  head/sys/vm/sg_pager.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/device_pager.c
==============================================================================
--- head/sys/vm/device_pager.c	Fri Mar 11 04:31:00 2011	(r219475)
+++ head/sys/vm/device_pager.c	Fri Mar 11 07:07:48 2011	(r219476)
@@ -67,13 +67,6 @@ static struct pagerlst dev_pager_object_
 /* protect list manipulation */
 static struct mtx dev_pager_mtx;
 
-
-static uma_zone_t fakepg_zone;
-
-static vm_page_t dev_pager_getfake(vm_paddr_t, vm_memattr_t);
-static void dev_pager_putfake(vm_page_t);
-static void dev_pager_updatefake(vm_page_t, vm_paddr_t, vm_memattr_t);
-
 struct pagerops devicepagerops = {
 	.pgo_init =	dev_pager_init,
 	.pgo_alloc =	dev_pager_alloc,
@@ -88,9 +81,6 @@ dev_pager_init()
 {
 	TAILQ_INIT(&dev_pager_object_list);
 	mtx_init(&dev_pager_mtx, "dev_pager list", NULL, MTX_DEF);
-	fakepg_zone = uma_zcreate("DP fakepg", sizeof(struct vm_page),
-	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
-	    UMA_ZONE_NOFREE|UMA_ZONE_VM); 
 }
 
 /*
@@ -199,7 +189,7 @@ dev_pager_dealloc(object)
 	 */
 	while ((m = TAILQ_FIRST(&object->un_pager.devp.devp_pglist)) != NULL) {
 		TAILQ_REMOVE(&object->un_pager.devp.devp_pglist, m, pageq);
-		dev_pager_putfake(m);
+		vm_page_putfake(m);
 	}
 }
 
@@ -250,7 +240,7 @@ dev_pager_getpages(object, m, count, req
 		 * the new physical address.
 		 */
 		VM_OBJECT_LOCK(object);
-		dev_pager_updatefake(page, paddr, memattr);
+		vm_page_updatefake(page, paddr, memattr);
 		if (count > 1) {
 
 			for (i = 0; i < count; i++) {
@@ -266,7 +256,7 @@ dev_pager_getpages(object, m, count, req
 		 * Replace the passed in reqpage page with our own fake page and
 		 * free up the all of the original pages.
 		 */
-		page = dev_pager_getfake(paddr, memattr);
+		page = vm_page_getfake(paddr, memattr);
 		VM_OBJECT_LOCK(object);
 		TAILQ_INSERT_TAIL(&object->un_pager.devp.devp_pglist, page, pageq);
 		for (i = 0; i < count; i++) {
@@ -305,51 +295,3 @@ dev_pager_haspage(object, pindex, before
 		*after = 0;
 	return (TRUE);
 }
-
-/*
- * Create a fictitious page with the specified physical address and memory
- * attribute.  The memory attribute is the only the machine-dependent aspect
- * of a fictitious page that must be initialized.
- */
-static vm_page_t
-dev_pager_getfake(vm_paddr_t paddr, vm_memattr_t memattr)
-{
-	vm_page_t m;
-
-	m = uma_zalloc(fakepg_zone, M_WAITOK | M_ZERO);
-	m->phys_addr = paddr;
-	m->queue = PQ_NONE;
-	/* Fictitious pages don't use "segind". */
-	m->flags = PG_FICTITIOUS;
-	/* Fictitious pages don't use "order" or "pool". */
-	m->oflags = VPO_BUSY;
-	m->wire_count = 1;
-	pmap_page_set_memattr(m, memattr);
-	return (m);
-}
-
-/*
- * Release a fictitious page.
- */
-static void
-dev_pager_putfake(vm_page_t m)
-{
-
-	if (!(m->flags & PG_FICTITIOUS))
-		panic("dev_pager_putfake: bad page");
-	uma_zfree(fakepg_zone, m);
-}
-
-/*
- * Update the given fictitious page to the specified physical address and
- * memory attribute.
- */
-static void
-dev_pager_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr)
-{
-
-	if (!(m->flags & PG_FICTITIOUS))
-		panic("dev_pager_updatefake: bad page");
-	m->phys_addr = paddr;
-	pmap_page_set_memattr(m, memattr);
-}

Modified: head/sys/vm/sg_pager.c
==============================================================================
--- head/sys/vm/sg_pager.c	Fri Mar 11 04:31:00 2011	(r219475)
+++ head/sys/vm/sg_pager.c	Fri Mar 11 07:07:48 2011	(r219476)
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static void sg_pager_init(void);
 static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t,
     vm_ooffset_t, struct ucred *);
 static void sg_pager_dealloc(vm_object_t);
@@ -53,13 +52,7 @@ static void sg_pager_putpages(vm_object_
 static boolean_t sg_pager_haspage(vm_object_t, vm_pindex_t, int *,
 		int *);
 
-static uma_zone_t fakepg_zone;
-
-static vm_page_t sg_pager_getfake(vm_paddr_t, vm_memattr_t);
-static void sg_pager_putfake(vm_page_t);
-
 struct pagerops sgpagerops = {
-	.pgo_init =	sg_pager_init,
 	.pgo_alloc =	sg_pager_alloc,
 	.pgo_dealloc =	sg_pager_dealloc,
 	.pgo_getpages =	sg_pager_getpages,
@@ -67,15 +60,6 @@ struct pagerops sgpagerops = {
 	.pgo_haspage =	sg_pager_haspage,
 };
 
-static void
-sg_pager_init(void)
-{
-
-	fakepg_zone = uma_zcreate("SG fakepg", sizeof(struct vm_page),
-	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
-	    UMA_ZONE_NOFREE|UMA_ZONE_VM); 
-}
-
 static vm_object_t
 sg_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
     vm_ooffset_t foff, struct ucred *cred)
@@ -138,7 +122,7 @@ sg_pager_dealloc(vm_object_t object)
 	 */
 	while ((m = TAILQ_FIRST(&object->un_pager.sgp.sgp_pglist)) != 0) {
 		TAILQ_REMOVE(&object->un_pager.sgp.sgp_pglist, m, pageq);
-		sg_pager_putfake(m);
+		vm_page_putfake(m);
 	}
 	
 	sg = object->handle;
@@ -193,7 +177,7 @@ sg_pager_getpages(vm_object_t object, vm
 	    ("backing page for SG is fake"));
 
 	/* Construct a new fake page. */
-	page = sg_pager_getfake(paddr, memattr);
+	page = vm_page_getfake(paddr, memattr);
 	VM_OBJECT_LOCK(object);
 	TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, pageq);
 
@@ -229,34 +213,3 @@ sg_pager_haspage(vm_object_t object, vm_
 		*after = 0;
 	return (TRUE);
 }
-
-/*
- * Create a fictitious page with the specified physical address and memory
- * attribute.  The memory attribute is the only the machine-dependent aspect
- * of a fictitious page that must be initialized.
- */
-static vm_page_t
-sg_pager_getfake(vm_paddr_t paddr, vm_memattr_t memattr)
-{
-	vm_page_t m;
-
-	m = uma_zalloc(fakepg_zone, M_WAITOK | M_ZERO);
-	m->phys_addr = paddr;
-	m->queue = PQ_NONE;
-	/* Fictitious pages don't use "segind". */
-	m->flags = PG_FICTITIOUS;
-	/* Fictitious pages don't use "order" or "pool". */
-	m->oflags = VPO_BUSY;
-	m->wire_count = 1;
-	pmap_page_set_memattr(m, memattr);
-	return (m);
-}
-
-static void
-sg_pager_putfake(vm_page_t m)
-{
-
-	if (!(m->flags & PG_FICTITIOUS))
-		panic("sg_pager_putfake: bad page");
-	uma_zfree(fakepg_zone, m);
-}

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Fri Mar 11 04:31:00 2011	(r219475)
+++ head/sys/vm/vm_page.c	Fri Mar 11 07:07:48 2011	(r219476)
@@ -156,9 +156,22 @@ static int pa_tryrelock_restart;
 SYSCTL_INT(_vm, OID_AUTO, tryrelock_restart, CTLFLAG_RD,
     &pa_tryrelock_restart, 0, "Number of tryrelock restarts");
 
+static uma_zone_t fakepg_zone;
+
 static void vm_page_clear_dirty_mask(vm_page_t m, int pagebits);
 static void vm_page_queue_remove(int queue, vm_page_t m);
 static void vm_page_enqueue(int queue, vm_page_t m);
+static void vm_page_init_fakepg(void *dummy);
+
+SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init_fakepg, NULL);
+
+static void
+vm_page_init_fakepg(void *dummy)
+{
+
+	fakepg_zone = uma_zcreate("fakepg", sizeof(struct vm_page), NULL, NULL,
+	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM); 
+}
 
 /* Make sure that u_long is at least 64 bits when PAGE_SIZE is 32K. */
 #if PAGE_SIZE == 32768
@@ -606,6 +619,60 @@ vm_page_unhold_pages(vm_page_t *ma, int 
 }
 
 /*
+ *	vm_page_getfake:
+ *
+ *	Create a fictitious page with the specified physical address and
+ *	memory attribute.  The memory attribute is the only the machine-
+ *	dependent aspect of a fictitious page that must be initialized.
+ */
+vm_page_t
+vm_page_getfake(vm_paddr_t paddr, vm_memattr_t memattr)
+{
+	vm_page_t m;
+
+	m = uma_zalloc(fakepg_zone, M_WAITOK | M_ZERO);
+	m->phys_addr = paddr;
+	m->queue = PQ_NONE;
+	/* Fictitious pages don't use "segind". */
+	m->flags = PG_FICTITIOUS;
+	/* Fictitious pages don't use "order" or "pool". */
+	m->oflags = VPO_BUSY;
+	m->wire_count = 1;
+	pmap_page_set_memattr(m, memattr);
+	return (m);
+}
+
+/*
+ *	vm_page_putfake:
+ *
+ *	Release a fictitious page.
+ */
+void
+vm_page_putfake(vm_page_t m)
+{
+
+	KASSERT((m->flags & PG_FICTITIOUS) != 0,
+	    ("vm_page_putfake: bad page %p", m));
+	uma_zfree(fakepg_zone, m);
+}
+
+/*
+ *	vm_page_updatefake:
+ *
+ *	Update the given fictitious page to the specified physical address and
+ *	memory attribute.
+ */
+void
+vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr)
+{
+
+	KASSERT((m->flags & PG_FICTITIOUS) != 0,
+	    ("vm_page_updatefake: bad page %p", m));
+	m->phys_addr = paddr;
+	pmap_page_set_memattr(m, memattr);
+}
+
+/*
  *	vm_page_free:
  *
  *	Free a page.

Modified: head/sys/vm/vm_page.h
==============================================================================
--- head/sys/vm/vm_page.h	Fri Mar 11 04:31:00 2011	(r219475)
+++ head/sys/vm/vm_page.h	Fri Mar 11 07:07:48 2011	(r219476)
@@ -352,11 +352,13 @@ int vm_page_try_to_free (vm_page_t);
 void vm_page_dontneed(vm_page_t);
 void vm_page_deactivate (vm_page_t);
 vm_page_t vm_page_find_least(vm_object_t, vm_pindex_t);
+vm_page_t vm_page_getfake(vm_paddr_t paddr, vm_memattr_t memattr);
 void vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t);
 vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t);
 vm_page_t vm_page_next(vm_page_t m);
 int vm_page_pa_tryrelock(pmap_t, vm_paddr_t, vm_paddr_t *);
 vm_page_t vm_page_prev(vm_page_t m);
+void vm_page_putfake(vm_page_t m);
 void vm_page_remove (vm_page_t);
 void vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t);
 void vm_page_requeue(vm_page_t m);
@@ -366,6 +368,7 @@ vm_page_t vm_page_splay(vm_pindex_t, vm_
 vm_offset_t vm_page_startup(vm_offset_t vaddr);
 void vm_page_unhold_pages(vm_page_t *ma, int count);
 void vm_page_unwire (vm_page_t, int);
+void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr);
 void vm_page_wire (vm_page_t);
 void vm_page_set_validclean (vm_page_t, int, int);
 void vm_page_clear_dirty (vm_page_t, int, int);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 10:11:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 480811065675;
	Fri, 11 Mar 2011 10:11:23 +0000 (UTC)
	(envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1ADD58FC17;
	Fri, 11 Mar 2011 10:11: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 p2BABN8S073146;
	Fri, 11 Mar 2011 10:11:23 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BABMvb073143;
	Fri, 11 Mar 2011 10:11:22 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201103111011.p2BABMvb073143@svn.freebsd.org>
From: Mikolaj Golub 
Date: Fri, 11 Mar 2011 10:11: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: r219478 - in head: share/misc usr.bin/calendar/calendars
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 10:11:23 -0000

Author: trociny
Date: Fri Mar 11 10:11:22 2011
New Revision: 219478
URL: http://svn.freebsd.org/changeset/base/219478

Log:
  Add myself to calendar.freebsd and committers-src.dot.
  
  Approved by:	pjd (mentor)

Modified:
  head/share/misc/committers-src.dot
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/share/misc/committers-src.dot
==============================================================================
--- head/share/misc/committers-src.dot	Fri Mar 11 08:59:40 2011	(r219477)
+++ head/share/misc/committers-src.dot	Fri Mar 11 10:11:22 2011	(r219478)
@@ -235,6 +235,7 @@ ticso [label="Bernd Walter\nticso@FreeBS
 tijl [label="Tijl Coosemans\ntijl@FreeBSD.org\n2010/07/16"]
 trasz [label="Edward Tomasz Napierala\ntrasz@FreeBSD.org\n2008/08/22"]
 trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2002/05/28"]
+trociny [label="Mikolaj Golub\ntrociny@FreeBSD.org\n2011/03/10"]
 tuexen [label="Michael Tuexen\ntuexen@FreeBSD.org\n2009/06/06"]
 ume [label="Hajimu UMEMOTO\nume@FreeBSD.org\n2000/02/26"]
 uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2010/01/28"]
@@ -435,6 +436,7 @@ kib -> rdivacky
 kib -> rmacklem
 kib -> stas
 kib -> tijl
+kib -> trociny
 
 kmacy -> lstewart
 
@@ -488,6 +490,7 @@ philip -> uqs
 
 pjd -> kib
 pjd -> lulf
+pjd -> trociny
 
 rgrimes -> markm
 

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==============================================================================
--- head/usr.bin/calendar/calendars/calendar.freebsd	Fri Mar 11 08:59:40 2011	(r219477)
+++ head/usr.bin/calendar/calendars/calendar.freebsd	Fri Mar 11 10:11:22 2011	(r219478)
@@ -231,6 +231,7 @@
 08/06	Anton Berezin  born in Dnepropetrovsk, Ukraine, 1970
 08/06	John-Mark Gurney  born in Detroit, Michigan, United States, 1978
 08/07	Jonathan Mini  born in San Mateo, California, United States, 1979
+08/08	Mikolaj Golub  born in Kharkov, USSR, 1977
 08/10	Peter Pentchev  born in Sofia, Bulgaria, 1977
 08/12	Joe Marcus Clarke  born in Lakeland, Florida, United States, 1976
 08/12	Max Brazhnikov  born in Leningradskaya, Russian Federation, 1979

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 11:07:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55EBE106567B;
	Fri, 11 Mar 2011 11:07:54 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 417518FC24;
	Fri, 11 Mar 2011 11:07: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 p2BB7sg2076201;
	Fri, 11 Mar 2011 11:07:54 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BB7s17076197;
	Fri, 11 Mar 2011 11:07:54 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103111107.p2BB7s17076197@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 11 Mar 2011 11:07: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: r219479 - in head/sys/dev/ath/ath_hal: ar5416 ar9002
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 11:07:54 -0000

Author: adrian
Date: Fri Mar 11 11:07:53 2011
New Revision: 219479
URL: http://svn.freebsd.org/changeset/base/219479

Log:
  Remove the ar9285FillVpdTable() and just use ar5416FillVpdTable().

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416.h
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416.h	Fri Mar 11 10:11:22 2011	(r219478)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h	Fri Mar 11 11:07:53 2011	(r219479)
@@ -233,6 +233,9 @@ extern	void ar5416RestoreChainMask(struc
 /* TX power setup related routines in ar5416_reset.c */
 extern	HAL_BOOL getLowerUpperIndex(uint8_t target, uint8_t *pList,
 	uint16_t listSize,  uint16_t *indexL, uint16_t *indexR);
+extern	HAL_BOOL ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax,
+	uint8_t *pPwrList, uint8_t *pVpdList, uint16_t numIntercepts,
+	uint8_t *pRetVpdList);
 extern	void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah,
 	const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet,
 	uint8_t * bChans, uint16_t availPiers,

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Mar 11 10:11:22 2011	(r219478)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Mar 11 11:07:53 2011	(r219479)
@@ -67,9 +67,6 @@ static uint16_t ar5416GetMaxEdgePower(ui
 static int16_t interpolate(uint16_t target, uint16_t srcLeft,
 	uint16_t srcRight, int16_t targetLeft, int16_t targetRight);
 static void ar5416Set11nRegs(struct ath_hal *ah, const struct ieee80211_channel *chan);
-static HAL_BOOL ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax,
-	uint8_t *pPwrList, uint8_t *pVpdList,
-	uint16_t numIntercepts, uint8_t *pRetVpdList);
 
 /*
  * Places the device in and out of reset and then places sane
@@ -2350,7 +2347,7 @@ getLowerUpperIndex(uint8_t target, uint8
  * Fill the Vpdlist for indices Pmax-Pmin
  * Note: pwrMin, pwrMax and Vpdlist are all in dBm * 4
  */
-static HAL_BOOL
+HAL_BOOL
 ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, uint8_t *pPwrList,
                    uint8_t *pVpdList, uint16_t numIntercepts, uint8_t *pRetVpdList)
 {

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c	Fri Mar 11 10:11:22 2011	(r219478)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c	Fri Mar 11 11:07:53 2011	(r219479)
@@ -59,8 +59,6 @@ static HAL_BOOL ar9285SetPowerCalTable(s
 	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,
@@ -667,7 +665,7 @@ ar9285GetGainBoundariesAndPdadcs(struct 
         for (i = 0; i < numXpdGains; i++) {
             minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0];
             maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4];
-            ar9285FillVpdTable(minPwrT4[i], maxPwrT4[i],
+            ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i],
 			       pRawDataSet[idxL].pwrPdg[i],
                                pRawDataSet[idxL].vpdPdg[i],
 			       AR5416_PD_GAIN_ICEPTS, vpdTableI[i]);
@@ -687,9 +685,9 @@ ar9285GetGainBoundariesAndPdadcs(struct 
             HALASSERT(maxPwrT4[i] > minPwrT4[i]);
 
             /* Fill pier Vpds */
-            ar9285FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL,
+            ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL,
 			       AR5416_PD_GAIN_ICEPTS, vpdTableL[i]);
-            ar9285FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR,
+            ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR,
 			       AR5416_PD_GAIN_ICEPTS, vpdTableR[i]);
 
             /* Interpolate the final vpd */
@@ -782,37 +780,7 @@ ar9285GetGainBoundariesAndPdadcs(struct 
     }
     return;
 }
-/*
- * XXX same as ar5416FillVpdTable
- */
-static HAL_BOOL
-ar9285FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, uint8_t *pPwrList,
-                   uint8_t *pVpdList, uint16_t numIntercepts, uint8_t *pRetVpdList)
-{
-    uint16_t  i, k;
-    uint8_t   currPwr = pwrMin;
-    uint16_t  idxL, idxR;
-
-    HALASSERT(pwrMax > pwrMin);
-    for (i = 0; i <= (pwrMax - pwrMin) / 2; i++) {
-        getLowerUpperIndex(currPwr, pPwrList, numIntercepts,
-                           &(idxL), &(idxR));
-        if (idxR < 1)
-            idxR = 1;           /* extrapolate below */
-        if (idxL == numIntercepts - 1)
-            idxL = (uint16_t)(numIntercepts - 2);   /* extrapolate above */
-        if (pPwrList[idxL] == pPwrList[idxR])
-            k = pVpdList[idxL];
-        else
-            k = (uint16_t)( ((currPwr - pPwrList[idxL]) * pVpdList[idxR] + (pPwrList[idxR] - currPwr) * pVpdList[idxL]) /
-                  (pPwrList[idxR] - pPwrList[idxL]) );
-        HALASSERT(k < 256);
-        pRetVpdList[i] = (uint8_t)k;
-        currPwr += 2;               /* half dB steps */
-    }
 
-    return AH_TRUE;
-}
 static int16_t
 interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight,
             int16_t targetLeft, int16_t targetRight)

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 11:35:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD1A91065672;
	Fri, 11 Mar 2011 11:35:36 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 991278FC0C;
	Fri, 11 Mar 2011 11:35: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 p2BBZasi076980;
	Fri, 11 Mar 2011 11:35:36 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BBZa1i076975;
	Fri, 11 Mar 2011 11:35:36 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103111135.p2BBZa1i076975@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 11 Mar 2011 11:35: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: r219480 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 11:35:36 -0000

Author: adrian
Date: Fri Mar 11 11:35:36 2011
New Revision: 219480
URL: http://svn.freebsd.org/changeset/base/219480

Log:
  Introduce methods for the initial calibration and the new PA calibration
  routines.
  
  These are needed for the AR9285/AR2427 and AR9287 calibration routines
  which will be introducecd in a later commit.

Modified:
  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_cal.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416.h	Fri Mar 11 11:07:53 2011	(r219479)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h	Fri Mar 11 11:35:36 2011	(r219480)
@@ -74,6 +74,12 @@ struct ath_hal_5416 {
 	void		(*ah_spurMitigate)(struct ath_hal *,
 			    const struct ieee80211_channel *);
 
+	/* calibration ops */
+	HAL_BOOL	(*ah_cal_initcal)(struct ath_hal *,
+			    const struct ieee80211_channel *);
+	void		(*ah_cal_pacal)(struct ath_hal *,
+			    HAL_BOOL is_reset);
+
 	/* optional open-loop tx power control related methods */
 	void		(*ah_olcInit)(struct ath_hal *);
 	void		(*ah_olcTempCompensation)(struct ath_hal *);

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Fri Mar 11 11:07:53 2011	(r219479)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c	Fri Mar 11 11:35:36 2011	(r219480)
@@ -178,6 +178,9 @@ ar5416InitState(struct ath_hal_5416 *ahp
 	AH5416(ah)->ah_writeIni		= ar5416WriteIni;
 	AH5416(ah)->ah_spurMitigate	= ar5416SpurMitigate;
 
+	/* Internal calibration ops */
+	AH5416(ah)->ah_cal_initcal	= ar5416InitCalHardware;
+
 	/* Internal TX power control related operations */
 	AH5416(ah)->ah_olcInit = ar5416olcInit;
 	AH5416(ah)->ah_olcTempCompensation	= ar5416olcTempCompensation;

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Fri Mar 11 11:07:53 2011	(r219479)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Fri Mar 11 11:35:36 2011	(r219480)
@@ -183,18 +183,9 @@ ar5416RunInitCals(struct ath_hal *ah, in
 }
 #endif
 
-/*
- * Initialize Calibration infrastructure.
- */
 HAL_BOOL
-ar5416InitCal(struct ath_hal *ah, const struct ieee80211_channel *chan)
+ar5416InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan)
 {
-	struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
-	HAL_CHANNEL_INTERNAL *ichan;
-
-	ichan = ath_hal_checkchannel(ah, chan);
-	HALASSERT(ichan != AH_NULL);
-
 	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);
@@ -235,6 +226,32 @@ ar5416InitCal(struct ath_hal *ah, const 
 		return AH_FALSE;
 	}
 
+	return AH_TRUE;
+}
+
+/*
+ * Initialize Calibration infrastructure.
+ */
+HAL_BOOL
+ar5416InitCal(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+	struct ar5416PerCal *cal = &AH5416(ah)->ah_cal;
+	HAL_CHANNEL_INTERNAL *ichan;
+
+	ichan = ath_hal_checkchannel(ah, chan);
+	HALASSERT(ichan != AH_NULL);
+
+	/* Do initial chipset-specific calibration */
+	if (! AH5416(ah)->ah_cal_initcal(ah, chan)) {
+		HALDEBUG(ah, HAL_DEBUG_ANY, "%s: initial chipset calibration did "
+		    "not complete in time; noisy environment?\n", __func__);
+		return AH_FALSE;
+	}
+
+	/* If there's PA Cal, do it */
+	if (AH5416(ah)->ah_cal_pacal)
+		AH5416(ah)->ah_cal_pacal(ah, AH_TRUE);
+
 	/* 
 	 * Do NF calibration after DC offset and other CALs.
 	 * Per system engineers, noise floor value can sometimes be 20 dB
@@ -468,6 +485,10 @@ ar5416PerCalibrationN(struct ath_hal *ah
 
 	/* Do NF cal only at longer intervals */
 	if (longcal) {
+		/* Do PA calibration if the chipset supports */
+		if (AH5416(ah)->ah_cal_pacal)
+			AH5416(ah)->ah_cal_pacal(ah, AH_FALSE);
+
 		/* Do temperature compensation if the chipset needs it */
 		AH5416(ah)->ah_olcTempCompensation(ah);
 

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h	Fri Mar 11 11:07:53 2011	(r219479)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h	Fri Mar 11 11:35:36 2011	(r219480)
@@ -102,6 +102,7 @@ struct ar5416PerCal {
 	}								\
 } while (0)
 
+HAL_BOOL	ar5416InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan);
 HAL_BOOL ar5416InitCal(struct ath_hal *, const struct ieee80211_channel *);
 HAL_BOOL ar5416PerCalibration(struct ath_hal *,  struct ieee80211_channel *,
 	    HAL_BOOL *isIQdone);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 11:58:55 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 03965106564A;
	Fri, 11 Mar 2011 11:58:55 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E1CB68FC08;
	Fri, 11 Mar 2011 11:58: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 p2BBwsW3077489;
	Fri, 11 Mar 2011 11:58:54 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BBwsoO077481;
	Fri, 11 Mar 2011 11:58:54 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103111158.p2BBwsoO077481@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 11 Mar 2011 11:58: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: r219481 - in head/sys: conf dev/ath/ath_hal/ar9002
	modules/ath
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 11:58:55 -0000

Author: adrian
Date: Fri Mar 11 11:58:54 2011
New Revision: 219481
URL: http://svn.freebsd.org/changeset/base/219481

Log:
  Port over the AR9285 PA calibration and initial calibration code from
  Linux ath9k.
  
  The ath9k ar9002_hw_init_cal() isn't entirely clear about what
  is supposed to be called for what chipsets, so I'm ignoring the
  rest of it and just porting the AR9285 init cal path as-is and
  leaving the rest alone. Subsequent commits may also tidy up the
  Merlin (AR9285) and other chipset support.
  
  Obtained from:	Linux ath9k

Added:
  head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c   (contents, props changed)
  head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.h   (contents, props changed)
  head/sys/dev/ath/ath_hal/ar9002/ar9285phy.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/ath/ath_hal/ar9002/ar9285.h
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  head/sys/modules/ath/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri Mar 11 11:35:36 2011	(r219480)
+++ head/sys/conf/files	Fri Mar 11 11:58:54 2011	(r219481)
@@ -767,6 +767,8 @@ dev/ath/ath_hal/ar9002/ar9285_attach.c o
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
 dev/ath/ath_hal/ar9002/ar9285_reset.c optional ath_hal | ath_ar9285 \ 
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar9002/ar9285_cal.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 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285.h	Fri Mar 11 11:35:36 2011	(r219480)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285.h	Fri Mar 11 11:58:54 2011	(r219481)
@@ -25,6 +25,12 @@ struct ath_hal_9285 {
 
 	HAL_INI_ARRAY	ah_ini_txgain;
 	HAL_INI_ARRAY	ah_ini_rxgain;
+
+	struct {
+		int32_t prev_offset;	/* Previous value of PA offset value */
+		int8_t max_skipcount;	/* Max No. of times PACAL can be skipped */
+		int8_t skipcount;	/* No. of times the PACAL to be skipped */
+	} pacal_info;
 };
 #define	AH9285(_ah)	((struct ath_hal_9285 *)(_ah))
 

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Fri Mar 11 11:35:36 2011	(r219480)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Fri Mar 11 11:58:54 2011	(r219481)
@@ -33,6 +33,8 @@
 #include "ar9002/ar9285v2.ini"
 #include "ar9002/ar9280v2.ini"		/* XXX ini for tx/rx gain */
 
+#include "ar9002/ar9285_cal.h"
+
 static const HAL_PERCAL_DATA ar9280_iq_cal = {		/* single sample */
 	.calName = "IQ", .calType = IQ_MISMATCH_CAL,
 	.calNumSamples	= MIN_CAL_SAMPLES,
@@ -118,6 +120,10 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s
 	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;
 
+	if (AR_SREV_KITE_12_OR_LATER(ah))
+		AH5416(ah)->ah_cal_initcal      = ar9285InitCalHardware;
+	AH5416(ah)->ah_cal_pacal        = ar9002_hw_pa_cal;
+
 	AH5416(ah)->ah_spurMitigate	= ar9280SpurMitigate;
 	AH5416(ah)->ah_writeIni		= ar9285WriteIni;
 	AH5416(ah)->ah_rx_chainmask	= AR9285_DEFAULT_RXCHAINMASK;

Added: head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c	Fri Mar 11 11:58:54 2011	(r219481)
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2008-2010 Atheros Communications Inc.
+ * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#include "opt_ah.h"
+#include "ah.h"
+#include "ah_internal.h"
+
+#include "ah_eeprom_v4k.h"
+
+#include "ar9002/ar9285.h"
+#include "ar5416/ar5416reg.h"
+#include "ar5416/ar5416phy.h"
+#include "ar9002/ar9002phy.h"
+#include "ar9002/ar9285phy.h"
+
+#include "ar9002/ar9285_cal.h"
+
+#define	AR9285_CLCAL_REDO_THRESH	1
+#define	MAX_PACAL_SKIPCOUNT		8
+
+#define	N(a)	(sizeof (a) / sizeof (a[0]))
+
+static void
+ar9285_hw_pa_cal(struct ath_hal *ah, HAL_BOOL is_reset)
+{
+	uint32_t regVal;
+	int i, offset, offs_6_1, offs_0;
+	uint32_t ccomp_org, reg_field;
+	uint32_t regList[][2] = {
+		{ 0x786c, 0 },
+		{ 0x7854, 0 },
+		{ 0x7820, 0 },
+		{ 0x7824, 0 },
+		{ 0x7868, 0 },
+		{ 0x783c, 0 },
+		{ 0x7838, 0 },
+	};
+
+	HALDEBUG(ah, HAL_DEBUG_PERCAL, "Running PA Calibration\n");
+
+	/* PA CAL is not needed for high power solution */
+	if (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL) ==
+	    AR5416_EEP_TXGAIN_HIGH_POWER)
+		return;
+
+	for (i = 0; i < N(regList); i++)
+		regList[i][1] = OS_REG_READ(ah, regList[i][0]);
+
+	regVal = OS_REG_READ(ah, 0x7834);
+	regVal &= (~(0x1));
+	OS_REG_WRITE(ah, 0x7834, regVal);
+	regVal = OS_REG_READ(ah, 0x9808);
+	regVal |= (0x1 << 27);
+	OS_REG_WRITE(ah, 0x9808, regVal);
+
+	OS_REG_RMW_FIELD(ah, AR9285_AN_TOP3, AR9285_AN_TOP3_PWDDAC, 1);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDRXTXBB1, 1);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDV2I, 1);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RXTXBB1, AR9285_AN_RXTXBB1_PDDACIF, 1);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G2, AR9285_AN_RF2G2_OFFCAL, 0);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PWDDB, 0);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_ENPACAL, 0);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV1, 0);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPADRV2, 0);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G1, AR9285_AN_RF2G1_PDPAOUT, 0);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G8, AR9285_AN_RF2G8_PADRVGN2TAB0, 7);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0);
+	ccomp_org = MS(OS_REG_READ(ah, AR9285_AN_RF2G6), AR9285_AN_RF2G6_CCOMP);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G6, AR9285_AN_RF2G6_CCOMP, 0xf);
+
+	OS_REG_WRITE(ah, AR9285_AN_TOP2, 0xca0358a0);
+	OS_DELAY(30);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G6, AR9285_AN_RF2G6_OFFS, 0);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_PDVCCOMP, 0);
+
+	for (i = 6; i > 0; i--) {
+		regVal = OS_REG_READ(ah, 0x7834);
+		regVal |= (1 << (19 + i));
+		OS_REG_WRITE(ah, 0x7834, regVal);
+		OS_DELAY(1);
+		regVal = OS_REG_READ(ah, 0x7834);
+		regVal &= (~(0x1 << (19 + i)));
+		reg_field = MS(OS_REG_READ(ah, 0x7840), AR9285_AN_RXTXBB1_SPARE9);
+		regVal |= (reg_field << (19 + i));
+		OS_REG_WRITE(ah, 0x7834, regVal);
+	}
+
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_PDVCCOMP, 1);
+	OS_DELAY(1);
+	reg_field = MS(OS_REG_READ(ah, AR9285_AN_RF2G9), AR9285_AN_RXTXBB1_SPARE9);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_PDVCCOMP, reg_field);
+	offs_6_1 = MS(OS_REG_READ(ah, AR9285_AN_RF2G6), AR9285_AN_RF2G6_OFFS);
+	offs_0   = MS(OS_REG_READ(ah, AR9285_AN_RF2G3), AR9285_AN_RF2G3_PDVCCOMP);
+
+	offset = (offs_6_1<<1) | offs_0;
+	offset = offset - 0;
+	offs_6_1 = offset>>1;
+	offs_0 = offset & 1;
+
+	if ((!is_reset) && (AH9285(ah)->pacal_info.prev_offset == offset)) {
+		if (AH9285(ah)->pacal_info.max_skipcount < MAX_PACAL_SKIPCOUNT)
+			AH9285(ah)->pacal_info.max_skipcount =
+				2 * AH9285(ah)->pacal_info.max_skipcount;
+		AH9285(ah)->pacal_info.skipcount = AH9285(ah)->pacal_info.max_skipcount;
+	} else {
+		AH9285(ah)->pacal_info.max_skipcount = 1;
+		AH9285(ah)->pacal_info.skipcount = 0;
+		AH9285(ah)->pacal_info.prev_offset = offset;
+	}
+
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G6, AR9285_AN_RF2G6_OFFS, offs_6_1);
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9285_AN_RF2G3_PDVCCOMP, offs_0);
+
+	regVal = OS_REG_READ(ah, 0x7834);
+	regVal |= 0x1;
+	OS_REG_WRITE(ah, 0x7834, regVal);
+	regVal = OS_REG_READ(ah, 0x9808);
+	regVal &= (~(0x1 << 27));
+	OS_REG_WRITE(ah, 0x9808, regVal);
+
+	for (i = 0; i < N(regList); i++)
+		OS_REG_WRITE(ah, regList[i][0], regList[i][1]);
+
+	OS_REG_RMW_FIELD(ah, AR9285_AN_RF2G6, AR9285_AN_RF2G6_CCOMP, ccomp_org);
+}
+
+void
+ar9002_hw_pa_cal(struct ath_hal *ah, HAL_BOOL is_reset)
+{
+	if (AR_SREV_KITE_12_OR_LATER(ah)) {
+		if (is_reset || !AH9285(ah)->pacal_info.skipcount)
+			ar9285_hw_pa_cal(ah, is_reset);
+		else
+			AH9285(ah)->pacal_info.skipcount--;
+	}
+}
+
+/* Carrier leakage Calibration fix */
+static HAL_BOOL
+ar9285_hw_cl_cal(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+	OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE);
+	if (IEEE80211_IS_CHAN_HT20(chan)) {
+		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);
+		if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL,
+				  AR_PHY_AGC_CONTROL_CAL, 0)) {
+			HALDEBUG(ah, HAL_DEBUG_PERCAL,
+				"offset calibration failed to complete in 1ms; noisy environment?\n");
+			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);
+	if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
+			  0)) {
+		HALDEBUG(ah, HAL_DEBUG_PERCAL,
+			"offset calibration failed to complete in 1ms; noisy environment?\n");
+		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);
+
+	return AH_TRUE;
+}
+
+static HAL_BOOL
+ar9285_hw_clc(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+	int i;
+	uint32_t txgain_max;
+	uint32_t clc_gain, gain_mask = 0, clc_num = 0;
+	uint32_t reg_clc_I0, reg_clc_Q0;
+	uint32_t i0_num = 0;
+	uint32_t q0_num = 0;
+	uint32_t total_num = 0;
+	uint32_t reg_rf2g5_org;
+	HAL_BOOL retv = AH_TRUE;
+
+	if (!(ar9285_hw_cl_cal(ah, chan)))
+		return AH_FALSE;
+
+	txgain_max = MS(OS_REG_READ(ah, AR_PHY_TX_PWRCTRL7),
+			AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX);
+
+	for (i = 0; i < (txgain_max+1); i++) {
+		clc_gain = (OS_REG_READ(ah, (AR_PHY_TX_GAIN_TBL1+(i<<2))) &
+			   AR_PHY_TX_GAIN_CLC) >> AR_PHY_TX_GAIN_CLC_S;
+		if (!(gain_mask & (1 << clc_gain))) {
+			gain_mask |= (1 << clc_gain);
+			clc_num++;
+		}
+	}
+
+	for (i = 0; i < clc_num; i++) {
+		reg_clc_I0 = (OS_REG_READ(ah, (AR_PHY_CLC_TBL1 + (i << 2)))
+			      & AR_PHY_CLC_I0) >> AR_PHY_CLC_I0_S;
+		reg_clc_Q0 = (OS_REG_READ(ah, (AR_PHY_CLC_TBL1 + (i << 2)))
+			      & AR_PHY_CLC_Q0) >> AR_PHY_CLC_Q0_S;
+		if (reg_clc_I0 == 0)
+			i0_num++;
+
+		if (reg_clc_Q0 == 0)
+			q0_num++;
+	}
+	total_num = i0_num + q0_num;
+	if (total_num > AR9285_CLCAL_REDO_THRESH) {
+		reg_rf2g5_org = OS_REG_READ(ah, AR9285_RF2G5);
+		if (AR_SREV_9285E_20(ah)) {
+			OS_REG_WRITE(ah, AR9285_RF2G5,
+				  (reg_rf2g5_org & AR9285_RF2G5_IC50TX) |
+				  AR9285_RF2G5_IC50TX_XE_SET);
+		} else {
+			OS_REG_WRITE(ah, AR9285_RF2G5,
+				  (reg_rf2g5_org & AR9285_RF2G5_IC50TX) |
+				  AR9285_RF2G5_IC50TX_SET);
+		}
+		retv = ar9285_hw_cl_cal(ah, chan);
+		OS_REG_WRITE(ah, AR9285_RF2G5, reg_rf2g5_org);
+	}
+	return retv;
+}
+
+HAL_BOOL
+ar9285InitCalHardware(struct ath_hal *ah,
+    const struct ieee80211_channel *chan)
+{
+	if (! ar9285_hw_clc(ah, chan))
+		return AH_FALSE;
+
+	ar9285_hw_pa_cal(ah, AH_TRUE);
+
+	return AH_TRUE;
+}

Added: head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.h	Fri Mar 11 11:58:54 2011	(r219481)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2008-2010 Atheros Communications Inc.
+ * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd.
+ *
+ * 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	__AR9285_CAL_H__
+#define	__AR9285_CAL_H__
+
+extern void ar9002_hw_pa_cal(struct ath_hal *ah, HAL_BOOL is_reset);
+extern HAL_BOOL ar9285InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan);
+
+#endif

Added: head/sys/dev/ath/ath_hal/ar9002/ar9285phy.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285phy.h	Fri Mar 11 11:58:54 2011	(r219481)
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2008-2010 Atheros Communications Inc.
+ * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd.
+ *
+ * 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	__ATH_AR9285PHY_H__
+#define	__ATH_AR9285PHY_H__
+
+#define AR9285_AN_RF2G1              0x7820
+#define AR9285_AN_RF2G1_ENPACAL      0x00000800
+#define AR9285_AN_RF2G1_ENPACAL_S    11
+#define AR9285_AN_RF2G1_PDPADRV1     0x02000000
+#define AR9285_AN_RF2G1_PDPADRV1_S   25
+#define AR9285_AN_RF2G1_PDPADRV2     0x01000000
+#define AR9285_AN_RF2G1_PDPADRV2_S   24
+#define AR9285_AN_RF2G1_PDPAOUT      0x00800000
+#define AR9285_AN_RF2G1_PDPAOUT_S    23
+
+#define AR9285_AN_RF2G2              0x7824
+#define AR9285_AN_RF2G2_OFFCAL       0x00001000
+#define AR9285_AN_RF2G2_OFFCAL_S     12
+
+#define AR9285_AN_RF2G3             0x7828
+#define AR9285_AN_RF2G3_PDVCCOMP    0x02000000
+#define AR9285_AN_RF2G3_PDVCCOMP_S  25
+#define AR9285_AN_RF2G3_OB_0    0x00E00000
+#define AR9285_AN_RF2G3_OB_0_S    21
+#define AR9285_AN_RF2G3_OB_1    0x001C0000
+#define AR9285_AN_RF2G3_OB_1_S    18
+#define AR9285_AN_RF2G3_OB_2    0x00038000
+#define AR9285_AN_RF2G3_OB_2_S    15
+#define AR9285_AN_RF2G3_OB_3    0x00007000
+#define AR9285_AN_RF2G3_OB_3_S    12
+#define AR9285_AN_RF2G3_OB_4    0x00000E00
+#define AR9285_AN_RF2G3_OB_4_S    9
+
+#define AR9285_AN_RF2G3_DB1_0    0x000001C0
+#define AR9285_AN_RF2G3_DB1_0_S    6
+#define AR9285_AN_RF2G3_DB1_1    0x00000038
+#define AR9285_AN_RF2G3_DB1_1_S    3
+#define AR9285_AN_RF2G3_DB1_2    0x00000007
+#define AR9285_AN_RF2G3_DB1_2_S    0
+
+#define AR9285_AN_RF2G4         0x782C
+#define AR9285_AN_RF2G4_DB1_3    0xE0000000
+#define AR9285_AN_RF2G4_DB1_3_S    29
+#define AR9285_AN_RF2G4_DB1_4    0x1C000000
+#define AR9285_AN_RF2G4_DB1_4_S    26
+
+#define AR9285_AN_RF2G4_DB2_0    0x03800000
+#define AR9285_AN_RF2G4_DB2_0_S    23
+#define AR9285_AN_RF2G4_DB2_1    0x00700000
+#define AR9285_AN_RF2G4_DB2_1_S    20
+#define AR9285_AN_RF2G4_DB2_2    0x000E0000
+#define AR9285_AN_RF2G4_DB2_2_S    17
+#define AR9285_AN_RF2G4_DB2_3    0x0001C000
+#define AR9285_AN_RF2G4_DB2_3_S    14
+#define AR9285_AN_RF2G4_DB2_4    0x00003800
+#define AR9285_AN_RF2G4_DB2_4_S    11
+
+#define AR9285_RF2G5                    0x7830
+#define AR9285_RF2G5_IC50TX             0xfffff8ff
+#define AR9285_RF2G5_IC50TX_SET         0x00000400
+#define AR9285_RF2G5_IC50TX_XE_SET      0x00000500
+#define AR9285_RF2G5_IC50TX_CLEAR       0x00000700
+#define AR9285_RF2G5_IC50TX_CLEAR_S     8
+
+#define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX   0x0007E000
+#define AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX_S 13
+#define AR_PHY_TX_GAIN_CLC       0x0000001E
+#define AR_PHY_TX_GAIN_CLC_S     1
+#define AR_PHY_TX_GAIN           0x0007F000
+#define AR_PHY_TX_GAIN_S         12
+
+#define AR_PHY_CLC_TBL1      0xa35c
+#define AR_PHY_CLC_I0        0x07ff0000
+#define AR_PHY_CLC_I0_S      16
+#define AR_PHY_CLC_Q0        0x0000ffd0
+#define AR_PHY_CLC_Q0_S      5
+
+#define AR_PHY_MULTICHAIN_GAIN_CTL          0x99ac
+#define AR_PHY_9285_FAST_DIV_BIAS           0x00007E00
+#define AR_PHY_9285_FAST_DIV_BIAS_S         9
+#define AR_PHY_9285_ANT_DIV_CTL_ALL         0x7f000000
+#define AR_PHY_9285_ANT_DIV_CTL             0x01000000
+#define AR_PHY_9285_ANT_DIV_CTL_S           24
+#define AR_PHY_9285_ANT_DIV_ALT_LNACONF     0x06000000
+#define AR_PHY_9285_ANT_DIV_ALT_LNACONF_S   25
+#define AR_PHY_9285_ANT_DIV_MAIN_LNACONF    0x18000000
+#define AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S  27
+#define AR_PHY_9285_ANT_DIV_ALT_GAINTB      0x20000000
+#define AR_PHY_9285_ANT_DIV_ALT_GAINTB_S    29
+#define AR_PHY_9285_ANT_DIV_MAIN_GAINTB     0x40000000
+#define AR_PHY_9285_ANT_DIV_MAIN_GAINTB_S   30
+#define AR_PHY_9285_ANT_DIV_LNA1            2
+#define AR_PHY_9285_ANT_DIV_LNA2            1
+#define AR_PHY_9285_ANT_DIV_LNA1_PLUS_LNA2  3
+#define AR_PHY_9285_ANT_DIV_LNA1_MINUS_LNA2 0
+#define AR_PHY_9285_ANT_DIV_GAINTB_0        0
+#define AR_PHY_9285_ANT_DIV_GAINTB_1        1
+
+/* for AR_PHY_CCK_DETECT */
+#define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME           0x00001FC0
+#define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME_S         6
+#define AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV    0x2000
+#define AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV_S  13
+
+#endif

Modified: head/sys/modules/ath/Makefile
==============================================================================
--- head/sys/modules/ath/Makefile	Fri Mar 11 11:35:36 2011	(r219480)
+++ head/sys/modules/ath/Makefile	Fri Mar 11 11:58:54 2011	(r219481)
@@ -98,7 +98,7 @@ SRCS+=	ar9160_attach.c
 
 .PATH:	${.CURDIR}/../../dev/ath/ath_hal/ar9002
 SRCS+=	ar9280.c ar9280_attach.c ar9280_olc.c
-SRCS+=	ar9285.c ar9285_reset.c ar9285_attach.c
+SRCS+=	ar9285.c ar9285_reset.c ar9285_attach.c ar9285_cal.c
 
 # NB: rate control is bound to the driver by symbol names so only pick one
 .if ${ATH_RATE} == "sample"

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 12:12:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C28461065672;
	Fri, 11 Mar 2011 12:12:35 +0000 (UTC)
	(envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9566E8FC1A;
	Fri, 11 Mar 2011 12:12:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2BCCZ2i077897;
	Fri, 11 Mar 2011 12:12:35 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BCCZIU077894;
	Fri, 11 Mar 2011 12:12:35 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201103111212.p2BCCZIU077894@svn.freebsd.org>
From: Mikolaj Golub 
Date: Fri, 11 Mar 2011 12:12: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: r219482 - head/sbin/hastd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 12:12:35 -0000

Author: trociny
Date: Fri Mar 11 12:12:35 2011
New Revision: 219482
URL: http://svn.freebsd.org/changeset/base/219482

Log:
  Make workers inherit debug level from the main process.
  
  Approved by:	pjd (mentor)
  MFC after:	1 week

Modified:
  head/sbin/hastd/primary.c
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c	Fri Mar 11 11:58:54 2011	(r219481)
+++ head/sbin/hastd/primary.c	Fri Mar 11 12:12:35 2011	(r219482)
@@ -806,7 +806,7 @@ hastd_primary(struct hast_resource *res)
 {
 	pthread_t td;
 	pid_t pid;
-	int error, mode;
+	int error, mode, debuglevel;
 
 	/*
 	 * Create communication channel for sending control commands from
@@ -858,6 +858,7 @@ hastd_primary(struct hast_resource *res)
 
 	gres = res;
 	mode = pjdlog_mode_get();
+	debuglevel = pjdlog_debug_get();
 
 	/* Declare that we are sender. */
 	proto_send(res->hr_event, NULL, 0);
@@ -869,6 +870,7 @@ hastd_primary(struct hast_resource *res)
 	descriptors_assert(res, mode);
 
 	pjdlog_init(mode);
+	pjdlog_debug_set(debuglevel);
 	pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role));
 	setproctitle("%s (primary)", res->hr_name);
 

Modified: head/sbin/hastd/secondary.c
==============================================================================
--- head/sbin/hastd/secondary.c	Fri Mar 11 11:58:54 2011	(r219481)
+++ head/sbin/hastd/secondary.c	Fri Mar 11 12:12:35 2011	(r219482)
@@ -346,7 +346,7 @@ hastd_secondary(struct hast_resource *re
 	sigset_t mask;
 	pthread_t td;
 	pid_t pid;
-	int error, mode;
+	int error, mode, debuglevel;
 
 	/*
 	 * Create communication channel between parent and child.
@@ -398,6 +398,7 @@ hastd_secondary(struct hast_resource *re
 
 	gres = res;
 	mode = pjdlog_mode_get();
+	debuglevel = pjdlog_debug_get();
 
 	/* Declare that we are sender. */
 	proto_send(res->hr_event, NULL, 0);
@@ -409,6 +410,7 @@ hastd_secondary(struct hast_resource *re
 	descriptors_assert(res, mode);
 
 	pjdlog_init(mode);
+	pjdlog_debug_set(debuglevel);
 	pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role));
 	setproctitle("%s (secondary)", res->hr_name);
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 13:11:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B945D1065670;
	Fri, 11 Mar 2011 13:11:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A70D28FC16;
	Fri, 11 Mar 2011 13:11: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 p2BDBF43079176;
	Fri, 11 Mar 2011 13:11:15 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BDBFBs079174;
	Fri, 11 Mar 2011 13:11:15 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103111311.p2BDBFBs079174@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 11 Mar 2011 13:11: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: r219483 - head/sys/boot/i386/gptboot
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 13:11:15 -0000

Author: jhb
Date: Fri Mar 11 13:11:15 2011
New Revision: 219483
URL: http://svn.freebsd.org/changeset/base/219483

Log:
  Remove all object files during 'make clean'.
  
  PR:		kern/154888
  Submitted by:	arundel
  MFC after:	1 week

Modified:
  head/sys/boot/i386/gptboot/Makefile

Modified: head/sys/boot/i386/gptboot/Makefile
==============================================================================
--- head/sys/boot/i386/gptboot/Makefile	Fri Mar 11 12:12:35 2011	(r219482)
+++ head/sys/boot/i386/gptboot/Makefile	Fri Mar 11 13:11:15 2011	(r219483)
@@ -65,7 +65,8 @@ gptldr.bin: gptldr.out
 gptldr.out: gptldr.o
 	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
 
-CLEANFILES+=	gptboot.bin gptboot.out gptboot.o sio.o ufsread.o
+CLEANFILES+=	gptboot.bin gptboot.out gptboot.o sio.o gpt.o crc32.o drv.o \
+		cons.o util.o
 
 gptboot.bin: gptboot.out
 	objcopy -S -O binary gptboot.out ${.TARGET}

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 14:38:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 29B591065673;
	Fri, 11 Mar 2011 14:38:36 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1743C8FC12;
	Fri, 11 Mar 2011 14:38: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 p2BEcZsn081532;
	Fri, 11 Mar 2011 14:38:35 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BEcZ5s081529;
	Fri, 11 Mar 2011 14:38:35 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111438.p2BEcZ5s081529@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 14:38:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219484 - in stable/8/sys: amd64/include i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 14:38:36 -0000

Author: avg
Date: Fri Mar 11 14:38:35 2011
New Revision: 219484
URL: http://svn.freebsd.org/changeset/base/219484

Log:
  MFC r215522: specialreg.h: add definition for AMD Core Performance Boost bit

Modified:
  stable/8/sys/amd64/include/specialreg.h
  stable/8/sys/i386/include/specialreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/include/specialreg.h
==============================================================================
--- stable/8/sys/amd64/include/specialreg.h	Fri Mar 11 13:11:15 2011	(r219483)
+++ stable/8/sys/amd64/include/specialreg.h	Fri Mar 11 14:38:35 2011	(r219484)
@@ -206,6 +206,7 @@
 #define	AMDPM_100MHZ_STEPS	0x00000040
 #define	AMDPM_HW_PSTATE		0x00000080
 #define	AMDPM_TSC_INVARIANT	0x00000100
+#define	AMDPM_CPB		0x00000200
 
 /*
  * AMD extended function 8000_0008h ecx info

Modified: stable/8/sys/i386/include/specialreg.h
==============================================================================
--- stable/8/sys/i386/include/specialreg.h	Fri Mar 11 13:11:15 2011	(r219483)
+++ stable/8/sys/i386/include/specialreg.h	Fri Mar 11 14:38:35 2011	(r219484)
@@ -205,6 +205,7 @@
 #define	AMDPM_100MHZ_STEPS	0x00000040
 #define	AMDPM_HW_PSTATE		0x00000080
 #define	AMDPM_TSC_INVARIANT	0x00000100
+#define	AMDPM_CPB		0x00000200
 
 /*
  * AMD extended function 8000_0008h ecx info

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 14:46:28 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2896F1065677;
	Fri, 11 Mar 2011 14:46:28 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 163048FC1C;
	Fri, 11 Mar 2011 14:46: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 p2BEkR0E081839;
	Fri, 11 Mar 2011 14:46:27 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BEkRMn081836;
	Fri, 11 Mar 2011 14:46:27 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111446.p2BEkRMn081836@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 14:46:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219485 - in stable/7/sys: amd64/include i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 14:46:28 -0000

Author: avg
Date: Fri Mar 11 14:46:27 2011
New Revision: 219485
URL: http://svn.freebsd.org/changeset/base/219485

Log:
  MFC r215522: specialreg.h: add definition for AMD Core Performance Boost bit

Modified:
  stable/7/sys/amd64/include/specialreg.h
  stable/7/sys/i386/include/specialreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/amd64/include/specialreg.h
==============================================================================
--- stable/7/sys/amd64/include/specialreg.h	Fri Mar 11 14:38:35 2011	(r219484)
+++ stable/7/sys/amd64/include/specialreg.h	Fri Mar 11 14:46:27 2011	(r219485)
@@ -196,6 +196,7 @@
 #define	AMDPM_100MHZ_STEPS	0x00000040
 #define	AMDPM_HW_PSTATE		0x00000080
 #define	AMDPM_TSC_INVARIANT	0x00000100
+#define	AMDPM_CPB		0x00000200
 
 /*
  * AMD extended function 8000_0008h ecx info

Modified: stable/7/sys/i386/include/specialreg.h
==============================================================================
--- stable/7/sys/i386/include/specialreg.h	Fri Mar 11 14:38:35 2011	(r219484)
+++ stable/7/sys/i386/include/specialreg.h	Fri Mar 11 14:46:27 2011	(r219485)
@@ -195,6 +195,7 @@
 #define	AMDPM_100MHZ_STEPS	0x00000040
 #define	AMDPM_HW_PSTATE		0x00000080
 #define	AMDPM_TSC_INVARIANT	0x00000100
+#define	AMDPM_CPB		0x00000200
 
 /*
  * AMD extended function 8000_0008h ecx info

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 14:53:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2EFEC106566B;
	Fri, 11 Mar 2011 14:53:35 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 02E9C8FC19;
	Fri, 11 Mar 2011 14:53: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 p2BErYiP082053;
	Fri, 11 Mar 2011 14:53:34 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BErYN8082048;
	Fri, 11 Mar 2011 14:53:34 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111453.p2BErYN8082048@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 14:53:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219486 - in stable/8/sys: amd64/include i386/i386
	i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 14:53:35 -0000

Author: avg
Date: Fri Mar 11 14:53:34 2011
New Revision: 219486
URL: http://svn.freebsd.org/changeset/base/219486

Log:
  MFC r215523: specialreg.h: add AMD-specific "Hardware Configuration
  Register" MSR

Modified:
  stable/8/sys/amd64/include/specialreg.h
  stable/8/sys/i386/i386/initcpu.c
  stable/8/sys/i386/include/specialreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/include/specialreg.h
==============================================================================
--- stable/8/sys/amd64/include/specialreg.h	Fri Mar 11 14:46:27 2011	(r219485)
+++ stable/8/sys/amd64/include/specialreg.h	Fri Mar 11 14:53:34 2011	(r219486)
@@ -504,6 +504,7 @@
 #define	MSR_PERFCTR2	0xc0010006
 #define	MSR_PERFCTR3	0xc0010007
 #define	MSR_SYSCFG	0xc0010010
+#define	MSR_HWCR	0xc0010015
 #define	MSR_IORRBASE0	0xc0010016
 #define	MSR_IORRMASK0	0xc0010017
 #define	MSR_IORRBASE1	0xc0010018

Modified: stable/8/sys/i386/i386/initcpu.c
==============================================================================
--- stable/8/sys/i386/i386/initcpu.c	Fri Mar 11 14:46:27 2011	(r219485)
+++ stable/8/sys/i386/i386/initcpu.c	Fri Mar 11 14:53:34 2011	(r219486)
@@ -672,7 +672,7 @@ initializecpu(void)
 			     (cpu_id & ~0xf) == 0x670 ||
 			     (cpu_id & ~0xf) == 0x680)) {
 				u_int regs[4];
-				wrmsr(0xC0010015, rdmsr(0xC0010015) & ~0x08000);
+				wrmsr(MSR_HWCR, rdmsr(MSR_HWCR) & ~0x08000);
 				do_cpuid(1, regs);
 				cpu_feature = regs[3];
 			}

Modified: stable/8/sys/i386/include/specialreg.h
==============================================================================
--- stable/8/sys/i386/include/specialreg.h	Fri Mar 11 14:46:27 2011	(r219485)
+++ stable/8/sys/i386/include/specialreg.h	Fri Mar 11 14:53:34 2011	(r219486)
@@ -554,7 +554,8 @@
 #define	AMD_WT_ALLOC_FRE	0x10000	/* fixed (A0000-FFFFF) range enable */
 
 /* AMD64 MSR's */
-#define	MSR_EFER	0xc0000080	/* extended features */
+#define	MSR_EFER		0xc0000080	/* extended features */
+#define	MSR_HWCR		0xc0010015
 #define	MSR_K8_UCODE_UPDATE	0xc0010020	/* update microcode */
 #define	MSR_MC0_CTL_MASK	0xc0010044
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 14:55:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BF93B106566B;
	Fri, 11 Mar 2011 14:55:23 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 93ACD8FC18;
	Fri, 11 Mar 2011 14:55: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 p2BEtNj4082166;
	Fri, 11 Mar 2011 14:55:23 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BEtNHZ082162;
	Fri, 11 Mar 2011 14:55:23 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111455.p2BEtNHZ082162@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 14:55:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219487 - in stable/7/sys: amd64/include i386/i386
	i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 14:55:23 -0000

Author: avg
Date: Fri Mar 11 14:55:23 2011
New Revision: 219487
URL: http://svn.freebsd.org/changeset/base/219487

Log:
  MFC r215523: specialreg.h: add AMD-specific "Hardware Configuration
  Register" MSR

Modified:
  stable/7/sys/amd64/include/specialreg.h
  stable/7/sys/i386/i386/initcpu.c
  stable/7/sys/i386/include/specialreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/amd64/include/specialreg.h
==============================================================================
--- stable/7/sys/amd64/include/specialreg.h	Fri Mar 11 14:53:34 2011	(r219486)
+++ stable/7/sys/amd64/include/specialreg.h	Fri Mar 11 14:55:23 2011	(r219487)
@@ -494,6 +494,7 @@
 #define	MSR_PERFCTR2	0xc0010006
 #define	MSR_PERFCTR3	0xc0010007
 #define	MSR_SYSCFG	0xc0010010
+#define	MSR_HWCR	0xc0010015
 #define	MSR_IORRBASE0	0xc0010016
 #define	MSR_IORRMASK0	0xc0010017
 #define	MSR_IORRBASE1	0xc0010018

Modified: stable/7/sys/i386/i386/initcpu.c
==============================================================================
--- stable/7/sys/i386/i386/initcpu.c	Fri Mar 11 14:53:34 2011	(r219486)
+++ stable/7/sys/i386/i386/initcpu.c	Fri Mar 11 14:55:23 2011	(r219487)
@@ -680,7 +680,7 @@ initializecpu(void)
 			     (cpu_id & ~0xf) == 0x670 ||
 			     (cpu_id & ~0xf) == 0x680)) {
 				u_int regs[4];
-				wrmsr(0xC0010015, rdmsr(0xC0010015) & ~0x08000);
+				wrmsr(MSR_HWCR, rdmsr(MSR_HWCR) & ~0x08000);
 				do_cpuid(1, regs);
 				cpu_feature = regs[3];
 			}

Modified: stable/7/sys/i386/include/specialreg.h
==============================================================================
--- stable/7/sys/i386/include/specialreg.h	Fri Mar 11 14:53:34 2011	(r219486)
+++ stable/7/sys/i386/include/specialreg.h	Fri Mar 11 14:55:23 2011	(r219487)
@@ -544,7 +544,8 @@
 #define	AMD_WT_ALLOC_FRE	0x10000	/* fixed (A0000-FFFFF) range enable */
 
 /* AMD64 MSR's */
-#define	MSR_EFER	0xc0000080	/* extended features */
+#define	MSR_EFER		0xc0000080	/* extended features */
+#define	MSR_HWCR		0xc0010015
 #define	MSR_K8_UCODE_UPDATE	0xc0010020	/* update microcode */
 #define	MSR_MC0_CTL_MASK	0xc0010044
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 14:58:17 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9D0A5106566B;
	Fri, 11 Mar 2011 14:58:17 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8AB858FC0C;
	Fri, 11 Mar 2011 14:58: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 p2BEwH6h082295;
	Fri, 11 Mar 2011 14:58:17 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BEwH1w082292;
	Fri, 11 Mar 2011 14:58:17 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111458.p2BEwH1w082292@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 14:58:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219488 - in stable/8/sys: amd64/include i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 14:58:17 -0000

Author: avg
Date: Fri Mar 11 14:58:17 2011
New Revision: 219488
URL: http://svn.freebsd.org/changeset/base/219488

Log:
  MFC r215524: specialreg.h: add definitions for MPERF/APERF pair of MSRs

Modified:
  stable/8/sys/amd64/include/specialreg.h
  stable/8/sys/i386/include/specialreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/include/specialreg.h
==============================================================================
--- stable/8/sys/amd64/include/specialreg.h	Fri Mar 11 14:55:23 2011	(r219487)
+++ stable/8/sys/amd64/include/specialreg.h	Fri Mar 11 14:58:17 2011	(r219488)
@@ -240,6 +240,8 @@
 #define	MSR_BIOS_SIGN		0x08b
 #define	MSR_PERFCTR0		0x0c1
 #define	MSR_PERFCTR1		0x0c2
+#define	MSR_MPERF		0x0e7
+#define	MSR_APERF		0x0e8
 #define	MSR_IA32_EXT_CONFIG	0x0ee	/* Undocumented. Core Solo/Duo only */
 #define	MSR_MTRRcap		0x0fe
 #define	MSR_BBL_CR_ADDR		0x116

Modified: stable/8/sys/i386/include/specialreg.h
==============================================================================
--- stable/8/sys/i386/include/specialreg.h	Fri Mar 11 14:55:23 2011	(r219487)
+++ stable/8/sys/i386/include/specialreg.h	Fri Mar 11 14:58:17 2011	(r219488)
@@ -246,6 +246,8 @@
 #define	MSR_BIOS_SIGN		0x08b
 #define	MSR_PERFCTR0		0x0c1
 #define	MSR_PERFCTR1		0x0c2
+#define	MSR_MPERF		0x0e7
+#define	MSR_APERF		0x0e8
 #define	MSR_IA32_EXT_CONFIG	0x0ee	/* Undocumented. Core Solo/Duo only */
 #define	MSR_MTRRcap		0x0fe
 #define	MSR_BBL_CR_ADDR		0x116

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 15:01:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBCB7106566C;
	Fri, 11 Mar 2011 15:01:54 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A92798FC19;
	Fri, 11 Mar 2011 15:01: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 p2BF1sw9082573;
	Fri, 11 Mar 2011 15:01:54 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BF1sMl082570;
	Fri, 11 Mar 2011 15:01:54 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111501.p2BF1sMl082570@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 15:01:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219489 - in stable/7/sys: amd64/include i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 15:01:54 -0000

Author: avg
Date: Fri Mar 11 15:01:54 2011
New Revision: 219489
URL: http://svn.freebsd.org/changeset/base/219489

Log:
  MFC r215524: specialreg.h: add definitions for MPERF/APERF pair of MSRs

Modified:
  stable/7/sys/amd64/include/specialreg.h
  stable/7/sys/i386/include/specialreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/amd64/include/specialreg.h
==============================================================================
--- stable/7/sys/amd64/include/specialreg.h	Fri Mar 11 14:58:17 2011	(r219488)
+++ stable/7/sys/amd64/include/specialreg.h	Fri Mar 11 15:01:54 2011	(r219489)
@@ -230,6 +230,8 @@
 #define	MSR_BIOS_SIGN		0x08b
 #define	MSR_PERFCTR0		0x0c1
 #define	MSR_PERFCTR1		0x0c2
+#define	MSR_MPERF		0x0e7
+#define	MSR_APERF		0x0e8
 #define	MSR_IA32_EXT_CONFIG	0x0ee	/* Undocumented. Core Solo/Duo only */
 #define	MSR_MTRRcap		0x0fe
 #define	MSR_BBL_CR_ADDR		0x116

Modified: stable/7/sys/i386/include/specialreg.h
==============================================================================
--- stable/7/sys/i386/include/specialreg.h	Fri Mar 11 14:58:17 2011	(r219488)
+++ stable/7/sys/i386/include/specialreg.h	Fri Mar 11 15:01:54 2011	(r219489)
@@ -236,6 +236,8 @@
 #define	MSR_BIOS_SIGN		0x08b
 #define	MSR_PERFCTR0		0x0c1
 #define	MSR_PERFCTR1		0x0c2
+#define	MSR_MPERF		0x0e7
+#define	MSR_APERF		0x0e8
 #define	MSR_IA32_EXT_CONFIG	0x0ee	/* Undocumented. Core Solo/Duo only */
 #define	MSR_MTRRcap		0x0fe
 #define	MSR_BBL_CR_ADDR		0x116

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 15:05:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3DCA4106566B;
	Fri, 11 Mar 2011 15:05:24 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B4078FC08;
	Fri, 11 Mar 2011 15:05: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 p2BF5OId082950;
	Fri, 11 Mar 2011 15:05:24 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BF5O4f082947;
	Fri, 11 Mar 2011 15:05:24 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111505.p2BF5O4f082947@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 15:05:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219490 - in stable/8/sys: amd64/include i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 15:05:24 -0000

Author: avg
Date: Fri Mar 11 15:05:23 2011
New Revision: 219490
URL: http://svn.freebsd.org/changeset/base/219490

Log:
  MFC r215748: specialreg.h: add definitions for some useful bits found in
  CPUID.6 EAX and ECX

Modified:
  stable/8/sys/amd64/include/specialreg.h
  stable/8/sys/i386/include/specialreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/include/specialreg.h
==============================================================================
--- stable/8/sys/amd64/include/specialreg.h	Fri Mar 11 15:01:54 2011	(r219489)
+++ stable/8/sys/amd64/include/specialreg.h	Fri Mar 11 15:05:23 2011	(r219490)
@@ -136,6 +136,15 @@
 #define	CPUID2_AESNI	0x02000000
 
 /*
+ * Important bits in the Thermal and Power Management flags
+ * CPUID.6 EAX and ECX.
+ */
+#define	CPUTPM1_SENSOR	0x00000001
+#define	CPUTPM1_TURBO	0x00000002
+#define	CPUTPM1_ARAT	0x00000004
+#define	CPUTPM2_EFFREQ	0x00000001
+
+/*
  * Important bits in the AMD extended cpuid flags
  */
 #define	AMDID_SYSCALL	0x00000800

Modified: stable/8/sys/i386/include/specialreg.h
==============================================================================
--- stable/8/sys/i386/include/specialreg.h	Fri Mar 11 15:01:54 2011	(r219489)
+++ stable/8/sys/i386/include/specialreg.h	Fri Mar 11 15:05:23 2011	(r219490)
@@ -133,6 +133,15 @@
 #define	CPUID2_AESNI	0x02000000
 
 /*
+ * Important bits in the Thermal and Power Management flags
+ * CPUID.6 EAX and ECX.
+ */
+#define	CPUTPM1_SENSOR	0x00000001
+#define	CPUTPM1_TURBO	0x00000002
+#define	CPUTPM1_ARAT	0x00000004
+#define	CPUTPM2_EFFREQ	0x00000001
+
+/*
  * Important bits in the AMD extended cpuid flags
  */
 #define	AMDID_SYSCALL	0x00000800

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 15:06:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D811106566B;
	Fri, 11 Mar 2011 15:06:57 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2AE708FC0C;
	Fri, 11 Mar 2011 15:06: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 p2BF6vu8083139;
	Fri, 11 Mar 2011 15:06:57 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BF6vU7083136;
	Fri, 11 Mar 2011 15:06:57 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111506.p2BF6vU7083136@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 15:06:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219491 - in stable/7/sys: amd64/include i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 15:06:57 -0000

Author: avg
Date: Fri Mar 11 15:06:56 2011
New Revision: 219491
URL: http://svn.freebsd.org/changeset/base/219491

Log:
  MFC r215748: specialreg.h: add definitions for some useful bits found in
  CPUID.6 EAX and ECX

Modified:
  stable/7/sys/amd64/include/specialreg.h
  stable/7/sys/i386/include/specialreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/amd64/include/specialreg.h
==============================================================================
--- stable/7/sys/amd64/include/specialreg.h	Fri Mar 11 15:05:23 2011	(r219490)
+++ stable/7/sys/amd64/include/specialreg.h	Fri Mar 11 15:06:56 2011	(r219491)
@@ -133,6 +133,15 @@
 #define	CPUID2_POPCNT	0x00800000
 
 /*
+ * Important bits in the Thermal and Power Management flags
+ * CPUID.6 EAX and ECX.
+ */
+#define	CPUTPM1_SENSOR	0x00000001
+#define	CPUTPM1_TURBO	0x00000002
+#define	CPUTPM1_ARAT	0x00000004
+#define	CPUTPM2_EFFREQ	0x00000001
+
+/*
  * Important bits in the AMD extended cpuid flags
  */
 #define	AMDID_SYSCALL	0x00000800

Modified: stable/7/sys/i386/include/specialreg.h
==============================================================================
--- stable/7/sys/i386/include/specialreg.h	Fri Mar 11 15:05:23 2011	(r219490)
+++ stable/7/sys/i386/include/specialreg.h	Fri Mar 11 15:06:56 2011	(r219491)
@@ -130,6 +130,15 @@
 #define	CPUID2_POPCNT	0x00800000
 
 /*
+ * Important bits in the Thermal and Power Management flags
+ * CPUID.6 EAX and ECX.
+ */
+#define	CPUTPM1_SENSOR	0x00000001
+#define	CPUTPM1_TURBO	0x00000002
+#define	CPUTPM1_ARAT	0x00000004
+#define	CPUTPM2_EFFREQ	0x00000001
+
+/*
  * Important bits in the AMD extended cpuid flags
  */
 #define	AMDID_SYSCALL	0x00000800

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 15:14:40 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8AE251065670;
	Fri, 11 Mar 2011 15:14:40 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 78A998FC0C;
	Fri, 11 Mar 2011 15:14:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2BFEeRW083792;
	Fri, 11 Mar 2011 15:14:40 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BFEeaH083790;
	Fri, 11 Mar 2011 15:14:40 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111514.p2BFEeaH083790@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 15:14:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219492 - stable/8/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 15:14:40 -0000

Author: avg
Date: Fri Mar 11 15:14:40 2011
New Revision: 219492
URL: http://svn.freebsd.org/changeset/base/219492

Log:
  MFC r215750: taskqueue: drop unused tq_name field

Modified:
  stable/8/sys/kern/subr_taskqueue.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/subr_taskqueue.c
==============================================================================
--- stable/8/sys/kern/subr_taskqueue.c	Fri Mar 11 15:06:56 2011	(r219491)
+++ stable/8/sys/kern/subr_taskqueue.c	Fri Mar 11 15:14:40 2011	(r219492)
@@ -53,7 +53,6 @@ struct taskqueue_busy {
 
 struct taskqueue {
 	STAILQ_HEAD(, task)	tq_queue;
-	const char		*tq_name;
 	taskqueue_enqueue_fn	tq_enqueue;
 	void			*tq_context;
 	TAILQ_HEAD(, taskqueue_busy) tq_active;
@@ -98,7 +97,7 @@ TQ_SLEEP(struct taskqueue *tq, void *p, 
 }
 
 static struct taskqueue *
-_taskqueue_create(const char *name, int mflags,
+_taskqueue_create(const char *name __unused, int mflags,
 		 taskqueue_enqueue_fn enqueue, void *context,
 		 int mtxflags, const char *mtxname)
 {
@@ -110,7 +109,6 @@ _taskqueue_create(const char *name, int 
 
 	STAILQ_INIT(&queue->tq_queue);
 	TAILQ_INIT(&queue->tq_active);
-	queue->tq_name = name;
 	queue->tq_enqueue = enqueue;
 	queue->tq_context = context;
 	queue->tq_spin = (mtxflags & MTX_SPIN) != 0;

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 15:34:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 73E9C106564A;
	Fri, 11 Mar 2011 15:34:07 +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 2A1D68FC0C;
	Fri, 11 Mar 2011 15:34: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 p2BFY7r1084321;
	Fri, 11 Mar 2011 15:34:07 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BFY7DI084319;
	Fri, 11 Mar 2011 15:34:07 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103111534.p2BFY7DI084319@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 11 Mar 2011 15:34:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219493 - stable/8/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 15:34:07 -0000

Author: jhb
Date: Fri Mar 11 15:34:06 2011
New Revision: 219493
URL: http://svn.freebsd.org/changeset/base/219493

Log:
  MFC 208898:
  Call BUS_PROBE_NOMATCH() when device detached due to driver unload.
  This allows bus to power-down device when driver unloaded on-flight.

Modified:
  stable/8/sys/kern/subr_bus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/subr_bus.c
==============================================================================
--- stable/8/sys/kern/subr_bus.c	Fri Mar 11 15:14:40 2011	(r219492)
+++ stable/8/sys/kern/subr_bus.c	Fri Mar 11 15:34:06 2011	(r219493)
@@ -1180,6 +1180,9 @@ devclass_delete_driver(devclass_t buscla
 				if ((error = device_detach(dev)) != 0)
 					return (error);
 				device_set_driver(dev, NULL);
+				BUS_PROBE_NOMATCH(dev->parent, dev);
+				devnomatch(dev);
+				dev->flags |= DF_DONENOMATCH;
 			}
 		}
 	}
@@ -2674,6 +2677,7 @@ device_attach(device_t dev)
 	}
 	device_sysctl_update(dev);
 	dev->state = DS_ATTACHED;
+	dev->flags &= ~DF_DONENOMATCH;
 	devadded(dev);
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 15:38:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 32F8D1065672;
	Fri, 11 Mar 2011 15:38:43 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 06F9F8FC0A;
	Fri, 11 Mar 2011 15:38: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 p2BFcg2M084472;
	Fri, 11 Mar 2011 15:38:42 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BFcgql084469;
	Fri, 11 Mar 2011 15:38:42 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111538.p2BFcgql084469@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 15:38:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219494 - in stable/8/sys/cddl/dev/dtrace: amd64 i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 15:38:43 -0000

Author: avg
Date: Fri Mar 11 15:38:42 2011
New Revision: 219494
URL: http://svn.freebsd.org/changeset/base/219494

Log:
  MFC r216250: dtrace_gethrtime_init: pin to master while examining other CPUs

Modified:
  stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==============================================================================
--- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Fri Mar 11 15:34:06 2011	(r219493)
+++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Fri Mar 11 15:38:42 2011	(r219494)
@@ -405,6 +405,7 @@ dtrace_gethrtime_init_cpu(void *arg)
 static void
 dtrace_gethrtime_init(void *arg)
 {
+	struct pcpu *pc;
 	uint64_t tsc_f;
 	cpumask_t map;
 	int i;
@@ -437,15 +438,14 @@ dtrace_gethrtime_init(void *arg)
 	nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f;
 
 	/* The current CPU is the reference one. */
+	sched_pin();
 	tsc_skew[curcpu] = 0;
-
 	CPU_FOREACH(i) {
 		if (i == curcpu)
 			continue;
 
-		map = 0;
-		map |= (1 << curcpu);
-		map |= (1 << i);
+		pc = pcpu_find(i);
+		map = PCPU_GET(cpumask) | pc->pc_cpumask;
 
 		smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync,
 		    dtrace_gethrtime_init_cpu,
@@ -453,6 +453,7 @@ dtrace_gethrtime_init(void *arg)
 
 		tsc_skew[i] = tgt_cpu_tsc - hst_cpu_tsc;
 	}
+	sched_unpin();
 }
 
 SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL);

Modified: stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==============================================================================
--- stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Fri Mar 11 15:34:06 2011	(r219493)
+++ stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Fri Mar 11 15:38:42 2011	(r219494)
@@ -405,6 +405,7 @@ dtrace_gethrtime_init_cpu(void *arg)
 static void
 dtrace_gethrtime_init(void *arg)
 {
+	struct pcpu *pc;
 	uint64_t tsc_f;
 	cpumask_t map;
 	int i;
@@ -437,15 +438,14 @@ dtrace_gethrtime_init(void *arg)
 	nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f;
 
 	/* The current CPU is the reference one. */
+	sched_pin();
 	tsc_skew[curcpu] = 0;
-
 	CPU_FOREACH(i) {
 		if (i == curcpu)
 			continue;
 
-		map = 0;
-		map |= (1 << curcpu);
-		map |= (1 << i);
+		pc = pcpu_find(i);
+		map = PCPU_GET(cpumask) | pc->pc_cpumask;
 
 		smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync,
 		    dtrace_gethrtime_init_cpu,
@@ -453,6 +453,7 @@ dtrace_gethrtime_init(void *arg)
 
 		tsc_skew[i] = tgt_cpu_tsc - hst_cpu_tsc;
 	}
+	sched_unpin();
 }
 
 SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 15:50:45 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D2DB2106566B;
	Fri, 11 Mar 2011 15:50:45 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C0BA78FC08;
	Fri, 11 Mar 2011 15:50: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 p2BFojBl084785;
	Fri, 11 Mar 2011 15:50:45 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BFojOe084783;
	Fri, 11 Mar 2011 15:50:45 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111550.p2BFojOe084783@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 15:50:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219495 - stable/8/sys/dev/cxgb/ulp/tom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 15:50:45 -0000

Author: avg
Date: Fri Mar 11 15:50:45 2011
New Revision: 219495
URL: http://svn.freebsd.org/changeset/base/219495

Log:
  MFC r216373: fix incorrect use of atomic_set_xxx in cxgb

Modified:
  stable/8/sys/dev/cxgb/ulp/tom/cxgb_tom.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/cxgb/ulp/tom/cxgb_tom.c
==============================================================================
--- stable/8/sys/dev/cxgb/ulp/tom/cxgb_tom.c	Fri Mar 11 15:38:42 2011	(r219494)
+++ stable/8/sys/dev/cxgb/ulp/tom/cxgb_tom.c	Fri Mar 11 15:50:45 2011	(r219495)
@@ -269,7 +269,7 @@ init_tid_tabs(struct tid_info *t, unsign
 	t->atid_base = atid_base;
 	t->afree = NULL;
 	t->stids_in_use = t->atids_in_use = 0;
-	atomic_set_int(&t->tids_in_use, 0);
+	t->tids_in_use = 0;
 	mtx_init(&t->stid_lock, "stid", NULL, MTX_DUPOK|MTX_DEF);
 	mtx_init(&t->atid_lock, "atid", NULL, MTX_DUPOK|MTX_DEF);
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 15:53:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CFCA01065670;
	Fri, 11 Mar 2011 15:53:11 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BD6F68FC1C;
	Fri, 11 Mar 2011 15:53: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 p2BFrBRw084880;
	Fri, 11 Mar 2011 15:53:11 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BFrBpj084878;
	Fri, 11 Mar 2011 15:53:11 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111553.p2BFrBpj084878@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 15:53:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219496 - stable/7/sys/dev/cxgb/ulp/tom
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 15:53:11 -0000

Author: avg
Date: Fri Mar 11 15:53:11 2011
New Revision: 219496
URL: http://svn.freebsd.org/changeset/base/219496

Log:
  MFC r216373: fix incorrect use of atomic_set_xxx in cxgb

Modified:
  stable/7/sys/dev/cxgb/ulp/tom/cxgb_tom.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/cxgb/ulp/tom/cxgb_tom.c
==============================================================================
--- stable/7/sys/dev/cxgb/ulp/tom/cxgb_tom.c	Fri Mar 11 15:50:45 2011	(r219495)
+++ stable/7/sys/dev/cxgb/ulp/tom/cxgb_tom.c	Fri Mar 11 15:53:11 2011	(r219496)
@@ -240,7 +240,7 @@ init_tid_tabs(struct tid_info *t, unsign
 	t->atid_base = atid_base;
 	t->afree = NULL;
 	t->stids_in_use = t->atids_in_use = 0;
-	atomic_set_int(&t->tids_in_use, 0);
+	t->tids_in_use = 0;
 	mtx_init(&t->stid_lock, "stid", NULL, MTX_DUPOK|MTX_DEF);
 	mtx_init(&t->atid_lock, "atid", NULL, MTX_DUPOK|MTX_DEF);
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:00:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 282991065670;
	Fri, 11 Mar 2011 16:00:57 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F08978FC13;
	Fri, 11 Mar 2011 16:00: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 p2BG0uNT085100;
	Fri, 11 Mar 2011 16:00:56 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BG0uxB085097;
	Fri, 11 Mar 2011 16:00:56 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111600.p2BG0uxB085097@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 16:00:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219497 - in stable/8/sys/cddl/dev/dtrace: amd64 i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:00:57 -0000

Author: avg
Date: Fri Mar 11 16:00:56 2011
New Revision: 219497
URL: http://svn.freebsd.org/changeset/base/219497

Log:
  MFC r216251: dtrace_xcall: no need for special handling of curcpu

Modified:
  stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==============================================================================
--- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Fri Mar 11 15:53:11 2011	(r219496)
+++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Fri Mar 11 16:00:56 2011	(r219497)
@@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_x
 {
 	cpumask_t cpus;
 
-	critical_enter();
-
 	if (cpu == DTRACE_CPUALL)
 		cpus = all_cpus;
 	else
-		cpus = (cpumask_t) (1 << cpu);
-
-	/* If the current CPU is in the set, call the function directly: */
-	if ((cpus & (1 << curcpu)) != 0) {
-		(*func)(arg);
-
-		/* Mask the current CPU from the set */
-		cpus &= ~(1 << curcpu);
-	}
-
-	/* If there are any CPUs in the set, cross-call to those CPUs */
-	if (cpus != 0)
-		smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg);
+		cpus = (cpumask_t)1 << cpu;
 
-	critical_exit();
+	smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func,
+	    smp_no_rendevous_barrier, arg);
 }
 
 static void

Modified: stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==============================================================================
--- stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Fri Mar 11 15:53:11 2011	(r219496)
+++ stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Fri Mar 11 16:00:56 2011	(r219497)
@@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_x
 {
 	cpumask_t cpus;
 
-	critical_enter();
-
 	if (cpu == DTRACE_CPUALL)
 		cpus = all_cpus;
 	else
-		cpus = (cpumask_t) (1 << cpu);
-
-	/* If the current CPU is in the set, call the function directly: */
-	if ((cpus & (1 << curcpu)) != 0) {
-		(*func)(arg);
-
-		/* Mask the current CPU from the set */
-		cpus &= ~(1 << curcpu);
-	}
-
-	/* If there are any CPUs in the set, cross-call to those CPUs */
-	if (cpus != 0)
-		smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg);
+		cpus = (cpumask_t)1 << cpu;
 
-	critical_exit();
+	smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func,
+	    smp_no_rendevous_barrier, arg);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:02:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25188106566B;
	Fri, 11 Mar 2011 16:02:39 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ED1E18FC0C;
	Fri, 11 Mar 2011 16:02: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 p2BG2cUt085194;
	Fri, 11 Mar 2011 16:02:38 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BG2cEh085191;
	Fri, 11 Mar 2011 16:02:38 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111602.p2BG2cEh085191@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 16:02:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219498 - in stable/7/sys/cddl/dev/dtrace: amd64 i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:02:39 -0000

Author: avg
Date: Fri Mar 11 16:02:38 2011
New Revision: 219498
URL: http://svn.freebsd.org/changeset/base/219498

Log:
  MFC r216251: dtrace_xcall: no need for special handling of curcpu

Modified:
  stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==============================================================================
--- stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Fri Mar 11 16:00:56 2011	(r219497)
+++ stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Fri Mar 11 16:02:38 2011	(r219498)
@@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_x
 {
 	cpumask_t cpus;
 
-	critical_enter();
-
 	if (cpu == DTRACE_CPUALL)
 		cpus = all_cpus;
 	else
-		cpus = (cpumask_t) (1 << cpu);
-
-	/* If the current CPU is in the set, call the function directly: */
-	if ((cpus & (1 << curcpu)) != 0) {
-		(*func)(arg);
-
-		/* Mask the current CPU from the set */
-		cpus &= ~(1 << curcpu);
-	}
-
-	/* If there are any CPUs in the set, cross-call to those CPUs */
-	if (cpus != 0)
-		smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg);
+		cpus = (cpumask_t)1 << cpu;
 
-	critical_exit();
+	smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func,
+	    smp_no_rendevous_barrier, arg);
 }
 
 static void

Modified: stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==============================================================================
--- stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Fri Mar 11 16:00:56 2011	(r219497)
+++ stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Fri Mar 11 16:02:38 2011	(r219498)
@@ -115,26 +115,13 @@ dtrace_xcall(processorid_t cpu, dtrace_x
 {
 	cpumask_t cpus;
 
-	critical_enter();
-
 	if (cpu == DTRACE_CPUALL)
 		cpus = all_cpus;
 	else
-		cpus = (cpumask_t) (1 << cpu);
-
-	/* If the current CPU is in the set, call the function directly: */
-	if ((cpus & (1 << curcpu)) != 0) {
-		(*func)(arg);
-
-		/* Mask the current CPU from the set */
-		cpus &= ~(1 << curcpu);
-	}
-
-	/* If there are any CPUs in the set, cross-call to those CPUs */
-	if (cpus != 0)
-		smp_rendezvous_cpus(cpus, NULL, func, smp_no_rendevous_barrier, arg);
+		cpus = (cpumask_t)1 << cpu;
 
-	critical_exit();
+	smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func,
+	    smp_no_rendevous_barrier, arg);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:05:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D8CFB1065672;
	Fri, 11 Mar 2011 16:05:36 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C665F8FC17;
	Fri, 11 Mar 2011 16:05: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 p2BG5aqG085299;
	Fri, 11 Mar 2011 16:05:36 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BG5aJS085297;
	Fri, 11 Mar 2011 16:05:36 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111605.p2BG5aJS085297@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 16:05:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219499 - stable/8/sys/cddl/dev/cyclic/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:05:37 -0000

Author: avg
Date: Fri Mar 11 16:05:36 2011
New Revision: 219499
URL: http://svn.freebsd.org/changeset/base/219499

Log:
  MFC r216252: opensolaris cyclic xcall: no need for special handling of curcpu

Modified:
  stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
==============================================================================
--- stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Fri Mar 11 16:02:38 2011	(r219498)
+++ stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Fri Mar 11 16:05:36 2011	(r219499)
@@ -121,13 +121,7 @@ static void reprogram(cyb_arg_t arg, hrt
 
 static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param)
 {
-	/*
-	 * If the target CPU is the current one, just call the
-	 * function. This covers the non-SMP case.
-	 */
-	if (c == &solaris_cpu[curcpu])
-		(*func)(param);
-	else
-		smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL,
-		    func, smp_no_rendevous_barrier, param);
+
+	smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL,
+	    func, smp_no_rendevous_barrier, param);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:07:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A804B1065670;
	Fri, 11 Mar 2011 16:07:20 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 959858FC0A;
	Fri, 11 Mar 2011 16:07: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 p2BG7Kwx085394;
	Fri, 11 Mar 2011 16:07:20 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BG7Ke6085392;
	Fri, 11 Mar 2011 16:07:20 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111607.p2BG7Ke6085392@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 16:07:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219500 - stable/7/sys/cddl/dev/cyclic/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:07:20 -0000

Author: avg
Date: Fri Mar 11 16:07:20 2011
New Revision: 219500
URL: http://svn.freebsd.org/changeset/base/219500

Log:
  MFC r216252: opensolaris cyclic xcall: no need for special handling of curcpu

Modified:
  stable/7/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
==============================================================================
--- stable/7/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Fri Mar 11 16:05:36 2011	(r219499)
+++ stable/7/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Fri Mar 11 16:07:20 2011	(r219500)
@@ -121,13 +121,7 @@ static void reprogram(cyb_arg_t arg, hrt
 
 static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param)
 {
-	/*
-	 * If the target CPU is the current one, just call the
-	 * function. This covers the non-SMP case.
-	 */
-	if (c == &solaris_cpu[curcpu])
-		(*func)(param);
-	else
-		smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL,
-		    func, smp_no_rendevous_barrier, param);
+
+	smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL,
+	    func, smp_no_rendevous_barrier, param);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:11:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A7DF1065672;
	Fri, 11 Mar 2011 16:11:42 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 86A9A8FC0C;
	Fri, 11 Mar 2011 16:11: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 p2BGBgkj085573;
	Fri, 11 Mar 2011 16:11:42 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BGBgC0085570;
	Fri, 11 Mar 2011 16:11:42 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111611.p2BGBgC0085570@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 16:11:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219501 - in stable/8/sys/cddl: compat/opensolaris/sys
	dev/cyclic
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:11:42 -0000

Author: avg
Date: Fri Mar 11 16:11:42 2011
New Revision: 219501
URL: http://svn.freebsd.org/changeset/base/219501

Log:
  MFC r216254: opensolaris cyclic: fix deadlock and make a little bit
  closer to upstream

Modified:
  stable/8/sys/cddl/compat/opensolaris/sys/cyclic_impl.h
  stable/8/sys/cddl/dev/cyclic/cyclic.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/compat/opensolaris/sys/cyclic_impl.h
==============================================================================
--- stable/8/sys/cddl/compat/opensolaris/sys/cyclic_impl.h	Fri Mar 11 16:07:20 2011	(r219500)
+++ stable/8/sys/cddl/compat/opensolaris/sys/cyclic_impl.h	Fri Mar 11 16:11:42 2011	(r219501)
@@ -288,7 +288,14 @@ typedef struct cyc_id {
 
 typedef struct cyc_xcallarg {
 	cyc_cpu_t *cyx_cpu;
-	hrtime_t cyx_exp;
+	cyc_handler_t *cyx_hdlr;
+	cyc_time_t *cyx_when;
+	cyc_index_t cyx_ndx;
+	cyc_index_t *cyx_heap;
+	cyclic_t *cyx_cyclics;
+	cyc_index_t cyx_size;
+	uint16_t cyx_flags;
+	int cyx_wait;
 } cyc_xcallarg_t;
 
 #define	CY_DEFAULT_PERCPU	1

Modified: stable/8/sys/cddl/dev/cyclic/cyclic.c
==============================================================================
--- stable/8/sys/cddl/dev/cyclic/cyclic.c	Fri Mar 11 16:07:20 2011	(r219500)
+++ stable/8/sys/cddl/dev/cyclic/cyclic.c	Fri Mar 11 16:11:42 2011	(r219501)
@@ -473,73 +473,6 @@ cyclic_expire(cyc_cpu_t *cpu, cyc_index_
 	(*handler)(arg);
 }
 
-static void
-cyclic_enable_xcall(void *v)
-{
-	cyc_xcallarg_t *argp = v;
-	cyc_cpu_t *cpu = argp->cyx_cpu;
-	cyc_backend_t *be = cpu->cyp_backend;
-
-	be->cyb_enable(be->cyb_arg);
-}
-
-static void
-cyclic_enable(cyc_cpu_t *cpu)
-{
-	cyc_backend_t *be = cpu->cyp_backend;
-	cyc_xcallarg_t arg;
-
-	arg.cyx_cpu = cpu;
-
-	/* Cross call to the target CPU */
-	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_enable_xcall, &arg);
-}
-
-static void
-cyclic_disable_xcall(void *v)
-{
-	cyc_xcallarg_t *argp = v;
-	cyc_cpu_t *cpu = argp->cyx_cpu;
-	cyc_backend_t *be = cpu->cyp_backend;
-
-	be->cyb_disable(be->cyb_arg);
-}
-
-static void
-cyclic_disable(cyc_cpu_t *cpu)
-{
-	cyc_backend_t *be = cpu->cyp_backend;
-	cyc_xcallarg_t arg;
-
-	arg.cyx_cpu = cpu;
-
-	/* Cross call to the target CPU */
-	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_disable_xcall, &arg);
-}
-
-static void
-cyclic_reprogram_xcall(void *v)
-{
-	cyc_xcallarg_t *argp = v;
-	cyc_cpu_t *cpu = argp->cyx_cpu;
-	cyc_backend_t *be = cpu->cyp_backend;
-
-	be->cyb_reprogram(be->cyb_arg, argp->cyx_exp);
-}
-
-static void
-cyclic_reprogram(cyc_cpu_t *cpu, hrtime_t exp)
-{
-	cyc_backend_t *be = cpu->cyp_backend;
-	cyc_xcallarg_t arg;
-
-	arg.cyx_cpu = cpu;
-	arg.cyx_exp = exp;
-
-	/* Cross call to the target CPU */
-	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_reprogram_xcall, &arg);
-}
-
 /*
  *  cyclic_fire(cpu_t *)
  *
@@ -570,17 +503,15 @@ static void
 cyclic_fire(cpu_t *c)
 {
 	cyc_cpu_t *cpu = c->cpu_cyclic;
-
-	mtx_lock_spin(&cpu->cyp_mtx);
-
+	cyc_backend_t *be = cpu->cyp_backend;
 	cyc_index_t *heap = cpu->cyp_heap;
 	cyclic_t *cyclic, *cyclics = cpu->cyp_cyclics;
+	void *arg = be->cyb_arg;
 	hrtime_t now = gethrtime();
 	hrtime_t exp;
 
 	if (cpu->cyp_nelems == 0) {
 		/* This is a spurious fire. */
-		mtx_unlock_spin(&cpu->cyp_mtx);
 		return;
 	}
 
@@ -631,8 +562,45 @@ cyclic_fire(cpu_t *c)
 	 * Now we have a cyclic in the root slot which isn't in the past;
 	 * reprogram the interrupt source.
 	 */
-	cyclic_reprogram(cpu, exp);
+	be->cyb_reprogram(arg, exp);
+}
+
+static void
+cyclic_expand_xcall(cyc_xcallarg_t *arg)
+{
+	cyc_cpu_t *cpu = arg->cyx_cpu;
+	cyc_index_t new_size = arg->cyx_size, size = cpu->cyp_size, i;
+	cyc_index_t *new_heap = arg->cyx_heap;
+	cyclic_t *cyclics = cpu->cyp_cyclics, *new_cyclics = arg->cyx_cyclics;
+
+	/* Disable preemption and interrupts. */
+	mtx_lock_spin(&cpu->cyp_mtx);
+
+	/*
+	 * Assert that the new size is a power of 2.
+	 */
+	ASSERT((new_size & (new_size - 1)) == 0);
+	ASSERT(new_size == (size << 1));
+	ASSERT(cpu->cyp_heap != NULL && cpu->cyp_cyclics != NULL);
+
+	bcopy(cpu->cyp_heap, new_heap, sizeof (cyc_index_t) * size);
+	bcopy(cyclics, new_cyclics, sizeof (cyclic_t) * size);
+
+	/*
+	 * Set up the free list, and set all of the new cyclics to be CYF_FREE.
+	 */
+	for (i = size; i < new_size; i++) {
+		new_heap[i] = i;
+		new_cyclics[i].cy_flags = CYF_FREE;
+	}
 
+	/*
+	 * We can go ahead and plow the value of cyp_heap and cyp_cyclics;
+	 * cyclic_expand() has kept a copy.
+	 */
+	cpu->cyp_heap = new_heap;
+	cpu->cyp_cyclics = new_cyclics;
+	cpu->cyp_size = new_size;
 	mtx_unlock_spin(&cpu->cyp_mtx);
 }
 
@@ -643,102 +611,70 @@ cyclic_fire(cpu_t *c)
 static void
 cyclic_expand(cyc_cpu_t *cpu)
 {
-	cyc_index_t new_size, old_size, i;
+	cyc_index_t new_size, old_size;
 	cyc_index_t *new_heap, *old_heap;
 	cyclic_t *new_cyclics, *old_cyclics;
+	cyc_xcallarg_t arg;
+	cyc_backend_t *be = cpu->cyp_backend;
 
 	ASSERT(MUTEX_HELD(&cpu_lock));
 
-	if ((new_size = ((old_size = cpu->cyp_size) << 1)) == 0)
+	old_heap = cpu->cyp_heap;
+	old_cyclics = cpu->cyp_cyclics;
+
+	if ((new_size = ((old_size = cpu->cyp_size) << 1)) == 0) {
 		new_size = CY_DEFAULT_PERCPU;
+		ASSERT(old_heap == NULL && old_cyclics == NULL);
+	}
 
 	/*
 	 * Check that the new_size is a power of 2.
 	 */
 	ASSERT(((new_size - 1) & new_size) == 0);
 
-	/* Unlock the mutex while allocating memory so we can wait... */
-	mtx_unlock_spin(&cpu->cyp_mtx);
-
 	new_heap = malloc(sizeof(cyc_index_t) * new_size, M_CYCLIC, M_WAITOK);
 	new_cyclics = malloc(sizeof(cyclic_t) * new_size, M_CYCLIC, M_ZERO | M_WAITOK);
 
-	/* Grab the lock again now we've got the memory... */
-	mtx_lock_spin(&cpu->cyp_mtx);
-
-	/* Check if another thread beat us while the mutex was unlocked. */
-	if (old_size != cpu->cyp_size) {
-		/* Oh well, he won. */
-		mtx_unlock_spin(&cpu->cyp_mtx);
-
-		free(new_heap, M_CYCLIC);
-		free(new_cyclics, M_CYCLIC);
-
-		mtx_lock_spin(&cpu->cyp_mtx);
-		return;
-	}
-
-	old_heap = cpu->cyp_heap;
-	old_cyclics = cpu->cyp_cyclics;
-
-	bcopy(cpu->cyp_heap, new_heap, sizeof (cyc_index_t) * old_size);
-	bcopy(old_cyclics, new_cyclics, sizeof (cyclic_t) * old_size);
-
-	/*
-	 * Set up the free list, and set all of the new cyclics to be CYF_FREE.
-	 */
-	for (i = old_size; i < new_size; i++) {
-		new_heap[i] = i;
-		new_cyclics[i].cy_flags = CYF_FREE;
-	}
+	arg.cyx_cpu = cpu;
+	arg.cyx_heap = new_heap;
+	arg.cyx_cyclics = new_cyclics;
+	arg.cyx_size = new_size;
 
-	/*
-	 * We can go ahead and plow the value of cyp_heap and cyp_cyclics;
-	 * cyclic_expand() has kept a copy.
-	 */
-	cpu->cyp_heap = new_heap;
-	cpu->cyp_cyclics = new_cyclics;
-	cpu->cyp_size = new_size;
+	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu,
+	    (cyc_func_t)cyclic_expand_xcall, &arg);
 
 	if (old_cyclics != NULL) {
 		ASSERT(old_heap != NULL);
 		ASSERT(old_size != 0);
-		mtx_unlock_spin(&cpu->cyp_mtx);
-
 		free(old_cyclics, M_CYCLIC);
 		free(old_heap, M_CYCLIC);
-
-		mtx_lock_spin(&cpu->cyp_mtx);
 	}
 }
 
-static cyc_index_t
-cyclic_add_here(cyc_cpu_t *cpu, cyc_handler_t *hdlr,
-    cyc_time_t *when, uint16_t flags)
+static void
+cyclic_add_xcall(cyc_xcallarg_t *arg)
 {
+	cyc_cpu_t *cpu = arg->cyx_cpu;
+	cyc_handler_t *hdlr = arg->cyx_hdlr;
+	cyc_time_t *when = arg->cyx_when;
+	cyc_backend_t *be = cpu->cyp_backend;
 	cyc_index_t ndx, nelems;
+	cyb_arg_t bar = be->cyb_arg;
 	cyclic_t *cyclic;
 
-	ASSERT(MUTEX_HELD(&cpu_lock));
-
-	mtx_lock_spin(&cpu->cyp_mtx);
-
-	ASSERT(!(cpu->cyp_cpu->cpu_flags & CPU_OFFLINE));
-	ASSERT(when->cyt_when >= 0 && when->cyt_interval > 0);
-
-	while (cpu->cyp_nelems == cpu->cyp_size)
-		cyclic_expand(cpu);
-
 	ASSERT(cpu->cyp_nelems < cpu->cyp_size);
 
+	/* Disable preemption and interrupts. */
+	mtx_lock_spin(&cpu->cyp_mtx);
 	nelems = cpu->cyp_nelems++;
 
-	if (nelems == 0)
+	if (nelems == 0) {
 		/*
 		 * If this is the first element, we need to enable the
 		 * backend on this CPU.
 		 */
-		cyclic_enable(cpu);
+		be->cyb_enable(bar);
+	}
 
 	ndx = cpu->cyp_heap[nelems];
 	cyclic = &cpu->cyp_cyclics[ndx];
@@ -746,14 +682,20 @@ cyclic_add_here(cyc_cpu_t *cpu, cyc_hand
 	ASSERT(cyclic->cy_flags == CYF_FREE);
 	cyclic->cy_interval = when->cyt_interval;
 
-	if (when->cyt_when == 0)
-		cyclic->cy_expire = gethrtime() + cyclic->cy_interval;
-	else
+	if (when->cyt_when == 0) {
+		/*
+		 * If a start time hasn't been explicitly specified, we'll
+		 * start on the next interval boundary.
+		 */
+		cyclic->cy_expire = (gethrtime() / cyclic->cy_interval + 1) *
+		    cyclic->cy_interval;
+	} else {
 		cyclic->cy_expire = when->cyt_when;
+	}
 
 	cyclic->cy_handler = hdlr->cyh_func;
 	cyclic->cy_arg = hdlr->cyh_arg;
-	cyclic->cy_flags = flags;
+	cyclic->cy_flags = arg->cyx_flags;
 
 	if (cyclic_upheap(cpu, nelems)) {
 		hrtime_t exp = cyclic->cy_expire;
@@ -762,31 +704,63 @@ cyclic_add_here(cyc_cpu_t *cpu, cyc_hand
 		 * If our upheap propagated to the root, we need to
 		 * reprogram the interrupt source.
 		 */
-		cyclic_reprogram(cpu, exp);
+		be->cyb_reprogram(bar, exp);
 	}
-
 	mtx_unlock_spin(&cpu->cyp_mtx);
 
-	return (ndx);
+	arg->cyx_ndx = ndx;
 }
 
-
-static int
-cyclic_remove_here(cyc_cpu_t *cpu, cyc_index_t ndx, cyc_time_t *when, int wait)
+static cyc_index_t
+cyclic_add_here(cyc_cpu_t *cpu, cyc_handler_t *hdlr,
+    cyc_time_t *when, uint16_t flags)
 {
-	cyc_index_t nelems, i;
-	cyclic_t *cyclic;
-	cyc_index_t *heap, last;
+	cyc_backend_t *be = cpu->cyp_backend;
+	cyb_arg_t bar = be->cyb_arg;
+	cyc_xcallarg_t arg;
 
 	ASSERT(MUTEX_HELD(&cpu_lock));
-	ASSERT(wait == CY_WAIT || wait == CY_NOWAIT);
+	ASSERT(!(cpu->cyp_cpu->cpu_flags & CPU_OFFLINE));
+	ASSERT(when->cyt_when >= 0 && when->cyt_interval > 0);
 
-	mtx_lock_spin(&cpu->cyp_mtx);
+	if (cpu->cyp_nelems == cpu->cyp_size) {
+		/*
+		 * This is expensive; it will cross call onto the other
+		 * CPU to perform the expansion.
+		 */
+		cyclic_expand(cpu);
+		ASSERT(cpu->cyp_nelems < cpu->cyp_size);
+	}
+
+	/*
+	 * By now, we know that we're going to be able to successfully
+	 * perform the add.  Now cross call over to the CPU of interest to
+	 * actually add our cyclic.
+	 */
+	arg.cyx_cpu = cpu;
+	arg.cyx_hdlr = hdlr;
+	arg.cyx_when = when;
+	arg.cyx_flags = flags;
+
+	be->cyb_xcall(bar, cpu->cyp_cpu, (cyc_func_t)cyclic_add_xcall, &arg);
+
+	return (arg.cyx_ndx);
+}
 
-	heap = cpu->cyp_heap;
+static void
+cyclic_remove_xcall(cyc_xcallarg_t *arg)
+{
+	cyc_cpu_t *cpu = arg->cyx_cpu;
+	cyc_backend_t *be = cpu->cyp_backend;
+	cyb_arg_t bar = be->cyb_arg;
+	cyc_index_t ndx = arg->cyx_ndx, nelems = cpu->cyp_nelems, i;
+	cyc_index_t *heap = cpu->cyp_heap, last;
+	cyclic_t *cyclic;
 
-	nelems = cpu->cyp_nelems;
+	ASSERT(nelems > 0);
 
+	/* Disable preemption and interrupts. */
+	mtx_lock_spin(&cpu->cyp_mtx);
 	cyclic = &cpu->cyp_cyclics[ndx];
 
 	/*
@@ -794,11 +768,17 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i
 	 * removed as part of a juggling operation, the expiration time
 	 * will be used when the cyclic is added to the new CPU.
 	 */
-	if (when != NULL) {
-		when->cyt_when = cyclic->cy_expire;
-		when->cyt_interval = cyclic->cy_interval;
+	if (arg->cyx_when != NULL) {
+		arg->cyx_when->cyt_when = cyclic->cy_expire;
+		arg->cyx_when->cyt_interval = cyclic->cy_interval;
 	}
 
+	/*
+	 * Now set the flags to CYF_FREE.  We don't need a membar_enter()
+	 * between zeroing pend and setting the flags because we're at
+	 * CY_HIGH_LEVEL (that is, the zeroing of pend and the setting
+	 * of cy_flags appear atomic to softints).
+	 */
 	cyclic->cy_flags = CYF_FREE;
 
 	for (i = 0; i < nelems; i++) {
@@ -811,19 +791,21 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i
 
 	cpu->cyp_nelems = --nelems;
 
-	if (nelems == 0)
+	if (nelems == 0) {
 		/*
 		 * If we just removed the last element, then we need to
 		 * disable the backend on this CPU.
 		 */
-		cyclic_disable(cpu);
+		be->cyb_disable(bar);
+	}
 
-	if (i == nelems)
+	if (i == nelems) {
 		/*
 		 * If we just removed the last element of the heap, then
 		 * we don't have to downheap.
 		 */
-		goto done;
+		goto out;
+	}
 
 	/*
 	 * Swap the last element of the heap with the one we want to
@@ -833,17 +815,18 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i
 	heap[i] = (last = heap[nelems]);
 	heap[nelems] = ndx;
 
-	if (i == 0)
+	if (i == 0) {
 		cyclic_downheap(cpu, 0);
-	else {
+	} else {
 		if (cyclic_upheap(cpu, i) == 0) {
 			/*
 			 * The upheap didn't propagate to the root; if it
 			 * didn't propagate at all, we need to downheap.
 			 */
-			if (heap[i] == last)
+			if (heap[i] == last) {
 				cyclic_downheap(cpu, i);
-			goto done;
+			}
+			goto out;
 		}
 	}
 
@@ -854,10 +837,27 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i
 	cyclic = &cpu->cyp_cyclics[heap[0]];
 
 	ASSERT(nelems != 0);
-	cyclic_reprogram(cpu, cyclic->cy_expire);
-
-done:
+	be->cyb_reprogram(bar, cyclic->cy_expire);
+out:
 	mtx_unlock_spin(&cpu->cyp_mtx);
+}
+
+static int
+cyclic_remove_here(cyc_cpu_t *cpu, cyc_index_t ndx, cyc_time_t *when, int wait)
+{
+	cyc_backend_t *be = cpu->cyp_backend;
+	cyc_xcallarg_t arg;
+
+	ASSERT(MUTEX_HELD(&cpu_lock));
+	ASSERT(wait == CY_WAIT || wait == CY_NOWAIT);
+
+	arg.cyx_ndx = ndx;
+	arg.cyx_cpu = cpu;
+	arg.cyx_when = when;
+	arg.cyx_wait = wait;
+
+	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu,
+	    (cyc_func_t)cyclic_remove_xcall, &arg);
 
 	return (1);
 }
@@ -1214,15 +1214,10 @@ cyclic_add_omni(cyc_omni_handler_t *omni
 
 	idp->cyi_omni_hdlr = *omni;
 
-	for (i = 0; i < MAXCPU; i++) {
-		if (pcpu_find(i) == NULL)
-			continue;
-
+	CPU_FOREACH(i) {
 		c = &solaris_cpu[i];
-
 		if ((cpu = c->cpu_cyclic) == NULL)
 			continue;
-
 		cyclic_omni_start(idp, cpu);
 	}
 
@@ -1325,12 +1320,8 @@ cyclic_mp_init(void)
 
 	mutex_enter(&cpu_lock);
 
-	for (i = 0; i <= mp_maxid; i++) {
-		if (pcpu_find(i) == NULL)
-			continue;
-
+	CPU_FOREACH(i) {
 		c = &solaris_cpu[i];
-
 		if (c->cpu_cyclic == NULL)
 			cyclic_configure(c);
 	}
@@ -1346,10 +1337,8 @@ cyclic_uninit(void)
 
 	CPU_FOREACH(id) {
 		c = &solaris_cpu[id];
-
 		if (c->cpu_cyclic == NULL)
 			continue;
-
 		cyclic_unconfigure(c);
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:13:26 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 564AA1065672;
	Fri, 11 Mar 2011 16:13:26 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 426CE8FC13;
	Fri, 11 Mar 2011 16:13: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 p2BGDQcB085666;
	Fri, 11 Mar 2011 16:13:26 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BGDQQ4085663;
	Fri, 11 Mar 2011 16:13:26 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111613.p2BGDQQ4085663@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 16:13:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219502 - in stable/7/sys/cddl: compat/opensolaris/sys
	dev/cyclic
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:13:26 -0000

Author: avg
Date: Fri Mar 11 16:13:26 2011
New Revision: 219502
URL: http://svn.freebsd.org/changeset/base/219502

Log:
  MFC r216254: opensolaris cyclic: fix deadlock and make a little bit
  closer to upstream

Modified:
  stable/7/sys/cddl/compat/opensolaris/sys/cyclic_impl.h
  stable/7/sys/cddl/dev/cyclic/cyclic.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/compat/opensolaris/sys/cyclic_impl.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/cyclic_impl.h	Fri Mar 11 16:11:42 2011	(r219501)
+++ stable/7/sys/cddl/compat/opensolaris/sys/cyclic_impl.h	Fri Mar 11 16:13:26 2011	(r219502)
@@ -288,7 +288,14 @@ typedef struct cyc_id {
 
 typedef struct cyc_xcallarg {
 	cyc_cpu_t *cyx_cpu;
-	hrtime_t cyx_exp;
+	cyc_handler_t *cyx_hdlr;
+	cyc_time_t *cyx_when;
+	cyc_index_t cyx_ndx;
+	cyc_index_t *cyx_heap;
+	cyclic_t *cyx_cyclics;
+	cyc_index_t cyx_size;
+	uint16_t cyx_flags;
+	int cyx_wait;
 } cyc_xcallarg_t;
 
 #define	CY_DEFAULT_PERCPU	1

Modified: stable/7/sys/cddl/dev/cyclic/cyclic.c
==============================================================================
--- stable/7/sys/cddl/dev/cyclic/cyclic.c	Fri Mar 11 16:11:42 2011	(r219501)
+++ stable/7/sys/cddl/dev/cyclic/cyclic.c	Fri Mar 11 16:13:26 2011	(r219502)
@@ -473,73 +473,6 @@ cyclic_expire(cyc_cpu_t *cpu, cyc_index_
 	(*handler)(arg);
 }
 
-static void
-cyclic_enable_xcall(void *v)
-{
-	cyc_xcallarg_t *argp = v;
-	cyc_cpu_t *cpu = argp->cyx_cpu;
-	cyc_backend_t *be = cpu->cyp_backend;
-
-	be->cyb_enable(be->cyb_arg);
-}
-
-static void
-cyclic_enable(cyc_cpu_t *cpu)
-{
-	cyc_backend_t *be = cpu->cyp_backend;
-	cyc_xcallarg_t arg;
-
-	arg.cyx_cpu = cpu;
-
-	/* Cross call to the target CPU */
-	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_enable_xcall, &arg);
-}
-
-static void
-cyclic_disable_xcall(void *v)
-{
-	cyc_xcallarg_t *argp = v;
-	cyc_cpu_t *cpu = argp->cyx_cpu;
-	cyc_backend_t *be = cpu->cyp_backend;
-
-	be->cyb_disable(be->cyb_arg);
-}
-
-static void
-cyclic_disable(cyc_cpu_t *cpu)
-{
-	cyc_backend_t *be = cpu->cyp_backend;
-	cyc_xcallarg_t arg;
-
-	arg.cyx_cpu = cpu;
-
-	/* Cross call to the target CPU */
-	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_disable_xcall, &arg);
-}
-
-static void
-cyclic_reprogram_xcall(void *v)
-{
-	cyc_xcallarg_t *argp = v;
-	cyc_cpu_t *cpu = argp->cyx_cpu;
-	cyc_backend_t *be = cpu->cyp_backend;
-
-	be->cyb_reprogram(be->cyb_arg, argp->cyx_exp);
-}
-
-static void
-cyclic_reprogram(cyc_cpu_t *cpu, hrtime_t exp)
-{
-	cyc_backend_t *be = cpu->cyp_backend;
-	cyc_xcallarg_t arg;
-
-	arg.cyx_cpu = cpu;
-	arg.cyx_exp = exp;
-
-	/* Cross call to the target CPU */
-	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu, cyclic_reprogram_xcall, &arg);
-}
-
 /*
  *  cyclic_fire(cpu_t *)
  *
@@ -570,17 +503,15 @@ static void
 cyclic_fire(cpu_t *c)
 {
 	cyc_cpu_t *cpu = c->cpu_cyclic;
-
-	mtx_lock_spin(&cpu->cyp_mtx);
-
+	cyc_backend_t *be = cpu->cyp_backend;
 	cyc_index_t *heap = cpu->cyp_heap;
 	cyclic_t *cyclic, *cyclics = cpu->cyp_cyclics;
+	void *arg = be->cyb_arg;
 	hrtime_t now = gethrtime();
 	hrtime_t exp;
 
 	if (cpu->cyp_nelems == 0) {
 		/* This is a spurious fire. */
-		mtx_unlock_spin(&cpu->cyp_mtx);
 		return;
 	}
 
@@ -631,8 +562,45 @@ cyclic_fire(cpu_t *c)
 	 * Now we have a cyclic in the root slot which isn't in the past;
 	 * reprogram the interrupt source.
 	 */
-	cyclic_reprogram(cpu, exp);
+	be->cyb_reprogram(arg, exp);
+}
+
+static void
+cyclic_expand_xcall(cyc_xcallarg_t *arg)
+{
+	cyc_cpu_t *cpu = arg->cyx_cpu;
+	cyc_index_t new_size = arg->cyx_size, size = cpu->cyp_size, i;
+	cyc_index_t *new_heap = arg->cyx_heap;
+	cyclic_t *cyclics = cpu->cyp_cyclics, *new_cyclics = arg->cyx_cyclics;
+
+	/* Disable preemption and interrupts. */
+	mtx_lock_spin(&cpu->cyp_mtx);
+
+	/*
+	 * Assert that the new size is a power of 2.
+	 */
+	ASSERT((new_size & (new_size - 1)) == 0);
+	ASSERT(new_size == (size << 1));
+	ASSERT(cpu->cyp_heap != NULL && cpu->cyp_cyclics != NULL);
+
+	bcopy(cpu->cyp_heap, new_heap, sizeof (cyc_index_t) * size);
+	bcopy(cyclics, new_cyclics, sizeof (cyclic_t) * size);
+
+	/*
+	 * Set up the free list, and set all of the new cyclics to be CYF_FREE.
+	 */
+	for (i = size; i < new_size; i++) {
+		new_heap[i] = i;
+		new_cyclics[i].cy_flags = CYF_FREE;
+	}
 
+	/*
+	 * We can go ahead and plow the value of cyp_heap and cyp_cyclics;
+	 * cyclic_expand() has kept a copy.
+	 */
+	cpu->cyp_heap = new_heap;
+	cpu->cyp_cyclics = new_cyclics;
+	cpu->cyp_size = new_size;
 	mtx_unlock_spin(&cpu->cyp_mtx);
 }
 
@@ -643,102 +611,70 @@ cyclic_fire(cpu_t *c)
 static void
 cyclic_expand(cyc_cpu_t *cpu)
 {
-	cyc_index_t new_size, old_size, i;
+	cyc_index_t new_size, old_size;
 	cyc_index_t *new_heap, *old_heap;
 	cyclic_t *new_cyclics, *old_cyclics;
+	cyc_xcallarg_t arg;
+	cyc_backend_t *be = cpu->cyp_backend;
 
 	ASSERT(MUTEX_HELD(&cpu_lock));
 
-	if ((new_size = ((old_size = cpu->cyp_size) << 1)) == 0)
+	old_heap = cpu->cyp_heap;
+	old_cyclics = cpu->cyp_cyclics;
+
+	if ((new_size = ((old_size = cpu->cyp_size) << 1)) == 0) {
 		new_size = CY_DEFAULT_PERCPU;
+		ASSERT(old_heap == NULL && old_cyclics == NULL);
+	}
 
 	/*
 	 * Check that the new_size is a power of 2.
 	 */
 	ASSERT(((new_size - 1) & new_size) == 0);
 
-	/* Unlock the mutex while allocating memory so we can wait... */
-	mtx_unlock_spin(&cpu->cyp_mtx);
-
 	new_heap = malloc(sizeof(cyc_index_t) * new_size, M_CYCLIC, M_WAITOK);
 	new_cyclics = malloc(sizeof(cyclic_t) * new_size, M_CYCLIC, M_ZERO | M_WAITOK);
 
-	/* Grab the lock again now we've got the memory... */
-	mtx_lock_spin(&cpu->cyp_mtx);
-
-	/* Check if another thread beat us while the mutex was unlocked. */
-	if (old_size != cpu->cyp_size) {
-		/* Oh well, he won. */
-		mtx_unlock_spin(&cpu->cyp_mtx);
-
-		free(new_heap, M_CYCLIC);
-		free(new_cyclics, M_CYCLIC);
-
-		mtx_lock_spin(&cpu->cyp_mtx);
-		return;
-	}
-
-	old_heap = cpu->cyp_heap;
-	old_cyclics = cpu->cyp_cyclics;
-
-	bcopy(cpu->cyp_heap, new_heap, sizeof (cyc_index_t) * old_size);
-	bcopy(old_cyclics, new_cyclics, sizeof (cyclic_t) * old_size);
-
-	/*
-	 * Set up the free list, and set all of the new cyclics to be CYF_FREE.
-	 */
-	for (i = old_size; i < new_size; i++) {
-		new_heap[i] = i;
-		new_cyclics[i].cy_flags = CYF_FREE;
-	}
+	arg.cyx_cpu = cpu;
+	arg.cyx_heap = new_heap;
+	arg.cyx_cyclics = new_cyclics;
+	arg.cyx_size = new_size;
 
-	/*
-	 * We can go ahead and plow the value of cyp_heap and cyp_cyclics;
-	 * cyclic_expand() has kept a copy.
-	 */
-	cpu->cyp_heap = new_heap;
-	cpu->cyp_cyclics = new_cyclics;
-	cpu->cyp_size = new_size;
+	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu,
+	    (cyc_func_t)cyclic_expand_xcall, &arg);
 
 	if (old_cyclics != NULL) {
 		ASSERT(old_heap != NULL);
 		ASSERT(old_size != 0);
-		mtx_unlock_spin(&cpu->cyp_mtx);
-
 		free(old_cyclics, M_CYCLIC);
 		free(old_heap, M_CYCLIC);
-
-		mtx_lock_spin(&cpu->cyp_mtx);
 	}
 }
 
-static cyc_index_t
-cyclic_add_here(cyc_cpu_t *cpu, cyc_handler_t *hdlr,
-    cyc_time_t *when, uint16_t flags)
+static void
+cyclic_add_xcall(cyc_xcallarg_t *arg)
 {
+	cyc_cpu_t *cpu = arg->cyx_cpu;
+	cyc_handler_t *hdlr = arg->cyx_hdlr;
+	cyc_time_t *when = arg->cyx_when;
+	cyc_backend_t *be = cpu->cyp_backend;
 	cyc_index_t ndx, nelems;
+	cyb_arg_t bar = be->cyb_arg;
 	cyclic_t *cyclic;
 
-	ASSERT(MUTEX_HELD(&cpu_lock));
-
-	mtx_lock_spin(&cpu->cyp_mtx);
-
-	ASSERT(!(cpu->cyp_cpu->cpu_flags & CPU_OFFLINE));
-	ASSERT(when->cyt_when >= 0 && when->cyt_interval > 0);
-
-	while (cpu->cyp_nelems == cpu->cyp_size)
-		cyclic_expand(cpu);
-
 	ASSERT(cpu->cyp_nelems < cpu->cyp_size);
 
+	/* Disable preemption and interrupts. */
+	mtx_lock_spin(&cpu->cyp_mtx);
 	nelems = cpu->cyp_nelems++;
 
-	if (nelems == 0)
+	if (nelems == 0) {
 		/*
 		 * If this is the first element, we need to enable the
 		 * backend on this CPU.
 		 */
-		cyclic_enable(cpu);
+		be->cyb_enable(bar);
+	}
 
 	ndx = cpu->cyp_heap[nelems];
 	cyclic = &cpu->cyp_cyclics[ndx];
@@ -746,14 +682,20 @@ cyclic_add_here(cyc_cpu_t *cpu, cyc_hand
 	ASSERT(cyclic->cy_flags == CYF_FREE);
 	cyclic->cy_interval = when->cyt_interval;
 
-	if (when->cyt_when == 0)
-		cyclic->cy_expire = gethrtime() + cyclic->cy_interval;
-	else
+	if (when->cyt_when == 0) {
+		/*
+		 * If a start time hasn't been explicitly specified, we'll
+		 * start on the next interval boundary.
+		 */
+		cyclic->cy_expire = (gethrtime() / cyclic->cy_interval + 1) *
+		    cyclic->cy_interval;
+	} else {
 		cyclic->cy_expire = when->cyt_when;
+	}
 
 	cyclic->cy_handler = hdlr->cyh_func;
 	cyclic->cy_arg = hdlr->cyh_arg;
-	cyclic->cy_flags = flags;
+	cyclic->cy_flags = arg->cyx_flags;
 
 	if (cyclic_upheap(cpu, nelems)) {
 		hrtime_t exp = cyclic->cy_expire;
@@ -762,31 +704,63 @@ cyclic_add_here(cyc_cpu_t *cpu, cyc_hand
 		 * If our upheap propagated to the root, we need to
 		 * reprogram the interrupt source.
 		 */
-		cyclic_reprogram(cpu, exp);
+		be->cyb_reprogram(bar, exp);
 	}
-
 	mtx_unlock_spin(&cpu->cyp_mtx);
 
-	return (ndx);
+	arg->cyx_ndx = ndx;
 }
 
-
-static int
-cyclic_remove_here(cyc_cpu_t *cpu, cyc_index_t ndx, cyc_time_t *when, int wait)
+static cyc_index_t
+cyclic_add_here(cyc_cpu_t *cpu, cyc_handler_t *hdlr,
+    cyc_time_t *when, uint16_t flags)
 {
-	cyc_index_t nelems, i;
-	cyclic_t *cyclic;
-	cyc_index_t *heap, last;
+	cyc_backend_t *be = cpu->cyp_backend;
+	cyb_arg_t bar = be->cyb_arg;
+	cyc_xcallarg_t arg;
 
 	ASSERT(MUTEX_HELD(&cpu_lock));
-	ASSERT(wait == CY_WAIT || wait == CY_NOWAIT);
+	ASSERT(!(cpu->cyp_cpu->cpu_flags & CPU_OFFLINE));
+	ASSERT(when->cyt_when >= 0 && when->cyt_interval > 0);
 
-	mtx_lock_spin(&cpu->cyp_mtx);
+	if (cpu->cyp_nelems == cpu->cyp_size) {
+		/*
+		 * This is expensive; it will cross call onto the other
+		 * CPU to perform the expansion.
+		 */
+		cyclic_expand(cpu);
+		ASSERT(cpu->cyp_nelems < cpu->cyp_size);
+	}
+
+	/*
+	 * By now, we know that we're going to be able to successfully
+	 * perform the add.  Now cross call over to the CPU of interest to
+	 * actually add our cyclic.
+	 */
+	arg.cyx_cpu = cpu;
+	arg.cyx_hdlr = hdlr;
+	arg.cyx_when = when;
+	arg.cyx_flags = flags;
+
+	be->cyb_xcall(bar, cpu->cyp_cpu, (cyc_func_t)cyclic_add_xcall, &arg);
+
+	return (arg.cyx_ndx);
+}
 
-	heap = cpu->cyp_heap;
+static void
+cyclic_remove_xcall(cyc_xcallarg_t *arg)
+{
+	cyc_cpu_t *cpu = arg->cyx_cpu;
+	cyc_backend_t *be = cpu->cyp_backend;
+	cyb_arg_t bar = be->cyb_arg;
+	cyc_index_t ndx = arg->cyx_ndx, nelems = cpu->cyp_nelems, i;
+	cyc_index_t *heap = cpu->cyp_heap, last;
+	cyclic_t *cyclic;
 
-	nelems = cpu->cyp_nelems;
+	ASSERT(nelems > 0);
 
+	/* Disable preemption and interrupts. */
+	mtx_lock_spin(&cpu->cyp_mtx);
 	cyclic = &cpu->cyp_cyclics[ndx];
 
 	/*
@@ -794,11 +768,17 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i
 	 * removed as part of a juggling operation, the expiration time
 	 * will be used when the cyclic is added to the new CPU.
 	 */
-	if (when != NULL) {
-		when->cyt_when = cyclic->cy_expire;
-		when->cyt_interval = cyclic->cy_interval;
+	if (arg->cyx_when != NULL) {
+		arg->cyx_when->cyt_when = cyclic->cy_expire;
+		arg->cyx_when->cyt_interval = cyclic->cy_interval;
 	}
 
+	/*
+	 * Now set the flags to CYF_FREE.  We don't need a membar_enter()
+	 * between zeroing pend and setting the flags because we're at
+	 * CY_HIGH_LEVEL (that is, the zeroing of pend and the setting
+	 * of cy_flags appear atomic to softints).
+	 */
 	cyclic->cy_flags = CYF_FREE;
 
 	for (i = 0; i < nelems; i++) {
@@ -811,19 +791,21 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i
 
 	cpu->cyp_nelems = --nelems;
 
-	if (nelems == 0)
+	if (nelems == 0) {
 		/*
 		 * If we just removed the last element, then we need to
 		 * disable the backend on this CPU.
 		 */
-		cyclic_disable(cpu);
+		be->cyb_disable(bar);
+	}
 
-	if (i == nelems)
+	if (i == nelems) {
 		/*
 		 * If we just removed the last element of the heap, then
 		 * we don't have to downheap.
 		 */
-		goto done;
+		goto out;
+	}
 
 	/*
 	 * Swap the last element of the heap with the one we want to
@@ -833,17 +815,18 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i
 	heap[i] = (last = heap[nelems]);
 	heap[nelems] = ndx;
 
-	if (i == 0)
+	if (i == 0) {
 		cyclic_downheap(cpu, 0);
-	else {
+	} else {
 		if (cyclic_upheap(cpu, i) == 0) {
 			/*
 			 * The upheap didn't propagate to the root; if it
 			 * didn't propagate at all, we need to downheap.
 			 */
-			if (heap[i] == last)
+			if (heap[i] == last) {
 				cyclic_downheap(cpu, i);
-			goto done;
+			}
+			goto out;
 		}
 	}
 
@@ -854,10 +837,27 @@ cyclic_remove_here(cyc_cpu_t *cpu, cyc_i
 	cyclic = &cpu->cyp_cyclics[heap[0]];
 
 	ASSERT(nelems != 0);
-	cyclic_reprogram(cpu, cyclic->cy_expire);
-
-done:
+	be->cyb_reprogram(bar, cyclic->cy_expire);
+out:
 	mtx_unlock_spin(&cpu->cyp_mtx);
+}
+
+static int
+cyclic_remove_here(cyc_cpu_t *cpu, cyc_index_t ndx, cyc_time_t *when, int wait)
+{
+	cyc_backend_t *be = cpu->cyp_backend;
+	cyc_xcallarg_t arg;
+
+	ASSERT(MUTEX_HELD(&cpu_lock));
+	ASSERT(wait == CY_WAIT || wait == CY_NOWAIT);
+
+	arg.cyx_ndx = ndx;
+	arg.cyx_cpu = cpu;
+	arg.cyx_when = when;
+	arg.cyx_wait = wait;
+
+	be->cyb_xcall(be->cyb_arg, cpu->cyp_cpu,
+	    (cyc_func_t)cyclic_remove_xcall, &arg);
 
 	return (1);
 }
@@ -1214,15 +1214,10 @@ cyclic_add_omni(cyc_omni_handler_t *omni
 
 	idp->cyi_omni_hdlr = *omni;
 
-	for (i = 0; i < MAXCPU; i++) {
-		if (pcpu_find(i) == NULL)
-			continue;
-
+	CPU_FOREACH(i) {
 		c = &solaris_cpu[i];
-
 		if ((cpu = c->cpu_cyclic) == NULL)
 			continue;
-
 		cyclic_omni_start(idp, cpu);
 	}
 
@@ -1325,12 +1320,8 @@ cyclic_mp_init(void)
 
 	mutex_enter(&cpu_lock);
 
-	for (i = 0; i <= mp_maxid; i++) {
-		if (pcpu_find(i) == NULL)
-			continue;
-
+	CPU_FOREACH(i) {
 		c = &solaris_cpu[i];
-
 		if (c->cpu_cyclic == NULL)
 			cyclic_configure(c);
 	}
@@ -1349,10 +1340,8 @@ cyclic_uninit(void)
 			continue;
 
 		c = &solaris_cpu[id];
-
 		if (c->cpu_cyclic == NULL)
 			continue;
-
 		cyclic_unconfigure(c);
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:14:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E04741065676;
	Fri, 11 Mar 2011 16:14:06 +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 CDEC68FC18;
	Fri, 11 Mar 2011 16:14: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 p2BGE6li085720;
	Fri, 11 Mar 2011 16:14:06 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BGE6MX085718;
	Fri, 11 Mar 2011 16:14:06 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103111614.p2BGE6MX085718@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 11 Mar 2011 16:14:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219503 - stable/8/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:14:07 -0000

Author: jhb
Date: Fri Mar 11 16:14:06 2011
New Revision: 219503
URL: http://svn.freebsd.org/changeset/base/219503

Log:
  MFC 219135:
  Similar to 189574, properly handle subclasses of bus drivers when deleting
  a driver during kldunload.  Specifically, recursively walk the tree of
  subclasses of a given driver attachment's bus device class detaching all
  instances of that driver for each class and its subclasses.

Modified:
  stable/8/sys/kern/subr_bus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/subr_bus.c
==============================================================================
--- stable/8/sys/kern/subr_bus.c	Fri Mar 11 16:13:26 2011	(r219502)
+++ stable/8/sys/kern/subr_bus.c	Fri Mar 11 16:14:06 2011	(r219503)
@@ -1023,10 +1023,12 @@ devclass_find(const char *classname)
  * is called by devclass_add_driver to accomplish the recursive
  * notification of all the children classes of dc, as well as dc.
  * Each layer will have BUS_DRIVER_ADDED() called for all instances of
- * the devclass.  We do a full search here of the devclass list at
- * each iteration level to save storing children-lists in the devclass
- * structure.  If we ever move beyond a few dozen devices doing this,
- * we may need to reevaluate...
+ * the devclass.
+ *
+ * We do a full search here of the devclass list at each iteration
+ * level to save storing children-lists in the devclass structure.  If
+ * we ever move beyond a few dozen devices doing this, we may need to
+ * reevaluate...
  *
  * @param dc		the devclass to edit
  * @param driver	the driver that was just added
@@ -1121,6 +1123,78 @@ devclass_add_driver(devclass_t dc, drive
 }
 
 /**
+ * @brief Register that a device driver has been deleted from a devclass
+ *
+ * Register that a device driver has been removed from a devclass.
+ * This is called by devclass_delete_driver to accomplish the
+ * recursive notification of all the children classes of busclass, as
+ * well as busclass.  Each layer will attempt to detach the driver
+ * from any devices that are children of the bus's devclass.  The function
+ * will return an error if a device fails to detach.
+ * 
+ * We do a full search here of the devclass list at each iteration
+ * level to save storing children-lists in the devclass structure.  If
+ * we ever move beyond a few dozen devices doing this, we may need to
+ * reevaluate...
+ *
+ * @param busclass	the devclass of the parent bus
+ * @param dc		the devclass of the driver being deleted
+ * @param driver	the driver being deleted
+ */
+static int
+devclass_driver_deleted(devclass_t busclass, devclass_t dc, driver_t *driver)
+{
+	devclass_t parent;
+	device_t dev;
+	int error, i;
+
+	/*
+	 * Disassociate from any devices.  We iterate through all the
+	 * devices in the devclass of the driver and detach any which are
+	 * using the driver and which have a parent in the devclass which
+	 * we are deleting from.
+	 *
+	 * Note that since a driver can be in multiple devclasses, we
+	 * should not detach devices which are not children of devices in
+	 * the affected devclass.
+	 */
+	for (i = 0; i < dc->maxunit; i++) {
+		if (dc->devices[i]) {
+			dev = dc->devices[i];
+			if (dev->driver == driver && dev->parent &&
+			    dev->parent->devclass == busclass) {
+				if ((error = device_detach(dev)) != 0)
+					return (error);
+				device_set_driver(dev, NULL);
+				BUS_PROBE_NOMATCH(dev->parent, dev);
+				devnomatch(dev);
+				dev->flags |= DF_DONENOMATCH;
+			}
+		}
+	}
+
+	/*
+	 * Walk through the children classes.  Since we only keep a
+	 * single parent pointer around, we walk the entire list of
+	 * devclasses looking for children.  We set the
+	 * DC_HAS_CHILDREN flag when a child devclass is created on
+	 * the parent, so we only walk the list for those devclasses
+	 * that have children.
+	 */
+	if (!(busclass->flags & DC_HAS_CHILDREN))
+		return (0);
+	parent = busclass;
+	TAILQ_FOREACH(busclass, &devclasses, link) {
+		if (busclass->parent == parent) {
+			error = devclass_driver_deleted(busclass, dc, driver);
+			if (error)
+				return (error);
+		}
+	}
+	return (0);
+}
+
+/**
  * @brief Delete a device driver from a device class
  *
  * Delete a device driver from a devclass. This is normally called
@@ -1139,8 +1213,6 @@ devclass_delete_driver(devclass_t buscla
 {
 	devclass_t dc = devclass_find(driver->name);
 	driverlink_t dl;
-	device_t dev;
-	int i;
 	int error;
 
 	PDEBUG(("%s from devclass %s", driver->name, DEVCLANAME(busclass)));
@@ -1162,30 +1234,9 @@ devclass_delete_driver(devclass_t buscla
 		return (ENOENT);
 	}
 
-	/*
-	 * Disassociate from any devices.  We iterate through all the
-	 * devices in the devclass of the driver and detach any which are
-	 * using the driver and which have a parent in the devclass which
-	 * we are deleting from.
-	 *
-	 * Note that since a driver can be in multiple devclasses, we
-	 * should not detach devices which are not children of devices in
-	 * the affected devclass.
-	 */
-	for (i = 0; i < dc->maxunit; i++) {
-		if (dc->devices[i]) {
-			dev = dc->devices[i];
-			if (dev->driver == driver && dev->parent &&
-			    dev->parent->devclass == busclass) {
-				if ((error = device_detach(dev)) != 0)
-					return (error);
-				device_set_driver(dev, NULL);
-				BUS_PROBE_NOMATCH(dev->parent, dev);
-				devnomatch(dev);
-				dev->flags |= DF_DONENOMATCH;
-			}
-		}
-	}
+	error = devclass_driver_deleted(busclass, dc, driver);
+	if (error != 0)
+		return (error);
 
 	TAILQ_REMOVE(&busclass->drivers, dl, link);
 	free(dl, M_BUS);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:21:46 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0453E1065672;
	Fri, 11 Mar 2011 16:21:46 +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 CD0738FC15;
	Fri, 11 Mar 2011 16:21:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2BGLjcG086002;
	Fri, 11 Mar 2011 16:21:45 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BGLjTo086000;
	Fri, 11 Mar 2011 16:21:45 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103111621.p2BGLjTo086000@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 11 Mar 2011 16:21:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219504 - stable/8
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:21:46 -0000

Author: jhb
Date: Fri Mar 11 16:21:45 2011
New Revision: 219504
URL: http://svn.freebsd.org/changeset/base/219504

Log:
  MFC 219136:
  Use a suitable DIRPRFX for each invocation of make in the build32 and
  install32 targets so that the full path to each program or library is
  displayed in the make output.

Modified:
  stable/8/Makefile.inc1   (contents, props changed)

Modified: stable/8/Makefile.inc1
==============================================================================
--- stable/8/Makefile.inc1	Fri Mar 11 16:14:06 2011	(r219503)
+++ stable/8/Makefile.inc1	Fri Mar 11 16:21:45 2011	(r219504)
@@ -445,36 +445,38 @@ build32:
 .for _t in obj depend all
 	cd ${.CURDIR}/kerberos5/tools; \
 	    MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
-	    ${_t}
+	    DIRPRFX=kerberos5/tools/ ${_t}
 .endfor
 .endif
 .for _t in obj includes
-	cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t}
-	cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t}
+	cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t}
+	cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t}
 .if ${MK_CDDL} != "no"
-	cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t}
+	cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t}
 .endif
-	cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t}
+	cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t}
 .if ${MK_CRYPT} != "no"
-	cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t}
+	cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t}
 .endif
 .if ${MK_KERBEROS} != "no"
-	cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t}
+	cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t}
 .endif
 .endfor
 .for _dir in usr.bin/lex/lib
-	cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj
+	cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj
 .endfor
 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
 	cd ${.CURDIR}/${_dir}; \
 	    MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
-	    build-tools
+	    DIRPRFX=${_dir}/ build-tools
 .endfor
 	cd ${.CURDIR}; \
 	    ${LIB32WMAKE} -f Makefile.inc1 libraries
 .for _t in obj depend all
-	cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t}
-	cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} ${_t}
+	cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
+	    DIRPRFX=libexec/rtld-elf/ ${_t}
+	cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
+	    DIRPRFX=usr.bin/ldd ${_t}
 .endfor
 
 distribute32 install32:

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:24:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C3BE106564A;
	Fri, 11 Mar 2011 16:24:49 +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 5A41B8FC1C;
	Fri, 11 Mar 2011 16:24: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 p2BGOn2v086115;
	Fri, 11 Mar 2011 16:24:49 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BGOnDC086113;
	Fri, 11 Mar 2011 16:24:49 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103111624.p2BGOnDC086113@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 11 Mar 2011 16:24:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219505 - stable/8
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:24:49 -0000

Author: jhb
Date: Fri Mar 11 16:24:49 2011
New Revision: 219505
URL: http://svn.freebsd.org/changeset/base/219505

Log:
  MFC 219137: Fully honor KERNSRCDIR for 'make universe' if it is set.

Modified:
  stable/8/Makefile   (contents, props changed)

Modified: stable/8/Makefile
==============================================================================
--- stable/8/Makefile	Fri Mar 11 16:21:45 2011	(r219504)
+++ stable/8/Makefile	Fri Mar 11 16:24:49 2011	(r219505)
@@ -289,6 +289,7 @@ MAKE_JUST_WORLDS=	YES
 .else
 UNIVERSE_TARGET?=	buildworld
 .endif
+KERNSRCDIR?=		${.CURDIR}/sys
 
 .if defined(DOING_TINDERBOX)
 FAILFILE=tinderbox.failed
@@ -321,8 +322,8 @@ universe_${target}:
 	@echo ">> ${target} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
 .endif
 .if !defined(MAKE_JUST_WORLDS)
-.if exists(${.CURDIR}/sys/${target}/conf/NOTES)
-	@(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \
+.if exists(${KERNSRCDIR}/${target}/conf/NOTES)
+	@(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \
 	    ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
 	    (echo "${target} 'make LINT' failed," \
 	    "check _.${target}.makeLINT for details"| ${MAKEFAIL}))
@@ -336,7 +337,7 @@ universe_kernels: universe_kernconfs
 .if !defined(TARGET)
 TARGET!=	uname -m
 .endif
-KERNCONFS!=	cd ${.CURDIR}/sys/${TARGET}/conf && \
+KERNCONFS!=	cd ${KERNSRCDIR}/${TARGET}/conf && \
 		find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
 		! -name DEFAULTS ! -name NOTES
 universe_kernconfs:

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:43:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9DA5A1065689;
	Fri, 11 Mar 2011 16:43:39 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B3B48FC08;
	Fri, 11 Mar 2011 16:43: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 p2BGhdBW086627;
	Fri, 11 Mar 2011 16:43:39 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BGhdG6086622;
	Fri, 11 Mar 2011 16:43:39 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111643.p2BGhdG6086622@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 16:43:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219507 - stable/8/sys/dev/acpica
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:43:39 -0000

Author: avg
Date: Fri Mar 11 16:43:39 2011
New Revision: 219507
URL: http://svn.freebsd.org/changeset/base/219507

Log:
  MFC r216503: small cleanup of acpi battery status setting and checking
  
  PR:		kern/124744

Modified:
  stable/8/sys/dev/acpica/acpi_battery.c
  stable/8/sys/dev/acpica/acpi_cmbat.c
  stable/8/sys/dev/acpica/acpi_smbat.c
  stable/8/sys/dev/acpica/acpiio.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi_battery.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_battery.c	Fri Mar 11 16:30:30 2011	(r219506)
+++ stable/8/sys/dev/acpica/acpi_battery.c	Fri Mar 11 16:43:39 2011	(r219507)
@@ -102,8 +102,9 @@ acpi_battery_get_info_expire(void)
 int
 acpi_battery_bst_valid(struct acpi_bst *bst)
 {
-    return (bst->state < ACPI_BATT_STAT_MAX && bst->cap != ACPI_BATT_UNKNOWN &&
-	bst->volt != ACPI_BATT_UNKNOWN);
+
+    return (bst->state != ACPI_BATT_STAT_NOT_PRESENT &&
+	bst->cap != ACPI_BATT_UNKNOWN && bst->volt != ACPI_BATT_UNKNOWN);
 }
 
 /* Check _BIF results for validity. */

Modified: stable/8/sys/dev/acpica/acpi_cmbat.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_cmbat.c	Fri Mar 11 16:30:30 2011	(r219506)
+++ stable/8/sys/dev/acpica/acpi_cmbat.c	Fri Mar 11 16:43:39 2011	(r219507)
@@ -279,6 +279,12 @@ acpi_cmbat_get_bst(void *arg)
 	goto end;
     acpi_cmbat_info_updated(&sc->bst_lastupdated);
 
+    /* Clear out undefined/extended bits that might be set by hardware. */
+    sc->bst.state &= ACPI_BATT_STAT_BST_MASK;
+    if ((sc->bst.state & ACPI_BATT_STAT_INVALID) == ACPI_BATT_STAT_INVALID)
+	ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
+	    "battery reports simultaneous charging and discharging\n");
+
     /* XXX If all batteries are critical, perhaps we should suspend. */
     if (sc->bst.state & ACPI_BATT_STAT_CRITICAL) {
     	if ((sc->flags & ACPI_BATT_STAT_CRITICAL) == 0) {

Modified: stable/8/sys/dev/acpica/acpi_smbat.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_smbat.c	Fri Mar 11 16:30:30 2011	(r219506)
+++ stable/8/sys/dev/acpica/acpi_smbat.c	Fri Mar 11 16:43:39 2011	(r219507)
@@ -390,6 +390,7 @@ acpi_smbat_get_bst(device_t dev, struct 
 
 	if (val > 0) {
 		sc->bst.rate = val * factor;
+		sc->bst.state &= ~SMBATT_BS_DISCHARGING;
 		sc->bst.state |= ACPI_BATT_STAT_CHARGING;
 	} else if (val < 0)
 		sc->bst.rate = (-val) * factor;

Modified: stable/8/sys/dev/acpica/acpiio.h
==============================================================================
--- stable/8/sys/dev/acpica/acpiio.h	Fri Mar 11 16:30:30 2011	(r219506)
+++ stable/8/sys/dev/acpica/acpiio.h	Fri Mar 11 16:43:39 2011	(r219507)
@@ -74,11 +74,22 @@ struct acpi_bst {
     uint32_t volt;			/* Present Voltage */
 };
 
+/*
+ * Note that the following definitions represent status bits for internal
+ * driver state.  The first three of them (charging, discharging and critical)
+ * conveninetly conform to ACPI specification of status returned by _BST
+ * method.  Other definitions (not present, etc) are synthetic.
+ * Also note that according to the specification the charging and discharging
+ * status bits must not be set at the same time.
+ */
 #define ACPI_BATT_STAT_DISCHARG		0x0001
 #define ACPI_BATT_STAT_CHARGING		0x0002
 #define ACPI_BATT_STAT_CRITICAL		0x0004
-#define ACPI_BATT_STAT_NOT_PRESENT	0x0007
-#define ACPI_BATT_STAT_MAX		0x0007
+#define ACPI_BATT_STAT_INVALID					\
+    (ACPI_BATT_STAT_DISCHARG | ACPI_BATT_STAT_CHARGING)
+#define ACPI_BATT_STAT_BST_MASK					\
+    (ACPI_BATT_STAT_INVALID | ACPI_BATT_STAT_CRITICAL)
+#define ACPI_BATT_STAT_NOT_PRESENT	ACPI_BATT_STAT_BST_MASK
 
 union acpi_battery_ioctl_arg {
     int			 unit;	/* Device unit or ACPI_BATTERY_ALL_UNITS. */

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 16:58:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 650A3106564A;
	Fri, 11 Mar 2011 16:58:22 +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 3990A8FC12;
	Fri, 11 Mar 2011 16:58: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 p2BGwMvH087005;
	Fri, 11 Mar 2011 16:58:22 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BGwMJN087003;
	Fri, 11 Mar 2011 16:58:22 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103111658.p2BGwMJN087003@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 11 Mar 2011 16:58: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: r219508 - head/release
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 16:58:22 -0000

Author: nwhitehorn
Date: Fri Mar 11 16:58:21 2011
New Revision: 219508
URL: http://svn.freebsd.org/changeset/base/219508

Log:
  Add a wrapper script for Makefile.bsdinstall that does the source
  checkout/chroot/compile/release dance that the existing release Makefile
  does for those who want a totally pristine release build.

Added:
  head/release/generate-release.sh   (contents, props changed)

Added: head/release/generate-release.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/release/generate-release.sh	Fri Mar 11 16:58:21 2011	(r219508)
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# generate-release.sh: check out source trees, and build release components with
+#  totally clean, fresh trees
+#
+#  Usage: generate-release.sh svn-branch scratch-dir
+#
+# Environment variables:
+#  CVSUP_HOST: Host of a cvsup server to obtain the ports tree. Must be set
+#   to include ports.
+#  CVSUP_TAG:  CVS tag for ports (HEAD by default)
+#  MAKE_FLAGS: optional flags to pass to make (e.g. -j)
+# 
+#  Note: Since this requires a chroot, release cross-builds will not work!
+#
+# $FreeBSD$
+#
+
+mkdir -p $2/usr/src
+svn co svn://svn.freebsd.org/base/$1 $2/usr/src || exit 1
+if [ ! -z $CVSUP_HOST ]; then
+	cat > $2/ports-supfile << EOF
+	*default host=$CVSUP_HOST
+	*default base=/var/db
+	*default prefix=/usr
+	*default release=cvs tag=${CVSUP_TAG:-.}
+	*default delete use-rel-suffix
+	*default compress
+	ports-all
+EOF
+else
+	RELEASE_FLAGS=-DNOPORTS
+fi
+
+cd $2/usr/src
+make $MAKE_FLAGS buildworld || exit 1
+make installworld distribution DESTDIR=$2 || exit 1
+mount -t devfs devfs $2/dev
+
+if [ ! -z $CVSUP_HOST ]; then 
+	cp /etc/resolv.conf $2/etc/resolv.conf
+	chroot $2 /usr/bin/csup /ports-supfile || exit 1
+fi
+chroot $2 /bin/sh -c "cd /usr/src && make $MAKE_FLAGS buildworld buildkernel" || exit 1
+mkdir $2/R
+chroot $2 /bin/sh -c "cd /usr/src/release && MAKEOBJDIR=/R make -f Makefile.bsdinstall release $RELEASE_FLAGS" || exit 1
+

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 17:01:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5F3EE1065673;
	Fri, 11 Mar 2011 17:01:15 +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 33AE48FC08;
	Fri, 11 Mar 2011 17:01: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 p2BH1FeN087114;
	Fri, 11 Mar 2011 17:01:15 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BH1Fks087112;
	Fri, 11 Mar 2011 17:01:15 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103111701.p2BH1Fks087112@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 11 Mar 2011 17:01: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: r219509 - head/release
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 17:01:15 -0000

Author: nwhitehorn
Date: Fri Mar 11 17:01:14 2011
New Revision: 219509
URL: http://svn.freebsd.org/changeset/base/219509

Log:
  Add support for generating release documentation. Note that, due to the
  release documentation build being broken at the moment, this is only
  partially functional.

Modified:
  head/release/Makefile.bsdinstall

Modified: head/release/Makefile.bsdinstall
==============================================================================
--- head/release/Makefile.bsdinstall	Fri Mar 11 16:58:21 2011	(r219508)
+++ head/release/Makefile.bsdinstall	Fri Mar 11 17:01:14 2011	(r219509)
@@ -13,6 +13,7 @@
 #  PORTSDIR: location of ports tree to distribute (default: /usr/ports)
 #  NOPORTS:  if set, do not distribute ports tree
 #  NOSRC:    if set, do not distribute source tree
+#  NODOC:    if set, do not generate release documentation
 #  TARGET/TARGET_ARCH: architecture of built release 
 #
 
@@ -35,6 +36,9 @@ EXTRA_PACKAGES+= ports.txz
 .if !defined(NOSRC)
 EXTRA_PACKAGES+= src.txz
 .endif
+.if !defined(NODOC)
+EXTRA_PACKAGES+= reldoc
+.endif
 
 .include 
 
@@ -61,6 +65,17 @@ ports.txz:
 	ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
 	cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz --exclude usr/ports/distfiles --exclude usr/ports/packages --exclude 'usr/ports/INDEX*' --exclude work usr/ports
 
+reldoc:
+	cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc
+	-mkdir ${.OBJDIR}/reldoc
+	@for i in hardware readme relnotes errata; do \
+		cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
+		    ${.OBJDIR}/reldoc/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
+		cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
+		    ${.OBJDIR}/reldoc/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
+	done
+	@cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/readme/docbook.css ${.OBJDIR}/reldoc
+
 system: packagesystem
 # Install system
 	-mkdir ${.OBJDIR}/release
@@ -69,6 +84,8 @@ system: packagesystem
 # Copy distfiles
 	mkdir ${.OBJDIR}/release/usr/freebsd-dist
 	cp ${.OBJDIR}/*.txz ${.OBJDIR}/release/usr/freebsd-dist
+# Copy documentation, if generated
+	-cp ${.OBJDIR}/reldoc/* ${.OBJDIR}/release
 # Set up installation environment
 	ln -s /tmp/bsdinstall_etc/resolv.conf ${.OBJDIR}/release/etc/resolv.conf
 	echo sendmail_enable=\"NONE\" > ${.OBJDIR}/release/etc/rc.conf

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 17:12:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 96120106564A;
	Fri, 11 Mar 2011 17:12:39 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 836C58FC13;
	Fri, 11 Mar 2011 17:12: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 p2BHCdrY087366;
	Fri, 11 Mar 2011 17:12:39 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BHCdXi087361;
	Fri, 11 Mar 2011 17:12:39 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111712.p2BHCdXi087361@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 17:12:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219510 - stable/7/sys/dev/acpica
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 17:12:39 -0000

Author: avg
Date: Fri Mar 11 17:12:39 2011
New Revision: 219510
URL: http://svn.freebsd.org/changeset/base/219510

Log:
  MFC r216503: small cleanup of acpi battery status setting and checking
  
  PR:		kern/124744

Modified:
  stable/7/sys/dev/acpica/acpi_battery.c
  stable/7/sys/dev/acpica/acpi_cmbat.c
  stable/7/sys/dev/acpica/acpi_smbat.c
  stable/7/sys/dev/acpica/acpiio.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/acpica/acpi_battery.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_battery.c	Fri Mar 11 17:01:14 2011	(r219509)
+++ stable/7/sys/dev/acpica/acpi_battery.c	Fri Mar 11 17:12:39 2011	(r219510)
@@ -101,8 +101,9 @@ acpi_battery_get_info_expire(void)
 int
 acpi_battery_bst_valid(struct acpi_bst *bst)
 {
-    return (bst->state < ACPI_BATT_STAT_MAX && bst->cap != ACPI_BATT_UNKNOWN &&
-	bst->volt != ACPI_BATT_UNKNOWN);
+
+    return (bst->state != ACPI_BATT_STAT_NOT_PRESENT &&
+	bst->cap != ACPI_BATT_UNKNOWN && bst->volt != ACPI_BATT_UNKNOWN);
 }
 
 /* Check _BIF results for validity. */

Modified: stable/7/sys/dev/acpica/acpi_cmbat.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_cmbat.c	Fri Mar 11 17:01:14 2011	(r219509)
+++ stable/7/sys/dev/acpica/acpi_cmbat.c	Fri Mar 11 17:12:39 2011	(r219510)
@@ -278,6 +278,12 @@ acpi_cmbat_get_bst(void *arg)
 	goto end;
     acpi_cmbat_info_updated(&sc->bst_lastupdated);
 
+    /* Clear out undefined/extended bits that might be set by hardware. */
+    sc->bst.state &= ACPI_BATT_STAT_BST_MASK;
+    if ((sc->bst.state & ACPI_BATT_STAT_INVALID) == ACPI_BATT_STAT_INVALID)
+	ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
+	    "battery reports simultaneous charging and discharging\n");
+
     /* XXX If all batteries are critical, perhaps we should suspend. */
     if (sc->bst.state & ACPI_BATT_STAT_CRITICAL) {
     	if ((sc->flags & ACPI_BATT_STAT_CRITICAL) == 0) {

Modified: stable/7/sys/dev/acpica/acpi_smbat.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_smbat.c	Fri Mar 11 17:01:14 2011	(r219509)
+++ stable/7/sys/dev/acpica/acpi_smbat.c	Fri Mar 11 17:12:39 2011	(r219510)
@@ -389,6 +389,7 @@ acpi_smbat_get_bst(device_t dev, struct 
 
 	if (val > 0) {
 		sc->bst.rate = val * factor;
+		sc->bst.state &= ~SMBATT_BS_DISCHARGING;
 		sc->bst.state |= ACPI_BATT_STAT_CHARGING;
 	} else if (val < 0)
 		sc->bst.rate = (-val) * factor;

Modified: stable/7/sys/dev/acpica/acpiio.h
==============================================================================
--- stable/7/sys/dev/acpica/acpiio.h	Fri Mar 11 17:01:14 2011	(r219509)
+++ stable/7/sys/dev/acpica/acpiio.h	Fri Mar 11 17:12:39 2011	(r219510)
@@ -74,11 +74,22 @@ struct acpi_bst {
     uint32_t volt;			/* Present Voltage */
 };
 
+/*
+ * Note that the following definitions represent status bits for internal
+ * driver state.  The first three of them (charging, discharging and critical)
+ * conveninetly conform to ACPI specification of status returned by _BST
+ * method.  Other definitions (not present, etc) are synthetic.
+ * Also note that according to the specification the charging and discharging
+ * status bits must not be set at the same time.
+ */
 #define ACPI_BATT_STAT_DISCHARG		0x0001
 #define ACPI_BATT_STAT_CHARGING		0x0002
 #define ACPI_BATT_STAT_CRITICAL		0x0004
-#define ACPI_BATT_STAT_NOT_PRESENT	0x0007
-#define ACPI_BATT_STAT_MAX		0x0007
+#define ACPI_BATT_STAT_INVALID					\
+    (ACPI_BATT_STAT_DISCHARG | ACPI_BATT_STAT_CHARGING)
+#define ACPI_BATT_STAT_BST_MASK					\
+    (ACPI_BATT_STAT_INVALID | ACPI_BATT_STAT_CRITICAL)
+#define ACPI_BATT_STAT_NOT_PRESENT	ACPI_BATT_STAT_BST_MASK
 
 union acpi_battery_ioctl_arg {
     int			 unit;	/* Device unit or ACPI_BATTERY_ALL_UNITS. */

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 17:16:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15A911065679;
	Fri, 11 Mar 2011 17:16:22 +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 2B4E08FC08;
	Fri, 11 Mar 2011 17:16:20 +0000 (UTC)
Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua
	[212.40.38.101])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA14647;
	Fri, 11 Mar 2011 19:16:19 +0200 (EET) (envelope-from avg@freebsd.org)
Message-ID: <4D7A58E2.1010001@freebsd.org>
Date: Fri, 11 Mar 2011 19:16:18 +0200
From: Andriy Gapon 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110309 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
To: src-committers@freebsd.org
References: <201103111514.p2BFEeaH083790@svn.freebsd.org>
In-Reply-To: <201103111514.p2BFEeaH083790@svn.freebsd.org>
X-Enigmail-Version: 1.1.2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r219492 - stable/8/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 17:16:22 -0000

on 11/03/2011 17:14 Andriy Gapon said the following:
> Author: avg
> Date: Fri Mar 11 15:14:40 2011
> New Revision: 219492
> URL: http://svn.freebsd.org/changeset/base/219492
> 
> Log:
>   MFC r215750: taskqueue: drop unused tq_name field

In stable/7 this field is still used in tasqueue_find function.

> Modified:
>   stable/8/sys/kern/subr_taskqueue.c
> Directory Properties:
>   stable/8/sys/   (props changed)
>   stable/8/sys/amd64/include/xen/   (props changed)
>   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
>   stable/8/sys/contrib/dev/acpica/   (props changed)
>   stable/8/sys/contrib/pf/   (props changed)
> 
> Modified: stable/8/sys/kern/subr_taskqueue.c
> ==============================================================================
> --- stable/8/sys/kern/subr_taskqueue.c	Fri Mar 11 15:06:56 2011	(r219491)
> +++ stable/8/sys/kern/subr_taskqueue.c	Fri Mar 11 15:14:40 2011	(r219492)
> @@ -53,7 +53,6 @@ struct taskqueue_busy {
>  
>  struct taskqueue {
>  	STAILQ_HEAD(, task)	tq_queue;
> -	const char		*tq_name;
>  	taskqueue_enqueue_fn	tq_enqueue;
>  	void			*tq_context;
>  	TAILQ_HEAD(, taskqueue_busy) tq_active;
> @@ -98,7 +97,7 @@ TQ_SLEEP(struct taskqueue *tq, void *p, 
>  }
>  
>  static struct taskqueue *
> -_taskqueue_create(const char *name, int mflags,
> +_taskqueue_create(const char *name __unused, int mflags,
>  		 taskqueue_enqueue_fn enqueue, void *context,
>  		 int mtxflags, const char *mtxname)
>  {
> @@ -110,7 +109,6 @@ _taskqueue_create(const char *name, int 
>  
>  	STAILQ_INIT(&queue->tq_queue);
>  	TAILQ_INIT(&queue->tq_active);
> -	queue->tq_name = name;
>  	queue->tq_enqueue = enqueue;
>  	queue->tq_context = context;
>  	queue->tq_spin = (mtxflags & MTX_SPIN) != 0;


-- 
Andriy Gapon

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 17:33:32 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B223106564A;
	Fri, 11 Mar 2011 17:33:32 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0FFCB8FC0C;
	Fri, 11 Mar 2011 17:33: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 p2BHXVq1087819;
	Fri, 11 Mar 2011 17:33:31 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BHXVtR087816;
	Fri, 11 Mar 2011 17:33:31 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103111733.p2BHXVtR087816@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 11 Mar 2011 17:33: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: r219511 - head/tools/test/malloc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 17:33:32 -0000

Author: brucec
Date: Fri Mar 11 17:33:31 2011
New Revision: 219511
URL: http://svn.freebsd.org/changeset/base/219511

Log:
  Fix warnings and style(9) issues.
  Set WARNS to 6.
  
  MFC after:	1 week

Modified:
  head/tools/test/malloc/Makefile
  head/tools/test/malloc/main.c

Modified: head/tools/test/malloc/Makefile
==============================================================================
--- head/tools/test/malloc/Makefile	Fri Mar 11 17:12:39 2011	(r219510)
+++ head/tools/test/malloc/Makefile	Fri Mar 11 17:33:31 2011	(r219511)
@@ -4,6 +4,7 @@ SRCS=	main.c
 .PATH:	${.CURDIR}/../../../lib/libc/stdlib
 
 NO_MAN=
+WARNS?=6
 
 test:	malloc
 	@echo

Modified: head/tools/test/malloc/main.c
==============================================================================
--- head/tools/test/malloc/main.c	Fri Mar 11 17:12:39 2011	(r219510)
+++ head/tools/test/malloc/main.c	Fri Mar 11 17:33:31 2011	(r219511)
@@ -1,6 +1,7 @@
 /* $FreeBSD$ */
 #include 
 #include 
+#include 
 #include 
 
 u_long NBUCKETS		= 2000;
@@ -12,25 +13,25 @@ char **foo;
 int
 main(int argc, char **argv) 
 {
-    int i,j,k;
+    u_long i,j,k;
     
     if (argc > 1) NOPS     = strtoul(argv[1],0,0);
     if (argc > 2) NBUCKETS = strtoul(argv[2],0,0);
     if (argc > 3) NSIZE	   = strtoul(argv[3],0,0);
-    printf("BRK(0)=%x ",sbrk(0));
-    foo = malloc (sizeof *foo * NBUCKETS);
-    memset(foo,0,sizeof *foo * NBUCKETS);
+    printf("BRK(0)=%p ", sbrk(0));
+    foo = malloc(sizeof(*foo) * NBUCKETS);
+    memset(foo, 0, sizeof(*foo) * NBUCKETS);
     for (i = 1; i <= 4096; i *= 2) {
-        for (j = 0 ; j < 40960/i && j < NBUCKETS; j++) {
+        for (j = 0; j < 40960/i && j < NBUCKETS; j++) {
 	    foo[j] = malloc(i);
         }
-        for (j = 0 ; j < 40960/i && j < NBUCKETS; j++) {
+        for (j = 0; j < 40960/i && j < NBUCKETS; j++) {
 	    free(foo[j]);
-	    foo[j] = 0;
+	    foo[j] = NULL;
         }
     }
 
-    for (i = 0 ; i < NOPS ; i++) {
+    for (i = 0; i < NOPS; i++) {
 	j = random() % NBUCKETS;
 	k = random() % NSIZE;
 	foo[j] = realloc(foo[j], k & 1 ? 0 : k);
@@ -39,19 +40,19 @@ main(int argc, char **argv) 
 		 * Workaround because realloc return bogus pointer rather than
 		 * NULL if passed zero length.
 		 */
-		foo[j] = 0;
+		foo[j] = NULL;
 	}
 	if (foo[j])
 	    foo[j][0] = 1;
     }
-    printf("BRK(1)=%x ",sbrk(0));
-    for (j = 0 ; j < NBUCKETS ; j++) {
+    printf("BRK(1)=%p ", sbrk(0));
+    for (j = 0; j < NBUCKETS; j++) {
 	if (foo[j]) {
 	    free(foo[j]);
-	    foo[j] = 0;
+	    foo[j] = NULL;
 	}
     }
-    printf("BRK(2)=%x NOPS=%lu NBUCKETS=%lu NSIZE=%lu\n",
-	sbrk(0),NOPS,NBUCKETS,NSIZE);
+    printf("BRK(2)=%p NOPS=%lu NBUCKETS=%lu NSIZE=%lu\n",
+	sbrk(0), NOPS, NBUCKETS, NSIZE);
     return 0;
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 17:47:59 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C84EF1065670;
	Fri, 11 Mar 2011 17:47:59 +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 9D2848FC14;
	Fri, 11 Mar 2011 17:47: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 p2BHlxwI088143;
	Fri, 11 Mar 2011 17:47:59 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BHlxTX088141;
	Fri, 11 Mar 2011 17:47:59 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103111747.p2BHlxTX088141@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 11 Mar 2011 17:47: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: r219512 - head/release
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 17:47:59 -0000

Author: nwhitehorn
Date: Fri Mar 11 17:47:59 2011
New Revision: 219512
URL: http://svn.freebsd.org/changeset/base/219512

Log:
  Fix bugs and make improvements to documentation renaming.
  
  Submitted by:	Garrett Cooper

Modified:
  head/release/Makefile.bsdinstall

Modified: head/release/Makefile.bsdinstall
==============================================================================
--- head/release/Makefile.bsdinstall	Fri Mar 11 17:33:31 2011	(r219511)
+++ head/release/Makefile.bsdinstall	Fri Mar 11 17:47:59 2011	(r219512)
@@ -19,6 +19,7 @@
 
 WORLDDIR?=	${.CURDIR}/..
 PORTSDIR?=	/usr/ports
+RELNOTES_LANG?= en_US.ISO8859-1
 
 TARGET_ARCH?=	${MACHINE_ARCH}
 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
@@ -68,12 +69,12 @@ ports.txz:
 reldoc:
 	cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc
 	-mkdir ${.OBJDIR}/reldoc
-	@for i in hardware readme relnotes errata; do \
-		cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
-		    ${.OBJDIR}/reldoc/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
-		cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
-		    ${.OBJDIR}/reldoc/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
-	done
+.for i in hardware readme relnotes errata
+	ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/$i/article.txt \
+	    ${.OBJDIR}/reldoc/${i:U}.TXT
+	ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/$i/article.html \
+	    ${.OBJDIR}/reldoc/${i:U}.HTM
+.endfor
 	@cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/readme/docbook.css ${.OBJDIR}/reldoc
 
 system: packagesystem
@@ -85,7 +86,9 @@ system: packagesystem
 	mkdir ${.OBJDIR}/release/usr/freebsd-dist
 	cp ${.OBJDIR}/*.txz ${.OBJDIR}/release/usr/freebsd-dist
 # Copy documentation, if generated
-	-cp ${.OBJDIR}/reldoc/* ${.OBJDIR}/release
+.if !defined(NODOC)
+	cp ${.OBJDIR}/reldoc/* ${.OBJDIR}/release
+.endif
 # Set up installation environment
 	ln -s /tmp/bsdinstall_etc/resolv.conf ${.OBJDIR}/release/etc/resolv.conf
 	echo sendmail_enable=\"NONE\" > ${.OBJDIR}/release/etc/rc.conf

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:07:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 737C01065670;
	Fri, 11 Mar 2011 18:07:49 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 60F8F8FC19;
	Fri, 11 Mar 2011 18:07: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 p2BI7nuJ088618;
	Fri, 11 Mar 2011 18:07:49 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BI7nXd088616;
	Fri, 11 Mar 2011 18:07:49 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111807.p2BI7nXd088616@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 18:07:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219513 - stable/8/sys/dev/acpi_support
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:07:49 -0000

Author: avg
Date: Fri Mar 11 18:07:49 2011
New Revision: 219513
URL: http://svn.freebsd.org/changeset/base/219513

Log:
  MFC r216376: acpi_fujitsu: update for P8010
  
  PR:		kern/121102

Modified:
  stable/8/sys/dev/acpi_support/acpi_fujitsu.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/acpi_support/acpi_fujitsu.c
==============================================================================
--- stable/8/sys/dev/acpi_support/acpi_fujitsu.c	Fri Mar 11 17:47:59 2011	(r219512)
+++ stable/8/sys/dev/acpi_support/acpi_fujitsu.c	Fri Mar 11 18:07:49 2011	(r219513)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2002 Sean Bullington 
- *               2003-2006 Anish Mistry 
+ *               2003-2008 Anish Mistry 
  *               2004 Mark Santcroos 
  * All Rights Reserved.
  *
@@ -86,6 +86,7 @@ ACPI_MODULE_NAME("Fujitsu")
 #define METHOD_RVOL	6
 #define METHOD_GSIF	7
 #define METHOD_GHKS	8
+#define METHOD_GBLS	9
 
 /* Notify event */
 #define	ACPI_NOTIFY_STATUS_CHANGED	0x80
@@ -110,6 +111,7 @@ struct acpi_fujitsu_softc {
 	/* Control methods */
 	struct int_nameval	_sta,	/* unused */
 				gbll,	/* brightness */
+				gbls,	/* get brightness state */
 				ghks,	/* hotkey selector */
 				gbuf,	/* unused (buffer?) */
 				gmou,	/* mouse */
@@ -191,6 +193,11 @@ static struct {
 		.description	= "Brightness level of the LCD panel"
 	},
 	{
+		.name		= "lcd_brightness",
+		.method		= METHOD_GBLS,
+		.description	= "Brightness level of the LCD panel"
+	},
+	{
 		.name		= "volume",
 		.method		= METHOD_GVOL,
 		.description	= "Speakers/headphones volume level"
@@ -360,6 +367,7 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
 	/* Setup all of the names for each control method */
 	sc->_sta.name = "_STA";
 	sc->gbll.name = "GBLL";
+	sc->gbls.name = "GBLS";
 	sc->ghks.name = "GHKS";
 	sc->gmou.name = "GMOU";
 	sc->gsif.name = "GSIF";
@@ -387,6 +395,9 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
 			case METHOD_GBLL:
 				exists = sc->gbll.exists;
 				break;
+			case METHOD_GBLS:
+				exists = sc->gbls.exists;
+				break;
 			case METHOD_GVOL:
 			case METHOD_MUTE:
 				exists = sc->gvol.exists;
@@ -463,6 +474,9 @@ acpi_fujitsu_method_get(struct acpi_fuji
 		case METHOD_GBLL:
 			nv = sc->gbll;
 			break;
+		case METHOD_GBLS:
+			nv = sc->gbls;
+			break;
 		case METHOD_GMOU:
 			nv = sc->gmou;
 			break;
@@ -520,6 +534,11 @@ acpi_fujitsu_method_set(struct acpi_fuji
 			control = "SBLL";
 			nv = sc->gbll;
 			break;
+		case METHOD_GBLS:
+			changed = BRIGHT_CHANGED;
+			control = "SBL2";
+			nv = sc->gbls;
+			break;
 		case METHOD_GMOU:
 			changed = MOUSE_CHANGED;
 			control = "SMOU";
@@ -585,6 +604,14 @@ acpi_fujitsu_check_hardware(struct acpi_
 	}
 
 	if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+		sc->gbls.name, &val))) {
+		sc->gbls.exists = 0;
+	} else {
+		sc->gbls.exists = 1;
+	}
+
+	// don't add if we can use the new method
+	if (sc->gbls.exists || ACPI_FAILURE(acpi_GetInteger(sc->handle,
 	    sc->gbll.name, &val))) {
 		sc->gbll.exists = 0;
 	} else {
@@ -681,6 +708,9 @@ acpi_fujitsu_update(struct acpi_fujitsu_
 			/* Clear the modification bit */
 			sc->gmou.value &= MOUSE_SETTING_BITS;
 			
+			/* Set the value in case it is not hardware controlled */
+                        acpi_fujitsu_method_set(sc, METHOD_GMOU, sc->gmou.value);
+
 			acpi_UserNotify("FUJITSU", sc->handle, FN_POINTER_ENABLE);
 	
 			ACPI_VPRINT(sc->dev, acpi_sc, "Internal pointer is now %s\n",
@@ -688,6 +718,29 @@ acpi_fujitsu_update(struct acpi_fujitsu_
 		}
 	}
 
+	/* Screen Brightness Level P8XXX */
+	if(sc->gbls.exists) {
+		if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+                sc->gbls.name, &(sc->gbls.value)))) {
+                        device_printf(sc->dev, "Couldn't query P8XXX brightness level\n");
+                        return (FALSE);
+                }
+		if (changed & BRIGHT_CHANGED) {
+			/* No state to record here. */
+
+			/* Clear the modification bit */
+			sc->gbls.value &= BRIGHTNESS_SETTING_BITS;
+
+			/* Set the value in case it is not hardware controlled */
+			acpi_fujitsu_method_set(sc, METHOD_GBLS, sc->gbls.value);
+
+			acpi_UserNotify("FUJITSU", sc->handle, FN_LCD_BRIGHTNESS);
+
+			ACPI_VPRINT(sc->dev, acpi_sc, "P8XXX Brightness level is now %d\n",
+			sc->gbls.value);
+                }
+	}
+
 	/* Screen Brightness Level */
 	if(sc->gbll.exists) {
 		if (ACPI_FAILURE(acpi_GetInteger(sc->handle,

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:10:37 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2498106566B;
	Fri, 11 Mar 2011 18:10:37 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FB918FC1E;
	Fri, 11 Mar 2011 18:10: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 p2BIAbu4088744;
	Fri, 11 Mar 2011 18:10:37 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BIAbJJ088742;
	Fri, 11 Mar 2011 18:10:37 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111810.p2BIAbJJ088742@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 18:10:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219514 - stable/7/sys/dev/acpi_support
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:10:37 -0000

Author: avg
Date: Fri Mar 11 18:10:37 2011
New Revision: 219514
URL: http://svn.freebsd.org/changeset/base/219514

Log:
  MFC r216376: acpi_fujitsu: update for P8010
  
  PR:		kern/121102

Modified:
  stable/7/sys/dev/acpi_support/acpi_fujitsu.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/acpi_support/acpi_fujitsu.c
==============================================================================
--- stable/7/sys/dev/acpi_support/acpi_fujitsu.c	Fri Mar 11 18:07:49 2011	(r219513)
+++ stable/7/sys/dev/acpi_support/acpi_fujitsu.c	Fri Mar 11 18:10:37 2011	(r219514)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2002 Sean Bullington 
- *               2003-2006 Anish Mistry 
+ *               2003-2008 Anish Mistry 
  *               2004 Mark Santcroos 
  * All Rights Reserved.
  *
@@ -84,6 +84,7 @@ ACPI_MODULE_NAME("Fujitsu")
 #define METHOD_RVOL	6
 #define METHOD_GSIF	7
 #define METHOD_GHKS	8
+#define METHOD_GBLS	9
 
 /* Notify event */
 #define	ACPI_NOTIFY_STATUS_CHANGED	0x80
@@ -108,6 +109,7 @@ struct acpi_fujitsu_softc {
 	/* Control methods */
 	struct int_nameval	_sta,	/* unused */
 				gbll,	/* brightness */
+				gbls,	/* get brightness state */
 				ghks,	/* hotkey selector */
 				gbuf,	/* unused (buffer?) */
 				gmou,	/* mouse */
@@ -189,6 +191,11 @@ static struct {
 		.description	= "Brightness level of the LCD panel"
 	},
 	{
+		.name		= "lcd_brightness",
+		.method		= METHOD_GBLS,
+		.description	= "Brightness level of the LCD panel"
+	},
+	{
 		.name		= "volume",
 		.method		= METHOD_GVOL,
 		.description	= "Speakers/headphones volume level"
@@ -358,6 +365,7 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
 	/* Setup all of the names for each control method */
 	sc->_sta.name = "_STA";
 	sc->gbll.name = "GBLL";
+	sc->gbls.name = "GBLS";
 	sc->ghks.name = "GHKS";
 	sc->gmou.name = "GMOU";
 	sc->gsif.name = "GSIF";
@@ -386,6 +394,9 @@ acpi_fujitsu_init(struct acpi_fujitsu_so
 			case METHOD_GBLL:
 				exists = sc->gbll.exists;
 				break;
+			case METHOD_GBLS:
+				exists = sc->gbls.exists;
+				break;
 			case METHOD_GVOL:
 			case METHOD_MUTE:
 				exists = sc->gvol.exists;
@@ -462,6 +473,9 @@ acpi_fujitsu_method_get(struct acpi_fuji
 		case METHOD_GBLL:
 			nv = sc->gbll;
 			break;
+		case METHOD_GBLS:
+			nv = sc->gbls;
+			break;
 		case METHOD_GMOU:
 			nv = sc->gmou;
 			break;
@@ -519,6 +533,11 @@ acpi_fujitsu_method_set(struct acpi_fuji
 			control = "SBLL";
 			nv = sc->gbll;
 			break;
+		case METHOD_GBLS:
+			changed = BRIGHT_CHANGED;
+			control = "SBL2";
+			nv = sc->gbls;
+			break;
 		case METHOD_GMOU:
 			changed = MOUSE_CHANGED;
 			control = "SMOU";
@@ -587,6 +606,14 @@ acpi_fujitsu_check_hardware(struct acpi_
 	}
 
 	if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+		sc->gbls.name, &val))) {
+		sc->gbls.exists = 0;
+	} else {
+		sc->gbls.exists = 1;
+	}
+
+	// don't add if we can use the new method
+	if (sc->gbls.exists || ACPI_FAILURE(acpi_GetInteger(sc->handle,
 	    sc->gbll.name, &val))) {
 		sc->gbll.exists = 0;
 	} else {
@@ -683,6 +710,9 @@ acpi_fujitsu_update(struct acpi_fujitsu_
 			/* Clear the modification bit */
 			sc->gmou.value &= MOUSE_SETTING_BITS;
 			
+			/* Set the value in case it is not hardware controlled */
+                        acpi_fujitsu_method_set(sc, METHOD_GMOU, sc->gmou.value);
+
 			acpi_UserNotify("FUJITSU", sc->handle, FN_POINTER_ENABLE);
 	
 			ACPI_VPRINT(sc->dev, acpi_sc, "Internal pointer is now %s\n",
@@ -690,6 +720,29 @@ acpi_fujitsu_update(struct acpi_fujitsu_
 		}
 	}
 
+	/* Screen Brightness Level P8XXX */
+	if(sc->gbls.exists) {
+		if (ACPI_FAILURE(acpi_GetInteger(sc->handle,
+                sc->gbls.name, &(sc->gbls.value)))) {
+                        device_printf(sc->dev, "Couldn't query P8XXX brightness level\n");
+                        return (FALSE);
+                }
+		if (changed & BRIGHT_CHANGED) {
+			/* No state to record here. */
+
+			/* Clear the modification bit */
+			sc->gbls.value &= BRIGHTNESS_SETTING_BITS;
+
+			/* Set the value in case it is not hardware controlled */
+			acpi_fujitsu_method_set(sc, METHOD_GBLS, sc->gbls.value);
+
+			acpi_UserNotify("FUJITSU", sc->handle, FN_LCD_BRIGHTNESS);
+
+			ACPI_VPRINT(sc->dev, acpi_sc, "P8XXX Brightness level is now %d\n",
+			sc->gbls.value);
+                }
+	}
+
 	/* Screen Brightness Level */
 	if(sc->gbll.exists) {
 		if (ACPI_FAILURE(acpi_GetInteger(sc->handle,

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:15:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4FFFB106564A;
	Fri, 11 Mar 2011 18:15:31 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DD408FC14;
	Fri, 11 Mar 2011 18:15: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 p2BIFVr8088902;
	Fri, 11 Mar 2011 18:15:31 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BIFV16088900;
	Fri, 11 Mar 2011 18:15:31 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111815.p2BIFV16088900@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 18:15:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219515 - stable/8/sys/dev/drm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:15:31 -0000

Author: avg
Date: Fri Mar 11 18:15:30 2011
New Revision: 219515
URL: http://svn.freebsd.org/changeset/base/219515

Log:
  MFC r216374: fix atomic_set_xxx misuse in drm

Modified:
  stable/8/sys/dev/drm/drm_irq.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/drm/drm_irq.c
==============================================================================
--- stable/8/sys/dev/drm/drm_irq.c	Fri Mar 11 18:10:37 2011	(r219514)
+++ stable/8/sys/dev/drm/drm_irq.c	Fri Mar 11 18:15:30 2011	(r219515)
@@ -140,7 +140,7 @@ int drm_vblank_init(struct drm_device *d
 	for (i = 0; i < num_crtcs; i++) {
 		DRM_INIT_WAITQUEUE(&dev->vblank[i].queue);
 		dev->vblank[i].refcount = 0;
-		atomic_set_rel_32(&dev->vblank[i].count, 0);
+		atomic_store_rel_32(&dev->vblank[i].count, 0);
 	}
 	dev->vblank_disable_allowed = 0;
 	DRM_SPINUNLOCK(&dev->vbl_lock);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:21:17 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 572E61065673;
	Fri, 11 Mar 2011 18:21:17 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 457D58FC1C;
	Fri, 11 Mar 2011 18:21: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 p2BILHgP089054;
	Fri, 11 Mar 2011 18:21:17 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BILHJv089052;
	Fri, 11 Mar 2011 18:21:17 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111821.p2BILHJv089052@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 18:21:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219516 - stable/7/sys/dev/drm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:21:17 -0000

Author: avg
Date: Fri Mar 11 18:21:16 2011
New Revision: 219516
URL: http://svn.freebsd.org/changeset/base/219516

Log:
  MFC r216374: fix atomic_set_xxx misuse in drm

Modified:
  stable/7/sys/dev/drm/drm_irq.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/drm/drm_irq.c
==============================================================================
--- stable/7/sys/dev/drm/drm_irq.c	Fri Mar 11 18:15:30 2011	(r219515)
+++ stable/7/sys/dev/drm/drm_irq.c	Fri Mar 11 18:21:16 2011	(r219516)
@@ -140,7 +140,7 @@ int drm_vblank_init(struct drm_device *d
 	for (i = 0; i < num_crtcs; i++) {
 		DRM_INIT_WAITQUEUE(&dev->vblank[i].queue);
 		dev->vblank[i].refcount = 0;
-		atomic_set_rel_32(&dev->vblank[i].count, 0);
+		atomic_store_rel_32(&dev->vblank[i].count, 0);
 	}
 	dev->vblank_disable_allowed = 0;
 	DRM_SPINUNLOCK(&dev->vbl_lock);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:28:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DED501065670;
	Fri, 11 Mar 2011 18:28:20 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CCE6B8FC1A;
	Fri, 11 Mar 2011 18:28: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 p2BISKQL089258;
	Fri, 11 Mar 2011 18:28:20 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BISKRN089256;
	Fri, 11 Mar 2011 18:28:20 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111828.p2BISKRN089256@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 18:28:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219517 - stable/8/sys/mips/rmi/dev/xlr
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:28:21 -0000

Author: avg
Date: Fri Mar 11 18:28:20 2011
New Revision: 219517
URL: http://svn.freebsd.org/changeset/base/219517

Log:
  MFC r216375,r216408: fix atomic_set_xxx misuse in rge

Modified:
  stable/8/sys/mips/rmi/dev/xlr/rge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/mips/rmi/dev/xlr/rge.c
==============================================================================
--- stable/8/sys/mips/rmi/dev/xlr/rge.c	Fri Mar 11 18:21:16 2011	(r219516)
+++ stable/8/sys/mips/rmi/dev/xlr/rge.c	Fri Mar 11 18:28:20 2011	(r219517)
@@ -170,10 +170,8 @@ extern uint32_t cpu_ltop_map[32];
 static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE);
 
 #define port_inc_counter(port, counter) 	atomic_add_int(&port_counters[port][(counter)], 1)
-#define port_set_counter(port, counter, value) 	atomic_set_int(&port_counters[port][(counter)], (value))
 #else
 #define port_inc_counter(port, counter)	/* Nothing */
-#define port_set_counter(port, counter, value)	/* Nothing */
 #endif
 
 int xlr_rge_tx_prepend[MAXCPU];
@@ -2281,7 +2279,7 @@ rmi_xlr_mac_open(struct rge_softc *sc)
 	mtx_unlock_spin(&priv->lock);
 
 	for (i = 0; i < 8; i++) {
-		atomic_set_int(&(priv->frin_to_be_sent[i]), 0);
+		priv->frin_to_be_sent[i] = 0;
 	}
 
 	return 0;

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:33:37 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C9C31065673;
	Fri, 11 Mar 2011 18:33:37 +0000 (UTC)
	(envelope-from pawel@dawidek.net)
Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60])
	by mx1.freebsd.org (Postfix) with ESMTP id 343B58FC14;
	Fri, 11 Mar 2011 18:33:35 +0000 (UTC)
Received: by mail.garage.freebsd.pl (Postfix, from userid 65534)
	id 4DB9445F28; Fri, 11 Mar 2011 19:33:34 +0100 (CET)
Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.garage.freebsd.pl (Postfix) with ESMTP id C6C4345C8A;
	Fri, 11 Mar 2011 19:33:28 +0100 (CET)
Date: Fri, 11 Mar 2011 19:33:26 +0100
From: Pawel Jakub Dawidek 
To: John Baldwin 
Message-ID: <20110311183326.GA1994@garage.freebsd.pl>
References: <201103111311.p2BDBFBs079174@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/"
Content-Disposition: inline
In-Reply-To: <201103111311.p2BDBFBs079174@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc
X-OS: FreeBSD 9.0-CURRENT amd64
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: r219483 - head/sys/boot/i386/gptboot
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:33:37 -0000


--pWyiEgJYm5f9v55/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 11, 2011 at 01:11:15PM +0000, John Baldwin wrote:
> Author: jhb
> Date: Fri Mar 11 13:11:15 2011
> New Revision: 219483
> URL: http://svn.freebsd.org/changeset/base/219483
>=20
> Log:
>   Remove all object files during 'make clean'.

Oops, I think that was me. Thank you, John.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com

--pWyiEgJYm5f9v55/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk16avUACgkQForvXbEpPzQsJQCgpP3GZs+mdywZE/JK9IHfPVxH
XmIAoOygo/5/xmxMGvma4UV6kuUZBSYn
=PzuY
-----END PGP SIGNATURE-----

--pWyiEgJYm5f9v55/--

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:42:17 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 788A41065670;
	Fri, 11 Mar 2011 18:42:17 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6666D8FC1A;
	Fri, 11 Mar 2011 18:42: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 p2BIgHO4089679;
	Fri, 11 Mar 2011 18:42:17 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BIgHgt089677;
	Fri, 11 Mar 2011 18:42:17 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111842.p2BIgHgt089677@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 18:42:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219518 - stable/7/sys/cddl/dev/cyclic/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:42:17 -0000

Author: avg
Date: Fri Mar 11 18:42:17 2011
New Revision: 219518
URL: http://svn.freebsd.org/changeset/base/219518

Log:
  MFC r216505: cyclic xcall: use smp_no_rendevous_barrier as setup
  function parameter

Modified:
  stable/7/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
==============================================================================
--- stable/7/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Fri Mar 11 18:28:20 2011	(r219517)
+++ stable/7/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Fri Mar 11 18:42:17 2011	(r219518)
@@ -122,6 +122,6 @@ static void reprogram(cyb_arg_t arg, hrt
 static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param)
 {
 
-	smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL,
-	    func, smp_no_rendevous_barrier, param);
+	smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid),
+	    smp_no_rendevous_barrier, func, smp_no_rendevous_barrier, param);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:44:16 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A04ED1065670;
	Fri, 11 Mar 2011 18:44:16 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8EEB88FC13;
	Fri, 11 Mar 2011 18:44: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 p2BIiGn8089793;
	Fri, 11 Mar 2011 18:44:16 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BIiGqH089791;
	Fri, 11 Mar 2011 18:44:16 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103111844.p2BIiGqH089791@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 11 Mar 2011 18:44:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219519 - head/tools/tools/ncpus
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:44:16 -0000

Author: brucec
Date: Fri Mar 11 18:44:16 2011
New Revision: 219519
URL: http://svn.freebsd.org/changeset/base/219519

Log:
  mptable.h is now in include/x86.

Modified:
  head/tools/tools/ncpus/biosmptable.c

Modified: head/tools/tools/ncpus/biosmptable.c
==============================================================================
--- head/tools/tools/ncpus/biosmptable.c	Fri Mar 11 18:42:17 2011	(r219518)
+++ head/tools/tools/ncpus/biosmptable.c	Fri Mar 11 18:44:16 2011	(r219519)
@@ -34,7 +34,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
+#include 
 
 #include 
 #include 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:46:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A3E0106564A;
	Fri, 11 Mar 2011 18:46:12 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0808E8FC15;
	Fri, 11 Mar 2011 18:46: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 p2BIkBOU089877;
	Fri, 11 Mar 2011 18:46:11 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BIkBKA089875;
	Fri, 11 Mar 2011 18:46:11 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111846.p2BIkBKA089875@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 18:46:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219520 - stable/8/sys/cddl/dev/cyclic/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:46:12 -0000

Author: avg
Date: Fri Mar 11 18:46:11 2011
New Revision: 219520
URL: http://svn.freebsd.org/changeset/base/219520

Log:
  MFC r216505: cyclic xcall: use smp_no_rendevous_barrier as setup
  function parameter

Modified:
  stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
==============================================================================
--- stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Fri Mar 11 18:44:16 2011	(r219519)
+++ stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c	Fri Mar 11 18:46:11 2011	(r219520)
@@ -122,6 +122,6 @@ static void reprogram(cyb_arg_t arg, hrt
 static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param)
 {
 
-	smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL,
-	    func, smp_no_rendevous_barrier, param);
+	smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid),
+	    smp_no_rendevous_barrier, func, smp_no_rendevous_barrier, param);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:47:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2523F106567D;
	Fri, 11 Mar 2011 18:47:49 +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 EC0758FC17;
	Fri, 11 Mar 2011 18:47:48 +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 6C27346B94;
	Fri, 11 Mar 2011 13:47:48 -0500 (EST)
Received: from jhbbsd.localnet (unknown [209.249.190.10])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 06F008A027;
	Fri, 11 Mar 2011 13:47:48 -0500 (EST)
From: John Baldwin 
To: Bruce Cran 
Date: Fri, 11 Mar 2011 13:46:56 -0500
User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; )
References: <201102210901.p1L91YoI063173@svn.freebsd.org>
In-Reply-To: <201102210901.p1L91YoI063173@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201103111346.56499.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Fri, 11 Mar 2011 13:47:48 -0500 (EST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r218909 - in head: bin/df bin/sh lib/libc/arm/gen
	lib/libc/ia64/gen lib/libc/mips/gen lib/libc/powerpc/gen
	lib/libc/powerpc64/gen lib/libpkg lib/libstand lib/msun/src
	sys/amd64/amd64 sy...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:47:49 -0000

On Monday, February 21, 2011 4:01:34 am Bruce Cran wrote:
> Author: brucec
> Date: Mon Feb 21 09:01:34 2011
> New Revision: 218909
> URL: http://svn.freebsd.org/changeset/base/218909
> 
> Log:
>   Fix typos - remove duplicate "the".
>   
>   PR:	bin/154928
>   Submitted by:	Eitan Adler 
>   MFC after: 	3 days

A few of these weren't just duplicates but were actually using 'the' when
they should have been using some other word instead:

> Modified: head/lib/libpkg/version.c
> ==============================================================================
> --- head/lib/libpkg/version.c	Mon Feb 21 05:10:34 2011	(r218908)
> +++ head/lib/libpkg/version.c	Mon Feb 21 09:01:34 2011	(r218909)
> @@ -76,7 +76,7 @@ split_version(const char *pkgname, const
>      if (pkgname == NULL)
>  	errx(2, "%s: Passed NULL pkgname.", __func__);
>  
> -    /* Look for the last '-' the the pkgname */
> +    /* Look for the last '-' the pkgname */
>      ch = strrchr(pkgname, '-');
>      /* Cheat if we are just passed a version, not a valid package name */
>      versionstr = ch ? ch + 1 : pkgname;

This is not a double the, it should be "Look for the last '-' in the pkgname".

> Modified: head/sys/dev/drm/r300_reg.h
> ==============================================================================
> --- head/sys/dev/drm/r300_reg.h	Mon Feb 21 05:10:34 2011	(r218908)
> +++ head/sys/dev/drm/r300_reg.h	Mon Feb 21 09:01:34 2011	(r218909)
> @@ -353,7 +353,7 @@ __FBSDID("$FreeBSD$");
>  #       define R300_PVS_CNTL_1_PROGRAM_START_SHIFT   0
>  #       define R300_PVS_CNTL_1_POS_END_SHIFT         10
>  #       define R300_PVS_CNTL_1_PROGRAM_END_SHIFT     20
> -/* Addresses are relative the the vertex program parameters area. */
> +/* Addresses are relative the vertex program parameters area. */
>  #define R300_VAP_PVS_CNTL_2                 0x22D4
>  #       define R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0
>  #       define R300_PVS_CNTL_2_PARAM_COUNT_SHIFT  16

I think this should be "Addresses are relative to the vertex ...".

> Modified: head/sys/dev/ep/if_epreg.h
> ==============================================================================
> --- head/sys/dev/ep/if_epreg.h	Mon Feb 21 05:10:34 2011	(r218908)
> +++ head/sys/dev/ep/if_epreg.h	Mon Feb 21 09:01:34 2011	(r218909)
> @@ -113,7 +113,7 @@
>  /**************************************************************************
>   *									  *
>   * These are the registers for the 3Com 3c509 and their bit patterns when *
> - * applicable.  They have been taken out the the "EtherLink III Parallel  *
> + * applicable.  They have been taken out the "EtherLink III Parallel  *
>   * Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual *
>   * from 3com.								  *
>   *									  *

I think this should be 'Then have been taken out of the "Etherlink III...'

> Modified: head/sys/dev/vx/if_vxreg.h
> ==============================================================================
> --- head/sys/dev/vx/if_vxreg.h	Mon Feb 21 05:10:34 2011	(r218908)
> +++ head/sys/dev/vx/if_vxreg.h	Mon Feb 21 09:01:34 2011	(r218909)
> @@ -112,7 +112,7 @@
>  
>  /**************************************************************************
>   * These are the registers for the 3Com 3c509 and their bit patterns when *
> - * applicable.  They have been taken out the the "EtherLink III Parallel  *
> + * applicable.  They have been taken out the "EtherLink III Parallel  *
>   * Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual *
>   * from 3com.								  *
>   **************************************************************************/

Same as above.  "out of the" rather than "out the"

> Modified: head/sys/gnu/fs/xfs/xfs_dir_leaf.c
> ==============================================================================
> --- head/sys/gnu/fs/xfs/xfs_dir_leaf.c	Mon Feb 21 05:10:34 2011	(r218908)
> +++ head/sys/gnu/fs/xfs/xfs_dir_leaf.c	Mon Feb 21 09:01:34 2011	(r218909)
> @@ -2153,7 +2153,7 @@ xfs_dir_leaf_getdents_int(
>  }
>  
>  /*
> - * Format a dirent64 structure and copy it out the the user's buffer.
> + * Format a dirent64 structure and copy it out the user's buffer.
>   */
>  int
>  xfs_dir_put_dirent64_direct(xfs_dir_put_args_t *pa)
> @@ -2185,7 +2185,7 @@ xfs_dir_put_dirent64_direct(xfs_dir_put_
>  }
>  
>  /*
> - * Format a dirent64 structure and copy it out the the user's buffer.
> + * Format a dirent64 structure and copy it out the user's buffer.
>   */
>  int
>  xfs_dir_put_dirent64_uio(xfs_dir_put_args_t *pa)

I think these should both be "out to the user's buffer".


> Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c
> ==============================================================================
> --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c	Mon Feb 21 05:10:34 2011	(r218908)
> +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c	Mon Feb 21 09:01:34 2011	(r218909)
> @@ -560,7 +560,7 @@ ng_btsocket_rfcomm_connect(struct socket
>  		soclose(l2so); /* we don't need new L2CAP socket */
>  
>  	/*
> -	 * Check if we already have the same DLCI the the same session
> +	 * Check if we already have the same DLCI the same session
>  	 */
>  
>  	mtx_lock(&s->session_mtx);

Not 100% sure, but I think the first "the" here should have been changed to
something else like "within", "in", "from", etc.  emax@ might be the best
person to ask.

> Modified: head/usr.bin/make/lst.c
> ==============================================================================
> --- head/usr.bin/make/lst.c	Mon Feb 21 05:10:34 2011	(r218908)
> +++ head/usr.bin/make/lst.c	Mon Feb 21 09:01:34 2011	(r218909)
> @@ -98,7 +98,7 @@ Lst_Append(Lst *list, LstNode *ln, void 
>   *		LST_CONCLINK if should just be relinked
>   *
>   * Side Effects:
> - *	New elements are created and appended the the first list.
> + *	New elements are created and appended the first list.
>   */
>  void
>  Lst_Concat(Lst *list1, Lst *list2, int flags)

I think this should be "appended to the first list"

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:48:28 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD528106566B;
	Fri, 11 Mar 2011 18:48:28 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC23C8FC1C;
	Fri, 11 Mar 2011 18:48: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 p2BImSgh089975;
	Fri, 11 Mar 2011 18:48:28 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BImS8K089972;
	Fri, 11 Mar 2011 18:48:28 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103111848.p2BImS8K089972@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 11 Mar 2011 18:48: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: r219521 - head/tools/tools/cfi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:48:29 -0000

Author: brucec
Date: Fri Mar 11 18:48:28 2011
New Revision: 219521
URL: http://svn.freebsd.org/changeset/base/219521

Log:
  Fix warnings and set WARNS to 6.
  
  MFC after:	1 week

Modified:
  head/tools/tools/cfi/Makefile
  head/tools/tools/cfi/cfi.c

Modified: head/tools/tools/cfi/Makefile
==============================================================================
--- head/tools/tools/cfi/Makefile	Fri Mar 11 18:46:11 2011	(r219520)
+++ head/tools/tools/cfi/Makefile	Fri Mar 11 18:48:28 2011	(r219521)
@@ -3,5 +3,6 @@
 PROG=	cfi
 BINDIR=	/usr/local/bin
 NO_MAN=
+WARNS?=6
 
 .include 

Modified: head/tools/tools/cfi/cfi.c
==============================================================================
--- head/tools/tools/cfi/cfi.c	Fri Mar 11 18:46:11 2011	(r219520)
+++ head/tools/tools/cfi/cfi.c	Fri Mar 11 18:48:28 2011	(r219521)
@@ -38,9 +38,12 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
 const char *progname;
 const char *dvname;
@@ -48,8 +51,6 @@ const char *dvname;
 static void
 usage(void)
 {
-	int i;
-
 	fprintf(stderr, "usage: %s [-f device] op...\n", progname);
 	fprintf(stderr, "where op's are:\n");
 	fprintf(stderr, "fact\t\tread factory PR segment\n");

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:51:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B78E106564A;
	Fri, 11 Mar 2011 18:51:42 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A2D28FC14;
	Fri, 11 Mar 2011 18:51: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 p2BIpgV9090100;
	Fri, 11 Mar 2011 18:51:42 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BIpgKE090097;
	Fri, 11 Mar 2011 18:51:42 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103111851.p2BIpgKE090097@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 11 Mar 2011 18:51: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: r219522 - head/tools/tools/aac
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:51:42 -0000

Author: brucec
Date: Fri Mar 11 18:51:42 2011
New Revision: 219522
URL: http://svn.freebsd.org/changeset/base/219522

Log:
  Fix warnings and set WARNS to 6.
  
  MFC after:	1 week

Modified:
  head/tools/tools/aac/Makefile
  head/tools/tools/aac/aac_checkq.c

Modified: head/tools/tools/aac/Makefile
==============================================================================
--- head/tools/tools/aac/Makefile	Fri Mar 11 18:48:28 2011	(r219521)
+++ head/tools/tools/aac/Makefile	Fri Mar 11 18:51:42 2011	(r219522)
@@ -2,6 +2,7 @@
 
 PROG=	aac_checkq
 NO_MAN=
+WARNS?=6
 BINDIR?=/usr/local/bin
 
 .include 

Modified: head/tools/tools/aac/aac_checkq.c
==============================================================================
--- head/tools/tools/aac/aac_checkq.c	Fri Mar 11 18:48:28 2011	(r219521)
+++ head/tools/tools/aac/aac_checkq.c	Fri Mar 11 18:51:42 2011	(r219522)
@@ -34,7 +34,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+
+void usage(void);
 
 /*
  * Simple program to print out the queue stats on the given queue index.

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 18:56:55 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5B841065672;
	Fri, 11 Mar 2011 18:56:55 +0000 (UTC) (envelope-from mdf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C35428FC0A;
	Fri, 11 Mar 2011 18:56: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 p2BIutbs090257;
	Fri, 11 Mar 2011 18:56:55 GMT (envelope-from mdf@svn.freebsd.org)
Received: (from mdf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BIut2E090250;
	Fri, 11 Mar 2011 18:56:55 GMT (envelope-from mdf@svn.freebsd.org)
Message-Id: <201103111856.p2BIut2E090250@svn.freebsd.org>
From: Matthew D Fleming 
Date: Fri, 11 Mar 2011 18:56: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: r219523 - in head/sys: amd64/amd64 ia64/ia64
	powerpc/aim sparc64/sparc64 sun4v/sun4v sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 18:56:56 -0000

Author: mdf
Date: Fri Mar 11 18:56:55 2011
New Revision: 219523
URL: http://svn.freebsd.org/changeset/base/219523

Log:
  Mostly revert r219468, as I had misremembered the C standard regarding
  the size of an extern array.
  
  Keep one change from strncpy to strlcpy.

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/ia64/ia64/machdep.c
  head/sys/powerpc/aim/machdep.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/sun4v/sun4v/machdep.c
  head/sys/sys/kernel.h

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Fri Mar 11 18:51:42 2011	(r219522)
+++ head/sys/amd64/amd64/machdep.c	Fri Mar 11 18:56:55 2011	(r219523)
@@ -1758,7 +1758,7 @@ hammer_time(u_int64_t modulep, u_int64_t
 
         env = getenv("kernelname");
 	if (env != NULL)
-		strlcpy(kernelname, env, MAXPATHLEN);
+		strlcpy(kernelname, env, sizeof(kernelname));
 
 #ifdef XENHVM
 	if (inw(0x10) == 0x49d2) {

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Fri Mar 11 18:51:42 2011	(r219522)
+++ head/sys/ia64/ia64/machdep.c	Fri Mar 11 18:56:55 2011	(r219523)
@@ -792,7 +792,7 @@ ia64_init(void)
 
 	p = getenv("kernelname");
 	if (p != NULL) {
-		strlcpy(kernelname, p, MAXPATHLEN);
+		strlcpy(kernelname, p, sizeof(kernelname));
 		freeenv(p);
 	}
 

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Fri Mar 11 18:51:42 2011	(r219522)
+++ head/sys/powerpc/aim/machdep.c	Fri Mar 11 18:56:55 2011	(r219523)
@@ -540,7 +540,7 @@ powerpc_init(vm_offset_t startkernel, vm
 	 */
         env = getenv("kernelname");
         if (env != NULL) {
-		strlcpy(kernelname, env, MAXPATHLEN);
+		strlcpy(kernelname, env, sizeof(kernelname));
 		freeenv(env);
 	}
 

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Fri Mar 11 18:51:42 2011	(r219522)
+++ head/sys/sparc64/sparc64/machdep.c	Fri Mar 11 18:56:55 2011	(r219523)
@@ -532,7 +532,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 	init_param2(physmem);
 	env = getenv("kernelname");
 	if (env != NULL) {
-		strlcpy(kernelname, env, MAXPATHLEN);
+		strlcpy(kernelname, env, sizeof(kernelname));
 		freeenv(env);
 	}
 

Modified: head/sys/sun4v/sun4v/machdep.c
==============================================================================
--- head/sys/sun4v/sun4v/machdep.c	Fri Mar 11 18:51:42 2011	(r219522)
+++ head/sys/sun4v/sun4v/machdep.c	Fri Mar 11 18:56:55 2011	(r219523)
@@ -425,7 +425,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l
 
 	env = getenv("kernelname");
 	if (env != NULL) {
-		strlcpy(kernelname, env, MAXPATHLEN);
+		strlcpy(kernelname, env, sizeof(kernelname));
 		freeenv(env);
 	}
 

Modified: head/sys/sys/kernel.h
==============================================================================
--- head/sys/sys/kernel.h	Fri Mar 11 18:51:42 2011	(r219522)
+++ head/sys/sys/kernel.h	Fri Mar 11 18:56:55 2011	(r219523)
@@ -55,7 +55,7 @@
 /* Global variables for the kernel. */
 
 /* 1.1 */
-extern char kernelname[/*MAXPATHLEN*/];
+extern char kernelname[MAXPATHLEN];
 
 extern int tick;			/* usec per tick (1000000 / hz) */
 extern int hz;				/* system clock's frequency */

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 19:19:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BCAD1106566B;
	Fri, 11 Mar 2011 19:19:47 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AB1D18FC0A;
	Fri, 11 Mar 2011 19:19: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 p2BJJlLa090771;
	Fri, 11 Mar 2011 19:19:47 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BJJlrb090769;
	Fri, 11 Mar 2011 19:19:47 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103111919.p2BJJlrb090769@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 11 Mar 2011 19:19: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: r219524 - head/tools/tools/ether_reflect
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 19:19:47 -0000

Author: brucec
Date: Fri Mar 11 19:19:47 2011
New Revision: 219524
URL: http://svn.freebsd.org/changeset/base/219524

Log:
  Fix the build: we have snprintf(3).
  
  MFC after:	1 week

Modified:
  head/tools/tools/ether_reflect/Makefile

Modified: head/tools/tools/ether_reflect/Makefile
==============================================================================
--- head/tools/tools/ether_reflect/Makefile	Fri Mar 11 18:56:55 2011	(r219523)
+++ head/tools/tools/ether_reflect/Makefile	Fri Mar 11 19:19:47 2011	(r219524)
@@ -6,5 +6,6 @@
 PROG=   ether_reflect
 DPADD=	${LIBPCAP}
 LDADD=	-lpcap
+CFLAGS+=-DHAVE_SNPRINTF
 
 .include 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 19:21:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C8D5C1065675;
	Fri, 11 Mar 2011 19:21:42 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B7CF18FC14;
	Fri, 11 Mar 2011 19:21: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 p2BJLgJN090858;
	Fri, 11 Mar 2011 19:21:42 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BJLgh0090856;
	Fri, 11 Mar 2011 19:21:42 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111921.p2BJLgh0090856@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 19:21: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: r219525 - head/sys/amd64/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 19:21:42 -0000

Author: avg
Date: Fri Mar 11 19:21:42 2011
New Revision: 219525
URL: http://svn.freebsd.org/changeset/base/219525

Log:
  amd64/NOTES: use a greater number in KSTACK_PAGES example
  
  This is a minor cosmetic change - the users are more likely to want to
  increase (rather than decrease) default kernel stack size,
  which is already 4 pages on amd64.
  
  MFC after:	4 days

Modified:
  head/sys/amd64/conf/NOTES

Modified: head/sys/amd64/conf/NOTES
==============================================================================
--- head/sys/amd64/conf/NOTES	Fri Mar 11 19:19:47 2011	(r219524)
+++ head/sys/amd64/conf/NOTES	Fri Mar 11 19:21:42 2011	(r219525)
@@ -547,7 +547,7 @@ options 	LINSYSFS
 # KSTACK_PAGES is the number of memory pages to assign to the kernel
 # stack of each thread.
 
-options 	KSTACK_PAGES=3
+options 	KSTACK_PAGES=5
 
 #####################################################################
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 19:27:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93FDE106564A;
	Fri, 11 Mar 2011 19:27:31 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 817BD8FC08;
	Fri, 11 Mar 2011 19:27: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 p2BJRVZY091031;
	Fri, 11 Mar 2011 19:27:31 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BJRVu3091029;
	Fri, 11 Mar 2011 19:27:31 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103111927.p2BJRVu3091029@svn.freebsd.org>
From: Andriy Gapon 
Date: Fri, 11 Mar 2011 19:27:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219526 -
	stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 19:27:31 -0000

Author: avg
Date: Fri Mar 11 19:27:31 2011
New Revision: 219526
URL: http://svn.freebsd.org/changeset/base/219526

Log:
  use even larger stack size for ZFS txg_sync_thread
  
  While the stack size was larger than the default stack size on i386, it
  was smaller than the default stack size on amd64 and apparently that
  wasn't enough.  So, bump the size to 4 pages.  Upcoming ZFSv28 code uses
  8 pages for this stack size.
  
  This is a direct commit to stable/8.
  
  PR:		kern/154681
  Discussed with:	pjd

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Mar 11 19:21:42 2011	(r219525)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Mar 11 19:27:31 2011	(r219526)
@@ -146,7 +146,7 @@ txg_sync_start(dsl_pool_t *dp)
 	 * 32-bit x86.  This is due in part to nested pools and
 	 * scrub_visitbp() recursion.
 	 */
-	tx->tx_sync_thread = thread_create(NULL, 12<<10, txg_sync_thread,
+	tx->tx_sync_thread = thread_create(NULL, 16<<10, txg_sync_thread,
 	    dp, 0, &p0, TS_RUN, minclsyspri);
 
 	mutex_exit(&tx->tx_sync_lock);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 19:32:16 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E288106566C;
	Fri, 11 Mar 2011 19:32:16 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1CAB08FC13;
	Fri, 11 Mar 2011 19:32: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 p2BJWGnZ091166;
	Fri, 11 Mar 2011 19:32:16 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BJWFr8091163;
	Fri, 11 Mar 2011 19:32:15 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103111932.p2BJWFr8091163@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 11 Mar 2011 19:32: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: r219527 - head/tools/tools/iwi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 19:32:16 -0000

Author: brucec
Date: Fri Mar 11 19:32:15 2011
New Revision: 219527
URL: http://svn.freebsd.org/changeset/base/219527

Log:
  Fix warnings and style(9) issues.
  Set WARNS to 6.

Modified:
  head/tools/tools/iwi/Makefile
  head/tools/tools/iwi/iwistats.c

Modified: head/tools/tools/iwi/Makefile
==============================================================================
--- head/tools/tools/iwi/Makefile	Fri Mar 11 19:27:31 2011	(r219526)
+++ head/tools/tools/iwi/Makefile	Fri Mar 11 19:32:15 2011	(r219527)
@@ -2,5 +2,6 @@
 
 PROG=	iwistats
 NO_MAN=
+WARNS?=6
 
 .include 

Modified: head/tools/tools/iwi/iwistats.c
==============================================================================
--- head/tools/tools/iwi/iwistats.c	Fri Mar 11 19:27:31 2011	(r219526)
+++ head/tools/tools/iwi/iwistats.c	Fri Mar 11 19:32:15 2011	(r219527)
@@ -113,16 +113,17 @@ get_statistics(const char *iface)
 	static uint32_t stats[256];
 	const struct statistic *stat;
 	char oid[32];
-	int ifaceno, len;
+	size_t len;
+	int ifaceno;
 
 	if (sscanf(iface, "iwi%u", &ifaceno) != 1)
 		errx(EX_DATAERR, "Invalid interface name '%s'", iface);
 
-	len = sizeof stats;
-	(void)snprintf(oid, sizeof oid, "dev.iwi.%u.stats", ifaceno);
+	len = sizeof(stats);
+	(void)snprintf(oid, sizeof(oid), "dev.iwi.%u.stats", ifaceno);
 	if (sysctlbyname(oid, stats, &len, NULL, 0) == -1)
 		err(EX_OSERR, "Can't retrieve statistics");
 
 	for (stat = tbl; stat->index != -1; stat++)
-		(void)printf("%-60s[%lu]\n", stat->desc, stats[stat->index]);
+		(void)printf("%-60s[%u]\n", stat->desc, stats[stat->index]);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 19:40:50 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5D2791065672;
	Fri, 11 Mar 2011 19:40:50 +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 123858FC13;
	Fri, 11 Mar 2011 19:40: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 p2BJenSj091393;
	Fri, 11 Mar 2011 19:40:49 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BJen9V091391;
	Fri, 11 Mar 2011 19:40:49 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103111940.p2BJen9V091391@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 11 Mar 2011 19:40: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: r219528 - head/usr.sbin/bsdinstall/scripts
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 19:40:50 -0000

Author: nwhitehorn
Date: Fri Mar 11 19:40:49 2011
New Revision: 219528
URL: http://svn.freebsd.org/changeset/base/219528

Log:
  Correct typo.

Modified:
  head/usr.sbin/bsdinstall/scripts/auto

Modified: head/usr.sbin/bsdinstall/scripts/auto
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/auto	Fri Mar 11 19:32:15 2011	(r219527)
+++ head/usr.sbin/bsdinstall/scripts/auto	Fri Mar 11 19:40:49 2011	(r219528)
@@ -114,7 +114,7 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then
 	ALL_DISTRIBUTIONS="$DISTRIBUTIONS"
 
 	# Download to a directory in the new system as scratch space
-	BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/bsdinstall-dist"
+	BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist"
 	mkdir -p "$BSDINSTALL_FETCHDEST" || error
 
 	export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS"

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 19:44:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A15AE1065678;
	Fri, 11 Mar 2011 19:44:06 +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 8F8518FC18;
	Fri, 11 Mar 2011 19:44:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2BJi66T091517;
	Fri, 11 Mar 2011 19:44:06 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BJi6B0091515;
	Fri, 11 Mar 2011 19:44:06 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201103111944.p2BJi6B0091515@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 11 Mar 2011 19:44:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219529 - stable/8/share/termcap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 19:44:06 -0000

Author: ed
Date: Fri Mar 11 19:44:06 2011
New Revision: 219529
URL: http://svn.freebsd.org/changeset/base/219529

Log:
  MFC r218844:
  
    Improve 256 color support.
  
    - Add screen-256color,
    - Improve rxvt-256color to set pa and op properly.
    - Add rxvt-unicode-256color as an alias to rxvt-256color.
  
    PR:           conf/152713, conf/153164
    Submitted by: Alexander Verbod and Frédéric Perrin

Modified:
  stable/8/share/termcap/termcap.src
Directory Properties:
  stable/8/share/termcap/   (props changed)

Modified: stable/8/share/termcap/termcap.src
==============================================================================
--- stable/8/share/termcap/termcap.src	Fri Mar 11 19:40:49 2011	(r219528)
+++ stable/8/share/termcap/termcap.src	Fri Mar 11 19:44:06 2011	(r219529)
@@ -2784,6 +2784,9 @@ SH|screen-s|VT 100/ANSI X3.64 virtual te
 	:ts=\E_:fs=\E\\:ds=\E_\E\\:tc=screen:
 SW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\
 	:co#132:tc=screen:
+screen-256color|VT 100/ANSI X3.64 terminal with 256 colors:\
+	:Co#256:pa#32767:\
+	:AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=screen:
 # $Xorg: termcap,v 1.3 2000/08/17 19:55:10 cpqbld Exp $
 #
 # Note:
@@ -4586,7 +4589,11 @@ rxvt|rxvt terminal emulator (X Window Sy
 	:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:
 
 rxvt-256color|rxvt terminal emulator with 256 colors:\
-	:Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode:
+	:Co#256:pa#32767:\
+	:AB=\E[48;5;%dm:AF=\E[38;5;%dm:op=\E[39;49m:tc=rxvt-unicode:
+
+rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System):\
+	:tc=rxvt-256color:
 
 # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2
 Eterm|Eterm Terminal Emulator (X11 Window System):\

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 19:50:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8495D1065672;
	Fri, 11 Mar 2011 19:50:51 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id 008458FC0C;
	Fri, 11 Mar 2011 19:50:50 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p2BJolnj082014
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 11 Mar 2011 21:50:47 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	p2BJokJh027683; Fri, 11 Mar 2011 21:50:46 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p2BJokCY027682; 
	Fri, 11 Mar 2011 21:50:46 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Fri, 11 Mar 2011 21:50:46 +0200
From: Kostik Belousov 
To: Andriy Gapon 
Message-ID: <20110311195046.GQ78089@deviant.kiev.zoral.com.ua>
References: <201103111927.p2BJRVu3091029@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="aaUKsgtkw/mqWK8Q"
Content-Disposition: inline
In-Reply-To: <201103111927.p2BJRVu3091029@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219526 -
	stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 19:50:51 -0000


--aaUKsgtkw/mqWK8Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 11, 2011 at 07:27:31PM +0000, Andriy Gapon wrote:
> Author: avg
> Date: Fri Mar 11 19:27:31 2011
> New Revision: 219526
> URL: http://svn.freebsd.org/changeset/base/219526
>=20
> Log:
>   use even larger stack size for ZFS txg_sync_thread
>  =20
>   While the stack size was larger than the default stack size on i386, it
>   was smaller than the default stack size on amd64 and apparently that
>   wasn't enough.  So, bump the size to 4 pages.  Upcoming ZFSv28 code uses
>   8 pages for this stack size.
>  =20
>   This is a direct commit to stable/8.
>  =20
>   PR:		kern/154681
>   Discussed with:	pjd
>=20
> Modified:
>   stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
>=20
> Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Mar=
 11 19:21:42 2011	(r219525)
> +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Mar=
 11 19:27:31 2011	(r219526)
> @@ -146,7 +146,7 @@ txg_sync_start(dsl_pool_t *dp)
>  	 * 32-bit x86.  This is due in part to nested pools and
>  	 * scrub_visitbp() recursion.
>  	 */
> -	tx->tx_sync_thread =3D thread_create(NULL, 12<<10, txg_sync_thread,
> +	tx->tx_sync_thread =3D thread_create(NULL, 16<<10, txg_sync_thread,
>  	    dp, 0, &p0, TS_RUN, minclsyspri);
> =20
>  	mutex_exit(&tx->tx_sync_lock);
What about architectures where PAGE_SIZE !=3D 4096 ?
We have ptoa() macro.

--aaUKsgtkw/mqWK8Q
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk16fRYACgkQC3+MBN1Mb4gi7QCg0sJ2PyZ/Du7929rnHMao1uVl
Z1UAoKPEFlJlJDayywH0I0tkb2giKM7u
=9Efe
-----END PGP SIGNATURE-----

--aaUKsgtkw/mqWK8Q--

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 20:00:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1369E1065670;
	Fri, 11 Mar 2011 20:00:39 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EBD1B8FC0C;
	Fri, 11 Mar 2011 20: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 p2BK0cRh091885;
	Fri, 11 Mar 2011 20:00:38 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BK0cC6091883;
	Fri, 11 Mar 2011 20:00:38 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112000.p2BK0cC6091883@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 20: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: r219530 - head/contrib/binutils/bfd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 20:00:39 -0000

Author: marius
Date: Fri Mar 11 20:00:38 2011
New Revision: 219530
URL: http://svn.freebsd.org/changeset/base/219530

Log:
  In the upstream rev. 1.61 of elf64-sparc.c the following bug was fixed:
  
          * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of
          dynamic relocs against section symbols for the output section vma.
  
  However, with the addition of TLS support in the upstream rev. 1.104
  this fix was essentially reverted. After factoring out the common parts
  of elf32-sparc.c and elf64-sparc.c a comment was added to elfxx-sparc.c
  in the upstream rev. 1.27 as part of unrelated changes, saying that the
  fix from elf64-sparc.c rev. 1.61 indeed should be implemented, but given
  that some unspecified OS has a broken ld.so expecting broken relocations
  deliberately is omitted.
  As the current behavior actually violates the SPARC ABI, FreeBSD never
  had such a broken ld.so and this is actually causing problems with at
  least kernel modules linked with binutils 2.17.50 committed in r218822
  without the workaround committed in r219340 in place, re-implement the
  above fix in a way so that is only applied if the output format is
  ELFOSABI_FREEBSD. In the upstream version it probably would make sense
  to invert this check and only skip adjusting the addend for the OS with
  the broken ld.so, once it's determine which one that is.
  
  Approved by:	dim

Modified:
  head/contrib/binutils/bfd/elfxx-sparc.c

Modified: head/contrib/binutils/bfd/elfxx-sparc.c
==============================================================================
--- head/contrib/binutils/bfd/elfxx-sparc.c	Fri Mar 11 19:44:06 2011	(r219529)
+++ head/contrib/binutils/bfd/elfxx-sparc.c	Fri Mar 11 20:00:38 2011	(r219530)
@@ -2474,11 +2474,13 @@ _bfd_sparc_elf_relocate_section (bfd *ou
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
   int num_relocs;
+  const struct elf_backend_data *bed;
 
   htab = _bfd_sparc_elf_hash_table (info);
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
   local_got_offsets = elf_local_got_offsets (input_bfd);
+  bed = get_elf_backend_data (output_bfd);
 
   if (elf_hash_table (info)->hgot == NULL)
     got_base = 0;
@@ -2876,11 +2878,6 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 			{
 			  asection *osec;
 
-			  /* We are turning this relocation into one
-			     against a section symbol.  It would be
-			     proper to subtract the symbol's value,
-			     osec->vma, from the emitted reloc addend,
-			     but ld.so expects buggy relocs.  */
 			  osec = sec->output_section;
 			  indx = elf_section_data (osec)->dynindx;
 
@@ -2901,6 +2898,15 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 			      bfd_set_error (bfd_error_bad_value);
 			      return FALSE;
 			    }
+
+			  /* We are turning this relocation into one
+			     against a section symbol, so subtract out
+			     the output section's address but not the
+			     offset of the input section in the output
+			     section on OSes where ld.so doesn't expect
+			     buggy relocs.  */
+			  if (bed->elf_osabi == ELFOSABI_FREEBSD)
+			    outrel.r_addend -= osec->vma;
 			}
 
 		      outrel.r_info = SPARC_ELF_R_INFO (htab, rel, indx,

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 20:01:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4EE41065672;
	Fri, 11 Mar 2011 20:01:57 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D3B568FC12;
	Fri, 11 Mar 2011 20:01: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 p2BK1vRi091959;
	Fri, 11 Mar 2011 20:01:57 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BK1vMN091957;
	Fri, 11 Mar 2011 20:01:57 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112001.p2BK1vMN091957@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 20:01: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: r219531 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 20:01:58 -0000

Author: marius
Date: Fri Mar 11 20:01:57 2011
New Revision: 219531
URL: http://svn.freebsd.org/changeset/base/219531

Log:
  Revert the binutils workaround committed in r219340, the underlying
  problem has been fixed in r219530.

Modified:
  head/sys/sparc64/sparc64/elf_machdep.c

Modified: head/sys/sparc64/sparc64/elf_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/elf_machdep.c	Fri Mar 11 20:00:38 2011	(r219530)
+++ head/sys/sparc64/sparc64/elf_machdep.c	Fri Mar 11 20:01:57 2011	(r219531)
@@ -333,14 +333,7 @@ elf_reloc(linker_file_t lf, Elf_Addr rel
 		addr = lookup(lf, symidx, 1);
 		if (addr == 0)
 			return (-1);
-		/*
-		 * With the addition of TLS support binutils started to make
-		 * addend values relative to relocbase instead of sections.
-		 */
-		if (addr > relocbase && addr <= relocbase + value)
-			value += relocbase;
-		else
-			value += addr;
+		value += addr;
 		if (RELOC_BARE_SYMBOL(rtype))
 			value = elf_relocaddr(lf, value);
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 20:30:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66435106564A;
	Fri, 11 Mar 2011 20:30:58 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 538E28FC16;
	Fri, 11 Mar 2011 20:30: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 p2BKUwd7092576;
	Fri, 11 Mar 2011 20:30:58 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BKUwYH092573;
	Fri, 11 Mar 2011 20:30:58 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112030.p2BKUwYH092573@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 20:30:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219532 - in head: libexec/rtld-elf/sparc64
	sys/sparc64/sparc64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 20:30:58 -0000

Author: marius
Date: Fri Mar 11 20:30:58 2011
New Revision: 219532
URL: http://svn.freebsd.org/changeset/base/219532

Log:
  - Remove clause 3 and 4 from TNF licenses. [1]
  - Add the _RF_X committed in r212998 also to the tables in the sparc64
    reloc.c in order reduce differences between the kernel and the userland
    source. This results in no functional change though.
  - Fix further inconsistencies in the abbreviations of the names of the
    relocations.
  - Further whitespace fixes.
  
  Obtained from:	NetBSD [1]

Modified:
  head/libexec/rtld-elf/sparc64/reloc.c
  head/sys/sparc64/sparc64/elf_machdep.c

Modified: head/libexec/rtld-elf/sparc64/reloc.c
==============================================================================
--- head/libexec/rtld-elf/sparc64/reloc.c	Fri Mar 11 20:01:57 2011	(r219531)
+++ head/libexec/rtld-elf/sparc64/reloc.c	Fri Mar 11 20:30:58 2011	(r219532)
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdreloc.c,v 1.5 2001/04/25 12:24:51 kleink Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.42 2008/04/28 20:23:04 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 Eduardo Horvath.
@@ -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
@@ -66,28 +59,29 @@ __FBSDID("$FreeBSD$");
  *		* the relocation is relative to the load address
  *
  */
-#define _RF_S		0x80000000		/* Resolve symbol */
-#define _RF_A		0x40000000		/* Use addend */
-#define _RF_P		0x20000000		/* Location relative */
-#define _RF_G		0x10000000		/* GOT offset */
-#define _RF_B		0x08000000		/* Load address relative */
-#define _RF_U		0x04000000		/* Unaligned */
-#define _RF_SZ(s)	(((s) & 0xff) << 8)	/* memory target size */
-#define _RF_RS(s)	( (s) & 0xff)		/* right shift */
+#define	_RF_S		0x80000000		/* Resolve symbol */
+#define	_RF_A		0x40000000		/* Use addend */
+#define	_RF_P		0x20000000		/* Location relative */
+#define	_RF_G		0x10000000		/* GOT offset */
+#define	_RF_B		0x08000000		/* Load address relative */
+#define	_RF_U		0x04000000		/* Unaligned */
+#define	_RF_X		0x02000000		/* Bare symbols, needs proc */
+#define	_RF_SZ(s)	(((s) & 0xff) << 8)	/* memory target size */
+#define	_RF_RS(s)	( (s) & 0xff)		/* right shift */
 static const int reloc_target_flags[] = {
 	0,							/* NONE */
-	_RF_S|_RF_A|		_RF_SZ(8)  | _RF_RS(0),		/* RELOC_8 */
-	_RF_S|_RF_A|		_RF_SZ(16) | _RF_RS(0),		/* RELOC_16 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* RELOC_32 */
+	_RF_S|_RF_A|		_RF_SZ(8)  | _RF_RS(0),		/* 8 */
+	_RF_S|_RF_A|		_RF_SZ(16) | _RF_RS(0),		/* 16 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 32 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(8)  | _RF_RS(0),		/* DISP_8 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(16) | _RF_RS(0),		/* DISP_16 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(0),		/* DISP_32 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* WDISP_30 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* WDISP_22 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* HI22 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 22 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 13 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* LO10 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(10),	/* HI22 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 22 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 13 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* LO10 */
 	_RF_G|			_RF_SZ(32) | _RF_RS(0),		/* GOT10 */
 	_RF_G|			_RF_SZ(32) | _RF_RS(0),		/* GOT13 */
 	_RF_G|			_RF_SZ(32) | _RF_RS(10),	/* GOT22 */
@@ -106,66 +100,64 @@ static const int reloc_target_flags[] = 
 	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(0),		/* PCPLT32 */
 	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(10),	/* PCPLT22 */
 	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(0),		/* PCPLT10 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 10 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 11 */
-	_RF_S|_RF_A|		_RF_SZ(64) | _RF_RS(0),		/* 64 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 10 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 11 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(64) | _RF_RS(0),		/* 64 */
 	_RF_S|_RF_A|/*extra*/	_RF_SZ(32) | _RF_RS(0),		/* OLO10 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(42),	/* HH22 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(32),	/* HM10 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* LM22 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(42),	/* HH22 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(32),	/* HM10 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(10),	/* LM22 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(42),	/* PC_HH22 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(32),	/* PC_HM10 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(10),	/* PC_LM22 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* WDISP16 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* WDISP19 */
 	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* GLOB_JMP */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 7 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 5 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 6 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 7 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 5 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* 6 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(64) | _RF_RS(0),		/* DISP64 */
 	      _RF_A|		_RF_SZ(64) | _RF_RS(0),		/* PLT64 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* HIX22 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* LOX10 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(22),	/* H44 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(12),	/* M44 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* L44 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(10),	/* HIX22 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* LOX10 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(22),	/* H44 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(12),	/* M44 */
+	_RF_S|_RF_A|_RF_X|	_RF_SZ(32) | _RF_RS(0),		/* L44 */
 	_RF_S|_RF_A|		_RF_SZ(64) | _RF_RS(0),		/* REGISTER */
 	_RF_S|_RF_A|	_RF_U|	_RF_SZ(64) | _RF_RS(0),		/* UA64 */
 	_RF_S|_RF_A|	_RF_U|	_RF_SZ(16) | _RF_RS(0),		/* UA16 */
 };
 
 #if 0
-static const char *reloc_names[] = {
-	"NONE", "RELOC_8", "RELOC_16", "RELOC_32", "DISP_8",
-	"DISP_16", "DISP_32", "WDISP_30", "WDISP_22", "HI22",
-	"22", "13", "LO10", "GOT10", "GOT13",
-	"GOT22", "PC10", "PC22", "WPLT30", "COPY",
-	"GLOB_DAT", "JMP_SLOT", "RELATIVE", "UA_32", "PLT32",
-	"HIPLT22", "LOPLT10", "LOPLT10", "PCPLT22", "PCPLT32",
-	"10", "11", "64", "OLO10", "HH22",
-	"HM10", "LM22", "PC_HH22", "PC_HM10", "PC_LM22",
-	"WDISP16", "WDISP19", "GLOB_JMP", "7", "5", "6",
-	"DISP64", "PLT64", "HIX22", "LOX10", "H44", "M44",
+static const char *const reloc_names[] = {
+	"NONE", "8", "16", "32", "DISP_8", "DISP_16", "DISP_32", "WDISP_30",
+	"WDISP_22", "HI22", "22", "13", "LO10", "GOT10", "GOT13", "GOT22",
+	"PC10", "PC22", "WPLT30", "COPY", "GLOB_DAT", "JMP_SLOT", "RELATIVE",
+	"UA_32", "PLT32", "HIPLT22", "LOPLT10", "LOPLT10", "PCPLT22",
+	"PCPLT32", "10", "11", "64", "OLO10", "HH22", "HM10", "LM22",
+	"PC_HH22", "PC_HM10", "PC_LM22", "WDISP16", "WDISP19", "GLOB_JMP",
+	"7", "5", "6", "DISP64", "PLT64", "HIX22", "LOX10", "H44", "M44",
 	"L44", "REGISTER", "UA64", "UA16"
 };
 #endif
 
-#define RELOC_RESOLVE_SYMBOL(t)		((reloc_target_flags[t] & _RF_S) != 0)
-#define RELOC_PC_RELATIVE(t)		((reloc_target_flags[t] & _RF_P) != 0)
-#define RELOC_BASE_RELATIVE(t)		((reloc_target_flags[t] & _RF_B) != 0)
-#define RELOC_UNALIGNED(t)		((reloc_target_flags[t] & _RF_U) != 0)
-#define RELOC_USE_ADDEND(t)		((reloc_target_flags[t] & _RF_A) != 0)
-#define RELOC_TARGET_SIZE(t)		((reloc_target_flags[t] >> 8) & 0xff)
-#define RELOC_VALUE_RIGHTSHIFT(t)	(reloc_target_flags[t] & 0xff)
+#define	RELOC_RESOLVE_SYMBOL(t)		((reloc_target_flags[t] & _RF_S) != 0)
+#define	RELOC_PC_RELATIVE(t)		((reloc_target_flags[t] & _RF_P) != 0)
+#define	RELOC_BASE_RELATIVE(t)		((reloc_target_flags[t] & _RF_B) != 0)
+#define	RELOC_UNALIGNED(t)		((reloc_target_flags[t] & _RF_U) != 0)
+#define	RELOC_USE_ADDEND(t)		((reloc_target_flags[t] & _RF_A) != 0)
+#define	RELOC_BARE_SYMBOL(t)		((reloc_target_flags[t] & _RF_X) != 0)
+#define	RELOC_TARGET_SIZE(t)		((reloc_target_flags[t] >> 8) & 0xff)
+#define	RELOC_VALUE_RIGHTSHIFT(t)	(reloc_target_flags[t] & 0xff)
 
 static const long reloc_target_bitmask[] = {
-#define _BM(x)	(~(-(1ULL << (x))))
+#define	_BM(x)	(~(-(1ULL << (x))))
 	0,				/* NONE */
-	_BM(8), _BM(16), _BM(32),	/* RELOC_8, 16, 32 */
+	_BM(8), _BM(16), _BM(32),	/* 8, 16, 32 */
 	_BM(8), _BM(16), _BM(32),	/* DISP8, DISP16, DISP32 */
 	_BM(30), _BM(22),		/* WDISP30, WDISP22 */
 	_BM(22), _BM(22),		/* HI22, 22 */
-	_BM(13), _BM(10),		/* RELOC_13, LO10 */
+	_BM(13), _BM(10),		/* 13, LO10 */
 	_BM(10), _BM(13), _BM(22),	/* GOT10, GOT13, GOT22 */
 	_BM(10), _BM(22),		/* PC10, PC22 */
 	_BM(30), 0,			/* WPLT30, COPY */
@@ -184,19 +176,12 @@ static const long reloc_target_bitmask[]
 	_BM(22), _BM(13),		/* HIX22, LOX10 */
 	_BM(22), _BM(10), _BM(13),	/* H44, M44, L44 */
 	-1, -1, _BM(16),		/* REGISTER, UA64, UA16 */
-	_BM(22), _BM(10), 0, _BM(30),	/* GD_HI22, GD_LO10, GD_ADD, GD_CALL */
-	_BM(22), _BM(10), 0,		/* LDM_HI22, LDMO10, LDM_ADD */
-	_BM(30),			/* LDM_CALL */
-	_BM(22), _BM(10), 0,		/* LDO_HIX22, LDO_LOX10, LDO_ADD */
-	_BM(22), _BM(10), 0, 0,		/* IE_HI22, IE_LO10, IE_LD, IE_LDX */
-	0,				/* IE_ADD */
-	_BM(22), _BM(13),		/* LE_HIX22, LE_LOX10 */
 #undef _BM
 };
-#define RELOC_VALUE_BITMASK(t)	(reloc_target_bitmask[t])
+#define	RELOC_VALUE_BITMASK(t)	(reloc_target_bitmask[t])
 
 #undef flush
-#define	flush(va, offs)	\
+#define	flush(va, offs)							\
 	__asm __volatile("flush %0 + %1" : : "r" (va), "I" (offs));
 
 static int reloc_nonplt_object(Obj_Entry *obj, const Elf_Rela *rela,
@@ -365,12 +350,12 @@ reloc_nonplt_object(Obj_Entry *obj, cons
 		/*
 		 * Note that even though sparcs use `Elf_rela' exclusively
 		 * we still need the implicit memory addend in relocations
-		 * referring to GOT entries. Undoubtedly, someone f*cked
+		 * referring to GOT entries.  Undoubtedly, someone f*cked
 		 * this up in the distant past, and now we're stuck with
-		 * it in the name of compatibility for all eternity..
+		 * it in the name of compatibility for all eternity ...
 		 *
 		 * In any case, the implicit and explicit should be mutually
-		 * exclusive. We provide a check for that here.
+		 * exclusive.  We provide a check for that here.
 		 */
 		/* XXXX -- apparently we ignore the preexisting value */
 		value += (Elf_Addr)(obj->relocbase);
@@ -456,7 +441,7 @@ reloc_plt(Obj_Entry *obj)
 
 /* %hi(v) with variable shift */
 #define	HIVAL(v, s)	(((v) >> (s)) &  0x003fffff)
-#define LOVAL(v)	((v) & 0x000003ff)
+#define	LOVAL(v)	((v) & 0x000003ff)
 
 int
 reloc_jmpslots(Obj_Entry *obj, RtldLockState *lockstate)
@@ -521,7 +506,8 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr
 		offset = ((Elf_Addr)where) - target;
 		if (offset <= (1L<<20) && offset >= -(1L<<20)) {
 			/*
-			 * We're within 1MB -- we can use a direct branch insn.
+			 * We're within 1MB -- we can use a direct branch
+			 * instruction.
 			 *
 			 * We can generate this pattern:
 			 *
@@ -604,7 +590,8 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr
 			flush(where, 4);
 		} else if (offset >= 0 && offset < (1L<<44)) {
 			/*
-			 * We're withing 44 bits.  We can generate this pattern:
+			 * We're withing 44 bits.  We can generate this
+			 * pattern:
 			 *
 			 * The resulting code in the jump slot is:
 			 *
@@ -628,7 +615,8 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr
 			flush(where, 4);
 		} else if (offset < 0 && offset > -(1L<<44)) {
 			/*
-			 * We're withing 44 bits.  We can generate this pattern:
+			 * We're withing 44 bits.  We can generate this
+			 * pattern:
 			 *
 			 * The resulting code in the jump slot is:
 			 *
@@ -683,7 +671,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr
 		/*
 		 * This is a high PLT slot; the relocation offset specifies a
 		 * pointer that needs to be frobbed; no actual code needs to
-		 * be modified. The pointer to be calculated needs the addend
+		 * be modified.  The pointer to be calculated needs the addend
 		 * added and the reference object relocation base subtraced.
 		 */
 		*wherep = target + rela->r_addend -

Modified: head/sys/sparc64/sparc64/elf_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/elf_machdep.c	Fri Mar 11 20:01:57 2011	(r219531)
+++ head/sys/sparc64/sparc64/elf_machdep.c	Fri Mar 11 20:30:58 2011	(r219532)
@@ -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
@@ -35,7 +28,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- *	from: NetBSD: mdreloc.c,v 1.5 2001/04/25 12:24:51 kleink Exp
+ *	from: NetBSD: mdreloc.c,v 1.42 2008/04/28 20:23:04 martin Exp
  */
 
 #include 
@@ -150,20 +143,20 @@ elf64_dump_thread(struct thread *td __un
  *		* the relocation is relative to the load address
  *
  */
-#define _RF_S		0x80000000		/* Resolve symbol */
-#define _RF_A		0x40000000		/* Use addend */
-#define _RF_P		0x20000000		/* Location relative */
-#define _RF_G		0x10000000		/* GOT offset */
-#define _RF_B		0x08000000		/* Load address relative */
-#define _RF_U		0x04000000		/* Unaligned */
+#define	_RF_S		0x80000000		/* Resolve symbol */
+#define	_RF_A		0x40000000		/* Use addend */
+#define	_RF_P		0x20000000		/* Location relative */
+#define	_RF_G		0x10000000		/* GOT offset */
+#define	_RF_B		0x08000000		/* Load address relative */
+#define	_RF_U		0x04000000		/* Unaligned */
 #define	_RF_X		0x02000000		/* Bare symbols, needs proc */
-#define _RF_SZ(s)	(((s) & 0xff) << 8)	/* memory target size */
-#define _RF_RS(s)	( (s) & 0xff)		/* right shift */
+#define	_RF_SZ(s)	(((s) & 0xff) << 8)	/* memory target size */
+#define	_RF_RS(s)	( (s) & 0xff)		/* right shift */
 static const int reloc_target_flags[] = {
 	0,							/* NONE */
-	_RF_S|_RF_A|		_RF_SZ(8)  | _RF_RS(0),		/* RELOC_8 */
-	_RF_S|_RF_A|		_RF_SZ(16) | _RF_RS(0),		/* RELOC_16 */
-	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* RELOC_32 */
+	_RF_S|_RF_A|		_RF_SZ(8)  | _RF_RS(0),		/* 8 */
+	_RF_S|_RF_A|		_RF_SZ(16) | _RF_RS(0),		/* 16 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* 32 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(8)  | _RF_RS(0),		/* DISP_8 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(16) | _RF_RS(0),		/* DISP_16 */
 	_RF_S|_RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(0),		/* DISP_32 */
@@ -221,58 +214,55 @@ static const int reloc_target_flags[] = 
 
 #if 0
 static const char *const reloc_names[] = {
-	"NONE", "RELOC_8", "RELOC_16", "RELOC_32", "DISP_8",
-	"DISP_16", "DISP_32", "WDISP_30", "WDISP_22", "HI22",
-	"22", "13", "LO10", "GOT10", "GOT13",
-	"GOT22", "PC10", "PC22", "WPLT30", "COPY",
-	"GLOB_DAT", "JMP_SLOT", "RELATIVE", "UA_32", "PLT32",
-	"HIPLT22", "LOPLT10", "LOPLT10", "PCPLT22", "PCPLT32",
-	"10", "11", "64", "OLO10", "HH22",
-	"HM10", "LM22", "PC_HH22", "PC_HM10", "PC_LM22",
-	"WDISP16", "WDISP19", "GLOB_JMP", "7", "5", "6",
-	"DISP64", "PLT64", "HIX22", "LOX10", "H44", "M44",
+	"NONE", "8", "16", "32", "DISP_8", "DISP_16", "DISP_32", "WDISP_30",
+	"WDISP_22", "HI22", "22", "13", "LO10", "GOT10", "GOT13", "GOT22",
+	"PC10", "PC22", "WPLT30", "COPY", "GLOB_DAT", "JMP_SLOT", "RELATIVE",
+	"UA_32", "PLT32", "HIPLT22", "LOPLT10", "LOPLT10", "PCPLT22",
+	"PCPLT32", "10", "11", "64", "OLO10", "HH22", "HM10", "LM22",
+	"PC_HH22", "PC_HM10", "PC_LM22", "WDISP16", "WDISP19", "GLOB_JMP",
+	"7", "5", "6", "DISP64", "PLT64", "HIX22", "LOX10", "H44", "M44",
 	"L44", "REGISTER", "UA64", "UA16"
 };
 #endif
 
-#define RELOC_RESOLVE_SYMBOL(t)		((reloc_target_flags[t] & _RF_S) != 0)
-#define RELOC_PC_RELATIVE(t)		((reloc_target_flags[t] & _RF_P) != 0)
-#define RELOC_BASE_RELATIVE(t)		((reloc_target_flags[t] & _RF_B) != 0)
-#define RELOC_UNALIGNED(t)		((reloc_target_flags[t] & _RF_U) != 0)
-#define RELOC_USE_ADDEND(t)		((reloc_target_flags[t] & _RF_A) != 0)
+#define	RELOC_RESOLVE_SYMBOL(t)		((reloc_target_flags[t] & _RF_S) != 0)
+#define	RELOC_PC_RELATIVE(t)		((reloc_target_flags[t] & _RF_P) != 0)
+#define	RELOC_BASE_RELATIVE(t)		((reloc_target_flags[t] & _RF_B) != 0)
+#define	RELOC_UNALIGNED(t)		((reloc_target_flags[t] & _RF_U) != 0)
+#define	RELOC_USE_ADDEND(t)		((reloc_target_flags[t] & _RF_A) != 0)
 #define	RELOC_BARE_SYMBOL(t)		((reloc_target_flags[t] & _RF_X) != 0)
-#define RELOC_TARGET_SIZE(t)		((reloc_target_flags[t] >> 8) & 0xff)
-#define RELOC_VALUE_RIGHTSHIFT(t)	(reloc_target_flags[t] & 0xff)
+#define	RELOC_TARGET_SIZE(t)		((reloc_target_flags[t] >> 8) & 0xff)
+#define	RELOC_VALUE_RIGHTSHIFT(t)	(reloc_target_flags[t] & 0xff)
 
 static const long reloc_target_bitmask[] = {
-#define _BM(x)	(~(-(1ULL << (x))))
+#define	_BM(x)	(~(-(1ULL << (x))))
 	0,				/* NONE */
-	_BM(8), _BM(16), _BM(32),	/* RELOC_8, _16, _32 */
+	_BM(8), _BM(16), _BM(32),	/* 8, 16, 32 */
 	_BM(8), _BM(16), _BM(32),	/* DISP8, DISP16, DISP32 */
 	_BM(30), _BM(22),		/* WDISP30, WDISP22 */
-	_BM(22), _BM(22),		/* HI22, _22 */
-	_BM(13), _BM(10),		/* RELOC_13, _LO10 */
+	_BM(22), _BM(22),		/* HI22, 22 */
+	_BM(13), _BM(10),		/* 13, LO10 */
 	_BM(10), _BM(13), _BM(22),	/* GOT10, GOT13, GOT22 */
 	_BM(10), _BM(22),		/* PC10, PC22 */
 	_BM(30), 0,			/* WPLT30, COPY */
 	_BM(32), _BM(32), _BM(32),	/* GLOB_DAT, JMP_SLOT, RELATIVE */
 	_BM(32), _BM(32),		/* UA32, PLT32 */
 	_BM(22), _BM(10),		/* HIPLT22, LOPLT10 */
-	_BM(32), _BM(22), _BM(10),	/* PCPLT32, _PCPLT22, _PCPLT10 */
+	_BM(32), _BM(22), _BM(10),	/* PCPLT32, PCPLT22, PCPLT10 */
 	_BM(10), _BM(11), -1,		/* 10, 11, 64 */
 	_BM(13), _BM(22),		/* OLO10, HH22 */
 	_BM(10), _BM(22),		/* HM10, LM22 */
 	_BM(22), _BM(10), _BM(22),	/* PC_HH22, PC_HM10, PC_LM22 */
 	_BM(16), _BM(19),		/* WDISP16, WDISP19 */
 	-1,				/* GLOB_JMP */
-	_BM(7), _BM(5), _BM(6)		/* 7, 5, 6 */
+	_BM(7), _BM(5), _BM(6),		/* 7, 5, 6 */
 	-1, -1,				/* DISP64, PLT64 */
 	_BM(22), _BM(13),		/* HIX22, LOX10 */
 	_BM(22), _BM(10), _BM(13),	/* H44, M44, L44 */
 	-1, -1, _BM(16),		/* REGISTER, UA64, UA16 */
 #undef _BM
 };
-#define RELOC_VALUE_BITMASK(t)	(reloc_target_bitmask[t])
+#define	RELOC_VALUE_BITMASK(t)	(reloc_target_bitmask[t])
 
 int
 elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, const void *data,

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 21:08:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D352B1065676;
	Fri, 11 Mar 2011 21:08:02 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C0D848FC12;
	Fri, 11 Mar 2011 21:08: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 p2BL82pk093732;
	Fri, 11 Mar 2011 21:08:02 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BL82Q3093729;
	Fri, 11 Mar 2011 21:08:02 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112108.p2BL82Q3093729@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 21:08: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: r219533 - in head: libexec/rtld-elf/sparc64
	sys/sparc64/sparc64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 21:08:03 -0000

Author: marius
Date: Fri Mar 11 21:08:02 2011
New Revision: 219533
URL: http://svn.freebsd.org/changeset/base/219533

Log:
  - Add support for TLS relocations.
  - Emitt an error when encountering an unsupported and in case of the
    kernel also for unaligned relocations.
  - Fix R_SPARC_LOX10 relocations. Apparently these are hardly ever used.

Modified:
  head/libexec/rtld-elf/sparc64/reloc.c
  head/sys/sparc64/sparc64/elf_machdep.c

Modified: head/libexec/rtld-elf/sparc64/reloc.c
==============================================================================
--- head/libexec/rtld-elf/sparc64/reloc.c	Fri Mar 11 20:30:58 2011	(r219532)
+++ head/libexec/rtld-elf/sparc64/reloc.c	Fri Mar 11 21:08:02 2011	(r219533)
@@ -66,6 +66,9 @@ __FBSDID("$FreeBSD$");
 #define	_RF_B		0x08000000		/* Load address relative */
 #define	_RF_U		0x04000000		/* Unaligned */
 #define	_RF_X		0x02000000		/* Bare symbols, needs proc */
+#define	_RF_D		0x01000000		/* Use dynamic TLS offset */
+#define	_RF_O		0x00800000		/* Use static TLS offset */
+#define	_RF_I		0x00400000		/* Use TLS object ID */
 #define	_RF_SZ(s)	(((s) & 0xff) << 8)	/* memory target size */
 #define	_RF_RS(s)	( (s) & 0xff)		/* right shift */
 static const int reloc_target_flags[] = {
@@ -126,6 +129,32 @@ static const int reloc_target_flags[] = 
 	_RF_S|_RF_A|		_RF_SZ(64) | _RF_RS(0),		/* REGISTER */
 	_RF_S|_RF_A|	_RF_U|	_RF_SZ(64) | _RF_RS(0),		/* UA64 */
 	_RF_S|_RF_A|	_RF_U|	_RF_SZ(16) | _RF_RS(0),		/* UA16 */
+
+	/* TLS */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* GD_HI22 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* GD_LO10 */
+	0,							/* GD_ADD */
+	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* GD_CALL */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* LDM_HI22 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* LDM_LO10 */
+	0,							/* LDM_ADD */
+	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* LDM_CALL */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* LDO_HIX22 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* LDO_LOX10 */
+	0,							/* LDO_ADD */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* IE_HI22 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* IE_LO10 */
+	0,							/* IE_LD */
+	0,							/* IE_LDX */
+	0,							/* IE_ADD */
+	_RF_S|_RF_A|	_RF_O|	_RF_SZ(32) | _RF_RS(10),	/* LE_HIX22 */
+	_RF_S|_RF_A|	_RF_O|	_RF_SZ(32) | _RF_RS(0),		/* LE_LOX10 */
+	_RF_S|		_RF_I|	_RF_SZ(32) | _RF_RS(0),		/* DTPMOD32 */
+	_RF_S|		_RF_I|	_RF_SZ(64) | _RF_RS(0),		/* DTPMOD64 */
+	_RF_S|_RF_A|	_RF_D|	_RF_SZ(32) | _RF_RS(0),		/* DTPOFF32 */
+	_RF_S|_RF_A|	_RF_D|	_RF_SZ(64) | _RF_RS(0),		/* DTPOFF64 */
+	_RF_S|_RF_A|	_RF_O|	_RF_SZ(32) | _RF_RS(0),		/* TPOFF32 */
+	_RF_S|_RF_A|	_RF_O|	_RF_SZ(64) | _RF_RS(0)		/* TPOFF64 */
 };
 
 #if 0
@@ -137,7 +166,11 @@ static const char *const reloc_names[] =
 	"PCPLT32", "10", "11", "64", "OLO10", "HH22", "HM10", "LM22",
 	"PC_HH22", "PC_HM10", "PC_LM22", "WDISP16", "WDISP19", "GLOB_JMP",
 	"7", "5", "6", "DISP64", "PLT64", "HIX22", "LOX10", "H44", "M44",
-	"L44", "REGISTER", "UA64", "UA16"
+	"L44", "REGISTER", "UA64", "UA16", "GD_HI22", "GD_LO10", "GD_ADD",
+	"GD_CALL", "LDM_HI22", "LDMO10", "LDM_ADD", "LDM_CALL", "LDO_HIX22",
+	"LDO_LOX10", "LDO_ADD", "IE_HI22", "IE_LO10", "IE_LD", "IE_LDX",
+	"IE_ADD", "LE_HIX22", "LE_LOX10", "DTPMOD32", "DTPMOD64", "DTPOFF32",
+	"DTPOFF64", "TPOFF32", "TPOFF64"
 };
 #endif
 
@@ -147,6 +180,9 @@ static const char *const reloc_names[] =
 #define	RELOC_UNALIGNED(t)		((reloc_target_flags[t] & _RF_U) != 0)
 #define	RELOC_USE_ADDEND(t)		((reloc_target_flags[t] & _RF_A) != 0)
 #define	RELOC_BARE_SYMBOL(t)		((reloc_target_flags[t] & _RF_X) != 0)
+#define	RELOC_USE_TLS_DOFF(t)		((reloc_target_flags[t] & _RF_D) != 0)
+#define	RELOC_USE_TLS_OFF(t)		((reloc_target_flags[t] & _RF_O) != 0)
+#define	RELOC_USE_TLS_ID(t)		((reloc_target_flags[t] & _RF_I) != 0)
 #define	RELOC_TARGET_SIZE(t)		((reloc_target_flags[t] >> 8) & 0xff)
 #define	RELOC_VALUE_RIGHTSHIFT(t)	(reloc_target_flags[t] & 0xff)
 
@@ -176,6 +212,16 @@ static const long reloc_target_bitmask[]
 	_BM(22), _BM(13),		/* HIX22, LOX10 */
 	_BM(22), _BM(10), _BM(13),	/* H44, M44, L44 */
 	-1, -1, _BM(16),		/* REGISTER, UA64, UA16 */
+	_BM(22), _BM(10), 0, _BM(30),	/* GD_HI22, GD_LO10, GD_ADD, GD_CALL */
+	_BM(22), _BM(10), 0,		/* LDM_HI22, LDMO10, LDM_ADD */
+	_BM(30),			/* LDM_CALL */
+	_BM(22), _BM(10), 0,		/* LDO_HIX22, LDO_LOX10, LDO_ADD */
+	_BM(22), _BM(10), 0, 0,		/* IE_HI22, IE_LO10, IE_LD, IE_LDX */
+	0,				/* IE_ADD */
+	_BM(22), _BM(13),		/* LE_HIX22, LE_LOX10 */
+	_BM(32), -1,			/* DTPMOD32, DTPMOD64 */
+	_BM(32), -1,			/* DTPOFF32, DTPOFF64 */
+	_BM(32), -1			/* TPOFF32, TPOFF64 */
 #undef _BM
 };
 #define	RELOC_VALUE_BITMASK(t)	(reloc_target_bitmask[t])
@@ -303,12 +349,22 @@ reloc_nonplt_object(Obj_Entry *obj, cons
 	if (type == R_SPARC_COPY)
 		return (0);
 
+	/* Ignore ADD and CALL relocations for dynamic TLS references. */
+	if (type == R_SPARC_TLS_GD_ADD || type == R_SPARC_TLS_GD_CALL ||
+	    type == R_SPARC_TLS_LDM_ADD || type == R_SPARC_TLS_LDM_CALL ||
+	    type == R_SPARC_TLS_LDO_ADD)
+		return (0);
+
 	/*
-	 * Note: R_SPARC_UA16 must be numerically largest relocation type.
+	 * Note: R_SPARC_TLS_TPOFF64 must be the numerically largest
+	 * relocation type.
 	 */
 	if (type >= sizeof(reloc_target_bitmask) /
-	    sizeof(*reloc_target_bitmask))
+	    sizeof(*reloc_target_bitmask)) {
+		_rtld_error("%s: Unsupported relocation type %d in non-PLT "
+		    "object\n", obj->path, type);
 		return (-1);
+	}
 
 	value = rela->r_addend;
 
@@ -333,14 +389,37 @@ reloc_nonplt_object(Obj_Entry *obj, cons
 		if (def == NULL)
 			return (-1);
 
-		/* Add in the symbol's absolute address. */
-		value += (Elf_Addr)(defobj->relocbase + def->st_value);
+		if (RELOC_USE_TLS_ID(type))
+			value = (Elf_Addr)defobj->tlsindex;
+		else if (RELOC_USE_TLS_DOFF(type))
+			value += (Elf_Addr)def->st_value;
+		else if (RELOC_USE_TLS_OFF(type)) {
+			/*
+			 * We lazily allocate offsets for static TLS as we
+			 * see the first relocation that references the TLS
+			 * block.  This allows us to support (small amounts
+			 * of) static TLS in dynamically loaded modules.  If
+			 * we run out of space, we generate an error.
+			 */
+			if (!defobj->tls_done &&
+			    !allocate_tls_offset((Obj_Entry*)defobj)) {
+				_rtld_error("%s: No space available for "
+				    "static Thread Local Storage", obj->path);
+				return (-1);
+			}
+			value += (Elf_Addr)(def->st_value -
+			    defobj->tlsoffset);
+		} else {
+			/* Add in the symbol's absolute address. */
+			value += (Elf_Addr)(def->st_value +
+			    defobj->relocbase);
+		}
 	}
 
 	if (type == R_SPARC_OLO10)
 		value = (value & 0x3ff) + ELF64_R_TYPE_DATA(rela->r_info);
 
-	if (type == R_SPARC_HIX22)
+	if (type == R_SPARC_HIX22 || type == R_SPARC_TLS_LE_HIX22)
 		value ^= 0xffffffffffffffff;
 
 	if (RELOC_PC_RELATIVE(type))
@@ -365,6 +444,9 @@ reloc_nonplt_object(Obj_Entry *obj, cons
 	value >>= RELOC_VALUE_RIGHTSHIFT(type);
 	value &= mask;
 
+	if (type == R_SPARC_LOX10 || type == R_SPARC_TLS_LE_LOX10)
+		value |= 0x1c00;
+
 	if (RELOC_UNALIGNED(type)) {
 		/* Handle unaligned relocations. */
 		Elf_Addr tmp;

Modified: head/sys/sparc64/sparc64/elf_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/elf_machdep.c	Fri Mar 11 20:30:58 2011	(r219532)
+++ head/sys/sparc64/sparc64/elf_machdep.c	Fri Mar 11 21:08:02 2011	(r219533)
@@ -102,8 +102,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 };
 
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST,
-    (sysinit_cfunc_t) elf64_insert_brand_entry,
-    &freebsd_brand_info);
+    (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info);
 
 static Elf64_Brandinfo freebsd_brand_oinfo = {
 	.brand		= ELFOSABI_FREEBSD,
@@ -118,9 +117,7 @@ static Elf64_Brandinfo freebsd_brand_oin
 };
 
 SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
-	(sysinit_cfunc_t) elf64_insert_brand_entry,
-	&freebsd_brand_oinfo);
-
+    (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo);
 
 void
 elf64_dump_thread(struct thread *td __unused, void *dst __unused,
@@ -150,6 +147,9 @@ elf64_dump_thread(struct thread *td __un
 #define	_RF_B		0x08000000		/* Load address relative */
 #define	_RF_U		0x04000000		/* Unaligned */
 #define	_RF_X		0x02000000		/* Bare symbols, needs proc */
+#define	_RF_D		0x01000000		/* Use dynamic TLS offset */
+#define	_RF_O		0x00800000		/* Use static TLS offset */
+#define	_RF_I		0x00400000		/* Use TLS object ID */
 #define	_RF_SZ(s)	(((s) & 0xff) << 8)	/* memory target size */
 #define	_RF_RS(s)	( (s) & 0xff)		/* right shift */
 static const int reloc_target_flags[] = {
@@ -210,6 +210,34 @@ static const int reloc_target_flags[] = 
 	_RF_S|_RF_A|		_RF_SZ(64) | _RF_RS(0),		/* REGISTER */
 	_RF_S|_RF_A|	_RF_U|	_RF_SZ(64) | _RF_RS(0),		/* UA64 */
 	_RF_S|_RF_A|	_RF_U|	_RF_SZ(16) | _RF_RS(0),		/* UA16 */
+
+#if 0
+	/* TLS */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* GD_HI22 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* GD_LO10 */
+	0,							/* GD_ADD */
+	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* GD_CALL */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* LDM_HI22 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* LDM_LO10 */
+	0,							/* LDM_ADD */
+	      _RF_A|_RF_P|	_RF_SZ(32) | _RF_RS(2),		/* LDM_CALL */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* LDO_HIX22 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* LDO_LOX10 */
+	0,							/* LDO_ADD */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(10),	/* IE_HI22 */
+	_RF_S|_RF_A|		_RF_SZ(32) | _RF_RS(0),		/* IE_LO10 */
+	0,							/* IE_LD */
+	0,							/* IE_LDX */
+	0,							/* IE_ADD */
+	_RF_S|_RF_A|	_RF_O|	_RF_SZ(32) | _RF_RS(10),	/* LE_HIX22 */
+	_RF_S|_RF_A|	_RF_O|	_RF_SZ(32) | _RF_RS(0),		/* LE_LOX10 */
+	_RF_S|		_RF_I|	_RF_SZ(32) | _RF_RS(0),		/* DTPMOD32 */
+	_RF_S|		_RF_I|	_RF_SZ(64) | _RF_RS(0),		/* DTPMOD64 */
+	_RF_S|_RF_A|	_RF_D|	_RF_SZ(32) | _RF_RS(0),		/* DTPOFF32 */
+	_RF_S|_RF_A|	_RF_D|	_RF_SZ(64) | _RF_RS(0),		/* DTPOFF64 */
+	_RF_S|_RF_A|	_RF_O|	_RF_SZ(32) | _RF_RS(0),		/* TPOFF32 */
+	_RF_S|_RF_A|	_RF_O|	_RF_SZ(64) | _RF_RS(0)		/* TPOFF64 */
+#endif
 };
 
 #if 0
@@ -221,7 +249,11 @@ static const char *const reloc_names[] =
 	"PCPLT32", "10", "11", "64", "OLO10", "HH22", "HM10", "LM22",
 	"PC_HH22", "PC_HM10", "PC_LM22", "WDISP16", "WDISP19", "GLOB_JMP",
 	"7", "5", "6", "DISP64", "PLT64", "HIX22", "LOX10", "H44", "M44",
-	"L44", "REGISTER", "UA64", "UA16"
+	"L44", "REGISTER", "UA64", "UA16", "GD_HI22", "GD_LO10", "GD_ADD",
+	"GD_CALL", "LDM_HI22", "LDMO10", "LDM_ADD", "LDM_CALL", "LDO_HIX22",
+	"LDO_LOX10", "LDO_ADD", "IE_HI22", "IE_LO10", "IE_LD", "IE_LDX",
+	"IE_ADD", "LE_HIX22", "LE_LOX10", "DTPMOD32", "DTPMOD64", "DTPOFF32",
+	"DTPOFF64", "TPOFF32", "TPOFF64"
 };
 #endif
 
@@ -231,6 +263,9 @@ static const char *const reloc_names[] =
 #define	RELOC_UNALIGNED(t)		((reloc_target_flags[t] & _RF_U) != 0)
 #define	RELOC_USE_ADDEND(t)		((reloc_target_flags[t] & _RF_A) != 0)
 #define	RELOC_BARE_SYMBOL(t)		((reloc_target_flags[t] & _RF_X) != 0)
+#define	RELOC_USE_TLS_DOFF(t)		((reloc_target_flags[t] & _RF_D) != 0)
+#define	RELOC_USE_TLS_OFF(t)		((reloc_target_flags[t] & _RF_O) != 0)
+#define	RELOC_USE_TLS_ID(t)		((reloc_target_flags[t] & _RF_I) != 0)
 #define	RELOC_TARGET_SIZE(t)		((reloc_target_flags[t] >> 8) & 0xff)
 #define	RELOC_VALUE_RIGHTSHIFT(t)	(reloc_target_flags[t] & 0xff)
 
@@ -260,6 +295,18 @@ static const long reloc_target_bitmask[]
 	_BM(22), _BM(13),		/* HIX22, LOX10 */
 	_BM(22), _BM(10), _BM(13),	/* H44, M44, L44 */
 	-1, -1, _BM(16),		/* REGISTER, UA64, UA16 */
+#if 0
+	_BM(22), _BM(10), 0, _BM(30),	/* GD_HI22, GD_LO10, GD_ADD, GD_CALL */
+	_BM(22), _BM(10), 0,		/* LDM_HI22, LDMO10, LDM_ADD */
+	_BM(30),			/* LDM_CALL */
+	_BM(22), _BM(10), 0,		/* LDO_HIX22, LDO_LOX10, LDO_ADD */
+	_BM(22), _BM(10), 0, 0,		/* IE_HI22, IE_LO10, IE_LD, IE_LDX */
+	0,				/* IE_ADD */
+	_BM(22), _BM(13),		/* LE_HIX22, LE_LOX10 */
+	_BM(32), -1,			/* DTPMOD32, DTPMOD64 */
+	_BM(32), -1,			/* DTPOFF32, DTPOFF64 */
+	_BM(32), -1			/* TPOFF32, TPOFF64 */
+#endif
 #undef _BM
 };
 #define	RELOC_VALUE_BITMASK(t)	(reloc_target_bitmask[t])
@@ -311,11 +358,15 @@ elf_reloc(linker_file_t lf, Elf_Addr rel
 
 	if (rtype == R_SPARC_JMP_SLOT || rtype == R_SPARC_COPY ||
 	    rtype >= sizeof(reloc_target_bitmask) /
-	    sizeof(*reloc_target_bitmask))
+	    sizeof(*reloc_target_bitmask)) {
+		printf("kldload: unexpected relocation type %ld\n", rtype);
 		return (-1);
+	}
 
-	if (RELOC_UNALIGNED(rtype))
+	if (RELOC_UNALIGNED(rtype)) {
+		printf("kldload: unaligned relocation type %ld\n", rtype);
 		return (-1);
+	}
 
 	value = rela->r_addend;
 
@@ -344,6 +395,9 @@ elf_reloc(linker_file_t lf, Elf_Addr rel
 	value >>= RELOC_VALUE_RIGHTSHIFT(rtype);
 	value &= mask;
 
+	if (rtype == R_SPARC_LOX10)
+		value |= 0x1c00;
+
 	if (RELOC_TARGET_SIZE(rtype) > 32) {
 		*where &= ~mask;
 		*where |= value;

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 21:24:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C1642106564A;
	Fri, 11 Mar 2011 21:24:02 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 93D5B8FC08;
	Fri, 11 Mar 2011 21:24: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 p2BLO21L094077;
	Fri, 11 Mar 2011 21:24:02 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BLO2EV094072;
	Fri, 11 Mar 2011 21:24:02 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112124.p2BLO2EV094072@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 21:24: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: r219534 - in head: contrib/gcc/config/sparc
	gnu/lib/libgomp gnu/lib/libstdc++ gnu/usr.bin/cc/cc_tools
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 21:24:02 -0000

Author: marius
Date: Fri Mar 11 21:24:02 2011
New Revision: 219534
URL: http://svn.freebsd.org/changeset/base/219534

Log:
  Now that TLS is supported for sparc64 by both binutils 2.17.50 committed
  in r218822 and rtld(1) committed in r219533 turn on TLS support in GCC.

Modified:
  head/contrib/gcc/config/sparc/freebsd.h
  head/gnu/lib/libgomp/config.h
  head/gnu/lib/libstdc++/config.h
  head/gnu/usr.bin/cc/cc_tools/auto-host.h

Modified: head/contrib/gcc/config/sparc/freebsd.h
==============================================================================
--- head/contrib/gcc/config/sparc/freebsd.h	Fri Mar 11 21:08:02 2011	(r219533)
+++ head/contrib/gcc/config/sparc/freebsd.h	Fri Mar 11 21:24:02 2011	(r219534)
@@ -161,6 +161,13 @@ Boston, MA 02110-1301, USA.  */
 
 /* #define DWARF_OFFSET_SIZE PTR_SIZE */
 
+#ifdef HAVE_AS_TLS
+#undef TARGET_SUN_TLS
+#undef TARGET_GNU_TLS
+#define TARGET_SUN_TLS 0
+#define TARGET_GNU_TLS 1
+#endif
+
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC						\
   "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} "	\

Modified: head/gnu/lib/libgomp/config.h
==============================================================================
--- head/gnu/lib/libgomp/config.h	Fri Mar 11 21:08:02 2011	(r219533)
+++ head/gnu/lib/libgomp/config.h	Fri Mar 11 21:24:02 2011	(r219534)
@@ -59,7 +59,7 @@
 #define HAVE_SYS_TYPES_H 1
 
 /* Define to 1 if the target supports thread-local storage. */
-#if !defined(__sparc64__) && !defined(__arm__) && !defined(__mips__)
+#if !defined(__arm__) && !defined(__mips__)
 #define HAVE_TLS 1
 #endif
 

Modified: head/gnu/lib/libstdc++/config.h
==============================================================================
--- head/gnu/lib/libstdc++/config.h	Fri Mar 11 21:08:02 2011	(r219533)
+++ head/gnu/lib/libstdc++/config.h	Fri Mar 11 21:24:02 2011	(r219534)
@@ -371,7 +371,7 @@
 /* #undef HAVE_TANL */
 
 /* Define to 1 if the target supports thread-local storage. */
-#if !defined(__sparc64__) && !defined(__arm__) && !defined(__mips__)
+#if !defined(__arm__) && !defined(__mips__)
 #define HAVE_TLS 1
 #endif
 

Modified: head/gnu/usr.bin/cc/cc_tools/auto-host.h
==============================================================================
--- head/gnu/usr.bin/cc/cc_tools/auto-host.h	Fri Mar 11 21:08:02 2011	(r219533)
+++ head/gnu/usr.bin/cc/cc_tools/auto-host.h	Fri Mar 11 21:24:02 2011	(r219534)
@@ -287,7 +287,7 @@
 
 /* Define if your assembler supports thread-local storage. */
 #ifndef USED_FOR_TARGET
-#if !defined(__sparc64__) && !defined(__arm__)
+#if !defined(__arm__)
 #define HAVE_AS_TLS 1
 #endif
 #endif

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 21:35:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22B95106566B;
	Fri, 11 Mar 2011 21:35:39 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1167C8FC0C;
	Fri, 11 Mar 2011 21:35: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 p2BLZcHN094322;
	Fri, 11 Mar 2011 21:35:38 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BLZcvl094320;
	Fri, 11 Mar 2011 21:35:38 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112135.p2BLZcvl094320@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 21:35: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: r219535 - head/lib/libc/stdlib
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 21:35:39 -0000

Author: marius
Date: Fri Mar 11 21:35:38 2011
New Revision: 219535
URL: http://svn.freebsd.org/changeset/base/219535

Log:
  Now that TLS generally is available on sparc64 since r219534 turn on
  support for it. Note that while sparc64 also supports the static TLS
  model and thus tls_model("initial-exec"), using the default model
  turned out to yield slightly better buildstone performance.

Modified:
  head/lib/libc/stdlib/malloc.c

Modified: head/lib/libc/stdlib/malloc.c
==============================================================================
--- head/lib/libc/stdlib/malloc.c	Fri Mar 11 21:24:02 2011	(r219534)
+++ head/lib/libc/stdlib/malloc.c	Fri Mar 11 21:35:38 2011	(r219535)
@@ -234,7 +234,7 @@ __FBSDID("$FreeBSD$");
 #ifdef __sparc64__
 #  define LG_QUANTUM		4
 #  define LG_SIZEOF_PTR		3
-#  define NO_TLS
+#  define TLS_MODEL		/* default */
 #endif
 #ifdef __amd64__
 #  define LG_QUANTUM		4

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:07:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3FA09106564A;
	Fri, 11 Mar 2011 22:07:29 +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 237C08FC08;
	Fri, 11 Mar 2011 22:07: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 p2BM7Tbq095199;
	Fri, 11 Mar 2011 22:07:29 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BM7T0l095195;
	Fri, 11 Mar 2011 22:07:29 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201103112207.p2BM7T0l095195@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Fri, 11 Mar 2011 22:07:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219539 - in stable/8: lib/libelf usr.sbin/ntp/doc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:07:29 -0000

Author: uqs
Date: Fri Mar 11 22:07:28 2011
New Revision: 219539
URL: http://svn.freebsd.org/changeset/base/219539

Log:
  MFH r210933,219210: Typo fixes

Modified:
  stable/8/lib/libelf/elf_cntl.3
  stable/8/usr.sbin/ntp/doc/ntp.conf.5
  stable/8/usr.sbin/ntp/doc/ntpq.8
Directory Properties:
  stable/8/lib/libelf/   (props changed)
  stable/8/usr.sbin/ntp/   (props changed)

Modified: stable/8/lib/libelf/elf_cntl.3
==============================================================================
--- stable/8/lib/libelf/elf_cntl.3	Fri Mar 11 22:00:45 2011	(r219538)
+++ stable/8/lib/libelf/elf_cntl.3	Fri Mar 11 22:07:28 2011	(r219539)
@@ -75,7 +75,7 @@ archive, an ELF file, or other data file
 .Sh IMPLEMENTATION NOTES
 Due to use of
 .Xr mmap 2
-internally, this function is a no-op for for ELF objects opened in
+internally, this function is a no-op for ELF objects opened in
 .Dv ELF_C_READ
 mode.
 .Sh RETURN VALUES

Modified: stable/8/usr.sbin/ntp/doc/ntp.conf.5
==============================================================================
--- stable/8/usr.sbin/ntp/doc/ntp.conf.5	Fri Mar 11 22:00:45 2011	(r219538)
+++ stable/8/usr.sbin/ntp/doc/ntp.conf.5	Fri Mar 11 22:07:28 2011	(r219539)
@@ -317,7 +317,7 @@ the
 option to a lower limit of 4 (16 s).
 .It Cm noselect
 Marks the server as unused, except for display purposes.
-The server is discarded by the selection algroithm.
+The server is discarded by the selection algorithm.
 .It Cm prefer
 Marks the server as preferred.
 All other things being equal,
@@ -1368,7 +1368,7 @@ The
 daemon implements a general purpose address/mask based restriction
 list.
 The list contains address/match entries sorted first
-by increasing address values and and then by increasing mask values.
+by increasing address values and then by increasing mask values.
 A match occurs when the bitwise AND of the mask and the packet
 source address is equal to the bitwise AND of the mask and
 address in the list.
@@ -1405,9 +1405,9 @@ at abusive rates.
 Some violations cause denied service
 only for the offending packet, others cause denied service
 for a timed period and others cause the denied service for
-an indefinate period.
+an indefinite period.
 When a client or network is denied access
-for an indefinate period, the only way at present to remove
+for an indefinite period, the only way at present to remove
 the restrictions is by restarting the server.
 .Ss The Kiss-of-Death Packet
 Ordinarily, packets denied service are simply dropped with no

Modified: stable/8/usr.sbin/ntp/doc/ntpq.8
==============================================================================
--- stable/8/usr.sbin/ntp/doc/ntpq.8	Fri Mar 11 22:00:45 2011	(r219538)
+++ stable/8/usr.sbin/ntp/doc/ntpq.8	Fri Mar 11 22:07:28 2011	(r219539)
@@ -269,7 +269,7 @@ Exit
 .It Ic raw
 Causes all output from query commands is printed as received
 from the remote server.
-The only formating/interpretation done on
+The only formatting/interpretation done on
 the data is to transform nonascii data into a printable (but barely
 understandable) form.
 .It Ic timeout Ar milliseconds

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:09:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB2F0106566B;
	Fri, 11 Mar 2011 22:09:13 +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 B71C48FC0A;
	Fri, 11 Mar 2011 22:09:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2BM9Dbl095309;
	Fri, 11 Mar 2011 22:09:13 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BM9Dri095262;
	Fri, 11 Mar 2011 22:09:13 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201103112209.p2BM9Dri095262@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Fri, 11 Mar 2011 22:09:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219540 - in stable/7: lib/libelf usr.sbin/ntp/doc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:09:13 -0000

Author: uqs
Date: Fri Mar 11 22:09:13 2011
New Revision: 219540
URL: http://svn.freebsd.org/changeset/base/219540

Log:
  MFH r206622,210933,219210: Typo fixes, prologue ordering.

Modified:
  stable/7/lib/libelf/elf.3
  stable/7/lib/libelf/elf_begin.3
  stable/7/lib/libelf/elf_cntl.3
  stable/7/lib/libelf/elf_end.3
  stable/7/lib/libelf/elf_errmsg.3
  stable/7/lib/libelf/elf_fill.3
  stable/7/lib/libelf/elf_flagdata.3
  stable/7/lib/libelf/elf_getarhdr.3
  stable/7/lib/libelf/elf_getarsym.3
  stable/7/lib/libelf/elf_getbase.3
  stable/7/lib/libelf/elf_getdata.3
  stable/7/lib/libelf/elf_getident.3
  stable/7/lib/libelf/elf_getphnum.3
  stable/7/lib/libelf/elf_getscn.3
  stable/7/lib/libelf/elf_getshnum.3
  stable/7/lib/libelf/elf_getshstrndx.3
  stable/7/lib/libelf/elf_hash.3
  stable/7/lib/libelf/elf_kind.3
  stable/7/lib/libelf/elf_memory.3
  stable/7/lib/libelf/elf_next.3
  stable/7/lib/libelf/elf_rand.3
  stable/7/lib/libelf/elf_rawfile.3
  stable/7/lib/libelf/elf_strptr.3
  stable/7/lib/libelf/elf_update.3
  stable/7/lib/libelf/elf_version.3
  stable/7/lib/libelf/gelf.3
  stable/7/lib/libelf/gelf_checksum.3
  stable/7/lib/libelf/gelf_fsize.3
  stable/7/lib/libelf/gelf_getcap.3
  stable/7/lib/libelf/gelf_getclass.3
  stable/7/lib/libelf/gelf_getdyn.3
  stable/7/lib/libelf/gelf_getehdr.3
  stable/7/lib/libelf/gelf_getmove.3
  stable/7/lib/libelf/gelf_getphdr.3
  stable/7/lib/libelf/gelf_getrel.3
  stable/7/lib/libelf/gelf_getrela.3
  stable/7/lib/libelf/gelf_getshdr.3
  stable/7/lib/libelf/gelf_getsym.3
  stable/7/lib/libelf/gelf_getsyminfo.3
  stable/7/lib/libelf/gelf_getsymshndx.3
  stable/7/lib/libelf/gelf_newehdr.3
  stable/7/lib/libelf/gelf_newphdr.3
  stable/7/lib/libelf/gelf_update_ehdr.3
  stable/7/lib/libelf/gelf_xlatetof.3
  stable/7/usr.sbin/ntp/doc/ntp.conf.5
  stable/7/usr.sbin/ntp/doc/ntpq.8
Directory Properties:
  stable/7/lib/libelf/   (props changed)
  stable/7/usr.sbin/ntp/   (props changed)

Modified: stable/7/lib/libelf/elf.3
==============================================================================
--- stable/7/lib/libelf/elf.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd December 11, 2006
-.Os
 .Dt ELF 3
+.Os
 .Sh NAME
 .Nm elf
 .Nd API for manipulating ELF objects

Modified: stable/7/lib/libelf/elf_begin.3
==============================================================================
--- stable/7/lib/libelf/elf_begin.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_begin.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 20, 2010
-.Os
 .Dt ELF_BEGIN 3
+.Os
 .Sh NAME
 .Nm elf_begin
 .Nd open an ELF file or ar(1) archive

Modified: stable/7/lib/libelf/elf_cntl.3
==============================================================================
--- stable/7/lib/libelf/elf_cntl.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_cntl.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 9, 2006
-.Os
 .Dt ELF_CNTL 3
+.Os
 .Sh NAME
 .Nm elf_cntl
 .Nd control an elf file descriptor
@@ -75,7 +75,7 @@ archive, an ELF file, or other data file
 .Sh IMPLEMENTATION NOTES
 Due to use of
 .Xr mmap 2
-internally, this function is a no-op for for ELF objects opened in
+internally, this function is a no-op for ELF objects opened in
 .Dv ELF_C_READ
 mode.
 .Sh RETURN VALUES

Modified: stable/7/lib/libelf/elf_end.3
==============================================================================
--- stable/7/lib/libelf/elf_end.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_end.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 29, 2006
-.Os
 .Dt ELF_END 3
+.Os
 .Sh NAME
 .Nm elf_end
 .Nd release an ELF descriptor

Modified: stable/7/lib/libelf/elf_errmsg.3
==============================================================================
--- stable/7/lib/libelf/elf_errmsg.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_errmsg.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 11, 2006
-.Os
 .Dt ELF_ERRMSG 3
+.Os
 .Sh NAME
 .Nm elf_errmsg ,
 .Nm elf_errno

Modified: stable/7/lib/libelf/elf_fill.3
==============================================================================
--- stable/7/lib/libelf/elf_fill.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_fill.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 11, 2006
-.Os
 .Dt ELF_FILL 3
+.Os
 .Sh NAME
 .Nm elf_fill
 .Nd set fill byte for inter-section padding

Modified: stable/7/lib/libelf/elf_flagdata.3
==============================================================================
--- stable/7/lib/libelf/elf_flagdata.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_flagdata.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 10, 2006
-.Os
 .Dt ELF_FLAGDATA 3
+.Os
 .Sh NAME
 .Nm elf_flagdata ,
 .Nm elf_flagehdr ,

Modified: stable/7/lib/libelf/elf_getarhdr.3
==============================================================================
--- stable/7/lib/libelf/elf_getarhdr.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getarhdr.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 15, 2006
-.Os
 .Dt ELF_GETARHDR 3
+.Os
 .Sh NAME
 .Nm elf_getarhdr
 .Nd retrieve ar(1) header for an archive member

Modified: stable/7/lib/libelf/elf_getarsym.3
==============================================================================
--- stable/7/lib/libelf/elf_getarsym.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getarsym.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 15, 2006
-.Os
 .Dt ELF_GETARSYM 3
+.Os
 .Sh NAME
 .Nm elf_getarsym
 .Nd retrieve the symbol table of an archive

Modified: stable/7/lib/libelf/elf_getbase.3
==============================================================================
--- stable/7/lib/libelf/elf_getbase.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getbase.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 6, 2010
-.Os
 .Dt ELF_GETBASE 3
+.Os
 .Sh NAME
 .Nm elf_getbase
 .Nd get the base offset for an object file

Modified: stable/7/lib/libelf/elf_getdata.3
==============================================================================
--- stable/7/lib/libelf/elf_getdata.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getdata.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd April 30, 2010
-.Os
 .Dt ELF_GETDATA 3
+.Os
 .Sh NAME
 .Nm elf_getdata ,
 .Nm elf_newdata ,

Modified: stable/7/lib/libelf/elf_getident.3
==============================================================================
--- stable/7/lib/libelf/elf_getident.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getident.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd July 3, 2006
-.Os
 .Dt ELF_GETIDENT 3
+.Os
 .Sh NAME
 .Nm elf_getident
 .Nd return the initial bytes of a file

Modified: stable/7/lib/libelf/elf_getphnum.3
==============================================================================
--- stable/7/lib/libelf/elf_getphnum.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getphnum.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 5, 2009
-.Os
 .Dt ELF_GETPHNUM 3
+.Os
 .Sh NAME
 .Nm elf_getphnum
 .Nd return the number of program headers in an ELF file

Modified: stable/7/lib/libelf/elf_getscn.3
==============================================================================
--- stable/7/lib/libelf/elf_getscn.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getscn.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 26, 2006
-.Os
 .Dt ELF_GETSCN 3
+.Os
 .Sh NAME
 .Nm elf_getscn ,
 .Nm elf_ndxscn ,

Modified: stable/7/lib/libelf/elf_getshnum.3
==============================================================================
--- stable/7/lib/libelf/elf_getshnum.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getshnum.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 5, 2009
-.Os
 .Dt ELF_GETSHNUM 3
+.Os
 .Sh NAME
 .Nm elf_getshnum
 .Nd return the number of sections in an ELF file

Modified: stable/7/lib/libelf/elf_getshstrndx.3
==============================================================================
--- stable/7/lib/libelf/elf_getshstrndx.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_getshstrndx.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 5, 2009
-.Os
 .Dt ELF_GETSHSTRNDX 3
+.Os
 .Sh NAME
 .Nm elf_getshstrndx ,
 .Nm elf_setshstrndx

Modified: stable/7/lib/libelf/elf_hash.3
==============================================================================
--- stable/7/lib/libelf/elf_hash.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_hash.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 15, 2006
-.Os
 .Dt ELF_HASH 3
+.Os
 .Sh NAME
 .Nm elf_hash
 .Nd compute a hash value for a string

Modified: stable/7/lib/libelf/elf_kind.3
==============================================================================
--- stable/7/lib/libelf/elf_kind.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_kind.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 1, 2006
-.Os
 .Dt ELF_KIND 3
+.Os
 .Sh NAME
 .Nm elf_kind
 .Nd determine ELF file type

Modified: stable/7/lib/libelf/elf_memory.3
==============================================================================
--- stable/7/lib/libelf/elf_memory.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_memory.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 28, 2006
-.Os
 .Dt ELF_MEMORY 3
+.Os
 .Sh NAME
 .Nm elf_memory
 .Nd process an ELF or ar(1) archive mapped into memory

Modified: stable/7/lib/libelf/elf_next.3
==============================================================================
--- stable/7/lib/libelf/elf_next.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_next.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 17, 2006
-.Os
 .Dt ELF_NEXT 3
+.Os
 .Sh NAME
 .Nm elf_next
 .Nd provide sequential access to the next archive member

Modified: stable/7/lib/libelf/elf_rand.3
==============================================================================
--- stable/7/lib/libelf/elf_rand.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_rand.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 17, 2006
-.Os
 .Dt ELF_RAND 3
+.Os
 .Sh NAME
 .Nm elf_rand
 .Nd provide sequential access to the next archive member

Modified: stable/7/lib/libelf/elf_rawfile.3
==============================================================================
--- stable/7/lib/libelf/elf_rawfile.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_rawfile.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd July 3, 2006
-.Os
 .Dt ELF_RAWFILE 3
+.Os
 .Sh NAME
 .Nm elf_rawfile
 .Nd return uninterpreted contents of an ELF file

Modified: stable/7/lib/libelf/elf_strptr.3
==============================================================================
--- stable/7/lib/libelf/elf_strptr.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_strptr.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd December 16, 2006
-.Os
 .Dt ELF_STRPTR 3
+.Os
 .Sh NAME
 .Nm elf_strptr
 .Nd retrieve a string pointer in a string table

Modified: stable/7/lib/libelf/elf_update.3
==============================================================================
--- stable/7/lib/libelf/elf_update.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_update.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd September 08, 2007
-.Os
 .Dt ELF_UPDATE 3
+.Os
 .Sh NAME
 .Nm elf_update
 .Nd update an ELF descriptor

Modified: stable/7/lib/libelf/elf_version.3
==============================================================================
--- stable/7/lib/libelf/elf_version.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/elf_version.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd June 1, 2006
-.Os
 .Dt ELF_VERSION 3
+.Os
 .Sh NAME
 .Nm elf_version
 .Nd retrieve or set ELF library operating version

Modified: stable/7/lib/libelf/gelf.3
==============================================================================
--- stable/7/lib/libelf/gelf.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd September 1, 2006
-.Os
 .Dt GELF 3
+.Os
 .Sh NAME
 .Nm GElf
 .Nd class-independent API for ELF manipulation

Modified: stable/7/lib/libelf/gelf_checksum.3
==============================================================================
--- stable/7/lib/libelf/gelf_checksum.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_checksum.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 29, 2006
-.Os
 .Dt GELF_CHECKSUM 3
+.Os
 .Sh NAME
 .Nm elf32_checksum ,
 .Nm elf64_checksum ,

Modified: stable/7/lib/libelf/gelf_fsize.3
==============================================================================
--- stable/7/lib/libelf/gelf_fsize.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_fsize.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd February 5, 2008
-.Os
 .Dt GELF_FSIZE 3
+.Os
 .Sh NAME
 .Nm gelf_fsize ,
 .Nm elf32_fsize ,

Modified: stable/7/lib/libelf/gelf_getcap.3
==============================================================================
--- stable/7/lib/libelf/gelf_getcap.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getcap.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 29, 2006
-.Os
 .Dt GELF_GETCAP 3
+.Os
 .Sh NAME
 .Nm gelf_getcap ,
 .Nm gelf_update_cap

Modified: stable/7/lib/libelf/gelf_getclass.3
==============================================================================
--- stable/7/lib/libelf/gelf_getclass.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getclass.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd July 3, 2006
-.Os
 .Dt GELF_GETCLASS 3
+.Os
 .Sh NAME
 .Nm gelf_getclass
 .Nd retrieve the class of an ELF descriptor

Modified: stable/7/lib/libelf/gelf_getdyn.3
==============================================================================
--- stable/7/lib/libelf/gelf_getdyn.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getdyn.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 29, 2006
-.Os
 .Dt GELF_GETDYN 3
+.Os
 .Sh NAME
 .Nm gelf_getdyn ,
 .Nm gelf_update_dyn

Modified: stable/7/lib/libelf/gelf_getehdr.3
==============================================================================
--- stable/7/lib/libelf/gelf_getehdr.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getehdr.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd December 16, 2006
-.Os
 .Dt GELF_GETEHDR 3
+.Os
 .Sh NAME
 .Nm elf32_getehdr ,
 .Nm elf64_getehdr ,

Modified: stable/7/lib/libelf/gelf_getmove.3
==============================================================================
--- stable/7/lib/libelf/gelf_getmove.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getmove.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 29, 2006
-.Os
 .Dt GELF_GETMOVE 3
+.Os
 .Sh NAME
 .Nm gelf_getmove ,
 .Nm gelf_update_move

Modified: stable/7/lib/libelf/gelf_getphdr.3
==============================================================================
--- stable/7/lib/libelf/gelf_getphdr.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getphdr.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd December 16, 2006
-.Os
 .Dt GELF_GETPHDR 3
+.Os
 .Sh NAME
 .Nm elf32_getphdr ,
 .Nm elf64_getphdr ,

Modified: stable/7/lib/libelf/gelf_getrel.3
==============================================================================
--- stable/7/lib/libelf/gelf_getrel.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getrel.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 29, 2006
-.Os
 .Dt GELF_GETREL 3
+.Os
 .Sh NAME
 .Nm gelf_getrel ,
 .Nm gelf_update_rel

Modified: stable/7/lib/libelf/gelf_getrela.3
==============================================================================
--- stable/7/lib/libelf/gelf_getrela.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getrela.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 29, 2006
-.Os
 .Dt GELF_GETRELA 3
+.Os
 .Sh NAME
 .Nm gelf_getrela ,
 .Nm gelf_update_rela

Modified: stable/7/lib/libelf/gelf_getshdr.3
==============================================================================
--- stable/7/lib/libelf/gelf_getshdr.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getshdr.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 27, 2006
-.Os
 .Dt GELF_GETSHDR 3
+.Os
 .Sh NAME
 .Nm elf32_getshdr ,
 .Nm elf64_getshdr ,

Modified: stable/7/lib/libelf/gelf_getsym.3
==============================================================================
--- stable/7/lib/libelf/gelf_getsym.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getsym.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 29, 2006
-.Os
 .Dt GELF_GETSYM 3
+.Os
 .Sh NAME
 .Nm gelf_getsym ,
 .Nm gelf_update_sym

Modified: stable/7/lib/libelf/gelf_getsyminfo.3
==============================================================================
--- stable/7/lib/libelf/gelf_getsyminfo.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getsyminfo.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 29, 2006
-.Os
 .Dt GELF_GETSYMINFO 3
+.Os
 .Sh NAME
 .Nm gelf_getsyminfo ,
 .Nm gelf_update_syminfo

Modified: stable/7/lib/libelf/gelf_getsymshndx.3
==============================================================================
--- stable/7/lib/libelf/gelf_getsymshndx.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_getsymshndx.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd November 5, 2006
-.Os
 .Dt GELF_GETSYMSHNDX 3
+.Os
 .Sh NAME
 .Nm gelf_getsymshndx ,
 .Nm gelf_update_symshndx

Modified: stable/7/lib/libelf/gelf_newehdr.3
==============================================================================
--- stable/7/lib/libelf/gelf_newehdr.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_newehdr.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd December 16, 2006
-.Os
 .Dt GELF_NEWEHDR 3
+.Os
 .Sh NAME
 .Nm elf32_newehdr ,
 .Nm elf64_newehdr ,

Modified: stable/7/lib/libelf/gelf_newphdr.3
==============================================================================
--- stable/7/lib/libelf/gelf_newphdr.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_newphdr.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 25, 2006
-.Os
 .Dt GELF_NEWPHDR 3
+.Os
 .Sh NAME
 .Nm elf32_newphdr ,
 .Nm elf64_newphdr ,

Modified: stable/7/lib/libelf/gelf_update_ehdr.3
==============================================================================
--- stable/7/lib/libelf/gelf_update_ehdr.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_update_ehdr.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd August 27, 2006
-.Os
 .Dt GELF_UPDATE_EHDR 3
+.Os
 .Sh NAME
 .Nm gelf_update_ehdr ,
 .Nm gelf_update_phdr ,

Modified: stable/7/lib/libelf/gelf_xlatetof.3
==============================================================================
--- stable/7/lib/libelf/gelf_xlatetof.3	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/lib/libelf/gelf_xlatetof.3	Fri Mar 11 22:09:13 2011	(r219540)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd July 24, 2006
-.Os
 .Dt GELF_XLATETOF 3
+.Os
 .Sh NAME
 .Nm elf32_xlate ,
 .Nm elf64_xlate ,

Modified: stable/7/usr.sbin/ntp/doc/ntp.conf.5
==============================================================================
--- stable/7/usr.sbin/ntp/doc/ntp.conf.5	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/usr.sbin/ntp/doc/ntp.conf.5	Fri Mar 11 22:09:13 2011	(r219540)
@@ -317,7 +317,7 @@ the
 option to a lower limit of 4 (16 s).
 .It Cm noselect
 Marks the server as unused, except for display purposes.
-The server is discarded by the selection algroithm.
+The server is discarded by the selection algorithm.
 .It Cm prefer
 Marks the server as preferred.
 All other things being equal,
@@ -1368,7 +1368,7 @@ The
 daemon implements a general purpose address/mask based restriction
 list.
 The list contains address/match entries sorted first
-by increasing address values and and then by increasing mask values.
+by increasing address values and then by increasing mask values.
 A match occurs when the bitwise AND of the mask and the packet
 source address is equal to the bitwise AND of the mask and
 address in the list.
@@ -1405,9 +1405,9 @@ at abusive rates.
 Some violations cause denied service
 only for the offending packet, others cause denied service
 for a timed period and others cause the denied service for
-an indefinate period.
+an indefinite period.
 When a client or network is denied access
-for an indefinate period, the only way at present to remove
+for an indefinite period, the only way at present to remove
 the restrictions is by restarting the server.
 .Ss The Kiss-of-Death Packet
 Ordinarily, packets denied service are simply dropped with no

Modified: stable/7/usr.sbin/ntp/doc/ntpq.8
==============================================================================
--- stable/7/usr.sbin/ntp/doc/ntpq.8	Fri Mar 11 22:07:28 2011	(r219539)
+++ stable/7/usr.sbin/ntp/doc/ntpq.8	Fri Mar 11 22:09:13 2011	(r219540)
@@ -269,7 +269,7 @@ Exit
 .It Ic raw
 Causes all output from query commands is printed as received
 from the remote server.
-The only formating/interpretation done on
+The only formatting/interpretation done on
 the data is to transform nonascii data into a printable (but barely
 understandable) form.
 .It Ic timeout Ar milliseconds

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:19:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D679106564A;
	Fri, 11 Mar 2011 22:19:49 +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 6BD7E8FC08;
	Fri, 11 Mar 2011 22:19: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 p2BMJna5095636;
	Fri, 11 Mar 2011 22:19:49 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BMJnBn095633;
	Fri, 11 Mar 2011 22:19:49 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112219.p2BMJnBn095633@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 22:19: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: r219543 - head/sys/dev/firewire
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:19:49 -0000

Author: marius
Date: Fri Mar 11 22:19:49 2011
New Revision: 219543
URL: http://svn.freebsd.org/changeset/base/219543

Log:
  Allocate the DMA memory shared between the host and the controller as
  coherent.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/firewire/fwohci.c
  head/sys/dev/firewire/sbp.c

Modified: head/sys/dev/firewire/fwohci.c
==============================================================================
--- head/sys/dev/firewire/fwohci.c	Fri Mar 11 22:16:05 2011	(r219542)
+++ head/sys/dev/firewire/fwohci.c	Fri Mar 11 22:19:49 2011	(r219543)
@@ -686,7 +686,7 @@ fwohci_init(struct fwohci_softc *sc, dev
 	sc->fc.dev = dev;
 
 	sc->fc.config_rom = fwdma_malloc(&sc->fc, CROMSIZE, CROMSIZE,
-						&sc->crom_dma, BUS_DMA_WAITOK);
+	    &sc->crom_dma, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
 	if(sc->fc.config_rom == NULL){
 		device_printf(dev, "config_rom alloc failed.");
 		return ENOMEM;
@@ -708,7 +708,7 @@ fwohci_init(struct fwohci_softc *sc, dev
 /* SID recieve buffer must align 2^11 */
 #define	OHCI_SIDSIZE	(1 << 11)
 	sc->sid_buf = fwdma_malloc(&sc->fc, OHCI_SIDSIZE, OHCI_SIDSIZE,
-						&sc->sid_dma, BUS_DMA_WAITOK);
+	    &sc->sid_dma, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
 	if (sc->sid_buf == NULL) {
 		device_printf(dev, "sid_buf alloc failed.");
 		return ENOMEM;

Modified: head/sys/dev/firewire/sbp.c
==============================================================================
--- head/sys/dev/firewire/sbp.c	Fri Mar 11 22:16:05 2011	(r219542)
+++ head/sys/dev/firewire/sbp.c	Fri Mar 11 22:19:49 2011	(r219543)
@@ -562,7 +562,8 @@ END_DEBUG
 
 		fwdma_malloc(sbp->fd.fc, 
 			/* alignment */ sizeof(uint32_t),
-			SBP_DMA_SIZE, &sdev->dma, BUS_DMA_NOWAIT);
+			SBP_DMA_SIZE, &sdev->dma, BUS_DMA_NOWAIT |
+			BUS_DMA_COHERENT);
 		if (sdev->dma.v_addr == NULL) {
 			printf("%s: dma space allocation failed\n",
 							__func__);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:21:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20870106566B;
	Fri, 11 Mar 2011 22:21:13 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E9B678FC0C;
	Fri, 11 Mar 2011 22:21: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 p2BMLC4e095704;
	Fri, 11 Mar 2011 22:21:12 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BMLCG3095702;
	Fri, 11 Mar 2011 22:21:12 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112221.p2BMLCG3095702@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 22:21: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: r219544 - head/sys/dev/sk
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:21:13 -0000

Author: marius
Date: Fri Mar 11 22:21:12 2011
New Revision: 219544
URL: http://svn.freebsd.org/changeset/base/219544

Log:
  Allocate the DMA memory shared between the host and the controller as
  coherent.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/sk/if_sk.c

Modified: head/sys/dev/sk/if_sk.c
==============================================================================
--- head/sys/dev/sk/if_sk.c	Fri Mar 11 22:19:49 2011	(r219543)
+++ head/sys/dev/sk/if_sk.c	Fri Mar 11 22:21:12 2011	(r219544)
@@ -2036,8 +2036,8 @@ sk_dma_alloc(sc_if)
 
 	/* allocate DMA'able memory and load the DMA map for Tx ring */
 	error = bus_dmamem_alloc(sc_if->sk_cdata.sk_tx_ring_tag,
-	    (void **)&sc_if->sk_rdata.sk_tx_ring, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
-	    &sc_if->sk_cdata.sk_tx_ring_map);
+	    (void **)&sc_if->sk_rdata.sk_tx_ring, BUS_DMA_NOWAIT |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc_if->sk_cdata.sk_tx_ring_map);
 	if (error != 0) {
 		device_printf(sc_if->sk_if_dev,
 		    "failed to allocate DMA'able memory for Tx ring\n");
@@ -2057,8 +2057,8 @@ sk_dma_alloc(sc_if)
 
 	/* allocate DMA'able memory and load the DMA map for Rx ring */
 	error = bus_dmamem_alloc(sc_if->sk_cdata.sk_rx_ring_tag,
-	    (void **)&sc_if->sk_rdata.sk_rx_ring, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
-	    &sc_if->sk_cdata.sk_rx_ring_map);
+	    (void **)&sc_if->sk_rdata.sk_rx_ring, BUS_DMA_NOWAIT |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc_if->sk_cdata.sk_rx_ring_map);
 	if (error != 0) {
 		device_printf(sc_if->sk_if_dev,
 		    "failed to allocate DMA'able memory for Rx ring\n");
@@ -2165,8 +2165,9 @@ sk_dma_jumbo_alloc(sc_if)
 
 	/* allocate DMA'able memory and load the DMA map for jumbo Rx ring */
 	error = bus_dmamem_alloc(sc_if->sk_cdata.sk_jumbo_rx_ring_tag,
-	    (void **)&sc_if->sk_rdata.sk_jumbo_rx_ring,
-	    BUS_DMA_NOWAIT|BUS_DMA_ZERO, &sc_if->sk_cdata.sk_jumbo_rx_ring_map);
+	    (void **)&sc_if->sk_rdata.sk_jumbo_rx_ring, BUS_DMA_NOWAIT |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO,
+	    &sc_if->sk_cdata.sk_jumbo_rx_ring_map);
 	if (error != 0) {
 		device_printf(sc_if->sk_if_dev,
 		    "failed to allocate DMA'able memory for jumbo Rx ring\n");

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:23:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04404106566B;
	Fri, 11 Mar 2011 22:23:47 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E6E738FC0A;
	Fri, 11 Mar 2011 22: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 p2BMNkBo095795;
	Fri, 11 Mar 2011 22:23:46 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BMNkST095793;
	Fri, 11 Mar 2011 22:23:46 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112223.p2BMNkST095793@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 22: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: r219545 - head/sys/dev/stge
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:23:47 -0000

Author: marius
Date: Fri Mar 11 22:23:46 2011
New Revision: 219545
URL: http://svn.freebsd.org/changeset/base/219545

Log:
  Allocate the DMA memory shared between the host and the controller as
  coherent.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/stge/if_stge.c

Modified: head/sys/dev/stge/if_stge.c
==============================================================================
--- head/sys/dev/stge/if_stge.c	Fri Mar 11 22:21:12 2011	(r219544)
+++ head/sys/dev/stge/if_stge.c	Fri Mar 11 22:23:46 2011	(r219545)
@@ -960,8 +960,8 @@ stge_dma_alloc(struct stge_softc *sc)
 
 	/* allocate DMA'able memory and load the DMA map for Tx ring. */
 	error = bus_dmamem_alloc(sc->sc_cdata.stge_tx_ring_tag,
-	    (void **)&sc->sc_rdata.stge_tx_ring, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
-	    &sc->sc_cdata.stge_tx_ring_map);
+	    (void **)&sc->sc_rdata.stge_tx_ring, BUS_DMA_NOWAIT |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->sc_cdata.stge_tx_ring_map);
 	if (error != 0) {
 		device_printf(sc->sc_dev,
 		    "failed to allocate DMA'able memory for Tx ring\n");
@@ -981,8 +981,8 @@ stge_dma_alloc(struct stge_softc *sc)
 
 	/* allocate DMA'able memory and load the DMA map for Rx ring. */
 	error = bus_dmamem_alloc(sc->sc_cdata.stge_rx_ring_tag,
-	    (void **)&sc->sc_rdata.stge_rx_ring, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
-	    &sc->sc_cdata.stge_rx_ring_map);
+	    (void **)&sc->sc_rdata.stge_rx_ring, BUS_DMA_NOWAIT |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->sc_cdata.stge_rx_ring_map);
 	if (error != 0) {
 		device_printf(sc->sc_dev,
 		    "failed to allocate DMA'able memory for Rx ring\n");

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:25:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 373B71065672;
	Fri, 11 Mar 2011 22:25:35 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 25BAB8FC18;
	Fri, 11 Mar 2011 22:25: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 p2BMPZF5095869;
	Fri, 11 Mar 2011 22:25:35 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BMPZdE095867;
	Fri, 11 Mar 2011 22:25:35 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112225.p2BMPZdE095867@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 22:25: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: r219546 - head/sys/dev/xl
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:25:35 -0000

Author: marius
Date: Fri Mar 11 22:25:34 2011
New Revision: 219546
URL: http://svn.freebsd.org/changeset/base/219546

Log:
  Allocate the DMA memory shared between the host and the controller as
  coherent.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/xl/if_xl.c

Modified: head/sys/dev/xl/if_xl.c
==============================================================================
--- head/sys/dev/xl/if_xl.c	Fri Mar 11 22:23:46 2011	(r219545)
+++ head/sys/dev/xl/if_xl.c	Fri Mar 11 22:25:34 2011	(r219546)
@@ -1317,8 +1317,8 @@ xl_attach(device_t dev)
 	}
 
 	error = bus_dmamem_alloc(sc->xl_ldata.xl_rx_tag,
-	    (void **)&sc->xl_ldata.xl_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
-	    &sc->xl_ldata.xl_rx_dmamap);
+	    (void **)&sc->xl_ldata.xl_rx_list, BUS_DMA_NOWAIT |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->xl_ldata.xl_rx_dmamap);
 	if (error) {
 		device_printf(dev, "no memory for rx list buffers!\n");
 		bus_dma_tag_destroy(sc->xl_ldata.xl_rx_tag);
@@ -1349,8 +1349,8 @@ xl_attach(device_t dev)
 	}
 
 	error = bus_dmamem_alloc(sc->xl_ldata.xl_tx_tag,
-	    (void **)&sc->xl_ldata.xl_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
-	    &sc->xl_ldata.xl_tx_dmamap);
+	    (void **)&sc->xl_ldata.xl_tx_list, BUS_DMA_NOWAIT |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->xl_ldata.xl_tx_dmamap);
 	if (error) {
 		device_printf(dev, "no memory for list buffers!\n");
 		bus_dma_tag_destroy(sc->xl_ldata.xl_tx_tag);

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:32:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 303E61065670;
	Fri, 11 Mar 2011 22:32:18 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0581D8FC24;
	Fri, 11 Mar 2011 22:32: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 p2BMWHWw096038;
	Fri, 11 Mar 2011 22:32:17 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BMWHOi096035;
	Fri, 11 Mar 2011 22:32:17 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112232.p2BMWHOi096035@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 22:32: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: r219547 - head/sys/dev/ti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:32:18 -0000

Author: marius
Date: Fri Mar 11 22:32:17 2011
New Revision: 219547
URL: http://svn.freebsd.org/changeset/base/219547

Log:
  - Allocate the DMA memory shared between the host and the controller as
    coherent.
  - Constify the ti_devs table.
  - Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/ti/if_ti.c
  head/sys/dev/ti/if_tireg.h

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Fri Mar 11 22:25:34 2011	(r219546)
+++ head/sys/dev/ti/if_ti.c	Fri Mar 11 22:32:17 2011	(r219547)
@@ -145,7 +145,7 @@ typedef enum {
  * Various supported device vendors/types and their names.
  */
 
-static struct ti_type ti_devs[] = {
+static const struct ti_type const ti_devs[] = {
 	{ ALT_VENDORID,	ALT_DEVICEID_ACENIC,
 		"Alteon AceNIC 1000baseSX Gigabit Ethernet" },
 	{ ALT_VENDORID,	ALT_DEVICEID_ACENIC_COPPER,
@@ -1118,7 +1118,8 @@ ti_alloc_jumbo_mem(sc)
 
 	if (bus_dmamem_alloc(sc->ti_jumbo_dmat,
 			     (void**)&sc->ti_cdata.ti_jumbo_buf,
-			     BUS_DMA_NOWAIT, &sc->ti_jumbo_dmamap) != 0) {
+			     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+			     &sc->ti_jumbo_dmamap) != 0) {
 		device_printf(sc->ti_dev, "Failed to allocate jumbo memory\n");
 		return (ENOBUFS);
 	}
@@ -2252,7 +2253,7 @@ static int
 ti_probe(dev)
 	device_t		dev;
 {
-	struct ti_type		*t;
+	const struct ti_type	*t;
 
 	t = ti_devs;
 
@@ -2389,7 +2390,8 @@ ti_attach(dev)
 	}
 
 	if (bus_dmamem_alloc(sc->ti_rdata_dmat, (void**)&sc->ti_rdata,
-			     BUS_DMA_NOWAIT, &sc->ti_rdata_dmamap) != 0) {
+			     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+			     &sc->ti_rdata_dmamap) != 0) {
 		device_printf(dev, "Failed to allocate rdata memory\n");
 		error = ENOMEM;
 		goto fail;
@@ -2487,7 +2489,6 @@ ti_attach(dev)
 	ifp->if_start = ti_start;
 	ifp->if_init = ti_init;
 	ifp->if_baudrate = 1000000000;
-	ifp->if_mtu = ETHERMTU;
 	ifp->if_snd.ifq_maxlen = TI_TX_RING_CNT - 1;
 
 	/* Set up ifmedia support. */

Modified: head/sys/dev/ti/if_tireg.h
==============================================================================
--- head/sys/dev/ti/if_tireg.h	Fri Mar 11 22:25:34 2011	(r219546)
+++ head/sys/dev/ti/if_tireg.h	Fri Mar 11 22:32:17 2011	(r219547)
@@ -967,7 +967,7 @@ struct ti_chain_data {
 struct ti_type {
 	u_int16_t		ti_vid;
 	u_int16_t		ti_did;
-	char			*ti_name;
+	const char		*ti_name;
 };
 
 #define TI_HWREV_TIGON		0x01

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:42:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7DC7C1065670;
	Fri, 11 Mar 2011 22:42:04 +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 6C7748FC13;
	Fri, 11 Mar 2011 22:42: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 p2BMg4cB096463;
	Fri, 11 Mar 2011 22:42:04 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BMg4pk096461;
	Fri, 11 Mar 2011 22:42:04 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103112242.p2BMg4pk096461@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 11 Mar 2011 22:42: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: r219548 - head/sys/dev/sound/pcm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:42:04 -0000

Author: marius
Date: Fri Mar 11 22:42:04 2011
New Revision: 219548
URL: http://svn.freebsd.org/changeset/base/219548

Log:
  Allocate the sound buffer DMA memory coherent. While NetBSD typically
  also does this for sound drivers it's probably not necessary for all
  combinations of controllers and drivers. However, given that our sound
  drivers completely lack bus_dmamap_sync(9) calls this at least serves
  as a workaround when enabling use of the IOMMU streaming buffers on
  sparc64 and generally for arm and mips.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/sound/pcm/buffer.c

Modified: head/sys/dev/sound/pcm/buffer.c
==============================================================================
--- head/sys/dev/sound/pcm/buffer.c	Fri Mar 11 22:32:17 2011	(r219547)
+++ head/sys/dev/sound/pcm/buffer.c	Fri Mar 11 22:42:04 2011	(r219548)
@@ -93,7 +93,7 @@ sndbuf_alloc(struct snd_dbuf *b, bus_dma
 	int ret;
 
 	b->dmatag = dmatag;
-	b->dmaflags = dmaflags | BUS_DMA_NOWAIT;
+	b->dmaflags = dmaflags | BUS_DMA_NOWAIT | BUS_DMA_COHERENT;
 	b->maxsize = size;
 	b->bufsize = b->maxsize;
 	b->buf_addr = 0;

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 22:54:00 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EA6F106566B;
	Fri, 11 Mar 2011 22:54:00 +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 645C48FC17;
	Fri, 11 Mar 2011 22:53:58 +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 AAA17865;
	Sat, 12 Mar 2011 00:53:55 +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 1PyBDX-000JqL-1p; Sat, 12 Mar 2011 00:53:55 +0200
Message-ID: <4D7AA801.5050503@freebsd.org>
Date: Sat, 12 Mar 2011 00:53:53 +0200
From: Andriy Gapon 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
To: Kostik Belousov 
References: <201103111927.p2BJRVu3091029@svn.freebsd.org>
	<20110311195046.GQ78089@deviant.kiev.zoral.com.ua>
In-Reply-To: <20110311195046.GQ78089@deviant.kiev.zoral.com.ua>
X-Enigmail-Version: 1.1.2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219526 -
	stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 22:54:00 -0000

on 11/03/2011 21:50 Kostik Belousov said the following:
> On Fri, Mar 11, 2011 at 07:27:31PM +0000, Andriy Gapon wrote:
>> Author: avg
>> Date: Fri Mar 11 19:27:31 2011
>> New Revision: 219526
>> URL: http://svn.freebsd.org/changeset/base/219526
>>
>> Log:
>>   use even larger stack size for ZFS txg_sync_thread
>>   
>>   While the stack size was larger than the default stack size on i386, it
>>   was smaller than the default stack size on amd64 and apparently that
>>   wasn't enough.  So, bump the size to 4 pages.  Upcoming ZFSv28 code uses
>>   8 pages for this stack size.
>>   
>>   This is a direct commit to stable/8.
>>   
>>   PR:		kern/154681
>>   Discussed with:	pjd
>>
>> Modified:
>>   stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
>>
>> Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
>> ==============================================================================
>> --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Mar 11 19:21:42 2011	(r219525)
>> +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Mar 11 19:27:31 2011	(r219526)
>> @@ -146,7 +146,7 @@ txg_sync_start(dsl_pool_t *dp)
>>  	 * 32-bit x86.  This is due in part to nested pools and
>>  	 * scrub_visitbp() recursion.
>>  	 */
>> -	tx->tx_sync_thread = thread_create(NULL, 12<<10, txg_sync_thread,
>> +	tx->tx_sync_thread = thread_create(NULL, 16<<10, txg_sync_thread,
>>  	    dp, 0, &p0, TS_RUN, minclsyspri);
>>  
>>  	mutex_exit(&tx->tx_sync_lock);
> What about architectures where PAGE_SIZE != 4096 ?
> We have ptoa() macro.

I agree, but this is not the moment when the style that you comment on was
introduced.  So, it's better to review (and fix) the code in head.

-- 
Andriy Gapon

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 23:12:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD35D1065673;
	Fri, 11 Mar 2011 23:12:20 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A126E8FC08;
	Fri, 11 Mar 2011 23:12: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 p2BNCKdA097246;
	Fri, 11 Mar 2011 23:12:20 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BNCKe3097245;
	Fri, 11 Mar 2011 23:12:20 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103112312.p2BNCKe3097245@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 11 Mar 2011 23:12:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219549 - in stable/8/share/examples: . etc kld/syscall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 23:12:20 -0000

Author: dougb
Date: Fri Mar 11 23:12:20 2011
New Revision: 219549
URL: http://svn.freebsd.org/changeset/base/219549

Log:
  Pull up mergeinfo from r209199,210482,212138,217826

Modified:
Directory Properties:
  stable/8/share/examples/   (props changed)
  stable/8/share/examples/etc/   (props changed)
  stable/8/share/examples/kld/syscall/   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 23:13:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EEF62106566C;
	Fri, 11 Mar 2011 23:13:22 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DCD388FC0A;
	Fri, 11 Mar 2011 23:13: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 p2BNDM7w097320;
	Fri, 11 Mar 2011 23:13:22 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BNDMoR097317;
	Fri, 11 Mar 2011 23:13:22 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103112313.p2BNDMoR097317@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 11 Mar 2011 23:13:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219550 - stable/8/share/examples/cvsup
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 23:13:23 -0000

Author: dougb
Date: Fri Mar 11 23:13:22 2011
New Revision: 219550
URL: http://svn.freebsd.org/changeset/base/219550

Log:
  MFC r219353:
  
  mbone is no longer a physical category
  
  Submitted by:	pav

Modified:
  stable/8/share/examples/cvsup/cvs-supfile
  stable/8/share/examples/cvsup/ports-supfile
Directory Properties:
  stable/8/share/examples/   (props changed)

Modified: stable/8/share/examples/cvsup/cvs-supfile
==============================================================================
--- stable/8/share/examples/cvsup/cvs-supfile	Fri Mar 11 23:12:20 2011	(r219549)
+++ stable/8/share/examples/cvsup/cvs-supfile	Fri Mar 11 23:13:22 2011	(r219550)
@@ -140,7 +140,6 @@ ports-all
 #ports-lang
 #ports-mail
 #ports-math
-#ports-mbone
 #ports-misc
 #ports-multimedia
 #ports-net

Modified: stable/8/share/examples/cvsup/ports-supfile
==============================================================================
--- stable/8/share/examples/cvsup/ports-supfile	Fri Mar 11 23:12:20 2011	(r219549)
+++ stable/8/share/examples/cvsup/ports-supfile	Fri Mar 11 23:13:22 2011	(r219550)
@@ -104,7 +104,6 @@ ports-all
 #ports-lang
 #ports-mail
 #ports-math
-#ports-mbone
 #ports-misc
 #ports-multimedia
 #ports-net

From owner-svn-src-all@FreeBSD.ORG  Fri Mar 11 23:16:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5CA21065673;
	Fri, 11 Mar 2011 23:16:04 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A360C8FC0C;
	Fri, 11 Mar 2011 23:16: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 p2BNG4mY097458;
	Fri, 11 Mar 2011 23:16:04 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BNG4YM097455;
	Fri, 11 Mar 2011 23:16:04 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103112316.p2BNG4YM097455@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 11 Mar 2011 23:16:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219551 - stable/7/share/examples/cvsup
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 11 Mar 2011 23:16:04 -0000

Author: dougb
Date: Fri Mar 11 23:16:04 2011
New Revision: 219551
URL: http://svn.freebsd.org/changeset/base/219551

Log:
  MFC r219353:
  
  mbone is no longer a physical category
  
  Submitted by:	pav

Modified:
  stable/7/share/examples/cvsup/cvs-supfile
  stable/7/share/examples/cvsup/ports-supfile
Directory Properties:
  stable/7/share/examples/   (props changed)

Modified: stable/7/share/examples/cvsup/cvs-supfile
==============================================================================
--- stable/7/share/examples/cvsup/cvs-supfile	Fri Mar 11 23:13:22 2011	(r219550)
+++ stable/7/share/examples/cvsup/cvs-supfile	Fri Mar 11 23:16:04 2011	(r219551)
@@ -140,7 +140,6 @@ ports-all
 #ports-lang
 #ports-mail
 #ports-math
-#ports-mbone
 #ports-misc
 #ports-multimedia
 #ports-net

Modified: stable/7/share/examples/cvsup/ports-supfile
==============================================================================
--- stable/7/share/examples/cvsup/ports-supfile	Fri Mar 11 23:13:22 2011	(r219550)
+++ stable/7/share/examples/cvsup/ports-supfile	Fri Mar 11 23:16:04 2011	(r219551)
@@ -104,7 +104,6 @@ ports-all
 #ports-lang
 #ports-mail
 #ports-math
-#ports-mbone
 #ports-misc
 #ports-multimedia
 #ports-net

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 07:03:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17EFC106566B;
	Sat, 12 Mar 2011 07:03:07 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 04F478FC0C;
	Sat, 12 Mar 2011 07:03: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 p2C737sO007982;
	Sat, 12 Mar 2011 07:03:07 GMT (envelope-from das@svn.freebsd.org)
Received: (from das@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2C736xI007977;
	Sat, 12 Mar 2011 07:03:06 GMT (envelope-from das@svn.freebsd.org)
Message-Id: <201103120703.p2C736xI007977@svn.freebsd.org>
From: David Schultz 
Date: Sat, 12 Mar 2011 07:03: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: r219557 - head/contrib/gdtoa
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 07:03:07 -0000

Author: das
Date: Sat Mar 12 07:03:06 2011
New Revision: 219557
URL: http://svn.freebsd.org/changeset/base/219557

Log:
  Merge gdtoa-20110304.

Added:
  head/contrib/gdtoa/changes
     - copied unchanged from r219423, vendor/gdtoa/dist/changes
  head/contrib/gdtoa/printf.c
     - copied unchanged from r219423, vendor/gdtoa/dist/printf.c
  head/contrib/gdtoa/printf.c0
     - copied unchanged from r219423, vendor/gdtoa/dist/printf.c0
  head/contrib/gdtoa/stdio1.h
     - copied unchanged from r219423, vendor/gdtoa/dist/stdio1.h
Modified:
  head/contrib/gdtoa/README
  head/contrib/gdtoa/dtoa.c
  head/contrib/gdtoa/g__fmt.c
  head/contrib/gdtoa/g_ddfmt.c
  head/contrib/gdtoa/g_dfmt.c
  head/contrib/gdtoa/gdtoa.c
  head/contrib/gdtoa/gdtoa.h
  head/contrib/gdtoa/gdtoaimp.h
  head/contrib/gdtoa/gethex.c
  head/contrib/gdtoa/hexnan.c
  head/contrib/gdtoa/makefile
  head/contrib/gdtoa/misc.c
  head/contrib/gdtoa/smisc.c
  head/contrib/gdtoa/strtoIg.c
  head/contrib/gdtoa/strtod.c
  head/contrib/gdtoa/strtodI.c
  head/contrib/gdtoa/strtodg.c
  head/contrib/gdtoa/strtof.c
  head/contrib/gdtoa/strtopdd.c
  head/contrib/gdtoa/strtopf.c
  head/contrib/gdtoa/strtopx.c
  head/contrib/gdtoa/strtopxL.c
  head/contrib/gdtoa/strtordd.c
  head/contrib/gdtoa/strtorf.c
  head/contrib/gdtoa/strtorx.c
  head/contrib/gdtoa/strtorxL.c
  head/contrib/gdtoa/ulp.c
Directory Properties:
  head/contrib/gdtoa/   (props changed)

Modified: head/contrib/gdtoa/README
==============================================================================
--- head/contrib/gdtoa/README	Sat Mar 12 06:35:53 2011	(r219556)
+++ head/contrib/gdtoa/README	Sat Mar 12 07:03:06 2011	(r219557)
@@ -353,5 +353,12 @@ you also compile with -DNO_LOCALE_CACHE,
 current "decimal point" character string are cached and assumed not
 to change during the program's execution.
 
+On machines with a 64-bit long double and perhaps a 113-bit "quad"
+type, you can invoke "make Printf" to add Printf (and variants, such
+as Fprintf) to gdtoa.a.  These are analogs, declared in stdio1.h, of
+printf and fprintf, etc. in which %La, %Le, %Lf, and %Lg are for long
+double and (if appropriate) %Lqa, %Lqe, %Lqf, and %Lqg are for quad
+precision printing.
+
 Please send comments to	David M. Gay (dmg at acm dot org, with " at "
 changed at "@" and " dot " changed to ".").

Copied: head/contrib/gdtoa/changes (from r219423, vendor/gdtoa/dist/changes)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/gdtoa/changes	Sat Mar 12 07:03:06 2011	(r219557, copy of r219423, vendor/gdtoa/dist/changes)
@@ -0,0 +1,672 @@
+Sun Jun 30 13:48:26 EDT 1991:
+  dtoa.c: adjust dtoa to allow negative ndigits for modes 3,5,7,9
+(fixed-point mode); fix rounding bug in these modes when the input
+d (to be converted) satisfies 10^-(ndigits+1) <= |d| < 10^-ndigits ,
+i.e., when the result, before rounding, would be empty but might
+round to one digit.  Adjust the decpt returned in these modes when
+the result is empty (i.e., when |d| <= 5 * 10^-ndigits).
+
+Tue Jul  2 21:44:00 EDT 1991
+  Correct an inefficiency introduced 2 days ago in dtoa's handling of
+integers in modes 0, 1.
+
+Mon Sep  9 23:29:38 EDT 1991
+  dtoa.c: remove superfluous declaration of size_t.
+
+Sun Oct  6 15:34:15 EDT 1991
+  dtoa.c: fix another bug in modes 3,5,7,9 when the result, before
+rounding, would be empty, but rounds to one digit: *decpt was low by
+one.
+
+Sat Jan 18 12:30:04 EST 1992
+  dtoa.c: add some #ifdef KR_headers lines relevant only if IBM is
+defined; for input decimal strings representing numbers too large, have
+strtod return HUGE_VAL only if __STDC__ is defined; otherwise have it
+return +-Infinity for IEEE arithmetic, +- the largest machine number
+for IBM and VAX arithmetic.  (If __STDC__ is not defined, HUGE_VAL may
+not be defined either, or it may be wrong.)
+
+Mon Apr 27 23:13:43 EDT 1992
+  dtoa.c: tweak strtod (one-line addition) so the end-pointer = start
+pointer when the input has, e.g., only white space.
+
+Thu May  7 18:04:46 EDT 1992
+  dtoa.c: adjust treatment of exponent field (in strtod) to behave
+reasonably with huge numbers and 16-bit ints.
+
+Fri Jun 19 08:29:02 EDT 1992
+  dtoa.c: fix a botch in placement of #ifdef __cplusplus (which only
+matters if you're using a C++ compiler).
+
+Wed Oct 21 11:23:07 EDT 1992
+  dtoa.c: add #ifdef Bad_float_h lines for systems with missing or
+inferior float.h .
+
+Thu Apr 22 07:54:48 EDT 1993
+  dtoa.c: change < to <= in line 2059:
+<	for(result_k = 0; sizeof(Bigint) - sizeof(unsigned long) + j < i;
+---
+>	for(result_k = 0; sizeof(Bigint) - sizeof(unsigned long) + j <= i;
+With 32-bit ints, the former could give too small a block for the return
+value when, e.g., mode = 2 or 4 and ndigits = 24 (16 for 16-bit ints).
+
+Mon Jun 21 12:56:42 EDT 1993
+  dtoa.c: tweak to work with 32-bit ints and 64-bit longs
+when compiled with -DLong=int .
+
+Wed Jan 26 11:09:16 EST 1994
+  dtoa.c: fix bug in strtod's handling of numbers with very
+negative exponents (e.g. 1.8826e-512), which should underflow to 0;
+fix storage leak in strtod with underflows and overflows near
+the underflow and overflow thresholds.
+
+Mon Feb 28 11:37:30 EST 1994
+  dtoa.c:
+85a86,89
+>  * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
+>  *	if memory is available and otherwise does something you deem
+>  *	appropriate.  If MALLOC is undefined, malloc will be invoked
+>  *	directly -- and assumed always to succeed.
+87a92,95
+> #ifndef MALLOC
+> #define MALLOC malloc
+> #endif
+>
+352c360
+< 		rv = (Bigint *)malloc(sizeof(Bigint) + (x-1)*sizeof(Long));
+---
+> 		rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long));
+
+Thu Mar  3 16:56:39 EST 1994
+  dtoa.c: if MALLOC is #defined, declare it.
+
+Wed Jan  4 15:45:34 EST 1995
+  dtoa.c: add CONST qualification to tens, bigtens, tinytens (for use
+on embedded systems with little spare RAM).
+
+Fri Mar  1 08:55:39 EST 1996
+  g_fmt.c: honor the sign of 0 and return the first argument (buf).
+
+Sat Jul  6 07:59:28 EDT 1996
+  dtoa.c: cosmetic changes: "ULong" rather than "unsigned Long";
+update comments to reflect AT&T breakup.
+
+Mon Aug  5 23:31:24 EDT 1996
+  dtoa.c: add comment about invoking _control87(PC_53, MCW_PC)
+(or the equivalent) on 80x87 machines before calling strtod or dtoa.
+
+Tue Dec 17 15:01:56 EST 1996
+  dtoa.c: new #define possibilities: #define INFNAN_CHECK to have
+strtod check (case insensitively) for "Infinity" and "NaN" on machines
+with IEEE arithmetic; #define MULTIPLE_THREADS if the system offers
+preemptively scheduled multiple threads, in which case you must supply
+routines ACQUIRE_DTOA_LOCK(n) and FREE_DTOA_LOCK(n) (n = 0 or 1).
+New void freedtoa(char*) for freeing values returned by dtoa; use of
+freedtoa() is required if MULTIPLE_THREADS is #defined, and is merely
+recommended otherwise.
+  g_fmt.c: adjusted to invoke freedtoa().
+
+Wed Feb 12 00:40:01 EST 1997
+  dtoa.c: strtod: on IEEE systems, scale to avoid intermediate
+underflows when the result does not underflow; compiling with
+-DNO_IEEE_Scale restores the old logic.  Fix a bug, revealed by
+input string 2.2250738585072012e-308, in treating input just less
+than the smallest normalized number.  (The bug introduced an extra
+ULP of error in this special case.)
+
+Tue May 12 11:13:04 EDT 1998
+  dtoa.c: strtod: fix a glitch introduced with the scaling of 19970212
+that caused one-bit rounding errors in certain denormal numbers, such
+as 8.44291197326099e-309, which was read as 8.442911973260987e-309.
+Remove #ifdef Unsigned_Shifts logic in favor of unsigned arithmetic.
+Unless compiled with -DNO_LONG_LONG, use 64-bit arithmetic where
+possible.
+
+Fri May 15 07:49:07 EDT 1998
+  dtoa.c: strtod: fix another glitch with scaling to avoid underflow
+with IEEE arithmetic, again revealed by the input string
+2.2250738585072012e-308, which was rounded to the largest denormal
+rather than the smallest normal double precision number.
+
+Wed Aug  5 23:27:26 EDT 1998
+  gdtoa.tar.gz: tweaks in response to comments from Shawn C. Sheridan
+(with no effect on the resulting .o files except when strtod.c is
+compiled with -DNO_ERRNO); bigtens --> bigtens_D2A (a symbol meant
+to be private to gdtoa.a).
+
+Sat Sep 12 17:05:15 EDT 1998
+  gdtoa.tar.gz: more changes in response to comments from Shawn C.
+Sheridan (including repair of a glitch in g_ffmt.c).  For consistency
+and possible convenience, there are some new functions and some name
+changes to existing ones:
+	Old	New
+	---	g_xLfmt
+	strtoQ	strtopQ
+	---	strtopd
+	strtodd	strtopdd
+	---	strtopf
+	strtox	strtopx
+	---	strtopxL
+	---	strtorxL
+	---	strtoIxL
+Functions strtopd and strtopf are variations of strtod and strtof,
+respectively, which write their results to their final (pointer)
+arguments.  Functions strtorf and strtord are now analogous to the
+other strtor* functions in that they now have a final pointer
+argument to which they write their results, and they return the
+int value they get from strtodg.
+  The xL family (g_xLfmt, strto[Irp]xL) is a variation of the old x
+family (for 80-bit IEEE double-extended precision) that assumes the
+storage layout of the Motorola 68881's double-extended format:  80
+interesting bits stored in 3 unsigned 32-bit ints (with a "hole", 16
+zero bits, in the word that holds the sign and exponent).  The x
+family now deals with 80-bit (5 unsigned 16-bit ints) rather than
+96-bit arrays (3 unsigned 32-bit ints) that hold its 80-bit
+double-extended values.  (This relaxes the alignment requirements of
+the x family and results in strto[Ipr]x writing 80 rather than 96 bits
+to their final arguments.)
+  Each g_*fmt routine now returns a pointer to the null character
+that terminates the strings it writes, rather than a pointer to
+the beginning of that string (the first argument).  These routines
+still return 0 (NULL) if the first argument is too short.
+  The second argument to g_dfmt is now pointer (to a double) rather
+than a double value.
+
+Thu Oct 29 21:54:00 EST 1998
+  dtoa.c: Fix bug in strtod under -DSudden_Underflow and (the default)
+-DAvoid_Underflow: some numbers that should have suffered sudden
+underflow were scaled inappropriately (giving nonzero return values).
+Example: "1e-320" gave -3.6304123742133376e+280 rather than 0.
+
+Mon Nov  2 15:41:16 EST 1998
+  dtoa.c: tweak to remove LL suffixes from numeric constants (for
+compilers that offer a 64-bit long long type but do not recognize the
+LL constants prescribed by C9x, the proposed update to the ANSI/ISO C
+standard).  Thanks to Earl Chew for pointing out the existence of such
+compilers.
+  gdtoa.tar.gz: renamed gdtoa.tgz and updated to incorporate the above
+changes (of 29 Oct. and 2 Nov. 1998) to dtoa.c.
+
+Thu Mar 25 17:56:44 EST 1999
+  dtoa.c, gdtoa.tgz: fix a bug in strtod's reading of 4.9e-324:
+it returned 0 rather than the smallest denormal.
+
+Mon Apr 12 10:39:25 EDT 1999
+  gdtoa.tgz: test/ftest.c: change %.7g to %.8g throughout.
+
+Fri Aug 20 19:17:52 EDT 1999
+  gdtoa.tgz: gdtoa.c: fix two bugs reported by David Chase (thanks!):
+1. An adjustment for denormalized numbers around 503 was off by one.
+2. A check for "The special case" around line 551 omitted the condition
+that we not be at the bottom of the exponent range.
+
+Mon Sep 13 10:53:34 EDT 1999
+  dtoa.c: computationally invisible tweak for the benefit of people
+who actually read the code:
+
+2671c2671
+< 		 && word0(d) & Exp_mask
+---
+> 		 && word0(d) & (Exp_mask & Exp_mask << 1)
+
+I.e., in dtoa(), the "special case" does not arise for the smallest
+normalized IEEE double.  Thanks to Waldemar Horwat for pointing this
+out and suggesting the modified test above.  Also, some tweaks for
+compilation with -DKR_headers.
+  gdtoa.tgz: gdtoa.c: analogous change:
+
+552c552
+< 		if (bbits == 1 && be0 > fpi->emin) {
+---
+> 		if (bbits == 1 && be0 > fpi->emin + 1) {
+
+This has no effect on the g*fmt.c routines, but might affect the
+computation of the shortest decimal string that rounds to the
+smallest normalized floating-point number of other precisions.
+  gdota.tgz: test/d.out test/dI.out test/dd.out: updated to reflect
+previous changes (of 19990820); test/*.c: most test programs modified
+to permit #hex input.  See the comments.
+
+Fri Sep 17 01:39:25 EDT 1999
+  Try again to update dtoa.c: somehow dtoa.c got put back to a version
+from 3 years ago after this "changes" file was updated on 13 Sept. 1999.
+One more tweak to omit a warning on some systems:
+2671c2671
+<		 && word0(d) & (Exp_mask & Exp_mask << 1)
+---
+>		 && word0(d) & (Exp_mask & ~Exp_msk1)
+Plus changes to avoid trouble with aggressively optimizing compilers
+(e.g., gcc 2.95.1 under -O2).  On some systems, these changes do not
+affect the resulting machine code; on others, the old way of viewing
+a double as a pair of ULongs is available with -DYES_ALIAS.
+
+Tue Sep 21 09:21:25 EDT 1999
+  gdtoa.tgz: changes analogous to those of 17 Sept. 1999 to dtoa.c to
+avoid trouble with aggressively optimizing compilers.
+
+Wed Dec 15 13:14:38 EST 1999
+  dtoa.c: tweak to bypass a bug with HUGE_VAL on HP systems.
+
+Mon Jan 17 18:32:52 EST 2000
+  dtoa.c and gdtoa.tgz: strtod: set errno = ERANGE on all inputs that
+underflow to zero (not just those sufficiently less than the smallest
+positive denormalized number).
+  gdtoa.tgz: README: point out that compiling with -DNO_ERRNO inhibits
+errno assignments (by strtod and the core converter, strtodg).
+
+Tue Jan 18 16:35:31 EST 2000
+  dtoa.c and gdtoa.tgz: strtod: modify the test inserted yesterday so
+it may work correctly with buggy 80x87 compilers.  (The change matters,
+e.g., to Microsoft Visual C++ 4.2 and 6.0.)
+
+Thu Nov  2 21:00:45 EST 2000
+  dtoa.c and gdtoa.tgz:
+1. Fix bug in test for exact half-way cases of denormalized numbers
+   (without -DNO_IEEE_Scale).
+2. Compilation with -DNO_ERRNO prevents strtod from assigning
+   errno = ERANGE when the result overflows or underflows to 0.
+3. With IEEE arithmetic and no -DNO_IEEE_Scale, adjust scaling so
+   ulp(d) never returns a denormalized number.  This and other tweaks
+   permit strtod and dtoa to work correctly on machines that flush
+   underflows to zero but otherwise use IEEE arithmetic without
+   Sudden_Underflow being #defined (and with strtod simply returning 0
+   instead of denormalized numbers).
+4. Compilations with -DUSE_LOCALE causes strtod to use the current
+   locale's decimal_point value.
+5. Under compilations with -DINFNAN_CHECK, strtod and strtodg (case
+   insensitively) treat "inf" the same as "infinity" and, unless
+   compiled with -DNo_Hex_NaN, accept "nan(x)", where x is a string of
+   hexadecimal digits and spaces, as a NaN whose value is constructed
+   from x (as explained in comments near the top of dtoa.c and in
+   gdtoaimp.h).
+6. The default PRIVATE_MEM is increased slightly (to 2304), and comments
+   near the top of dtoa.c provide more discussion of PRIVATE_MEM.
+7. Meanings of dtoa modes 4,5,8,9 changed.  See comments in dtoa.c and
+   gdtoa.c; modes 4 and 5 may now provide shorter strings that round
+   (in round-nearest mode) to the given double value.  (Paxson's
+   testbase program is unhappy with this new rounding, as it can
+   introduce an error of more than one base-10 ulp when 17 or more
+   decimal digits are requested.)
+8. With IEEE arithmetic, compilation with -DHonor_FLT_ROUNDS causes
+   strtod and dtoa to round according to FLT_ROUNDS:
+	0 ==> towards 0,
+	1 ==> nearest,
+	2 ==> towards +Infinity,
+	3 ==> towards -Infinity.
+9. With IEEE arithmetic, compilation with -DSET_INEXACT causes extra
+   computation (and sometimes slower conversions in dtoa and strtod,
+   particularly for dtoa in cases where otherwise some simple floating-
+   point computations would suffice) to set the IEEE inexact flag
+   correctly.  As comments in dtoa.c explain in more detail, this
+   requires compilation in an environment (such as #include "dtoa.c"
+   in suitable source) that provides
+		int get_inexact(void);
+		void clear_inexact(void);
+10. On input "-x", return 0 rather than -0.
+
+gdtoa.tgz: gethex.c: adjust logic for reading hex constants to accord
+with current wording of the C99 standard.  Previously, I thought hex
+constants read by strtod and friends had to have either a decimal point
+or an exponent field; p. 307 of the C99 standard states that both are
+optional.  Because of the complexity of this reading, it is available
+only in the variant of strtod that appears in gdtoa.tgz.
+
+strtodg (gdtoa.tgz): New return value STRTOG_NaNbits (with
+STRTOG_NoNumber renumbered).  Allow STRTOG_Neg bit in strtodg returns
+for STRTOG_NaN and STRTOG_NaNbits.
+
+gdtoa.tgz: Fix uninitialized variable bug in g_Qfmt.c's handling of NaNs.
+
+Mon Nov 13 14:00:05 EST 2000
+  gdtoa.tgz: strtodg:  fix a storage leak and an apparently rare infinite
+loop with a boundary case of directed rounding.  Example input to
+gdtoa/test/Qtest where the loop bug bit:
+	r 3
+	35184372088831.999999999999999999999999999999999999
+This was revealed by testbase for quad precision Solaris arithmetic;
+it did not show up in several other testbase configurations.
+
+Wed Feb  7 12:56:11 EST 2001
+  dtoa.c:  fix bug (possible infinite loop, e.g., with
+2.47032822920623272e-324) introduced 20001113 in handling the special
+case of a power of 2 to be rounded down one ulp.  Add test (required
+by changes of 20001113) for the extra special case of 2^-1075 (half
+the smallest denormal).
+  gdtoa.tgz: corresponding adjustments to strtod.c and strtodg.c.
+
+Tue Mar 13 00:46:09 EST 2001
+  gdtoa.tgz: gdtoa/strtodg.c: fix bug in handling values exactly half
+an ulp less than the smallest normal floating-point number;
+gdtoa/*test.c: fix glitch in handling "n ..." lines (intended to
+change "ndig").
+
+Wed Mar  6 10:13:52 EST 2002
+  gdtoa.tgz:  add gdtoa/test/strtodt.c and gdtoa/test/testnos3 to test
+strtod on hard cases posted by Fred Tydeman to comp.arch.arithmetic on
+26 Feb. 1996.  Add comment to gdtoa/README about strtod requiring true
+IEEE arithmetic (with 53-bit rounding precision on 80x87 chips).
+In gdtoa/test, automate selection of expected output files [xQ]*.out.
+
+Wed Mar  5 10:35:41 EST 2003
+  gdtoa.tgz:  fix a bug in strtod's handling of 0-valued 0x... "decimal"
+strings.  A fault was possible.  Thanks to David Shultz for reporting
+this bug.
+
+Tue Mar 18 09:38:28 EST 2003
+  gdtoa.tgz:  fix a glitch in strtodg.c with -DUSE_LOCALE; add #ifdef
+USE_LOCALE lines to g__fmt.c (to affect binary --> decimal conversions
+via the g*fmt routines), and add comments about -DUSE_LOCALE to README.
+In short, compiling strtod.c, strtodg.c, and g__fmt.c with -DUSE_LOCALE
+causes them to determine the decimal-point character from the current
+locale.  (Otherwise it is '.'.)
+
+Fri Mar 21 16:36:27 EST 2003
+  gdtoa.tgz:  gethex.c: add #ifdef USE_LOCAL logic; strtod.c: fix a
+glitch in handling 0x... input (the return from gethex was ignored).
+
+Wed Mar 26 15:35:10 EST 2003
+  gdtoa.tgz:  gethex.c:  pedantic (and normally invisible) change:
+use unsigned char for decimalpoint variable (under -DUSE_LOCALE).
+
+Sat Jan 17 23:58:52 MST 2004
+  gdtoa.tgz:  gethex.c:  supply missing parens in test for whether a
+denormal result should be zero, correct logic for rounding up when the
+result is denormal, and when returning zero or Infinity, set *bp = 0;
+strtod.c:  switch on gethex(...)  & STRTOG_Retmask rather than just on
+gethex(), and only copybits(..., bb) when bb is nonzero.  This
+mattered for underflows and overflows in 0x notation.
+
+Thu Mar 25 22:34:56 MST 2004
+ dtoa.c and gdtoa.c/misc.c:  change "(!x & 1)" to "(!x)" to avoid
+confusion by human readers -- the object code is unaffected (with
+reasonable compilers).
+
+Mon Apr 12 00:44:22 MDT 2004
+ dtoa.c and gdtoa.tar.gz:  update contact info. for dmg and correct
+page numbers in comment on Steele & White (1990).
+ gdtoa.tgz:  add strtodnrp.c for a variant of strtod that is slower
+but does not require 53-bit rounding precision on Intel IA32 systems.
+
+Tue Apr 13 00:28:14 MDT 2004
+ gdtoa.tgz: strtod.c: fix glitch when both INFNAN_CHECK and No_Hex_NaN
+are #defined.  Thanks to David Mendenhall for pointing this bug out.
+
+Wed Jan  5 22:39:17 MST 2005
+  gdtoa.tgz:
+    gethex.c:  fix the bug reported by Stefan Farfeleder of ignoring a
+binary-exponent-part if the converted number is zero.
+    strto[pr]x.c: fix bug reported by Stefan Farfeleder in setting the
+exponent of denormals (which should be 0, not 1).
+    g_xfmt.c: fix a corresponding bug with denormals.
+    strtodg.c: fix a bug under IBM (base 16) arithemtic reported
+by Greg Alexander:  a correction to the binary exponent for changes to
+the exponent of a native double value for avoiding overflow had to be
+multiplied by 4 ("e2 <<= 2;").
+    Various files: minor tweaks for portability.
+
+Sat Jan 15 15:36:03 MST 2005
+  gdtoa.tgz: gethex.c:  fix a glitch introduced last week (and reported
+by Stefan Farfelder) with 0x forms with no nonzero digits before the "."
+character, e.g., 0x.1 (which was rendered as 0 rather than .0625).
+  gdtoa.tgz: many files: add automatic computation of gd_qnan.h for
+giving the system-dependent format of a quiet NaN (the one generated
+for Infinity - Infinity).  Tweak test/makefile so differences in the
+spelling of Infinity ("INF" or "Inf" on some systems) do not matter.
+Fix bug in strtod.c and strtodg.c under which, e.g., -.nan was read
+as NaN rather than unacceptable input (causing return 0).  Adjust
+comments in README about nan(...).  Fix glitch in test/dt.c.
+
+Sun Jan 16 18:22:13 MST 2005
+  gdtoa.tgz: strtodg.c: fix long-standing bug in handling input
+that rounds up to 2^nbits, e.g., strtof("16777215.5").  Thanks to
+Edward Moy for reporting this problem.
+  gdtoa.tgz: Fix some bugs with -DJust_16.
+
+Thu Sep 22 22:40:16 MDT 2005
+gdtoa.tgz:
+  strtod.c: unless prevented by -DNO_FENV_H, include C99's fenv.h
+and with hex input, get the current rounding mode from fegetround().
+With decimal input, strtod honors the rounding mode automatically.
+Thanks to David Schultz (das at FreeBSD dot ORG) for pointing
+  strtodg.c: fix a bug with handling numbers very near the largest
+possible one, which were sometimes incorrectly converted to Infinity.
+Thanks to Edward Moy (emoy at apple dot com) for pointing this out.
+  g_Qfmt.c: change strcpy to strcp.  Thanks to J. T. Conklin
+(jtc at acorntoolworks dot com) for pointing this out.
+  test/xtest.c:  fix some subscript bugs.
+  test/x.ou0, test/x.ou1, test/xL.: update in response to the above fix to
+test/xtest.c.
+  test/makefile:  add -lm to some link lines (needed for fegetround).
+
+Sun Jan 21 20:26:44 MST 2007
+gdtoa.tgz:
+  strtodg.c:  fix a botch in the test of whether to increase rvbits
+before terminating the big for(;;) loop with dsign true:  change
+	if (hi0bits(rvb->x[(rvb->wds - 1) >> kshift])
+			!= j)
+		rvbits++;
+to
+	if (hi0bits(rvb->x[rvb->wds - 1]) != j)
+		rvbits++;
+Example of input where this bug bit:  1.9e27.  Thanks to Edward Moy
+ for providing this example.  Also, simplify the
+preceding computation of j.
+  test/README:  add comment that strtodt needs to operate with 53-bit
+rounding precision on Intel x86 systems, and add a pointer to Paxson's
+paper.
+
+Sat Mar 15 11:44:31 MDT 2008
+  dtoa.c and gdtoa.tgz:  with -DINFNAN_CHECK and without
+-DGDOTA_NON_PEDANTIC_NANCHECK, conform to the ill-advised prescription
+in the C99 standard of consuming (...)  in "nan(...)"  even when ...
+is not of the expected form.  Allow an optional 0x or 0X to precede
+the string of hex digits in the expected form of ... .
+  gdtoa.tgz: gethex.c: have, e.g., strtod("0xyz",&se) set se to "xyz".
+Previously it was incorrectly set to "0xyz".
+
+Thu Aug 28 22:37:35 MDT 2008
+  dtoa.c and gdtoa.tgz:  Fix a bug in strtod when compiled with
+-DHonor_FLT_ROUNDS:  in rounding modes other than "to nearest",
+strtod looped on input larger than and within a factor of 2 of
+the largest finite floating-point number.  Since FLT_ROUNDS is buggy
+on some (Linux) systems in that it does not reflect calls on
+fesetround(), when Honor_FLT_ROUNDS is #defined, get the curren
+rounding mode from fegetround() rather than FLT_ROUNDS, unless
+Trust_FLT_ROUNDS is also #defined.
+  gdtoa/test/getround.c in gdtoa.tgz: simply report the current
+rounding mode when the input line is "r" by itself.  (Previously it
+did so, but also complained of invalid input.)
+  gdtoa/gethex.c: fix an off-by-one bug in a rounding test; detect and
+deal with huge exponents (positive or negative).  This affected the
+reading of hexadecimal floating-point values (0x...).  Also set errno
+to ERANGE on out-of-range values (unless compiled with -DNO_ERRNO).
+  gdtoa/strtod.c: adjust scaling of tinytens[4] (as in dtoa.c) to
+avoid double rounding when dealing with numbers near the bottom of
+the exponent range.
+
+Sat Aug 30 23:37:07 MDT 2008
+  gdtoa/gethex.c: ensure *bp is set to something (NULL if nothing else).
+  Bring gdtoa/xsum0.out and gdtoa/test/xsum0.out up to date.
+
+Tue Sep  9 22:08:30 MDT 2008
+  gdtoa/strto*.c and gdtoa/*fmt.c:  if compiled with -DUSE_LOCALE, use
+the current locale's decimal point character string.
+  gdtoa/gdtoa.c: trim trailing zeros in a missed case (e.g., ndigits = 6
+on 1020302).
+  dtoa.c and gdtoa/strtod.c: on systems with IEEE arithmetic (and without
+NO_ERRNO being defined) set ERANGE for denormal values as well as real
+underflows.
+  gdtoa/strtodg.c:  fix an off-by-one bug in rounding to the largest
+representable magnitude when nbits is a multiple of 32.
+  gdtoa/*fmt.c and gdtoa/gdtoa.h:  bufsize changed from unsigned to size_t.
+  gdtoaimp.h, *fmt.c:  change in calling sequence to internal g__fmt(),
+which now explicitly checks bufsize.
+  Relevant routines (see README) honor the current rounding mode if
+compiled with -DHonor_FLT_ROUNDS on IEEE-arithmetic systems that provide
+the C99 fegetround() function.
+  gdtoa/test/getround.c can optionally be compiled with
+-DHonor_FLT_ROUNDS and/or -DUSE_MY_LOCALE for manual testing of gdtoa.a
+compiled with -DHonor_FLT_ROUNDS or -DUSE_LOCALE.
+
+Fri Oct 10 20:07:15 MDT 2008
+  gdtoa/gethex.c:  fix a bug reading hexadecimal floating-point values
+starting with "0xd" for a nonzero digit d (such as "0x1.0002p3").  The
+bug caused the values to be read as zero with endptr set incorrectly.
+
+Tue Oct 28 00:14:08 MDT 2008
+  gdtoa/strtod.c: fix a comment glitch (with commented {}).
+
+Tue Nov 11 23:05:25 MST 2008
+  gdtoa:  fix a glitch in the strto* routines when compiled with
+-DUSE_LOCALE and the locale's decimal-point string is two or more
+characters long.  Wrong conversions were then possible.
+
+Fri Dec  5 18:20:36 MST 2008
+  gdtoa.tgz: fix bugs with reading C99-style hexadecimal floating-point
+values when compiled with -DPack_16; on IEEE-arithmetic systems, make
+INFNAN_CHECK the default unless NO_INFNAN_CHECK is #defined.  (This is
+consistent with dtoa.c, which has worked this way for a while.)
+  dtoa.c:  add recognition of C99-style hexadecimal floating-point
+values (unless compiled with NO_HEX_FP is #defined).
+
+Thu Dec 11 23:10:23 MST 2008
+  dtoa.c: omit an unused variable.
+
+Fri Jan  2 22:45:33 MST 2009
+  dtoa.c: tweak to banish some compiler warnings.
+
+Sun Mar  1 20:57:22 MST 2009
+  dtoa.c, gdtoa/{g__fmt.c, gethex.c, strtod.c, strtodg.c}: change malloc
+to MALLOC.
+  dtoa.c and gdtoa/gdtoaimp.h and gdtoa/misc.c:  reduce Kmax, and use
+MALLOC and FREE or free for huge blocks, which are possible only in
+pathological cases, such as dtoa calls in mode 3 with thousands of
+digits requested, or strtod() calls with thousand of digits.  For the
+latter case, I have an alternate approach that runs much faster
+and uses less memory, but finding time to get it ready for distribution
+may take a while.
+
+Mon Mar 16 00:32:43 MDT 2009
+  dtoa.c:  Fix a bug under -DUSE_LOCALE in handling "decimal point"
+strings more than one character long.
+  dtoa.c and gdtoa/misc.c:  Remove a buggy test activated with
+-DDEBUG.
+  dtoa.c and gdtoa/gdtoa.c: simplify logic for "4 leading 0 bits".
+  dtoa.c:  Add logic (that can be disabled with -DNO_STRTOD_BIGCOMP
+and that) to strtod for more efficiently handling a very long input
+string.  It proceeds by initially truncating the input string, then if
+necessary comparing the whole string with a decimal expansion to
+decide close cases.  This logic is only used for input more than
+STRTOD_DIGLIM digits long (default 40), and for now only applies to
+IEEE arithmetic (for want of other kinds of platforms on which to run
+tests).  This only appears worthwhile for absurdly long input strings,
+so a corresponding update to gdtoa does not seem warranted.
+  dtoa.c, gdtoa.tgz:  tweaks (mostly adding unnecessary parens) to
+silence "gcc -Wall" warnings.  Aside from a couple of minor changes
+to banish erroneous warnings about uninitialized variables, the tweaks
+do not affect the generated object code.
+
+Sat Apr 11 23:25:58 MDT 2009
+  dtoa.c: fix glitch in compiling with -DNo_Hex_NaN and the bug of
+accepting (e.g.) ".nan" or ".inf" as NaN or Infinity.
+  gdtoa.tgz: tweaks to silence warnings from "gcc -Wstrict-aliasing=2";
+update xsum0.out files.
+
+Sun Apr 19 23:40:24 MDT 2009
+  dtoa.c, gdtoa/misc.c:  do not attempt to allocate large memory blocks
+from the private memory pool (which was an unlikely event, but a bug).
+  gdtoa/strtopx.c, gdtoa/strtopxL.c, gdtoa/strtorx.c, gdtoa/strtorxL.c:
+supply explicit bit for Infinity.  Note that the Q routines (which do
+not supply this bit) are appropriate for Sparc quad precision (probably
+known as long double with most current compilers).
+
+Wed Dec  9 08:14:52 MST 2009
+  gdtoa.tgz:  add gdtoa/printf.c* and modify makefile so "make Printf"
+adds a printf to gdtoa.a (to be accessed with #include "stdio1.h" to
+get gdtoa/stdio1.h, which you might install in some standard place).
+On Intel/AMD i386, x86_64, and Sparc systems, this adds formats %La,
+%Le, %Lf and %Lg to handle long double.  On x86_64 systems, it also
+adds %Lqa, %Lqe, %Lqf and %Lqg to handle 128-bit bit types (called
+__float128 by gcc and _Quad by the Intel compiler).  In gdtoa/test,
+"make pf_test" tests this printf (provided the system is an i386,
+x86_64, or Sparc system).  On x86_64 systems, "make pf_testLq" tests
+the %Lq...  formats (briefly).
+
+Mon Jan 11 22:25:17 MST 2010
+  dtoa.c: fix a minor performance bug and, under compilation with -DDEBUG,
+an erroneous error message "oversize b in quorem" in strtod's processing
+of some input that underflows to zero.  Also fix a bug in bigcomp()'s
+handling of numbers that will scale to denormal values.  The increments
+that bigcomp applied were ignoring the effects of denormalization.
+
+Sat Jan 23 00:25:54 MST 2010
+  dtoa.c:  Fix some glitches in recently introduced changes meant to
+speed up returns in pedantic cases.  In quorem, adjust #ifdef DEBUG
+stuff so it does not complain when bigcomp() calls quorem on input
+near the smallest representable number and rounding up by a bit causes
+a quorem return > 9 (which in this case is not a bug).  Fix a memory
+leak in the unlikely case of overflow only being detected after some
+high-precision integer computations.  Fix an off-by-one bug in
+handling a large number of digits with a few nonzero digits, followed
+by many zeros, and then some nonzero digits.  (This does not happen
+with sensible input.)  Fix an off-by-one bug in a recently introduced
+quick test for underflow (i.e., zero result) on input at the bottom of
+the exponent range.  Thanks to Mark Dickinson for pointing these bugs
+out.
+
+  dtoa.c and gdtoa/strtod.c:  Fix an obscure bug in strtod's handling
+of some inputs of many digits at the bottom of the exponent range:
+results were sometimes off by a bit when gdtoa/strtod.c or dtoa.c was
+compiled without -DNO_IEEE_SCALE and, for dtoa.c, when compiled with
+-DNO_STRTOD_BIGCOMP.
+
+  gdtoa/test/testnos3: add some examples that went wrong before
+the present changes.
+
+Sat Jan 23 23:29:02 MST 2010
+  dtoa.c: more tweaks relevant only to absurd input.
+
+Tue Feb  2 23:05:34 MST 2010
+  dtoa.c: add test for setting errno = ERANGE when input of many digits
+is rounded to Infinity or underflows to zero.  Fix a memory leak in
+such instances.
+  gdtoa/strtod.c: make some corresponding changes.
+
+Wed Jul  7 09:25:46 MDT 2010
+  dtoa.c:  adjust to use bigcomp when necessary when compiled with
+-DHonor_FLT_ROUNDS (and without -DNO_STRTOD_BIGCOMP), and the rounding
+mode is torwards +Infinity.  An input (supplied by Rick Regan
+) where this matters is
+1.100000000000000088817841970012523233890533447265626
+  gdtoa/strtod.c:  fix errors (introduced 20090411) when compiled
+with -DHonor_FLT_ROUNDS.
+
+Wed Sep 15 09:00:26 MDT 2010
+  dtoa.c, gdtoa/dtoa.c, gdtoa/gdtoa.c:  fix bugs with -DROUND_BIASED
+pointed out by Jay Foad.
+
+Mon Sep 27 13:43:30 MDT 2010
+  gdtoa/gdtoa.c: fix a glitch (not revealed by compilation) in the
+changes of 15 Sept. 2010.
+
+Fri Nov  5 13:02:41 MDT 2010
+  dtoa.c:  fix a bug related to bigcomp:  decimal strings with all
+zeros before the decimal point more than 40 significant digits that
+required use of bigcomp might be converted very incorrectly.
+Example: .010000000000000000057612911342378542997169 .
+Thanks to Rick Regan  for reporting the
+symptoms and providing an example.
+
+20110403:
+  dtoa.c, gdtoa/gdtoaimp.h, gdtoa/strtod.c:  if
+ROUND_BIASED_without_Round_Up is #defined, assume ROUND_BIASED and
+omit the quick computation that would use ordinary arithmetic to
+compute the correctly rounded result with one rounding error.  If you
+want biased rounding with IEEE-style format "double" and will operate
+with rounding toward +Infinity, it suffices to #define ROUND_BIASED
+(and thus retain the quick computation when it is appropriate).
+  gdtoa/gdtoa.h: change default Long from long to int (with the goal
+of portability when compiling without -DLong=... specified).  On some
+64-bit systems, long is a 64-bit type; we need a 32-bit type here.
+  dtoa.c, gdtoa/gdtoa.c: fix a glith with ndigits with mode = 4 at
+the bottom of the exponent range, e.g., 1e-323.

Modified: head/contrib/gdtoa/dtoa.c
==============================================================================
--- head/contrib/gdtoa/dtoa.c	Sat Mar 12 06:35:53 2011	(r219556)
+++ head/contrib/gdtoa/dtoa.c	Sat Mar 12 07:03:06 2011	(r219557)
@@ -75,10 +75,10 @@ THIS SOFTWARE.
  char *
 dtoa
 #ifdef KR_headers
-	(d, mode, ndigits, decpt, sign, rve)
-	double d; int mode, ndigits, *decpt, *sign; char **rve;
+	(d0, mode, ndigits, decpt, sign, rve)
+	double d0; int mode, ndigits, *decpt, *sign; char **rve;
 #else
-	(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
+	(double d0, int mode, int ndigits, int *decpt, int *sign, char **rve)
 #endif
 {
  /*	Arguments ndigits, decpt, sign are similar to those
@@ -124,7 +124,8 @@ dtoa
 	ULong x;
 #endif
 	Bigint *b, *b1, *delta, *mlo, *mhi, *S;
-	double d2, ds, eps;
+	U d, d2, eps;
+	double ds;
 	char *s, *s0;
 #ifdef SET_INEXACT
 	int inexact, oldinexact;
@@ -149,35 +150,35 @@ dtoa
 		dtoa_result = 0;
 		}
 #endif
-
-	if (word0(d) & Sign_bit) {
+	d.d = d0;
+	if (word0(&d) & Sign_bit) {
 		/* set sign for everything, including 0's and NaNs */
 		*sign = 1;
-		word0(d) &= ~Sign_bit;	/* clear sign bit */
+		word0(&d) &= ~Sign_bit;	/* clear sign bit */
 		}
 	else
 		*sign = 0;
 
 #if defined(IEEE_Arith) + defined(VAX)
 #ifdef IEEE_Arith
-	if ((word0(d) & Exp_mask) == Exp_mask)
+	if ((word0(&d) & Exp_mask) == Exp_mask)
 #else
-	if (word0(d)  == 0x8000)
+	if (word0(&d)  == 0x8000)
 #endif
 		{
 		/* Infinity or NaN */
 		*decpt = 9999;
 #ifdef IEEE_Arith
-		if (!word1(d) && !(word0(d) & 0xfffff))
+		if (!word1(&d) && !(word0(&d) & 0xfffff))
 			return nrv_alloc("Infinity", rve, 8);
 #endif
 		return nrv_alloc("NaN", rve, 3);
 		}
 #endif
 #ifdef IBM
-	dval(d) += 0; /* normalize */
+	dval(&d) += 0; /* normalize */
 #endif
-	if (!dval(d)) {
+	if (!dval(&d)) {
 		*decpt = 1;
 		return nrv_alloc("0", rve, 1);
 		}
@@ -196,26 +197,26 @@ dtoa
 		}
 #endif
 
-	b = d2b(dval(d), &be, &bbits);
+	b = d2b(dval(&d), &be, &bbits);
 #ifdef Sudden_Underflow
-	i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
+	i = (int)(word0(&d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
 #else
-	if (( i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)) )!=0) {
+	if (( i = (int)(word0(&d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)) )!=0) {
 #endif
-		dval(d2) = dval(d);
-		word0(d2) &= Frac_mask1;
-		word0(d2) |= Exp_11;
+		dval(&d2) = dval(&d);
+		word0(&d2) &= Frac_mask1;
+		word0(&d2) |= Exp_11;
 #ifdef IBM
-		if (( j = 11 - hi0bits(word0(d2) & Frac_mask) )!=0)
-			dval(d2) /= 1 << j;
+		if (( j = 11 - hi0bits(word0(&d2) & Frac_mask) )!=0)
+			dval(&d2) /= 1 << j;
 #endif
 
 		/* log(x)	~=~ log(1.5) + (x-1.5)/1.5
 		 * log10(x)	 =  log(x) / log(10)
 		 *		~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10))
-		 * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2)
+		 * log10(&d) = (i-Bias)*log(2)/log(10) + log10(&d2)
 		 *
-		 * This suggests computing an approximation k to log10(d) by
+		 * This suggests computing an approximation k to log10(&d) by
 		 *
 		 * k = (i - Bias)*0.301029995663981
 		 *	+ ( (d2-1.5)*0.289529654602168 + 0.176091259055681 );
@@ -244,21 +245,21 @@ dtoa
 		/* d is denormalized */
 
 		i = bbits + be + (Bias + (P-1) - 1);
-		x = i > 32  ? word0(d) << 64 - i | word1(d) >> i - 32
-			    : word1(d) << 32 - i;
-		dval(d2) = x;
-		word0(d2) -= 31*Exp_msk1; /* adjust exponent */
+		x = i > 32  ? word0(&d) << (64 - i) | word1(&d) >> (i - 32)
+			    : word1(&d) << (32 - i);
+		dval(&d2) = x;
+		word0(&d2) -= 31*Exp_msk1; /* adjust exponent */
 		i -= (Bias + (P-1) - 1) + 1;
 		denorm = 1;
 		}
 #endif
-	ds = (dval(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
+	ds = (dval(&d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
 	k = (int)ds;
 	if (ds < 0. && ds != k)
 		k--;	/* want k = floor(ds) */
 	k_check = 1;
 	if (k >= 0 && k <= Ten_pmax) {
-		if (dval(d) < tens[k])
+		if (dval(&d) < tens[k])
 			k--;
 		k_check = 0;
 		}
@@ -297,10 +298,11 @@ dtoa
 		try_quick = 0;
 		}
 	leftright = 1;
+	ilim = ilim1 = -1;	/* Values for cases 0 and 1; done here to */
+				/* silence erroneous "gcc -Wall" warning. */
 	switch(mode) {
 		case 0:
 		case 1:
-			ilim = ilim1 = -1;
 			i = 18;
 			ndigits = 0;
 			break;
@@ -334,7 +336,7 @@ dtoa
 		/* Try to get by with floating-point arithmetic. */
 
 		i = 0;
-		dval(d2) = dval(d);
+		dval(&d2) = dval(&d);
 		k0 = k;
 		ilim0 = ilim;
 		ieps = 2; /* conservative */
@@ -344,7 +346,7 @@ dtoa
 			if (j & Bletch) {
 				/* prevent overflows */
 				j &= Bletch - 1;
-				dval(d) /= bigtens[n_bigtens-1];
+				dval(&d) /= bigtens[n_bigtens-1];
 				ieps++;
 				}
 			for(; j; j >>= 1, i++)
@@ -352,32 +354,32 @@ dtoa
 					ieps++;
 					ds *= bigtens[i];
 					}
-			dval(d) /= ds;
+			dval(&d) /= ds;
 			}
 		else if (( j1 = -k )!=0) {
-			dval(d) *= tens[j1 & 0xf];
+			dval(&d) *= tens[j1 & 0xf];
 			for(j = j1 >> 4; j; j >>= 1, i++)
 				if (j & 1) {
 					ieps++;
-					dval(d) *= bigtens[i];
+					dval(&d) *= bigtens[i];
 					}
 			}
-		if (k_check && dval(d) < 1. && ilim > 0) {
+		if (k_check && dval(&d) < 1. && ilim > 0) {
 			if (ilim1 <= 0)
 				goto fast_failed;
 			ilim = ilim1;
 			k--;
-			dval(d) *= 10.;
+			dval(&d) *= 10.;
 			ieps++;
 			}
-		dval(eps) = ieps*dval(d) + 7.;
-		word0(eps) -= (P-1)*Exp_msk1;
+		dval(&eps) = ieps*dval(&d) + 7.;
+		word0(&eps) -= (P-1)*Exp_msk1;
 		if (ilim == 0) {
 			S = mhi = 0;
-			dval(d) -= 5.;
-			if (dval(d) > dval(eps))
+			dval(&d) -= 5.;
+			if (dval(&d) > dval(&eps))
 				goto one_digit;
-			if (dval(d) < -dval(eps))
+			if (dval(&d) < -dval(&eps))
 				goto no_digits;
 			goto fast_failed;
 			}
@@ -386,34 +388,34 @@ dtoa
 			/* Use Steele & White method of only
 			 * generating digits needed.
 			 */
-			dval(eps) = 0.5/tens[ilim-1] - dval(eps);
+			dval(&eps) = 0.5/tens[ilim-1] - dval(&eps);
 			for(i = 0;;) {
-				L = dval(d);
-				dval(d) -= L;
+				L = dval(&d);
+				dval(&d) -= L;
 				*s++ = '0' + (int)L;
-				if (dval(d) < dval(eps))
+				if (dval(&d) < dval(&eps))
 					goto ret1;
-				if (1. - dval(d) < dval(eps))
+				if (1. - dval(&d) < dval(&eps))
 					goto bump_up;
 				if (++i >= ilim)
 					break;
-				dval(eps) *= 10.;
-				dval(d) *= 10.;
+				dval(&eps) *= 10.;
+				dval(&d) *= 10.;
 				}
 			}
 		else {
 #endif
 			/* Generate ilim digits, then fix them up. */
-			dval(eps) *= tens[ilim-1];
-			for(i = 1;; i++, dval(d) *= 10.) {
-				L = (Long)(dval(d));
-				if (!(dval(d) -= L))
+			dval(&eps) *= tens[ilim-1];
+			for(i = 1;; i++, dval(&d) *= 10.) {
+				L = (Long)(dval(&d));
+				if (!(dval(&d) -= L))
 					ilim = i;
 				*s++ = '0' + (int)L;
 				if (i == ilim) {
-					if (dval(d) > 0.5 + dval(eps))
+					if (dval(&d) > 0.5 + dval(&eps))
 						goto bump_up;
-					else if (dval(d) < 0.5 - dval(eps)) {
+					else if (dval(&d) < 0.5 - dval(&eps)) {
 						while(*--s == '0');
 						s++;
 						goto ret1;
@@ -426,7 +428,7 @@ dtoa
 #endif
  fast_failed:
 		s = s0;
-		dval(d) = dval(d2);
+		dval(&d) = dval(&d2);
 		k = k0;
 		ilim = ilim0;
 		}
@@ -438,22 +440,22 @@ dtoa
 		ds = tens[k];
 		if (ndigits < 0 && ilim <= 0) {
 			S = mhi = 0;
-			if (ilim < 0 || dval(d) <= 5*ds)
+			if (ilim < 0 || dval(&d) <= 5*ds)
 				goto no_digits;
 			goto one_digit;
 			}
-		for(i = 1;; i++, dval(d) *= 10.) {
-			L = (Long)(dval(d) / ds);
-			dval(d) -= L*ds;
+		for(i = 1;; i++, dval(&d) *= 10.) {
+			L = (Long)(dval(&d) / ds);
+			dval(&d) -= L*ds;
 #ifdef Check_FLT_ROUNDS
 			/* If FLT_ROUNDS == 2, L will usually be high by 1 */
-			if (dval(d) < 0) {
+			if (dval(&d) < 0) {
 				L--;
-				dval(d) += ds;
+				dval(&d) += ds;
 				}
 #endif
 			*s++ = '0' + (int)L;
-			if (!dval(d)) {
+			if (!dval(&d)) {
 #ifdef SET_INEXACT
 				inexact = 0;
 #endif
@@ -467,8 +469,13 @@ dtoa
 				  case 2: goto bump_up;
 				  }
 #endif
-				dval(d) += dval(d);
-				if (dval(d) > ds || dval(d) == ds && L & 1) {
+				dval(&d) += dval(&d);
+#ifdef ROUND_BIASED
+				if (dval(&d) >= ds)
+#else
+				if (dval(&d) > ds || (dval(&d) == ds && L & 1))
+#endif
+					{
  bump_up:

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 07:47:05 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C9F1106566B;
	Sat, 12 Mar 2011 07:47:05 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 49D2A8FC0A;
	Sat, 12 Mar 2011 07:47: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 p2C7l5IO008971;
	Sat, 12 Mar 2011 07:47:05 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2C7l5Yi008969;
	Sat, 12 Mar 2011 07:47:05 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103120747.p2C7l5Yi008969@svn.freebsd.org>
From: Dmitry Chagin 
Date: Sat, 12 Mar 2011 07: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: r219558 - head/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 07:47:05 -0000

Author: dchagin
Date: Sat Mar 12 07:47:05 2011
New Revision: 219558
URL: http://svn.freebsd.org/changeset/base/219558

Log:
  Style(9) fixes. No functional changes.
  
  MFC after:	2 Week

Modified:
  head/sys/compat/linux/linux_ipc.c

Modified: head/sys/compat/linux/linux_ipc.c
==============================================================================
--- head/sys/compat/linux/linux_ipc.c	Sat Mar 12 07:03:06 2011	(r219557)
+++ head/sys/compat/linux/linux_ipc.c	Sat Mar 12 07:47:05 2011	(r219558)
@@ -97,6 +97,7 @@ struct l_msginfo {
 static void
 bsd_to_linux_shminfo( struct shminfo *bpp, struct l_shminfo *lpp)
 {
+
 	lpp->shmmax = bpp->shmmax;
 	lpp->shmmin = bpp->shmmin;
 	lpp->shmmni = bpp->shmmni;
@@ -107,6 +108,7 @@ bsd_to_linux_shminfo( struct shminfo *bp
 static void
 bsd_to_linux_shm_info( struct shm_info *bpp, struct l_shm_info *lpp)
 {
+
 	lpp->used_ids = bpp->used_ids ;
 	lpp->shm_tot = bpp->shm_tot ;
 	lpp->shm_rss = bpp->shm_rss ;
@@ -128,26 +130,28 @@ struct l_ipc_perm {
 static void
 linux_to_bsd_ipc_perm(struct l_ipc_perm *lpp, struct ipc_perm *bpp)
 {
-    bpp->key = lpp->key;
-    bpp->uid = lpp->uid;
-    bpp->gid = lpp->gid;
-    bpp->cuid = lpp->cuid;
-    bpp->cgid = lpp->cgid;
-    bpp->mode = lpp->mode;
-    bpp->seq = lpp->seq;
+
+	bpp->key = lpp->key;
+	bpp->uid = lpp->uid;
+	bpp->gid = lpp->gid;
+	bpp->cuid = lpp->cuid;
+	bpp->cgid = lpp->cgid;
+	bpp->mode = lpp->mode;
+	bpp->seq = lpp->seq;
 }
 
 
 static void
 bsd_to_linux_ipc_perm(struct ipc_perm *bpp, struct l_ipc_perm *lpp)
 {
-    lpp->key = bpp->key;
-    lpp->uid = bpp->uid;
-    lpp->gid = bpp->gid;
-    lpp->cuid = bpp->cuid;
-    lpp->cgid = bpp->cgid;
-    lpp->mode = bpp->mode;
-    lpp->seq = bpp->seq;
+
+	lpp->key = bpp->key;
+	lpp->uid = bpp->uid;
+	lpp->gid = bpp->gid;
+	lpp->cuid = bpp->cuid;
+	lpp->cgid = bpp->cgid;
+	lpp->mode = bpp->mode;
+	lpp->seq = bpp->seq;
 }
 
 struct l_msqid_ds {
@@ -202,16 +206,18 @@ struct l_shmid_ds {
 static void
 linux_to_bsd_semid_ds(struct l_semid_ds *lsp, struct semid_ds *bsp)
 {
-    linux_to_bsd_ipc_perm(&lsp->sem_perm, &bsp->sem_perm);
-    bsp->sem_otime = lsp->sem_otime;
-    bsp->sem_ctime = lsp->sem_ctime;
-    bsp->sem_nsems = lsp->sem_nsems;
-    bsp->sem_base = PTRIN(lsp->sem_base);
+
+	linux_to_bsd_ipc_perm(&lsp->sem_perm, &bsp->sem_perm);
+	bsp->sem_otime = lsp->sem_otime;
+	bsp->sem_ctime = lsp->sem_ctime;
+	bsp->sem_nsems = lsp->sem_nsems;
+	bsp->sem_base = PTRIN(lsp->sem_base);
 }
 
 static void
 bsd_to_linux_semid_ds(struct semid_ds *bsp, struct l_semid_ds *lsp)
 {
+
 	bsd_to_linux_ipc_perm(&bsp->sem_perm, &lsp->sem_perm);
 	lsp->sem_otime = bsp->sem_otime;
 	lsp->sem_ctime = bsp->sem_ctime;
@@ -222,62 +228,66 @@ bsd_to_linux_semid_ds(struct semid_ds *b
 static void
 linux_to_bsd_shmid_ds(struct l_shmid_ds *lsp, struct shmid_ds *bsp)
 {
-    linux_to_bsd_ipc_perm(&lsp->shm_perm, &bsp->shm_perm);
-    bsp->shm_segsz = lsp->shm_segsz;
-    bsp->shm_lpid = lsp->shm_lpid;
-    bsp->shm_cpid = lsp->shm_cpid;
-    bsp->shm_nattch = lsp->shm_nattch;
-    bsp->shm_atime = lsp->shm_atime;
-    bsp->shm_dtime = lsp->shm_dtime;
-    bsp->shm_ctime = lsp->shm_ctime;
+
+	linux_to_bsd_ipc_perm(&lsp->shm_perm, &bsp->shm_perm);
+	bsp->shm_segsz = lsp->shm_segsz;
+	bsp->shm_lpid = lsp->shm_lpid;
+	bsp->shm_cpid = lsp->shm_cpid;
+	bsp->shm_nattch = lsp->shm_nattch;
+	bsp->shm_atime = lsp->shm_atime;
+	bsp->shm_dtime = lsp->shm_dtime;
+	bsp->shm_ctime = lsp->shm_ctime;
 }
 
 static void
 bsd_to_linux_shmid_ds(struct shmid_ds *bsp, struct l_shmid_ds *lsp)
 {
-    bsd_to_linux_ipc_perm(&bsp->shm_perm, &lsp->shm_perm);
-    if (bsp->shm_segsz > INT_MAX)
-	    lsp->shm_segsz = INT_MAX;
-    else
-	    lsp->shm_segsz = bsp->shm_segsz;
-    lsp->shm_lpid = bsp->shm_lpid;
-    lsp->shm_cpid = bsp->shm_cpid;
-    if (bsp->shm_nattch > SHRT_MAX)
-	    lsp->shm_nattch = SHRT_MAX;
-    else
-	    lsp->shm_nattch = bsp->shm_nattch;
-    lsp->shm_atime = bsp->shm_atime;
-    lsp->shm_dtime = bsp->shm_dtime;
-    lsp->shm_ctime = bsp->shm_ctime;
-    lsp->private3 = 0;
+
+	bsd_to_linux_ipc_perm(&bsp->shm_perm, &lsp->shm_perm);
+	if (bsp->shm_segsz > INT_MAX)
+		lsp->shm_segsz = INT_MAX;
+	else
+		lsp->shm_segsz = bsp->shm_segsz;
+	lsp->shm_lpid = bsp->shm_lpid;
+	lsp->shm_cpid = bsp->shm_cpid;
+	if (bsp->shm_nattch > SHRT_MAX)
+		lsp->shm_nattch = SHRT_MAX;
+	else
+		lsp->shm_nattch = bsp->shm_nattch;
+	lsp->shm_atime = bsp->shm_atime;
+	lsp->shm_dtime = bsp->shm_dtime;
+	lsp->shm_ctime = bsp->shm_ctime;
+	lsp->private3 = 0;
 }
 
 static void
 linux_to_bsd_msqid_ds(struct l_msqid_ds *lsp, struct msqid_ds *bsp)
 {
-    linux_to_bsd_ipc_perm(&lsp->msg_perm, &bsp->msg_perm);
-    bsp->msg_cbytes = lsp->msg_cbytes;
-    bsp->msg_qnum = lsp->msg_qnum;
-    bsp->msg_qbytes = lsp->msg_qbytes;
-    bsp->msg_lspid = lsp->msg_lspid;
-    bsp->msg_lrpid = lsp->msg_lrpid;
-    bsp->msg_stime = lsp->msg_stime;
-    bsp->msg_rtime = lsp->msg_rtime;
-    bsp->msg_ctime = lsp->msg_ctime;
+
+	linux_to_bsd_ipc_perm(&lsp->msg_perm, &bsp->msg_perm);
+	bsp->msg_cbytes = lsp->msg_cbytes;
+	bsp->msg_qnum = lsp->msg_qnum;
+	bsp->msg_qbytes = lsp->msg_qbytes;
+	bsp->msg_lspid = lsp->msg_lspid;
+	bsp->msg_lrpid = lsp->msg_lrpid;
+	bsp->msg_stime = lsp->msg_stime;
+	bsp->msg_rtime = lsp->msg_rtime;
+	bsp->msg_ctime = lsp->msg_ctime;
 }
 
 static void
 bsd_to_linux_msqid_ds(struct msqid_ds *bsp, struct l_msqid_ds *lsp)
 {
-    bsd_to_linux_ipc_perm(&bsp->msg_perm, &lsp->msg_perm);
-    lsp->msg_cbytes = bsp->msg_cbytes;
-    lsp->msg_qnum = bsp->msg_qnum;
-    lsp->msg_qbytes = bsp->msg_qbytes;
-    lsp->msg_lspid = bsp->msg_lspid;
-    lsp->msg_lrpid = bsp->msg_lrpid;
-    lsp->msg_stime = bsp->msg_stime;
-    lsp->msg_rtime = bsp->msg_rtime;
-    lsp->msg_ctime = bsp->msg_ctime;
+
+	bsd_to_linux_ipc_perm(&bsp->msg_perm, &lsp->msg_perm);
+	lsp->msg_cbytes = bsp->msg_cbytes;
+	lsp->msg_qnum = bsp->msg_qnum;
+	lsp->msg_qbytes = bsp->msg_qbytes;
+	lsp->msg_lspid = bsp->msg_lspid;
+	lsp->msg_lrpid = bsp->msg_lrpid;
+	lsp->msg_stime = bsp->msg_stime;
+	lsp->msg_rtime = bsp->msg_rtime;
+	lsp->msg_ctime = bsp->msg_ctime;
 }
 
 static void
@@ -315,9 +325,9 @@ linux_msqid_pullup(l_int ver, struct l_m
 			linux_msqid->msg_lqbytes = linux_msqid64.msg_qbytes;
 		else
 			linux_msqid->msg_qbytes = linux_msqid64.msg_qbytes;
-	} else {
+	} else
 		error = copyin(uaddr, linux_msqid, sizeof(*linux_msqid));
-	}
+
 	return (error);
 }
 
@@ -352,9 +362,8 @@ linux_msqid_pushdown(l_int ver, struct l
 		linux_msqid64.msg_lrpid = linux_msqid->msg_lrpid;
 
 		return (copyout(&linux_msqid64, uaddr, sizeof(linux_msqid64)));
-	} else {
+	} else
 		return (copyout(linux_msqid, uaddr, sizeof(*linux_msqid)));
-	}
 }
 
 static int
@@ -373,9 +382,9 @@ linux_semid_pullup(l_int ver, struct l_s
 		linux_semid->sem_perm.uid = linux_semid64.sem_perm.uid;
 		linux_semid->sem_perm.gid = linux_semid64.sem_perm.gid;
 		linux_semid->sem_perm.mode = linux_semid64.sem_perm.mode;
-	} else {
+	} else
 		error = copyin(uaddr, linux_semid, sizeof(*linux_semid));
-	}
+
 	return (error);
 }
 
@@ -395,9 +404,8 @@ linux_semid_pushdown(l_int ver, struct l
 		linux_semid64.sem_nsems = linux_semid->sem_nsems;
 
 		return (copyout(&linux_semid64, uaddr, sizeof(linux_semid64)));
-	} else {
+	} else
 		return (copyout(linux_semid, uaddr, sizeof(*linux_semid)));
-	}
 }
 
 static int
@@ -416,9 +424,9 @@ linux_shmid_pullup(l_int ver, struct l_s
 		linux_shmid->shm_perm.uid = linux_shmid64.shm_perm.uid;
 		linux_shmid->shm_perm.gid = linux_shmid64.shm_perm.gid;
 		linux_shmid->shm_perm.mode = linux_shmid64.shm_perm.mode;
-	} else {
+	} else
 		error = copyin(uaddr, linux_shmid, sizeof(*linux_shmid));
-	}
+
 	return (error);
 }
 
@@ -451,9 +459,8 @@ linux_shmid_pushdown(l_int ver, struct l
 		linux_shmid64.shm_nattch = linux_shmid->shm_nattch;
 
 		return (copyout(&linux_shmid64, uaddr, sizeof(linux_shmid64)));
-	} else {
+	} else
 		return (copyout(linux_shmid, uaddr, sizeof(*linux_shmid)));
-	}
 }
 
 static int
@@ -473,9 +480,8 @@ linux_shminfo_pushdown(l_int ver, struct
 
 		return (copyout(&linux_shminfo64, uaddr,
 		    sizeof(linux_shminfo64)));
-	} else {
+	} else
 		return (copyout(linux_shminfo, uaddr, sizeof(*linux_shminfo)));
-	}
 }
 
 int
@@ -490,7 +496,7 @@ linux_semop(struct thread *td, struct li
 	bsd_args.semid = args->semid;
 	bsd_args.sops = PTRIN(args->tsops);
 	bsd_args.nsops = args->nsops;
-	return semop(td, &bsd_args);
+	return (semop(td, &bsd_args));
 }
 
 int
@@ -507,7 +513,7 @@ linux_semget(struct thread *td, struct l
 	bsd_args.key = args->key;
 	bsd_args.nsems = args->nsems;
 	bsd_args.semflg = args->semflg;
-	return semget(td, &bsd_args);
+	return (semget(td, &bsd_args));
 }
 
 int
@@ -579,9 +585,9 @@ linux_semctl(struct thread *td, struct l
 		error = copyout(&linux_seminfo,
 		    PTRIN(args->arg.buf), sizeof(linux_seminfo));
 		if (error)
-			return error;
+			return (error);
 		td->td_retval[0] = seminfo.semmni;
-		return 0;			/* No need for __semctl call */
+		return (0);			/* No need for __semctl call */
 	case LINUX_GETALL:
 		cmd = GETALL;
 		semun.val = args->arg.val;
@@ -593,7 +599,7 @@ linux_semctl(struct thread *td, struct l
 	default:
 		linux_msg(td, "ipc type %d is not implemented",
 		  args->cmd & ~LINUX_IPC_64);
-		return EINVAL;
+		return (EINVAL);
 	}
 	return (kern_semctl(td, args->semid, args->semnum, cmd, &semun,
 	    td->td_retval));
@@ -640,241 +646,244 @@ linux_msgrcv(struct thread *td, struct l
 int
 linux_msgget(struct thread *td, struct linux_msgget_args *args)
 {
-    struct msgget_args /* {
-	key_t	key;
-	int	msgflg;
-    } */ bsd_args;
+	struct msgget_args /* {
+		key_t	key;
+		int	msgflg;
+	} */ bsd_args;
 
-    bsd_args.key = args->key;
-    bsd_args.msgflg = args->msgflg;
-    return msgget(td, &bsd_args);
+	bsd_args.key = args->key;
+	bsd_args.msgflg = args->msgflg;
+	return (msgget(td, &bsd_args));
 }
 
 int
 linux_msgctl(struct thread *td, struct linux_msgctl_args *args)
 {
-    int error, bsd_cmd;
-    struct l_msqid_ds linux_msqid;
-    struct msqid_ds bsd_msqid;
-
-    bsd_cmd = args->cmd & ~LINUX_IPC_64;
-    switch (bsd_cmd) {
-    case LINUX_IPC_INFO:
-    case LINUX_MSG_INFO: {
-	struct l_msginfo linux_msginfo;
+	int error, bsd_cmd;
+	struct l_msqid_ds linux_msqid;
+	struct msqid_ds bsd_msqid;
 
-	/*
-	 * XXX MSG_INFO uses the same data structure but returns different
-	 * dynamic counters in msgpool, msgmap, and msgtql fields.
+	bsd_cmd = args->cmd & ~LINUX_IPC_64;
+	switch (bsd_cmd) {
+	case LINUX_IPC_INFO:
+	case LINUX_MSG_INFO: {
+		struct l_msginfo linux_msginfo;
+
+		/*
+		 * XXX MSG_INFO uses the same data structure but returns different
+		 * dynamic counters in msgpool, msgmap, and msgtql fields.
+		 */
+		linux_msginfo.msgpool = (long)msginfo.msgmni *
+		    (long)msginfo.msgmnb / 1024L;	/* XXX MSG_INFO. */
+		linux_msginfo.msgmap = msginfo.msgmnb;	/* XXX MSG_INFO. */
+		linux_msginfo.msgmax = msginfo.msgmax;
+		linux_msginfo.msgmnb = msginfo.msgmnb;
+		linux_msginfo.msgmni = msginfo.msgmni;
+		linux_msginfo.msgssz = msginfo.msgssz;
+		linux_msginfo.msgtql = msginfo.msgtql;	/* XXX MSG_INFO. */
+		linux_msginfo.msgseg = msginfo.msgseg;
+		error = copyout(&linux_msginfo, PTRIN(args->buf),
+		    sizeof(linux_msginfo));
+		if (error == 0)
+		    td->td_retval[0] = msginfo.msgmni;	/* XXX */
+
+		return (error);
+	}
+
+	/* 
+	 * TODO: implement this 
+	 * case LINUX_MSG_STAT:
 	 */
-	linux_msginfo.msgpool = (long)msginfo.msgmni *
-	    (long)msginfo.msgmnb / 1024L;	/* XXX MSG_INFO. */
-	linux_msginfo.msgmap = msginfo.msgmnb;	/* XXX MSG_INFO. */
-	linux_msginfo.msgmax = msginfo.msgmax;
-	linux_msginfo.msgmnb = msginfo.msgmnb;
-	linux_msginfo.msgmni = msginfo.msgmni;
-	linux_msginfo.msgssz = msginfo.msgssz;
-	linux_msginfo.msgtql = msginfo.msgtql;	/* XXX MSG_INFO. */
-	linux_msginfo.msgseg = msginfo.msgseg;
-	error = copyout(&linux_msginfo, PTRIN(args->buf),
-	    sizeof(linux_msginfo));
-	if (error == 0)
-	    td->td_retval[0] = msginfo.msgmni;	/* XXX */
+	case LINUX_IPC_STAT:
+		/* NOTHING */
+		break;
 
-	return (error);
-    }
+	case LINUX_IPC_SET:
+		error = linux_msqid_pullup(args->cmd & LINUX_IPC_64,
+		    &linux_msqid, PTRIN(args->buf));
+		if (error)
+			return (error);
+		linux_to_bsd_msqid_ds(&linux_msqid, &bsd_msqid);
+		break;
 
-/* 
- * TODO: implement this 
- * case LINUX_MSG_STAT:
- */
-    case LINUX_IPC_STAT:
-	/* NOTHING */
-	break;
-
-    case LINUX_IPC_SET:
-	error = linux_msqid_pullup(args->cmd & LINUX_IPC_64,
-	    &linux_msqid, PTRIN(args->buf));
-	if (error)
-	    return (error);
-	linux_to_bsd_msqid_ds(&linux_msqid, &bsd_msqid);
-	break;
-
-    case LINUX_IPC_RMID:
-	/* NOTHING */
-	break;
-
-    default:
-	return (EINVAL);
-	break;
-    }
-
-    error = kern_msgctl(td, args->msqid, bsd_cmd, &bsd_msqid);
-    if (error != 0)
-	if (bsd_cmd != LINUX_IPC_RMID || error != EINVAL)
-	    return (error);
-
-    if (bsd_cmd == LINUX_IPC_STAT) {
-	bsd_to_linux_msqid_ds(&bsd_msqid, &linux_msqid);
-	return (linux_msqid_pushdown(args->cmd & LINUX_IPC_64,
-	  &linux_msqid, PTRIN(args->buf)));
-    }
+	case LINUX_IPC_RMID:
+		/* NOTHING */
+		break;
+
+	default:
+		return (EINVAL);
+		break;
+	}
+
+	error = kern_msgctl(td, args->msqid, bsd_cmd, &bsd_msqid);
+	if (error != 0)
+		if (bsd_cmd != LINUX_IPC_RMID || error != EINVAL)
+			return (error);
+
+	if (bsd_cmd == LINUX_IPC_STAT) {
+		bsd_to_linux_msqid_ds(&bsd_msqid, &linux_msqid);
+		return (linux_msqid_pushdown(args->cmd & LINUX_IPC_64,
+		    &linux_msqid, PTRIN(args->buf)));
+	}
 
-    return (0);
+	return (0);
 }
 
 int
 linux_shmat(struct thread *td, struct linux_shmat_args *args)
 {
-    struct shmat_args /* {
-	int shmid;
-	void *shmaddr;
-	int shmflg;
-    } */ bsd_args;
-    int error;
+	struct shmat_args /* {
+		int shmid;
+		void *shmaddr;
+		int shmflg;
+	} */ bsd_args;
+	int error;
 #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
-    l_uintptr_t addr;
+	l_uintptr_t addr;
 #endif
 
-    bsd_args.shmid = args->shmid;
-    bsd_args.shmaddr = PTRIN(args->shmaddr);
-    bsd_args.shmflg = args->shmflg;
-    if ((error = shmat(td, &bsd_args)))
-	return error;
+	bsd_args.shmid = args->shmid;
+	bsd_args.shmaddr = PTRIN(args->shmaddr);
+	bsd_args.shmflg = args->shmflg;
+	if ((error = shmat(td, &bsd_args)))
+		return (error);
 #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
-    addr = td->td_retval[0];
-    if ((error = copyout(&addr, PTRIN(args->raddr), sizeof(addr))))
-	return error;
-    td->td_retval[0] = 0;
+	addr = td->td_retval[0];
+	if ((error = copyout(&addr, PTRIN(args->raddr), sizeof(addr))))
+		return (error);
+	td->td_retval[0] = 0;
 #endif
-    return 0;
+	return (0);
 }
 
 int
 linux_shmdt(struct thread *td, struct linux_shmdt_args *args)
 {
-    struct shmdt_args /* {
-	void *shmaddr;
-    } */ bsd_args;
+	struct shmdt_args /* {
+		void *shmaddr;
+	} */ bsd_args;
 
-    bsd_args.shmaddr = PTRIN(args->shmaddr);
-    return shmdt(td, &bsd_args);
+	bsd_args.shmaddr = PTRIN(args->shmaddr);
+	return (shmdt(td, &bsd_args));
 }
 
 int
 linux_shmget(struct thread *td, struct linux_shmget_args *args)
 {
-    struct shmget_args /* {
-	key_t key;
-	int size;
-	int shmflg;
-    } */ bsd_args;
-
-    bsd_args.key = args->key;
-    bsd_args.size = args->size;
-    bsd_args.shmflg = args->shmflg;
-    return shmget(td, &bsd_args);
+	struct shmget_args /* {
+		key_t key;
+		int size;
+		int shmflg;
+	} */ bsd_args;
+
+	bsd_args.key = args->key;
+	bsd_args.size = args->size;
+	bsd_args.shmflg = args->shmflg;
+	return (shmget(td, &bsd_args));
 }
 
 int
 linux_shmctl(struct thread *td, struct linux_shmctl_args *args)
 {
-    struct l_shmid_ds linux_shmid;
+	struct l_shmid_ds linux_shmid;
 	struct l_shminfo linux_shminfo;
 	struct l_shm_info linux_shm_info;
 	struct shmid_ds bsd_shmid;
-    int error;
+	int error;
 
-    switch (args->cmd & ~LINUX_IPC_64) {
+	switch (args->cmd & ~LINUX_IPC_64) {
 
 	case LINUX_IPC_INFO: {
-	    struct shminfo bsd_shminfo;
+		struct shminfo bsd_shminfo;
 
-	    /* Perform shmctl wanting removed segments lookup */
-	    error = kern_shmctl(td, args->shmid, IPC_INFO,
-	        (void *)&bsd_shminfo, NULL);
-	    if (error)
-		return error;
-	
-	    bsd_to_linux_shminfo(&bsd_shminfo, &linux_shminfo);
+		/* Perform shmctl wanting removed segments lookup */
+		error = kern_shmctl(td, args->shmid, IPC_INFO,
+		    (void *)&bsd_shminfo, NULL);
+		if (error)
+			return (error);
 
-	    return (linux_shminfo_pushdown(args->cmd & LINUX_IPC_64,
-	       &linux_shminfo, PTRIN(args->buf)));
+		bsd_to_linux_shminfo(&bsd_shminfo, &linux_shminfo);
+
+		return (linux_shminfo_pushdown(args->cmd & LINUX_IPC_64,
+		    &linux_shminfo, PTRIN(args->buf)));
 	}
 
 	case LINUX_SHM_INFO: {
-	    struct shm_info bsd_shm_info;
+		struct shm_info bsd_shm_info;
 
-	    /* Perform shmctl wanting removed segments lookup */
-	    error = kern_shmctl(td, args->shmid, SHM_INFO,
-	        (void *)&bsd_shm_info, NULL);
-	    if (error)
-		return error;
+		/* Perform shmctl wanting removed segments lookup */
+		error = kern_shmctl(td, args->shmid, SHM_INFO,
+		    (void *)&bsd_shm_info, NULL);
+		if (error)
+			return (error);
 
-	    bsd_to_linux_shm_info(&bsd_shm_info, &linux_shm_info);
+		bsd_to_linux_shm_info(&bsd_shm_info, &linux_shm_info);
 
-	    return copyout(&linux_shm_info, PTRIN(args->buf),
-	        sizeof(struct l_shm_info));
+		return (copyout(&linux_shm_info, PTRIN(args->buf),
+		    sizeof(struct l_shm_info)));
 	}
 
 	case LINUX_IPC_STAT:
-	    /* Perform shmctl wanting removed segments lookup */
-	    error = kern_shmctl(td, args->shmid, IPC_STAT,
-	        (void *)&bsd_shmid, NULL);
-	    if (error)
-		return error;
+		/* Perform shmctl wanting removed segments lookup */
+		error = kern_shmctl(td, args->shmid, IPC_STAT,
+		    (void *)&bsd_shmid, NULL);
+		if (error)
+			return (error);
 		
-	    bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid);
+		bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid);
 
-	    return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64,
-	  &linux_shmid, PTRIN(args->buf)));
+		return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64,
+		    &linux_shmid, PTRIN(args->buf)));
 
-    case LINUX_SHM_STAT:
-	/* Perform shmctl wanting removed segments lookup */
-	error = kern_shmctl(td, args->shmid, IPC_STAT,
-	    (void *)&bsd_shmid, NULL);
-	if (error)
-		return error;
+	case LINUX_SHM_STAT:
+		/* Perform shmctl wanting removed segments lookup */
+		error = kern_shmctl(td, args->shmid, IPC_STAT,
+		    (void *)&bsd_shmid, NULL);
+		if (error)
+			return (error);
 		
-	bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid);
-	
-	return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64,
-	   &linux_shmid, PTRIN(args->buf)));
-
-    case LINUX_IPC_SET:
-	error = linux_shmid_pullup(args->cmd & LINUX_IPC_64,
-	  &linux_shmid, PTRIN(args->buf));
-	if (error)
-    		return error;
-
-	linux_to_bsd_shmid_ds(&linux_shmid, &bsd_shmid);
-
-	/* Perform shmctl wanting removed segments lookup */
-	return kern_shmctl(td, args->shmid, IPC_SET,
-	    (void *)&bsd_shmid, NULL);
+		bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid);
 
-    case LINUX_IPC_RMID: {
-	void *buf;
-		
-	if (args->buf == 0)
-    		buf = NULL;
-	else {
-    		error = linux_shmid_pullup(args->cmd & LINUX_IPC_64,
+		return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64,
+		    &linux_shmid, PTRIN(args->buf)));
+
+	case LINUX_IPC_SET:
+		error = linux_shmid_pullup(args->cmd & LINUX_IPC_64,
 		    &linux_shmid, PTRIN(args->buf));
 		if (error)
-			return error;
+			return (error);
+
 		linux_to_bsd_shmid_ds(&linux_shmid, &bsd_shmid);
-		buf = (void *)&bsd_shmid;
-	}
-	return kern_shmctl(td, args->shmid, IPC_RMID, buf, NULL);
-    }
 
-    case LINUX_SHM_LOCK:
-    case LINUX_SHM_UNLOCK:
-    default:
-	linux_msg(td, "ipc type %d not implemented", args->cmd & ~LINUX_IPC_64);
-	return EINVAL;
-    }
+		/* Perform shmctl wanting removed segments lookup */
+		return (kern_shmctl(td, args->shmid, IPC_SET,
+		    (void *)&bsd_shmid, NULL));
+
+	case LINUX_IPC_RMID: {
+		void *buf;
+
+		if (args->buf == 0)
+			buf = NULL;
+		else {
+			error = linux_shmid_pullup(args->cmd & LINUX_IPC_64,
+			    &linux_shmid, PTRIN(args->buf));
+			if (error)
+				return (error);
+			linux_to_bsd_shmid_ds(&linux_shmid, &bsd_shmid);
+			buf = (void *)&bsd_shmid;
+		}
+		return (kern_shmctl(td, args->shmid, IPC_RMID, buf, NULL));
+	}
+
+	case LINUX_SHM_LOCK:
+		/* FALLTHROUGH */
+	case LINUX_SHM_UNLOCK:
+		/* FALLTHROUGH */
+	default:
+		linux_msg(td, "ipc type %d not implemented",
+		    args->cmd & ~LINUX_IPC_64);
+		return (EINVAL);
+	}
 }
 
 MODULE_DEPEND(linux, sysvmsg, 1, 1, 1);

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 08:51:44 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D0BB106566B;
	Sat, 12 Mar 2011 08:51:44 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 29A5E8FC14;
	Sat, 12 Mar 2011 08:51: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 p2C8piQi010351;
	Sat, 12 Mar 2011 08:51:44 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2C8phoN010341;
	Sat, 12 Mar 2011 08:51:43 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103120851.p2C8phoN010341@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 12 Mar 2011 08:51: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: r219559 - in head/sys: amd64/linux32 compat/freebsd32
	i386/linux kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 08:51:44 -0000

Author: avg
Date: Sat Mar 12 08:51:43 2011
New Revision: 219559
URL: http://svn.freebsd.org/changeset/base/219559

Log:
  add DTrace systrace support for linux32 and freebsd32 on amd64 syscalls
  
  This commits makes necessary changes in syscall/sysent generation
  infrastructure.
  
  PR:		kern/152822
  Submitted by:	Artem Belevich 
  Reviewed by:	jhb (ealier version)
  MFC after:	3 weeks

Modified:
  head/sys/amd64/linux32/Makefile
  head/sys/amd64/linux32/syscalls.conf
  head/sys/amd64/linux32/syscalls.master
  head/sys/compat/freebsd32/Makefile
  head/sys/compat/freebsd32/syscalls.conf
  head/sys/i386/linux/Makefile
  head/sys/i386/linux/syscalls.conf
  head/sys/i386/linux/syscalls.master
  head/sys/kern/makesyscalls.sh

Modified: head/sys/amd64/linux32/Makefile
==============================================================================
--- head/sys/amd64/linux32/Makefile	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/amd64/linux32/Makefile	Sat Mar 12 08:51:43 2011	(r219559)
@@ -5,11 +5,13 @@
 all:
 	@echo "make sysent only"
 
-sysent:  linux32_sysent.c linux32_syscall.h linux32_proto.h
+sysent:  linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c
 
-linux32_sysent.c linux32_syscall.h linux32_proto.h: ../../kern/makesyscalls.sh \
+linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c: ../../kern/makesyscalls.sh \
 		syscalls.master syscalls.conf
 	-mv -f linux32_sysent.c linux32_sysent.c.bak
 	-mv -f linux32_syscall.h linux32_syscall.h.bak
 	-mv -f linux32_proto.h linux32_proto.h.bak
+	-mv -f linux32_syscalls.c linux32_syscalls.c.bak
+	-mv -f linux32_systrace_args.c linux32_systrace_args.c.bak
 	sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf

Modified: head/sys/amd64/linux32/syscalls.conf
==============================================================================
--- head/sys/amd64/linux32/syscalls.conf	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/amd64/linux32/syscalls.conf	Sat Mar 12 08:51:43 2011	(r219559)
@@ -1,5 +1,5 @@
 # $FreeBSD$
-sysnames="/dev/null"
+sysnames="linux32_syscalls.c"
 sysproto="linux32_proto.h"
 sysproto_h=_LINUX_SYSPROTO_H_
 syshdr="linux32_syscall.h"
@@ -8,4 +8,4 @@ sysmk="/dev/null"
 syscallprefix="LINUX_SYS_"
 switchname="linux_sysent"
 namesname="linux_syscallnames"
-systrace="/dev/null"
+systrace="linux32_systrace_args.c"

Modified: head/sys/amd64/linux32/syscalls.master
==============================================================================
--- head/sys/amd64/linux32/syscalls.master	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/amd64/linux32/syscalls.master	Sat Mar 12 08:51:43 2011	(r219559)
@@ -291,7 +291,7 @@
 				    l_uid16_t *euid, l_uid16_t *suid); }
 166	AUE_NULL	UNIMPL	vm86
 167	AUE_NULL	STD	{ int linux_query_module(void); }
-168	AUE_POLL	NOPROTO	{ int poll(struct pollfd*, \
+168	AUE_POLL	NOPROTO	{ int poll(struct pollfd *fds, \
 				    unsigned int nfds, int timeout); }
 169	AUE_NULL	STD	{ int linux_nfsservctl(void); }
 170	AUE_SETRESGID	STD	{ int linux_setresgid16(l_gid16_t rgid, \

Modified: head/sys/compat/freebsd32/Makefile
==============================================================================
--- head/sys/compat/freebsd32/Makefile	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/compat/freebsd32/Makefile	Sat Mar 12 08:51:43 2011	(r219559)
@@ -5,15 +5,17 @@
 all:
 	@echo "make sysent only"
 
-sysent:  freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h
+sysent:  freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c
 
-freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h: \
+freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c : \
 	    ../../kern/makesyscalls.sh syscalls.master syscalls.conf
 	-mv -f freebsd32_sysent.c freebsd32_sysent.c.bak
 	-mv -f freebsd32_syscalls.c freebsd32_syscalls.c.bak
 	-mv -f freebsd32_syscall.h freebsd32_syscall.h.bak
 	-mv -f freebsd32_proto.h freebsd32_proto.h.bak
+	-mv -f freebsd32_systrace_args.c  freebsd32_systrace_args.c.bak
 	sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf
 
 clean:
 	rm -f freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h
+	rm -f freebsd32_systrace_args.c 

Modified: head/sys/compat/freebsd32/syscalls.conf
==============================================================================
--- head/sys/compat/freebsd32/syscalls.conf	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/compat/freebsd32/syscalls.conf	Sat Mar 12 08:51:43 2011	(r219559)
@@ -8,4 +8,4 @@ sysmk="/dev/null"
 syscallprefix="FREEBSD32_SYS_"
 switchname="freebsd32_sysent"
 namesname="freebsd32_syscallnames"
-systrace="/dev/null"
+systrace="freebsd32_systrace_args.c"

Modified: head/sys/i386/linux/Makefile
==============================================================================
--- head/sys/i386/linux/Makefile	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/i386/linux/Makefile	Sat Mar 12 08:51:43 2011	(r219559)
@@ -5,11 +5,13 @@
 all:
 	@echo "make sysent only"
 
-sysent:  linux_sysent.c linux_syscall.h linux_proto.h
+sysent:  linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c
 
-linux_sysent.c linux_syscall.h linux_proto.h: ../../kern/makesyscalls.sh \
-		syscalls.master syscalls.conf
+linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \
+		../../kern/makesyscalls.sh syscalls.master syscalls.conf
 	-mv -f linux_sysent.c linux_sysent.c.bak
 	-mv -f linux_syscall.h linux_syscall.h.bak
 	-mv -f linux_proto.h linux_proto.h.bak
+	-mv -f linux_syscalls.c linux_syscalls.c.bak
+	-mv -f linux_systrace_args.c linux_systrace_args.c.bak
 	sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf

Modified: head/sys/i386/linux/syscalls.conf
==============================================================================
--- head/sys/i386/linux/syscalls.conf	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/i386/linux/syscalls.conf	Sat Mar 12 08:51:43 2011	(r219559)
@@ -1,5 +1,5 @@
 # $FreeBSD$
-sysnames="/dev/null"
+sysnames="linux_syscalls.c"
 sysproto="linux_proto.h"
 sysproto_h=_LINUX_SYSPROTO_H_
 syshdr="linux_syscall.h"
@@ -8,4 +8,4 @@ sysmk="/dev/null"
 syscallprefix="LINUX_SYS_"
 switchname="linux_sysent"
 namesname="linux_syscallnames"
-systrace="/dev/null"
+systrace="linux_systrace_args.c"

Modified: head/sys/i386/linux/syscalls.master
==============================================================================
--- head/sys/i386/linux/syscalls.master	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/i386/linux/syscalls.master	Sat Mar 12 08:51:43 2011	(r219559)
@@ -102,7 +102,7 @@
 46	AUE_SETGID	STD	{ int linux_setgid16(l_gid16_t gid); }
 47	AUE_GETGID	STD	{ int linux_getgid16(void); }
 48	AUE_NULL	STD	{ int linux_signal(l_int sig, \
-				    l_handler_t handler); }
+				    void *handler); }
 49	AUE_GETEUID	STD	{ int linux_geteuid16(void); }
 50	AUE_GETEGID	STD	{ int linux_getegid16(void); }
 51	AUE_ACCT	NOPROTO	{ int acct(char *path); }
@@ -148,7 +148,7 @@
 				    struct timeval *tp, \
 				    struct timezone *tzp); }
 79	AUE_SETTIMEOFDAY	NOPROTO	{ int settimeofday( \
-				    struct timeval *tp, \
+				    struct timeval *tv, \
 				    struct timezone *tzp); }
 80	AUE_GETGROUPS	STD	{ int linux_getgroups16(l_uint gidsetsize, \
 				    l_gid16_t *gidset); }
@@ -293,7 +293,7 @@
 				    l_uid16_t *euid, l_uid16_t *suid); }
 166	AUE_NULL	STD	{ int linux_vm86(void); }
 167	AUE_NULL	STD	{ int linux_query_module(void); }
-168	AUE_POLL	NOPROTO	{ int poll(struct pollfd*, \
+168	AUE_POLL	NOPROTO	{ int poll(struct pollfd* fds, \
 				    unsigned int nfds, long timeout); }
 169	AUE_NULL	STD	{ int linux_nfsservctl(void); }
 170	AUE_SETRESGID	STD	{ int linux_setresgid16(l_gid16_t rgid, \

Modified: head/sys/kern/makesyscalls.sh
==============================================================================
--- head/sys/kern/makesyscalls.sh	Sat Mar 12 07:47:05 2011	(r219558)
+++ head/sys/kern/makesyscalls.sh	Sat Mar 12 08:51:43 2011	(r219559)
@@ -200,6 +200,8 @@ s/\$//g
 		print > syscompat6
 		print > syscompat7
 		print > sysnames
+		print > systrace
+		print > systracetmp
 		savesyscall = syscall
 		next
 	}
@@ -212,6 +214,8 @@ s/\$//g
 		print > syscompat6
 		print > syscompat7
 		print > sysnames
+		print > systrace
+		print > systracetmp
 		syscall = savesyscall
 		next
 	}
@@ -224,6 +228,8 @@ s/\$//g
 		print > syscompat6
 		print > syscompat7
 		print > sysnames
+		print > systrace
+		print > systracetmp
 		next
 	}
 	syscall != $1 {

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 08:58:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EB4D1065677;
	Sat, 12 Mar 2011 08:58:19 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B9F38FC0A;
	Sat, 12 Mar 2011 08:58: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 p2C8wJXV010534;
	Sat, 12 Mar 2011 08:58:19 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2C8wJJM010527;
	Sat, 12 Mar 2011 08:58:19 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103120858.p2C8wJJM010527@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 12 Mar 2011 08:58: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: r219560 - in head/sys: amd64/linux32 compat/freebsd32
	i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 08:58:19 -0000

Author: avg
Date: Sat Mar 12 08:58:19 2011
New Revision: 219560
URL: http://svn.freebsd.org/changeset/base/219560

Log:
  add DTrace systrace support for linux32 and freebsd32 on amd64 syscalls
  
  Regenerate system call and systrace support files.
  
  PR:		kern/152822
  Submitted by:	Artem Belevich 
  Reviewed by:	jhb (earlier version)
  MFC after:	3 weeks

Added:
  head/sys/amd64/linux32/linux32_syscalls.c   (contents, props changed)
  head/sys/amd64/linux32/linux32_systrace_args.c   (contents, props changed)
  head/sys/compat/freebsd32/freebsd32_systrace_args.c   (contents, props changed)
  head/sys/i386/linux/linux_syscalls.c   (contents, props changed)
  head/sys/i386/linux/linux_systrace_args.c   (contents, props changed)
Modified:
  head/sys/amd64/linux32/linux32_proto.h
  head/sys/amd64/linux32/linux32_syscall.h
  head/sys/amd64/linux32/linux32_sysent.c
  head/sys/i386/linux/linux_proto.h
  head/sys/i386/linux/linux_syscall.h
  head/sys/i386/linux/linux_sysent.c

Modified: head/sys/amd64/linux32/linux32_proto.h
==============================================================================
--- head/sys/amd64/linux32/linux32_proto.h	Sat Mar 12 08:51:43 2011	(r219559)
+++ head/sys/amd64/linux32/linux32_proto.h	Sat Mar 12 08:58:19 2011	(r219560)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 218610 2011-02-12 15:33:25Z dchagin 
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 219559 2011-03-12 08:51:43Z avg 
  */
 
 #ifndef _LINUX_SYSPROTO_H_

Modified: head/sys/amd64/linux32/linux32_syscall.h
==============================================================================
--- head/sys/amd64/linux32/linux32_syscall.h	Sat Mar 12 08:51:43 2011	(r219559)
+++ head/sys/amd64/linux32/linux32_syscall.h	Sat Mar 12 08:58:19 2011	(r219560)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 218610 2011-02-12 15:33:25Z dchagin 
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 219559 2011-03-12 08:51:43Z avg 
  */
 
 #define	LINUX_SYS_exit	1

Added: head/sys/amd64/linux32/linux32_syscalls.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/amd64/linux32/linux32_syscalls.c	Sat Mar 12 08:58:19 2011	(r219560)
@@ -0,0 +1,328 @@
+/*
+ * System call names.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 219559 2011-03-12 08:51:43Z avg 
+ */
+
+const char *linux_syscallnames[] = {
+#define	nosys	linux_nosys
+	"#0",			/* 0 = setup */
+	"exit",			/* 1 = exit */
+	"linux_fork",			/* 2 = linux_fork */
+	"read",			/* 3 = read */
+	"write",			/* 4 = write */
+	"linux_open",			/* 5 = linux_open */
+	"close",			/* 6 = close */
+	"linux_waitpid",			/* 7 = linux_waitpid */
+	"linux_creat",			/* 8 = linux_creat */
+	"linux_link",			/* 9 = linux_link */
+	"linux_unlink",			/* 10 = linux_unlink */
+	"linux_execve",			/* 11 = linux_execve */
+	"linux_chdir",			/* 12 = linux_chdir */
+	"linux_time",			/* 13 = linux_time */
+	"linux_mknod",			/* 14 = linux_mknod */
+	"linux_chmod",			/* 15 = linux_chmod */
+	"linux_lchown16",			/* 16 = linux_lchown16 */
+	"#17",			/* 17 = break */
+	"linux_stat",			/* 18 = linux_stat */
+	"linux_lseek",			/* 19 = linux_lseek */
+	"linux_getpid",			/* 20 = linux_getpid */
+	"linux_mount",			/* 21 = linux_mount */
+	"linux_oldumount",			/* 22 = linux_oldumount */
+	"linux_setuid16",			/* 23 = linux_setuid16 */
+	"linux_getuid16",			/* 24 = linux_getuid16 */
+	"linux_stime",			/* 25 = linux_stime */
+	"linux_ptrace",			/* 26 = linux_ptrace */
+	"linux_alarm",			/* 27 = linux_alarm */
+	"#28",			/* 28 = fstat */
+	"linux_pause",			/* 29 = linux_pause */
+	"linux_utime",			/* 30 = linux_utime */
+	"#31",			/* 31 = stty */
+	"#32",			/* 32 = gtty */
+	"linux_access",			/* 33 = linux_access */
+	"linux_nice",			/* 34 = linux_nice */
+	"#35",			/* 35 = ftime */
+	"sync",			/* 36 = sync */
+	"linux_kill",			/* 37 = linux_kill */
+	"linux_rename",			/* 38 = linux_rename */
+	"linux_mkdir",			/* 39 = linux_mkdir */
+	"linux_rmdir",			/* 40 = linux_rmdir */
+	"dup",			/* 41 = dup */
+	"linux_pipe",			/* 42 = linux_pipe */
+	"linux_times",			/* 43 = linux_times */
+	"#44",			/* 44 = prof */
+	"linux_brk",			/* 45 = linux_brk */
+	"linux_setgid16",			/* 46 = linux_setgid16 */
+	"linux_getgid16",			/* 47 = linux_getgid16 */
+	"linux_signal",			/* 48 = linux_signal */
+	"linux_geteuid16",			/* 49 = linux_geteuid16 */
+	"linux_getegid16",			/* 50 = linux_getegid16 */
+	"acct",			/* 51 = acct */
+	"linux_umount",			/* 52 = linux_umount */
+	"#53",			/* 53 = lock */
+	"linux_ioctl",			/* 54 = linux_ioctl */
+	"linux_fcntl",			/* 55 = linux_fcntl */
+	"#56",			/* 56 = mpx */
+	"setpgid",			/* 57 = setpgid */
+	"#58",			/* 58 = ulimit */
+	"linux_olduname",			/* 59 = linux_olduname */
+	"umask",			/* 60 = umask */
+	"chroot",			/* 61 = chroot */
+	"linux_ustat",			/* 62 = linux_ustat */
+	"dup2",			/* 63 = dup2 */
+	"linux_getppid",			/* 64 = linux_getppid */
+	"getpgrp",			/* 65 = getpgrp */
+	"setsid",			/* 66 = setsid */
+	"linux_sigaction",			/* 67 = linux_sigaction */
+	"linux_sgetmask",			/* 68 = linux_sgetmask */
+	"linux_ssetmask",			/* 69 = linux_ssetmask */
+	"linux_setreuid16",			/* 70 = linux_setreuid16 */
+	"linux_setregid16",			/* 71 = linux_setregid16 */
+	"linux_sigsuspend",			/* 72 = linux_sigsuspend */
+	"linux_sigpending",			/* 73 = linux_sigpending */
+	"linux_sethostname",			/* 74 = linux_sethostname */
+	"linux_setrlimit",			/* 75 = linux_setrlimit */
+	"linux_old_getrlimit",			/* 76 = linux_old_getrlimit */
+	"linux_getrusage",			/* 77 = linux_getrusage */
+	"linux_gettimeofday",			/* 78 = linux_gettimeofday */
+	"linux_settimeofday",			/* 79 = linux_settimeofday */
+	"linux_getgroups16",			/* 80 = linux_getgroups16 */
+	"linux_setgroups16",			/* 81 = linux_setgroups16 */
+	"linux_old_select",			/* 82 = linux_old_select */
+	"linux_symlink",			/* 83 = linux_symlink */
+	"linux_lstat",			/* 84 = linux_lstat */
+	"linux_readlink",			/* 85 = linux_readlink */
+	"#86",			/* 86 = linux_uselib */
+	"swapon",			/* 87 = swapon */
+	"linux_reboot",			/* 88 = linux_reboot */
+	"linux_readdir",			/* 89 = linux_readdir */
+	"linux_mmap",			/* 90 = linux_mmap */
+	"munmap",			/* 91 = munmap */
+	"linux_truncate",			/* 92 = linux_truncate */
+	"linux_ftruncate",			/* 93 = linux_ftruncate */
+	"fchmod",			/* 94 = fchmod */
+	"fchown",			/* 95 = fchown */
+	"linux_getpriority",			/* 96 = linux_getpriority */
+	"setpriority",			/* 97 = setpriority */
+	"#98",			/* 98 = profil */
+	"linux_statfs",			/* 99 = linux_statfs */
+	"linux_fstatfs",			/* 100 = linux_fstatfs */
+	"#101",			/* 101 = ioperm */
+	"linux_socketcall",			/* 102 = linux_socketcall */
+	"linux_syslog",			/* 103 = linux_syslog */
+	"linux_setitimer",			/* 104 = linux_setitimer */
+	"linux_getitimer",			/* 105 = linux_getitimer */
+	"linux_newstat",			/* 106 = linux_newstat */
+	"linux_newlstat",			/* 107 = linux_newlstat */
+	"linux_newfstat",			/* 108 = linux_newfstat */
+	"linux_uname",			/* 109 = linux_uname */
+	"linux_iopl",			/* 110 = linux_iopl */
+	"linux_vhangup",			/* 111 = linux_vhangup */
+	"#112",			/* 112 = idle */
+	"#113",			/* 113 = vm86old */
+	"linux_wait4",			/* 114 = linux_wait4 */
+	"linux_swapoff",			/* 115 = linux_swapoff */
+	"linux_sysinfo",			/* 116 = linux_sysinfo */
+	"linux_ipc",			/* 117 = linux_ipc */
+	"fsync",			/* 118 = fsync */
+	"linux_sigreturn",			/* 119 = linux_sigreturn */
+	"linux_clone",			/* 120 = linux_clone */
+	"linux_setdomainname",			/* 121 = linux_setdomainname */
+	"linux_newuname",			/* 122 = linux_newuname */
+	"#123",			/* 123 = modify_ldt */
+	"linux_adjtimex",			/* 124 = linux_adjtimex */
+	"linux_mprotect",			/* 125 = linux_mprotect */
+	"linux_sigprocmask",			/* 126 = linux_sigprocmask */
+	"linux_create_module",			/* 127 = linux_create_module */
+	"linux_init_module",			/* 128 = linux_init_module */
+	"linux_delete_module",			/* 129 = linux_delete_module */
+	"linux_get_kernel_syms",			/* 130 = linux_get_kernel_syms */
+	"linux_quotactl",			/* 131 = linux_quotactl */
+	"getpgid",			/* 132 = getpgid */
+	"fchdir",			/* 133 = fchdir */
+	"linux_bdflush",			/* 134 = linux_bdflush */
+	"linux_sysfs",			/* 135 = linux_sysfs */
+	"linux_personality",			/* 136 = linux_personality */
+	"#137",			/* 137 = afs_syscall */
+	"linux_setfsuid16",			/* 138 = linux_setfsuid16 */
+	"linux_setfsgid16",			/* 139 = linux_setfsgid16 */
+	"linux_llseek",			/* 140 = linux_llseek */
+	"linux_getdents",			/* 141 = linux_getdents */
+	"linux_select",			/* 142 = linux_select */
+	"flock",			/* 143 = flock */
+	"linux_msync",			/* 144 = linux_msync */
+	"linux_readv",			/* 145 = linux_readv */
+	"linux_writev",			/* 146 = linux_writev */
+	"linux_getsid",			/* 147 = linux_getsid */
+	"linux_fdatasync",			/* 148 = linux_fdatasync */
+	"linux_sysctl",			/* 149 = linux_sysctl */
+	"mlock",			/* 150 = mlock */
+	"munlock",			/* 151 = munlock */
+	"mlockall",			/* 152 = mlockall */
+	"munlockall",			/* 153 = munlockall */
+	"sched_setparam",			/* 154 = sched_setparam */
+	"sched_getparam",			/* 155 = sched_getparam */
+	"linux_sched_setscheduler",			/* 156 = linux_sched_setscheduler */
+	"linux_sched_getscheduler",			/* 157 = linux_sched_getscheduler */
+	"sched_yield",			/* 158 = sched_yield */
+	"linux_sched_get_priority_max",			/* 159 = linux_sched_get_priority_max */
+	"linux_sched_get_priority_min",			/* 160 = linux_sched_get_priority_min */
+	"linux_sched_rr_get_interval",			/* 161 = linux_sched_rr_get_interval */
+	"linux_nanosleep",			/* 162 = linux_nanosleep */
+	"linux_mremap",			/* 163 = linux_mremap */
+	"linux_setresuid16",			/* 164 = linux_setresuid16 */
+	"linux_getresuid16",			/* 165 = linux_getresuid16 */
+	"#166",			/* 166 = vm86 */
+	"linux_query_module",			/* 167 = linux_query_module */
+	"poll",			/* 168 = poll */
+	"linux_nfsservctl",			/* 169 = linux_nfsservctl */
+	"linux_setresgid16",			/* 170 = linux_setresgid16 */
+	"linux_getresgid16",			/* 171 = linux_getresgid16 */
+	"linux_prctl",			/* 172 = linux_prctl */
+	"linux_rt_sigreturn",			/* 173 = linux_rt_sigreturn */
+	"linux_rt_sigaction",			/* 174 = linux_rt_sigaction */
+	"linux_rt_sigprocmask",			/* 175 = linux_rt_sigprocmask */
+	"linux_rt_sigpending",			/* 176 = linux_rt_sigpending */
+	"linux_rt_sigtimedwait",			/* 177 = linux_rt_sigtimedwait */
+	"linux_rt_sigqueueinfo",			/* 178 = linux_rt_sigqueueinfo */
+	"linux_rt_sigsuspend",			/* 179 = linux_rt_sigsuspend */
+	"linux_pread",			/* 180 = linux_pread */
+	"linux_pwrite",			/* 181 = linux_pwrite */
+	"linux_chown16",			/* 182 = linux_chown16 */
+	"linux_getcwd",			/* 183 = linux_getcwd */
+	"linux_capget",			/* 184 = linux_capget */
+	"linux_capset",			/* 185 = linux_capset */
+	"linux_sigaltstack",			/* 186 = linux_sigaltstack */
+	"linux_sendfile",			/* 187 = linux_sendfile */
+	"#188",			/* 188 = getpmsg */
+	"#189",			/* 189 = putpmsg */
+	"linux_vfork",			/* 190 = linux_vfork */
+	"linux_getrlimit",			/* 191 = linux_getrlimit */
+	"linux_mmap2",			/* 192 = linux_mmap2 */
+	"linux_truncate64",			/* 193 = linux_truncate64 */
+	"linux_ftruncate64",			/* 194 = linux_ftruncate64 */
+	"linux_stat64",			/* 195 = linux_stat64 */
+	"linux_lstat64",			/* 196 = linux_lstat64 */
+	"linux_fstat64",			/* 197 = linux_fstat64 */
+	"linux_lchown",			/* 198 = linux_lchown */
+	"linux_getuid",			/* 199 = linux_getuid */
+	"linux_getgid",			/* 200 = linux_getgid */
+	"geteuid",			/* 201 = geteuid */
+	"getegid",			/* 202 = getegid */
+	"setreuid",			/* 203 = setreuid */
+	"setregid",			/* 204 = setregid */
+	"linux_getgroups",			/* 205 = linux_getgroups */
+	"linux_setgroups",			/* 206 = linux_setgroups */
+	"fchown",			/* 207 = fchown */
+	"setresuid",			/* 208 = setresuid */
+	"getresuid",			/* 209 = getresuid */
+	"setresgid",			/* 210 = setresgid */
+	"getresgid",			/* 211 = getresgid */
+	"linux_chown",			/* 212 = linux_chown */
+	"setuid",			/* 213 = setuid */
+	"setgid",			/* 214 = setgid */
+	"linux_setfsuid",			/* 215 = linux_setfsuid */
+	"linux_setfsgid",			/* 216 = linux_setfsgid */
+	"linux_pivot_root",			/* 217 = linux_pivot_root */
+	"linux_mincore",			/* 218 = linux_mincore */
+	"madvise",			/* 219 = madvise */
+	"linux_getdents64",			/* 220 = linux_getdents64 */
+	"linux_fcntl64",			/* 221 = linux_fcntl64 */
+	"#222",			/* 222 =  */
+	"#223",			/* 223 =  */
+	"linux_gettid",			/* 224 = linux_gettid */
+	"#225",			/* 225 = linux_readahead */
+	"linux_setxattr",			/* 226 = linux_setxattr */
+	"linux_lsetxattr",			/* 227 = linux_lsetxattr */
+	"linux_fsetxattr",			/* 228 = linux_fsetxattr */
+	"linux_getxattr",			/* 229 = linux_getxattr */
+	"linux_lgetxattr",			/* 230 = linux_lgetxattr */
+	"linux_fgetxattr",			/* 231 = linux_fgetxattr */
+	"linux_listxattr",			/* 232 = linux_listxattr */
+	"linux_llistxattr",			/* 233 = linux_llistxattr */
+	"linux_flistxattr",			/* 234 = linux_flistxattr */
+	"linux_removexattr",			/* 235 = linux_removexattr */
+	"linux_lremovexattr",			/* 236 = linux_lremovexattr */
+	"linux_fremovexattr",			/* 237 = linux_fremovexattr */
+	"linux_tkill",			/* 238 = linux_tkill */
+	"#239",			/* 239 = linux_sendfile64 */
+	"linux_sys_futex",			/* 240 = linux_sys_futex */
+	"linux_sched_setaffinity",			/* 241 = linux_sched_setaffinity */
+	"linux_sched_getaffinity",			/* 242 = linux_sched_getaffinity */
+	"linux_set_thread_area",			/* 243 = linux_set_thread_area */
+	"#244",			/* 244 = linux_get_thread_area */
+	"#245",			/* 245 = linux_io_setup */
+	"#246",			/* 246 = linux_io_destroy */
+	"#247",			/* 247 = linux_io_getevents */
+	"#248",			/* 248 = linux_io_submit */
+	"#249",			/* 249 = linux_io_cancel */
+	"linux_fadvise64",			/* 250 = linux_fadvise64 */
+	"#251",			/* 251 =  */
+	"linux_exit_group",			/* 252 = linux_exit_group */
+	"linux_lookup_dcookie",			/* 253 = linux_lookup_dcookie */
+	"linux_epoll_create",			/* 254 = linux_epoll_create */
+	"linux_epoll_ctl",			/* 255 = linux_epoll_ctl */
+	"linux_epoll_wait",			/* 256 = linux_epoll_wait */
+	"linux_remap_file_pages",			/* 257 = linux_remap_file_pages */
+	"linux_set_tid_address",			/* 258 = linux_set_tid_address */
+	"linux_timer_create",			/* 259 = linux_timer_create */
+	"linux_timer_settime",			/* 260 = linux_timer_settime */
+	"linux_timer_gettime",			/* 261 = linux_timer_gettime */
+	"linux_timer_getoverrun",			/* 262 = linux_timer_getoverrun */
+	"linux_timer_delete",			/* 263 = linux_timer_delete */
+	"linux_clock_settime",			/* 264 = linux_clock_settime */
+	"linux_clock_gettime",			/* 265 = linux_clock_gettime */
+	"linux_clock_getres",			/* 266 = linux_clock_getres */
+	"linux_clock_nanosleep",			/* 267 = linux_clock_nanosleep */
+	"linux_statfs64",			/* 268 = linux_statfs64 */
+	"linux_fstatfs64",			/* 269 = linux_fstatfs64 */
+	"linux_tgkill",			/* 270 = linux_tgkill */
+	"linux_utimes",			/* 271 = linux_utimes */
+	"linux_fadvise64_64",			/* 272 = linux_fadvise64_64 */
+	"#273",			/* 273 =  */
+	"linux_mbind",			/* 274 = linux_mbind */
+	"linux_get_mempolicy",			/* 275 = linux_get_mempolicy */
+	"linux_set_mempolicy",			/* 276 = linux_set_mempolicy */
+	"linux_mq_open",			/* 277 = linux_mq_open */
+	"linux_mq_unlink",			/* 278 = linux_mq_unlink */
+	"linux_mq_timedsend",			/* 279 = linux_mq_timedsend */
+	"linux_mq_timedreceive",			/* 280 = linux_mq_timedreceive */
+	"linux_mq_notify",			/* 281 = linux_mq_notify */
+	"linux_mq_getsetattr",			/* 282 = linux_mq_getsetattr */
+	"linux_kexec_load",			/* 283 = linux_kexec_load */
+	"linux_waitid",			/* 284 = linux_waitid */
+	"#285",			/* 285 =  */
+	"linux_add_key",			/* 286 = linux_add_key */
+	"linux_request_key",			/* 287 = linux_request_key */
+	"linux_keyctl",			/* 288 = linux_keyctl */
+	"linux_ioprio_set",			/* 289 = linux_ioprio_set */
+	"linux_ioprio_get",			/* 290 = linux_ioprio_get */
+	"linux_inotify_init",			/* 291 = linux_inotify_init */
+	"linux_inotify_add_watch",			/* 292 = linux_inotify_add_watch */
+	"linux_inotify_rm_watch",			/* 293 = linux_inotify_rm_watch */
+	"linux_migrate_pages",			/* 294 = linux_migrate_pages */
+	"linux_openat",			/* 295 = linux_openat */
+	"linux_mkdirat",			/* 296 = linux_mkdirat */
+	"linux_mknodat",			/* 297 = linux_mknodat */
+	"linux_fchownat",			/* 298 = linux_fchownat */
+	"linux_futimesat",			/* 299 = linux_futimesat */
+	"linux_fstatat64",			/* 300 = linux_fstatat64 */
+	"linux_unlinkat",			/* 301 = linux_unlinkat */
+	"linux_renameat",			/* 302 = linux_renameat */
+	"linux_linkat",			/* 303 = linux_linkat */
+	"linux_symlinkat",			/* 304 = linux_symlinkat */
+	"linux_readlinkat",			/* 305 = linux_readlinkat */
+	"linux_fchmodat",			/* 306 = linux_fchmodat */
+	"linux_faccessat",			/* 307 = linux_faccessat */
+	"linux_pselect6",			/* 308 = linux_pselect6 */
+	"linux_ppoll",			/* 309 = linux_ppoll */
+	"linux_unshare",			/* 310 = linux_unshare */
+	"linux_set_robust_list",			/* 311 = linux_set_robust_list */
+	"linux_get_robust_list",			/* 312 = linux_get_robust_list */
+	"linux_splice",			/* 313 = linux_splice */
+	"linux_sync_file_range",			/* 314 = linux_sync_file_range */
+	"linux_tee",			/* 315 = linux_tee */
+	"linux_vmsplice",			/* 316 = linux_vmsplice */
+};

Modified: head/sys/amd64/linux32/linux32_sysent.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysent.c	Sat Mar 12 08:51:43 2011	(r219559)
+++ head/sys/amd64/linux32/linux32_sysent.c	Sat Mar 12 08:58:19 2011	(r219560)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 218610 2011-02-12 15:33:25Z dchagin 
+ * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 219559 2011-03-12 08:51:43Z avg 
  */
 
 #include "opt_compat.h"

Added: head/sys/amd64/linux32/linux32_systrace_args.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/amd64/linux32/linux32_systrace_args.c	Sat Mar 12 08:58:19 2011	(r219560)
@@ -0,0 +1,5100 @@
+/*
+ * System call argument to DTrace register array converstion.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * This file is part of the DTrace syscall provider.
+ */
+
+static void
+systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
+{
+	int64_t *iarg  = (int64_t *) uarg;
+	switch (sysnum) {
+#define	nosys	linux_nosys
+	/* sys_exit */
+	case 1: {
+		struct sys_exit_args *p = params;
+		iarg[0] = p->rval; /* int */
+		*n_args = 1;
+		break;
+	}
+	/* linux_fork */
+	case 2: {
+		*n_args = 0;
+		break;
+	}
+	/* read */
+	case 3: {
+		struct read_args *p = params;
+		iarg[0] = p->fd; /* int */
+		uarg[1] = (intptr_t) p->buf; /* char * */
+		uarg[2] = p->nbyte; /* u_int */
+		*n_args = 3;
+		break;
+	}
+	/* write */
+	case 4: {
+		struct write_args *p = params;
+		iarg[0] = p->fd; /* int */
+		uarg[1] = (intptr_t) p->buf; /* char * */
+		uarg[2] = p->nbyte; /* u_int */
+		*n_args = 3;
+		break;
+	}
+	/* linux_open */
+	case 5: {
+		struct linux_open_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->flags; /* l_int */
+		iarg[2] = p->mode; /* l_int */
+		*n_args = 3;
+		break;
+	}
+	/* close */
+	case 6: {
+		struct close_args *p = params;
+		iarg[0] = p->fd; /* int */
+		*n_args = 1;
+		break;
+	}
+	/* linux_waitpid */
+	case 7: {
+		struct linux_waitpid_args *p = params;
+		iarg[0] = p->pid; /* l_pid_t */
+		uarg[1] = (intptr_t) p->status; /* l_int * */
+		iarg[2] = p->options; /* l_int */
+		*n_args = 3;
+		break;
+	}
+	/* linux_creat */
+	case 8: {
+		struct linux_creat_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->mode; /* l_int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_link */
+	case 9: {
+		struct linux_link_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		uarg[1] = (intptr_t) p->to; /* char * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_unlink */
+	case 10: {
+		struct linux_unlink_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_execve */
+	case 11: {
+		struct linux_execve_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		uarg[1] = (intptr_t) p->argp; /* u_int32_t * */
+		uarg[2] = (intptr_t) p->envp; /* u_int32_t * */
+		*n_args = 3;
+		break;
+	}
+	/* linux_chdir */
+	case 12: {
+		struct linux_chdir_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_time */
+	case 13: {
+		struct linux_time_args *p = params;
+		uarg[0] = (intptr_t) p->tm; /* l_time_t * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_mknod */
+	case 14: {
+		struct linux_mknod_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->mode; /* l_int */
+		iarg[2] = p->dev; /* l_dev_t */
+		*n_args = 3;
+		break;
+	}
+	/* linux_chmod */
+	case 15: {
+		struct linux_chmod_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->mode; /* l_mode_t */
+		*n_args = 2;
+		break;
+	}
+	/* linux_lchown16 */
+	case 16: {
+		struct linux_lchown16_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->uid; /* l_uid16_t */
+		iarg[2] = p->gid; /* l_gid16_t */
+		*n_args = 3;
+		break;
+	}
+	/* linux_stat */
+	case 18: {
+		struct linux_stat_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		uarg[1] = (intptr_t) p->up; /* struct linux_stat * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_lseek */
+	case 19: {
+		struct linux_lseek_args *p = params;
+		iarg[0] = p->fdes; /* l_uint */
+		iarg[1] = p->off; /* l_off_t */
+		iarg[2] = p->whence; /* l_int */
+		*n_args = 3;
+		break;
+	}
+	/* linux_getpid */
+	case 20: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_mount */
+	case 21: {
+		struct linux_mount_args *p = params;
+		uarg[0] = (intptr_t) p->specialfile; /* char * */
+		uarg[1] = (intptr_t) p->dir; /* char * */
+		uarg[2] = (intptr_t) p->filesystemtype; /* char * */
+		iarg[3] = p->rwflag; /* l_ulong */
+		uarg[4] = (intptr_t) p->data; /* void * */
+		*n_args = 5;
+		break;
+	}
+	/* linux_oldumount */
+	case 22: {
+		struct linux_oldumount_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_setuid16 */
+	case 23: {
+		struct linux_setuid16_args *p = params;
+		iarg[0] = p->uid; /* l_uid16_t */
+		*n_args = 1;
+		break;
+	}
+	/* linux_getuid16 */
+	case 24: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_stime */
+	case 25: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_ptrace */
+	case 26: {
+		struct linux_ptrace_args *p = params;
+		iarg[0] = p->req; /* l_long */
+		iarg[1] = p->pid; /* l_long */
+		iarg[2] = p->addr; /* l_long */
+		iarg[3] = p->data; /* l_long */
+		*n_args = 4;
+		break;
+	}
+	/* linux_alarm */
+	case 27: {
+		struct linux_alarm_args *p = params;
+		iarg[0] = p->secs; /* l_uint */
+		*n_args = 1;
+		break;
+	}
+	/* linux_pause */
+	case 29: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_utime */
+	case 30: {
+		struct linux_utime_args *p = params;
+		uarg[0] = (intptr_t) p->fname; /* char * */
+		uarg[1] = (intptr_t) p->times; /* struct l_utimbuf * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_access */
+	case 33: {
+		struct linux_access_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->flags; /* l_int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_nice */
+	case 34: {
+		struct linux_nice_args *p = params;
+		iarg[0] = p->inc; /* l_int */
+		*n_args = 1;
+		break;
+	}
+	/* sync */
+	case 36: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_kill */
+	case 37: {
+		struct linux_kill_args *p = params;
+		iarg[0] = p->pid; /* l_int */
+		iarg[1] = p->signum; /* l_int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_rename */
+	case 38: {
+		struct linux_rename_args *p = params;
+		uarg[0] = (intptr_t) p->from; /* char * */
+		uarg[1] = (intptr_t) p->to; /* char * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_mkdir */
+	case 39: {
+		struct linux_mkdir_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->mode; /* l_int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_rmdir */
+	case 40: {
+		struct linux_rmdir_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		*n_args = 1;
+		break;
+	}
+	/* dup */
+	case 41: {
+		struct dup_args *p = params;
+		uarg[0] = p->fd; /* u_int */
+		*n_args = 1;
+		break;
+	}
+	/* linux_pipe */
+	case 42: {
+		struct linux_pipe_args *p = params;
+		uarg[0] = (intptr_t) p->pipefds; /* l_ulong * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_times */
+	case 43: {
+		struct linux_times_args *p = params;
+		uarg[0] = (intptr_t) p->buf; /* struct l_times_argv * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_brk */
+	case 45: {
+		struct linux_brk_args *p = params;
+		iarg[0] = p->dsend; /* l_ulong */
+		*n_args = 1;
+		break;
+	}
+	/* linux_setgid16 */
+	case 46: {
+		struct linux_setgid16_args *p = params;
+		iarg[0] = p->gid; /* l_gid16_t */
+		*n_args = 1;
+		break;
+	}
+	/* linux_getgid16 */
+	case 47: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_signal */
+	case 48: {
+		struct linux_signal_args *p = params;
+		iarg[0] = p->sig; /* l_int */
+		iarg[1] = p->handler; /* l_handler_t */
+		*n_args = 2;
+		break;
+	}
+	/* linux_geteuid16 */
+	case 49: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_getegid16 */
+	case 50: {
+		*n_args = 0;
+		break;
+	}
+	/* acct */
+	case 51: {
+		struct acct_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_umount */
+	case 52: {
+		struct linux_umount_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->flags; /* l_int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_ioctl */
+	case 54: {
+		struct linux_ioctl_args *p = params;
+		iarg[0] = p->fd; /* l_uint */
+		iarg[1] = p->cmd; /* l_uint */
+		uarg[2] = p->arg; /* uintptr_t */
+		*n_args = 3;
+		break;
+	}
+	/* linux_fcntl */
+	case 55: {
+		struct linux_fcntl_args *p = params;
+		iarg[0] = p->fd; /* l_uint */
+		iarg[1] = p->cmd; /* l_uint */
+		uarg[2] = p->arg; /* uintptr_t */
+		*n_args = 3;
+		break;
+	}
+	/* setpgid */
+	case 57: {
+		struct setpgid_args *p = params;
+		iarg[0] = p->pid; /* int */
+		iarg[1] = p->pgid; /* int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_olduname */
+	case 59: {
+		*n_args = 0;
+		break;
+	}
+	/* umask */
+	case 60: {
+		struct umask_args *p = params;
+		iarg[0] = p->newmask; /* int */
+		*n_args = 1;
+		break;
+	}
+	/* chroot */
+	case 61: {
+		struct chroot_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_ustat */
+	case 62: {
+		struct linux_ustat_args *p = params;
+		iarg[0] = p->dev; /* l_dev_t */
+		uarg[1] = (intptr_t) p->ubuf; /* struct l_ustat * */
+		*n_args = 2;
+		break;
+	}
+	/* dup2 */
+	case 63: {
+		struct dup2_args *p = params;
+		uarg[0] = p->from; /* u_int */
+		uarg[1] = p->to; /* u_int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_getppid */
+	case 64: {
+		*n_args = 0;
+		break;
+	}
+	/* getpgrp */
+	case 65: {
+		*n_args = 0;
+		break;
+	}
+	/* setsid */
+	case 66: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_sigaction */
+	case 67: {
+		struct linux_sigaction_args *p = params;
+		iarg[0] = p->sig; /* l_int */
+		uarg[1] = (intptr_t) p->nsa; /* l_osigaction_t * */
+		uarg[2] = (intptr_t) p->osa; /* l_osigaction_t * */
+		*n_args = 3;
+		break;
+	}
+	/* linux_sgetmask */
+	case 68: {
+		*n_args = 0;
+		break;
+	}
+	/* linux_ssetmask */
+	case 69: {
+		struct linux_ssetmask_args *p = params;
+		iarg[0] = p->mask; /* l_osigset_t */
+		*n_args = 1;
+		break;
+	}
+	/* linux_setreuid16 */
+	case 70: {
+		struct linux_setreuid16_args *p = params;
+		iarg[0] = p->ruid; /* l_uid16_t */
+		iarg[1] = p->euid; /* l_uid16_t */
+		*n_args = 2;
+		break;
+	}
+	/* linux_setregid16 */
+	case 71: {
+		struct linux_setregid16_args *p = params;
+		iarg[0] = p->rgid; /* l_gid16_t */
+		iarg[1] = p->egid; /* l_gid16_t */
+		*n_args = 2;
+		break;
+	}
+	/* linux_sigsuspend */
+	case 72: {
+		struct linux_sigsuspend_args *p = params;
+		iarg[0] = p->hist0; /* l_int */
+		iarg[1] = p->hist1; /* l_int */
+		iarg[2] = p->mask; /* l_osigset_t */
+		*n_args = 3;
+		break;
+	}
+	/* linux_sigpending */
+	case 73: {
+		struct linux_sigpending_args *p = params;
+		uarg[0] = (intptr_t) p->mask; /* l_osigset_t * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_sethostname */
+	case 74: {
+		struct linux_sethostname_args *p = params;
+		uarg[0] = (intptr_t) p->hostname; /* char * */
+		uarg[1] = p->len; /* u_int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_setrlimit */
+	case 75: {
+		struct linux_setrlimit_args *p = params;
+		iarg[0] = p->resource; /* l_uint */
+		uarg[1] = (intptr_t) p->rlim; /* struct l_rlimit * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_old_getrlimit */
+	case 76: {
+		struct linux_old_getrlimit_args *p = params;
+		iarg[0] = p->resource; /* l_uint */
+		uarg[1] = (intptr_t) p->rlim; /* struct l_rlimit * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_getrusage */
+	case 77: {
+		struct linux_getrusage_args *p = params;
+		iarg[0] = p->who; /* int */
+		uarg[1] = (intptr_t) p->rusage; /* struct l_rusage * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_gettimeofday */
+	case 78: {
+		struct linux_gettimeofday_args *p = params;
+		uarg[0] = (intptr_t) p->tp; /* struct l_timeval * */
+		uarg[1] = (intptr_t) p->tzp; /* struct timezone * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_settimeofday */
+	case 79: {
+		struct linux_settimeofday_args *p = params;
+		uarg[0] = (intptr_t) p->tp; /* struct l_timeval * */
+		uarg[1] = (intptr_t) p->tzp; /* struct timezone * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_getgroups16 */
+	case 80: {
+		struct linux_getgroups16_args *p = params;
+		iarg[0] = p->gidsetsize; /* l_uint */
+		uarg[1] = (intptr_t) p->gidset; /* l_gid16_t * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_setgroups16 */
+	case 81: {
+		struct linux_setgroups16_args *p = params;
+		iarg[0] = p->gidsetsize; /* l_uint */
+		uarg[1] = (intptr_t) p->gidset; /* l_gid16_t * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_old_select */
+	case 82: {
+		struct linux_old_select_args *p = params;
+		uarg[0] = (intptr_t) p->ptr; /* struct l_old_select_argv * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_symlink */
+	case 83: {
+		struct linux_symlink_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		uarg[1] = (intptr_t) p->to; /* char * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_lstat */
+	case 84: {
+		struct linux_lstat_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		uarg[1] = (intptr_t) p->up; /* struct linux_lstat * */
+		*n_args = 2;
+		break;
+	}
+	/* linux_readlink */
+	case 85: {
+		struct linux_readlink_args *p = params;
+		uarg[0] = (intptr_t) p->name; /* char * */
+		uarg[1] = (intptr_t) p->buf; /* char * */
+		iarg[2] = p->count; /* l_int */
+		*n_args = 3;
+		break;
+	}
+	/* swapon */
+	case 87: {
+		struct swapon_args *p = params;
+		uarg[0] = (intptr_t) p->name; /* char * */
+		*n_args = 1;
+		break;
+	}
+	/* linux_reboot */
+	case 88: {
+		struct linux_reboot_args *p = params;
+		iarg[0] = p->magic1; /* l_int */
+		iarg[1] = p->magic2; /* l_int */
+		iarg[2] = p->cmd; /* l_uint */
+		uarg[3] = (intptr_t) p->arg; /* void * */
+		*n_args = 4;
+		break;
+	}
+	/* linux_readdir */
+	case 89: {
+		struct linux_readdir_args *p = params;
+		iarg[0] = p->fd; /* l_uint */
+		uarg[1] = (intptr_t) p->dent; /* struct l_dirent * */
+		iarg[2] = p->count; /* l_uint */
+		*n_args = 3;
+		break;
+	}
+	/* linux_mmap */
+	case 90: {
+		struct linux_mmap_args *p = params;
+		uarg[0] = (intptr_t) p->ptr; /* struct l_mmap_argv * */
+		*n_args = 1;
+		break;
+	}
+	/* munmap */
+	case 91: {
+		struct munmap_args *p = params;
+		uarg[0] = (intptr_t) p->addr; /* caddr_t */
+		iarg[1] = p->len; /* int */
+		*n_args = 2;
+		break;
+	}
+	/* linux_truncate */
+	case 92: {
+		struct linux_truncate_args *p = params;
+		uarg[0] = (intptr_t) p->path; /* char * */
+		iarg[1] = p->length; /* l_ulong */
+		*n_args = 2;
+		break;
+	}
+	/* linux_ftruncate */
+	case 93: {
+		struct linux_ftruncate_args *p = params;
+		iarg[0] = p->fd; /* int */
+		iarg[1] = p->length; /* long */
+		*n_args = 2;
+		break;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 09:09:26 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 36A73106566B;
	Sat, 12 Mar 2011 09:09:26 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 222698FC1A;
	Sat, 12 Mar 2011 09:09: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 p2C99Qu3010790;
	Sat, 12 Mar 2011 09:09:26 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2C99P2j010783;
	Sat, 12 Mar 2011 09:09:25 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201103120909.p2C99P2j010783@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 12 Mar 2011 09:09: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: r219561 - in head/sys: cddl/dev/systrace modules/dtrace
	modules/dtrace/dtraceall modules/dtrace/systrace_freebsd32
	modules/dtrace/systrace_linux32
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 09:09:26 -0000

Author: avg
Date: Sat Mar 12 09:09:25 2011
New Revision: 219561
URL: http://svn.freebsd.org/changeset/base/219561

Log:
  add DTrace systrace support for linux32 and freebsd32 on amd64 syscalls
  
  Add systrace_linux32 and systrace_freebsd32 modules which provide
  support for tracing compat system calls in addition to native system
  call tracing provided by systrace module.
  
  Provided that all the systrace modules are loaded now you can select
  what syscalls to trace in the following manner:
  
  syscall::xxx:yyy - work on all system calls that match the specification
  syscall:freebsd:xxx:yyy - only native system calls
  syscall:linux32:xxx:yyy - linux32 compat system calls
  syscall:freebsd32:xxx:yyy - freebsd32 compat system calls on amd64
  
  PR:		kern/152822
  Submitted by:	Artem Belevich 
  Reviewed by:	jhb (earlier version)
  MFC after:	3 weeks

Added:
  head/sys/modules/dtrace/systrace_freebsd32/
  head/sys/modules/dtrace/systrace_freebsd32/Makefile   (contents, props changed)
  head/sys/modules/dtrace/systrace_linux32/
  head/sys/modules/dtrace/systrace_linux32/Makefile   (contents, props changed)
Modified:
  head/sys/cddl/dev/systrace/systrace.c
  head/sys/modules/dtrace/Makefile
  head/sys/modules/dtrace/dtraceall/Makefile
  head/sys/modules/dtrace/dtraceall/dtraceall.c

Modified: head/sys/cddl/dev/systrace/systrace.c
==============================================================================
--- head/sys/cddl/dev/systrace/systrace.c	Sat Mar 12 08:58:19 2011	(r219560)
+++ head/sys/cddl/dev/systrace/systrace.c	Sat Mar 12 09:09:25 2011	(r219561)
@@ -59,17 +59,38 @@
 #include 
 
 #ifdef LINUX_SYSTRACE
-#include 
-#include 
-#include 
-#include 
-#include 
+#if defined(__amd64__)
+#include 
+#include 
+#include 
+#include 
+#elif defined(__i386__)
+#include 
+#include 
+#include 
+#include 
+#else
+#error Only i386 and amd64 are supported.
+#endif
 extern struct sysent linux_sysent[];
-#define	DEVNAME		"dtrace/linsystrace"
-#define	PROVNAME	"linsyscall"
+#define	MODNAME		"linux32"
 #define	MAXSYSCALL	LINUX_SYS_MAXSYSCALL
 #define	SYSCALLNAMES	linux_syscallnames
 #define	SYSENT		linux_sysent
+#elif defined(FREEBSD32_SYSTRACE)
+/*
+ * The syscall arguments are processed into a DTrace argument array
+ * using a generated function. See sys/kern/makesyscalls.sh.
+ */
+#include 
+#include 
+#include 
+#include 
+extern const char *freebsd32_syscallnames[];
+#define	MODNAME		"freebsd32"
+#define	MAXSYSCALL	FREEBSD32_SYS_MAXSYSCALL
+#define	SYSCALLNAMES	freebsd32_syscallnames
+#define	SYSENT		freebsd32_sysent
 #else
 /*
  * The syscall arguments are processed into a DTrace argument array
@@ -77,13 +98,15 @@ extern struct sysent linux_sysent[];
  */
 #include 
 #include 
-#define	DEVNAME		"dtrace/systrace"
-#define	PROVNAME	"syscall"
+#define	MODNAME		"freebsd"
 #define	MAXSYSCALL	SYS_MAXSYSCALL
 #define	SYSCALLNAMES	syscallnames
 #define	SYSENT		sysent
 #endif
 
+#define	PROVNAME	"syscall"
+#define	DEVNAME	        "dtrace/systrace/" MODNAME
+
 #define	SYSTRACE_ARTIFICIAL_FRAMES	1
 
 #define	SYSTRACE_SHIFT			16
@@ -214,14 +237,14 @@ systrace_provide(void *arg, dtrace_probe
 		return;
 
 	for (i = 0; i < MAXSYSCALL; i++) {
-		if (dtrace_probe_lookup(systrace_id, NULL,
+		if (dtrace_probe_lookup(systrace_id, MODNAME,
 		    uglyhack.pp_syscallnames[i], "entry") != 0)
 			continue;
 
-		(void) dtrace_probe_create(systrace_id, NULL, uglyhack.pp_syscallnames[i],
+		(void) dtrace_probe_create(systrace_id, MODNAME, uglyhack.pp_syscallnames[i],
 		    "entry", SYSTRACE_ARTIFICIAL_FRAMES,
 		    (void *)((uintptr_t)SYSTRACE_ENTRY(i)));
-		(void) dtrace_probe_create(systrace_id, NULL, uglyhack.pp_syscallnames[i],
+		(void) dtrace_probe_create(systrace_id, MODNAME, uglyhack.pp_syscallnames[i],
 		    "return", SYSTRACE_ARTIFICIAL_FRAMES,
 		    (void *)((uintptr_t)SYSTRACE_RETURN(i)));
 	}
@@ -335,12 +358,16 @@ SYSINIT(systrace_load, SI_SUB_DTRACE_PRO
 SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_unload, NULL);
 
 #ifdef LINUX_SYSTRACE
-DEV_MODULE(linsystrace, systrace_modevent, NULL);
-MODULE_VERSION(linsystrace, 1);
-MODULE_DEPEND(linsystrace, linux, 1, 1, 1);
-MODULE_DEPEND(linsystrace, systrace, 1, 1, 1);
-MODULE_DEPEND(linsystrace, dtrace, 1, 1, 1);
-MODULE_DEPEND(linsystrace, opensolaris, 1, 1, 1);
+DEV_MODULE(systrace_linux32, systrace_modevent, NULL);
+MODULE_VERSION(systrace_linux32, 1);
+MODULE_DEPEND(systrace_linux32, linux, 1, 1, 1);
+MODULE_DEPEND(systrace_linux32, dtrace, 1, 1, 1);
+MODULE_DEPEND(systrace_linux32, opensolaris, 1, 1, 1);
+#elif defined(FREEBSD32_SYSTRACE)
+DEV_MODULE(systrace_freebsd32, systrace_modevent, NULL);
+MODULE_VERSION(systrace_freebsd32, 1);
+MODULE_DEPEND(systrace_freebsd32, dtrace, 1, 1, 1);
+MODULE_DEPEND(systrace_freebsd32, opensolaris, 1, 1, 1);
 #else
 DEV_MODULE(systrace, systrace_modevent, NULL);
 MODULE_VERSION(systrace, 1);

Modified: head/sys/modules/dtrace/Makefile
==============================================================================
--- head/sys/modules/dtrace/Makefile	Sat Mar 12 08:58:19 2011	(r219560)
+++ head/sys/modules/dtrace/Makefile	Sat Mar 12 09:09:25 2011	(r219561)
@@ -15,7 +15,10 @@ SUBDIR=		dtmalloc	\
 		systrace
 
 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
-SUBDIR+=	fasttrap fbt
+SUBDIR+=	fasttrap fbt systrace_linux32
+.endif
+.if ${MACHINE_CPUARCH} == "amd64"
+SUBDIR+=	systrace_freebsd32
 .endif
 
 .include 

Modified: head/sys/modules/dtrace/dtraceall/Makefile
==============================================================================
--- head/sys/modules/dtrace/dtraceall/Makefile	Sat Mar 12 08:58:19 2011	(r219560)
+++ head/sys/modules/dtrace/dtraceall/Makefile	Sat Mar 12 09:09:25 2011	(r219561)
@@ -1,8 +1,15 @@
 # $FreeBSD$
 
 KMOD=		dtraceall
-SRCS=		dtraceall.c
+SRCS=		dtraceall.c opt_compat.h
 
 CFLAGS+=	-I${.CURDIR}/../../..
 
+.if !defined(KERNBUILDDIR)
+opt_compat.h:
+.if ${MACHINE_ARCH} == "amd64"
+	echo "#define COMPAT_FREEBSD32 1" >> ${.TARGET}
+.endif
+.endif
+
 .include 

Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c
==============================================================================
--- head/sys/modules/dtrace/dtraceall/dtraceall.c	Sat Mar 12 08:58:19 2011	(r219560)
+++ head/sys/modules/dtrace/dtraceall/dtraceall.c	Sat Mar 12 09:09:25 2011	(r219561)
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include "opt_compat.h"
 
 static int
 dtraceall_modevent(module_t mod __unused, int type, void *data __unused)
@@ -73,4 +74,7 @@ MODULE_DEPEND(dtraceall, fasttrap, 1, 1,
 MODULE_DEPEND(dtraceall, lockstat, 1, 1, 1);
 MODULE_DEPEND(dtraceall, sdt, 1, 1, 1);
 MODULE_DEPEND(dtraceall, systrace, 1, 1, 1);
+#if defined(COMPAT_FREEBSD32)
+MODULE_DEPEND(dtraceall, systrace_freebsd32, 1, 1, 1);
+#endif
 MODULE_DEPEND(dtraceall, profile, 1, 1, 1);

Added: head/sys/modules/dtrace/systrace_freebsd32/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/dtrace/systrace_freebsd32/Makefile	Sat Mar 12 09:09:25 2011	(r219561)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../cddl/dev/systrace
+
+KMOD=		systrace_freebsd32
+SRCS=		systrace.c
+SRCS+=		vnode_if.h
+
+CFLAGS+=	-I${.CURDIR}/../../../cddl/compat/opensolaris \
+		-I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
+		-I${.CURDIR}/../../.. -DFREEBSD32_SYSTRACE
+
+.include 

Added: head/sys/modules/dtrace/systrace_linux32/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/dtrace/systrace_linux32/Makefile	Sat Mar 12 09:09:25 2011	(r219561)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../cddl/dev/systrace
+
+KMOD=		systrace_linux32
+SRCS=		systrace.c
+SRCS+=		vnode_if.h
+
+CFLAGS+=	-I${.CURDIR}/../../../cddl/compat/opensolaris \
+		-I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
+		-I${.CURDIR}/../../.. -DLINUX_SYSTRACE
+
+.include 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 09:41:26 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5376F1065679;
	Sat, 12 Mar 2011 09:41:26 +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 27CEA8FC13;
	Sat, 12 Mar 2011 09:41: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 p2C9fQS5011447;
	Sat, 12 Mar 2011 09:41:26 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2C9fQdd011445;
	Sat, 12 Mar 2011 09:41:26 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103120941.p2C9fQdd011445@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 12 Mar 2011 09:41: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: r219562 - head/sys/netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 09:41:26 -0000

Author: bz
Date: Sat Mar 12 09:41:25 2011
New Revision: 219562
URL: http://svn.freebsd.org/changeset/base/219562

Log:
  Make sure the locally cached value of rt->rt_gateway stays stable,
  even after dropping the reference and unlocking. Previously we
  have dereferenced a NULL pointer (after r121765).
  Simply unlocking after the block does not work either because of
  lock ordering (see r121765) and in addition we would still hold
  a pointer to something that might be gone by the time we access it.
  Thus take a copy of the value rather than just caching the pointer.
  
  PR:		kern/151908
  Submitted by:	chenyl (netstar2008 126.com) (initial version)
  MFC after:	2 weeks

Modified:
  head/sys/netinet6/nd6_nbr.c

Modified: head/sys/netinet6/nd6_nbr.c
==============================================================================
--- head/sys/netinet6/nd6_nbr.c	Sat Mar 12 09:09:25 2011	(r219561)
+++ head/sys/netinet6/nd6_nbr.c	Sat Mar 12 09:41:25 2011	(r219562)
@@ -113,7 +113,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 	int anycast = 0, proxy = 0, tentative = 0;
 	int tlladdr;
 	union nd_opts ndopts;
-	struct sockaddr_dl *proxydl = NULL;
+	struct sockaddr_dl proxydl;
 	char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
 
 #ifndef PULLDOWN_TEST
@@ -248,18 +248,25 @@ nd6_ns_input(struct mbuf *m, int off, in
 #endif
 		need_proxy = (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 &&
 		    rt->rt_gateway->sa_family == AF_LINK);
-		if (rt)
+		if (rt != NULL) {
+			/*
+			 * Make a copy while we can be sure that rt_gateway
+			 * is still stable before unlocking to avoid lock
+			 * order problems.  proxydl will only be used if
+			 * proxy will be set in the next block.
+			 */
+			if (need_proxy)
+				proxydl = *SDL(rt->rt_gateway);
 			RTFREE_LOCKED(rt);
+		}
 		if (need_proxy) {
 			/*
 			 * proxy NDP for single entry
 			 */
 			ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp,
 				IN6_IFF_NOTREADY|IN6_IFF_ANYCAST);
-			if (ifa) {
+			if (ifa)
 				proxy = 1;
-				proxydl = SDL(rt->rt_gateway);
-			}
 		}
 	}
 	if (ifa == NULL) {
@@ -333,7 +340,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 		nd6_na_output(ifp, &in6_all, &taddr6,
 		    ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) |
 		    (V_ip6_forwarding ? ND_NA_FLAG_ROUTER : 0),
-		    tlladdr, (struct sockaddr *)proxydl);
+		    tlladdr, (struct sockaddr *)&proxydl);
 		goto freeit;
 	}
 
@@ -343,7 +350,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 	nd6_na_output(ifp, &saddr6, &taddr6,
 	    ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) |
 	    (V_ip6_forwarding ? ND_NA_FLAG_ROUTER : 0) | ND_NA_FLAG_SOLICITED,
-	    tlladdr, (struct sockaddr *)proxydl);
+	    tlladdr, (struct sockaddr *)&proxydl);
  freeit:
 	if (ifa != NULL)
 		ifa_free(ifa);

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 11:12:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A56F1065678;
	Sat, 12 Mar 2011 11:12:30 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 574F18FC2D;
	Sat, 12 Mar 2011 11:12: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 p2CBCUac017257;
	Sat, 12 Mar 2011 11:12:30 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CBCUPP017254;
	Sat, 12 Mar 2011 11:12:30 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201103121112.p2CBCUPP017254@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Sat, 12 Mar 2011 11:12: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: r219563 - head/lib/libpam/modules/pam_group
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 11:12:30 -0000

Author: des
Date: Sat Mar 12 11:12:30 2011
New Revision: 219563
URL: http://svn.freebsd.org/changeset/base/219563

Log:
  Add "ruser" and "luser" options.  The former corresponds to the current
  behavior, where the module checks that the supplicant is a member of the
  required group.  The latter checks the target user instead.  If neither
  option was specified, pam_group(8) assumes "ruser" and issues a warning.
  I intend to eventually change the default to "luser" to match the
  behavior of similarly-named service modules in other operating systems.
  
  MFC after:	1 month

Modified:
  head/lib/libpam/modules/pam_group/pam_group.8
  head/lib/libpam/modules/pam_group/pam_group.c

Modified: head/lib/libpam/modules/pam_group/pam_group.8
==============================================================================
--- head/lib/libpam/modules/pam_group/pam_group.8	Sat Mar 12 09:41:25 2011	(r219562)
+++ head/lib/libpam/modules/pam_group/pam_group.8	Sat Mar 12 11:12:30 2011	(r219563)
@@ -1,4 +1,5 @@
 .\" Copyright (c) 2003 Networks Associates Technology, Inc.
+.\" Copyright (c) 2004-2011 Dag-Erling Smørgrav
 .\" All rights reserved.
 .\"
 .\" Portions of this software were developed for the FreeBSD Project by
@@ -32,7 +33,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 6, 2003
+.Dd March 9, 2011
 .Dt PAM_GROUP 8
 .Os
 .Sh NAME
@@ -64,10 +65,23 @@ it does exist and the applicant is a mem
 Specify the name of the group to check.
 The default is
 .Dq Li wheel .
+.It Cm luser
+Accept or reject based on the target user's group membership.
 .It Cm root_only
 Skip this module entirely if the target account is not the superuser
 account.
+.It Cm ruser
+Accept or reject based on the supplicant's group membership.
+This is the default.
 .El
+.Pp
+Note that the
+.Cm luser
+and
+.Cm ruser
+options are mutually exclusive, and that
+.Nm
+will fail if both are specified.
 .Sh SEE ALSO
 .Xr pam.conf 5 ,
 .Xr pam 8

Modified: head/lib/libpam/modules/pam_group/pam_group.c
==============================================================================
--- head/lib/libpam/modules/pam_group/pam_group.c	Sat Mar 12 09:41:25 2011	(r219562)
+++ head/lib/libpam/modules/pam_group/pam_group.c	Sat Mar 12 11:12:30 2011	(r219563)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2003 Networks Associates Technology, Inc.
+ * Copyright (c) 2004-2011 Dag-Erling Smørgrav
  * All rights reserved.
  *
  * Portions of this software were developed for the FreeBSD Project by
@@ -56,6 +57,7 @@ PAM_EXTERN int
 pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
     int argc __unused, const char *argv[] __unused)
 {
+	int local, remote;
 	const char *group, *user;
 	const void *ruser;
 	char *const *list;
@@ -69,10 +71,24 @@ pam_sm_authenticate(pam_handle_t *pamh, 
 	if (pwd->pw_uid != 0 && openpam_get_option(pamh, "root_only"))
 		return (PAM_IGNORE);
 
-	/* get applicant */
-	if (pam_get_item(pamh, PAM_RUSER, &ruser) != PAM_SUCCESS
-	    || ruser == NULL || (pwd = getpwnam(ruser)) == NULL)
-		return (PAM_AUTH_ERR);
+	/* check local / remote */
+	local = openpam_get_option(pamh, "luser") ? 1 : 0;
+	remote = openpam_get_option(pamh, "ruser") ? 1 : 0;
+	if (local && remote) {
+		openpam_log(PAM_LOG_ERROR,
+		    "the luser and ruser options are mutually exclusive");
+		return (PAM_SERVICE_ERR);
+	} else if (local) {
+		/* we already have the correct struct passwd */
+	} else {
+		if (!remote)
+			openpam_log(PAM_LOG_NOTICE,
+			    "neither luser nor ruser specified, assuming ruser");
+		/* default / historical behavior */
+		if (pam_get_item(pamh, PAM_RUSER, &ruser) != PAM_SUCCESS ||
+		    ruser == NULL || (pwd = getpwnam(ruser)) == NULL)
+			return (PAM_AUTH_ERR);
+	}
 
 	/* get regulating group */
 	if ((group = openpam_get_option(pamh, "group")) == NULL)

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 11:26:37 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB918106564A;
	Sat, 12 Mar 2011 11:26:37 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C98348FC1B;
	Sat, 12 Mar 2011 11:26:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2CBQbBL017608;
	Sat, 12 Mar 2011 11:26:37 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CBQbqm017606;
	Sat, 12 Mar 2011 11:26:37 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201103121126.p2CBQbqm017606@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Sat, 12 Mar 2011 11:26: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: r219564 - head/lib/libpam/modules/pam_group
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 11:26:38 -0000

Author: des
Date: Sat Mar 12 11:26:37 2011
New Revision: 219564
URL: http://svn.freebsd.org/changeset/base/219564

Log:
  Mention the name of the module in warning messages.

Modified:
  head/lib/libpam/modules/pam_group/pam_group.c

Modified: head/lib/libpam/modules/pam_group/pam_group.c
==============================================================================
--- head/lib/libpam/modules/pam_group/pam_group.c	Sat Mar 12 11:12:30 2011	(r219563)
+++ head/lib/libpam/modules/pam_group/pam_group.c	Sat Mar 12 11:26:37 2011	(r219564)
@@ -75,14 +75,14 @@ pam_sm_authenticate(pam_handle_t *pamh, 
 	local = openpam_get_option(pamh, "luser") ? 1 : 0;
 	remote = openpam_get_option(pamh, "ruser") ? 1 : 0;
 	if (local && remote) {
-		openpam_log(PAM_LOG_ERROR,
+		openpam_log(PAM_LOG_ERROR, "(pam_group) "
 		    "the luser and ruser options are mutually exclusive");
 		return (PAM_SERVICE_ERR);
 	} else if (local) {
 		/* we already have the correct struct passwd */
 	} else {
 		if (!remote)
-			openpam_log(PAM_LOG_NOTICE,
+			openpam_log(PAM_LOG_NOTICE, "(pam_group) "
 			    "neither luser nor ruser specified, assuming ruser");
 		/* default / historical behavior */
 		if (pam_get_item(pamh, PAM_RUSER, &ruser) != PAM_SUCCESS ||

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 12:10:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 045BF106564A;
	Sat, 12 Mar 2011 12:10:18 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E72A48FC08;
	Sat, 12 Mar 2011 12:10: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 p2CCAHpX018506;
	Sat, 12 Mar 2011 12:10:17 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CCAHGQ018504;
	Sat, 12 Mar 2011 12:10:17 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <201103121210.p2CCAHGQ018504@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 12 Mar 2011 12:10: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: r219565 - head/lib/libc/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 12:10:18 -0000

Author: rwatson
Date: Sat Mar 12 12:10:17 2011
New Revision: 219565
URL: http://svn.freebsd.org/changeset/base/219565

Log:
  Move cap_enter(2) and cap_getmode(2) symbols from FBSD_1.1 to FBSD_1.2.
  
  Suggested by:	kib
  Obtained from:	Capsicum Project
  Sponsored by:	Google
  MFC after:	3 months

Modified:
  head/lib/libc/sys/Symbol.map

Modified: head/lib/libc/sys/Symbol.map
==============================================================================
--- head/lib/libc/sys/Symbol.map	Sat Mar 12 11:26:37 2011	(r219564)
+++ head/lib/libc/sys/Symbol.map	Sat Mar 12 12:10:17 2011	(r219565)
@@ -330,8 +330,6 @@ FBSD_1.0 {
 
 FBSD_1.1 {
 	__semctl;
-	cap_enter;
-	cap_getmode;
 	closefrom;
 	cpuset;
 	cpuset_getid;
@@ -363,6 +361,8 @@ FBSD_1.1 {
 };
 
 FBSD_1.2 {
+	cap_enter;
+	cap_getmode;
 	getloginclass;
 	setloginclass;
 };

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 12:26:34 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id AFB3F1065672; Sat, 12 Mar 2011 12:26:34 +0000 (UTC)
Date: Sat, 12 Mar 2011 12:26:34 +0000
From: Alexander Best 
To: John Baldwin 
Message-ID: <20110312122634.GA74320@freebsd.org>
References: <201103111311.p2BDBFBs079174@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201103111311.p2BDBFBs079174@svn.freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219483 - head/sys/boot/i386/gptboot
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 12:26:34 -0000

On Fri Mar 11 11, John Baldwin wrote:
> Author: jhb
> Date: Fri Mar 11 13:11:15 2011
> New Revision: 219483
> URL: http://svn.freebsd.org/changeset/base/219483
> 
> Log:
>   Remove all object files during 'make clean'.

thanks. :)

>   
>   PR:		kern/154888
>   Submitted by:	arundel
>   MFC after:	1 week
> 
> Modified:
>   head/sys/boot/i386/gptboot/Makefile
> 
> Modified: head/sys/boot/i386/gptboot/Makefile
> ==============================================================================
> --- head/sys/boot/i386/gptboot/Makefile	Fri Mar 11 12:12:35 2011	(r219482)
> +++ head/sys/boot/i386/gptboot/Makefile	Fri Mar 11 13:11:15 2011	(r219483)
> @@ -65,7 +65,8 @@ gptldr.bin: gptldr.out
>  gptldr.out: gptldr.o
>  	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
>  
> -CLEANFILES+=	gptboot.bin gptboot.out gptboot.o sio.o ufsread.o
> +CLEANFILES+=	gptboot.bin gptboot.out gptboot.o sio.o gpt.o crc32.o drv.o \
> +		cons.o util.o
>  
>  gptboot.bin: gptboot.out
>  	objcopy -S -O binary gptboot.out ${.TARGET}

-- 
a13x

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 14:09:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CE616106564A;
	Sat, 12 Mar 2011 14:09: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 BDDB78FC17;
	Sat, 12 Mar 2011 14:09: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 p2CE9h0N021009;
	Sat, 12 Mar 2011 14:09:43 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CE9hG6021007;
	Sat, 12 Mar 2011 14:09:43 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103121409.p2CE9hG6021007@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 12 Mar 2011 14:09: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: r219566 - head/tools/regression/pjdfstest
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 14:09:43 -0000

Author: pjd
Date: Sat Mar 12 14:09:43 2011
New Revision: 219566
URL: http://svn.freebsd.org/changeset/base/219566

Log:
  Add some missing consts.

Modified:
  head/tools/regression/pjdfstest/pjdfstest.c

Modified: head/tools/regression/pjdfstest/pjdfstest.c
==============================================================================
--- head/tools/regression/pjdfstest/pjdfstest.c	Sat Mar 12 12:10:17 2011	(r219565)
+++ head/tools/regression/pjdfstest/pjdfstest.c	Sat Mar 12 14:09:43 2011	(r219566)
@@ -129,7 +129,7 @@ enum action {
 #define	MAX_ARGS	8
 
 struct syscall_desc {
-	char		*sd_name;
+	const char	*sd_name;
 	enum action	 sd_action;
 	int		 sd_args[MAX_ARGS];
 };
@@ -193,7 +193,7 @@ static struct syscall_desc syscalls[] = 
 
 struct flag {
 	long long	 f_flag;
-	char		*f_str;
+	const char	*f_str;
 };
 
 static struct flag open_flags[] = {
@@ -310,8 +310,8 @@ static struct flag fstatat_flags[] = {
 };
 
 struct name {
-	int	 n_name;
-	char	*n_str;
+	int		 n_name;
+	const char	*n_str;
 };
 
 static struct name pathconf_names[] = {

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 14:33:33 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BC53106566B;
	Sat, 12 Mar 2011 14:33:33 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EBF698FC0A;
	Sat, 12 Mar 2011 14:33: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 p2CEXWn8021619;
	Sat, 12 Mar 2011 14:33:32 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CEXWI3021589;
	Sat, 12 Mar 2011 14:33:32 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103121433.p2CEXWI3021589@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 12 Mar 2011 14:33: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: r219567 - in head/sys: sparc64/ebus sparc64/include
	sparc64/isa sparc64/pci sparc64/sbus sparc64/sparc64
	sun4v/include sun4v/sun4v
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 14:33:33 -0000

Author: marius
Date: Sat Mar 12 14:33:32 2011
New Revision: 219567
URL: http://svn.freebsd.org/changeset/base/219567

Log:
  Sync licenses and the corresponding RCS IDs with NetBSD, mainly switching
  the licenses of Matthew R. Green and the TNF to 2-clause.
  
  Obtained from:	NetBSD

Modified:
  head/sys/sparc64/ebus/ebus.c
  head/sys/sparc64/ebus/ebusreg.h
  head/sys/sparc64/include/_inttypes.h
  head/sys/sparc64/include/_stdint.h
  head/sys/sparc64/include/bus.h
  head/sys/sparc64/include/bus_dma.h
  head/sys/sparc64/include/iommuvar.h
  head/sys/sparc64/include/ofw_nexus.h
  head/sys/sparc64/isa/ofw_isa.c
  head/sys/sparc64/isa/ofw_isa.h
  head/sys/sparc64/pci/ofw_pci.h
  head/sys/sparc64/pci/psychoreg.h
  head/sys/sparc64/pci/psychovar.h
  head/sys/sparc64/sbus/dma_sbus.c
  head/sys/sparc64/sbus/lsi64854.c
  head/sys/sparc64/sbus/lsi64854reg.h
  head/sys/sparc64/sbus/lsi64854var.h
  head/sys/sparc64/sbus/ofw_sbus.h
  head/sys/sparc64/sbus/sbus.c
  head/sys/sparc64/sbus/sbusvar.h
  head/sys/sparc64/sparc64/bus_machdep.c
  head/sys/sparc64/sparc64/iommu.c
  head/sys/sun4v/include/_inttypes.h
  head/sys/sun4v/include/_stdint.h
  head/sys/sun4v/include/bus.h
  head/sys/sun4v/include/bus_dma.h
  head/sys/sun4v/include/ofw_nexus.h
  head/sys/sun4v/sun4v/bus_machdep.c
  head/sys/sun4v/sun4v/hviommu.c

Modified: head/sys/sparc64/ebus/ebus.c
==============================================================================
--- head/sys/sparc64/ebus/ebus.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/ebus/ebus.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
- * Copyright (c) 2001 Thomas Moestl 
  * Copyright (c) 2009 by Marius Strobl 
  * All rights reserved.
  *
@@ -27,7 +26,34 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp
+ *	from: NetBSD: ebus.c,v 1.52 2008/05/29 14:51:26 mrg Exp
+ */
+/*-
+ * Copyright (c) 2001 Thomas Moestl 
+ * 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.
+ * 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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 #include 

Modified: head/sys/sparc64/ebus/ebusreg.h
==============================================================================
--- head/sys/sparc64/ebus/ebusreg.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/ebus/ebusreg.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,6 +1,6 @@
 /*	$FreeBSD$	*/
 /*	$OpenBSD: ebusreg.h,v 1.4 2001/10/01 18:08:04 jason Exp $	*/
-/*	$NetBSD: ebusreg.h,v 1.1 1999/06/04 13:29:13 mrg Exp $	*/
+/*	$NetBSD: ebusreg.h,v 1.8 2008/05/29 14:51:27 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1999 Matthew R. Green
@@ -14,8 +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. The name of the author may not 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

Modified: head/sys/sparc64/include/_inttypes.h
==============================================================================
--- head/sys/sparc64/include/_inttypes.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/include/_inttypes.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -26,7 +26,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- *	From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $
+ *	From: $NetBSD: int_fmtio.h,v 1.4 2008/04/28 20:23:36 martin Exp $
  * $FreeBSD$
  */
 

Modified: head/sys/sparc64/include/_stdint.h
==============================================================================
--- head/sys/sparc64/include/_stdint.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/include/_stdint.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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/sparc64/include/bus.h
==============================================================================
--- head/sys/sparc64/include/bus.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/include/bus.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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
@@ -65,7 +58,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * 	from: NetBSD: bus.h,v 1.28 2001/07/19 15:32:19 thorpej Exp
+ * 	from: NetBSD: bus.h,v 1.58 2008/04/28 20:23:36 martin Exp
  *	and
  *	from: FreeBSD: src/sys/alpha/include/bus.h,v 1.9 2001/01/09
  *

Modified: head/sys/sparc64/include/bus_dma.h
==============================================================================
--- head/sys/sparc64/include/bus_dma.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/include/bus_dma.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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
@@ -65,7 +58,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * 	from: NetBSD: bus.h,v 1.28 2001/07/19 15:32:19 thorpej Exp
+ * 	from: NetBSD: bus.h,v 1.58 2008/04/28 20:23:36 martin Exp
  *	and
  *	from: FreeBSD: src/sys/alpha/include/bus.h,v 1.9 2001/01/09
  *

Modified: head/sys/sparc64/include/iommuvar.h
==============================================================================
--- head/sys/sparc64/include/iommuvar.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/include/iommuvar.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -25,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: iommuvar.h,v 1.9 2001/07/20 00:07:13 eeh Exp
+ *	from: NetBSD: iommuvar.h,v 1.6 2008/05/29 14:51:26 mrg Exp
  *
  * $FreeBSD$
  */

Modified: head/sys/sparc64/include/ofw_nexus.h
==============================================================================
--- head/sys/sparc64/include/ofw_nexus.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/include/ofw_nexus.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,5 +1,4 @@
 /*-
- * Copyright (c) 1998, 1999 Eduardo E. Horvath
  * Copyright (c) 1999 Matthew R. Green
  * All rights reserved.
  *
@@ -11,6 +10,32 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 1998, 1999 Eduardo E. Horvath
+ * 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.
  * 3. The name of the author may not be used to endorse or promote products
  *    derived from this software without specific prior written permission.
  *
@@ -26,7 +51,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: psychoreg.h,v 1.8 2001/09/10 16:17:06 eeh Exp
+ *	from: NetBSD: psychoreg.h,v 1.14 2008/05/30 02:29:37 mrg Exp
  *
  * $FreeBSD$
  */

Modified: head/sys/sparc64/isa/ofw_isa.c
==============================================================================
--- head/sys/sparc64/isa/ofw_isa.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/isa/ofw_isa.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
- * Copyright (c) 2001, 2003 Thomas Moestl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +25,34 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp
+ *	from: NetBSD: ebus.c,v 1.52 2008/05/29 14:51:26 mrg Exp
+ */
+/*-
+ * Copyright (c) 2001, 2003 Thomas Moestl 
+ * 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.
+ * 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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 #include 

Modified: head/sys/sparc64/isa/ofw_isa.h
==============================================================================
--- head/sys/sparc64/isa/ofw_isa.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/isa/ofw_isa.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
- * Copyright (c) 2001 Thomas Moestl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +25,34 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp
+ *	from: NetBSD: ebus.c,v 1.52 2008/05/29 14:51:26 mrg Exp
+ */
+/*-
+ * Copyright (c) 2001 Thomas Moestl 
+ * 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.
+ * 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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  *
  * $FreeBSD$
  */

Modified: head/sys/sparc64/pci/ofw_pci.h
==============================================================================
--- head/sys/sparc64/pci/ofw_pci.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/pci/ofw_pci.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,5 +1,33 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
+ * 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.
+ * 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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 1998, 1999 Eduardo E. Horvath
  * Copyright (c) 2001, 2003 by Thomas Moestl 
  * All rights reserved.
  *
@@ -26,7 +54,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: psychoreg.h,v 1.8 2001/09/10 16:17:06 eeh Exp
+ *	from: NetBSD: psychoreg.h,v 1.14 2008/05/30 02:29:37 mrg Exp
  *
  * $FreeBSD$
  */

Modified: head/sys/sparc64/pci/psychoreg.h
==============================================================================
--- head/sys/sparc64/pci/psychoreg.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/pci/psychoreg.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,5 +1,4 @@
 /*-
- * Copyright (c) 1998, 1999 Eduardo E. Horvath
  * Copyright (c) 1999 Matthew R. Green
  * All rights reserved.
  *
@@ -25,8 +24,36 @@
  * 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.
+ */
+
+/*-
+ * Copyright (c) 1998, 1999 Eduardo E. Horvath
+ * 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.
+ * 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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  *
- *	from: NetBSD: psychoreg.h,v 1.8 2001/09/10 16:17:06 eeh Exp
+ *	from: NetBSD: psychoreg.h,v 1.14 2008/05/30 02:29:37 mrg Exp
  *
  * $FreeBSD$
  */

Modified: head/sys/sparc64/pci/psychovar.h
==============================================================================
--- head/sys/sparc64/pci/psychovar.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/pci/psychovar.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -25,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp
+ *	from: NetBSD: psychovar.h,v 1.15 2008/05/29 14:51:26 mrg Exp
  *
  * $FreeBSD$
  */

Modified: head/sys/sparc64/sbus/dma_sbus.c
==============================================================================
--- head/sys/sparc64/sbus/dma_sbus.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sbus/dma_sbus.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,5 +1,5 @@
-/*	$OpenBSD: dma_sbus.c,v 1.12 2005/03/03 01:41:45 miod Exp $	*/
-/*	$NetBSD: dma_sbus.c,v 1.5 2000/07/09 20:57:42 pk Exp $ */
+/*	$OpenBSD: dma_sbus.c,v 1.16 2008/06/26 05:42:18 ray Exp $	*/
+/*	$NetBSD: dma_sbus.c,v 1.32 2008/04/28 20:23:57 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -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/sparc64/sbus/lsi64854.c
==============================================================================
--- head/sys/sparc64/sbus/lsi64854.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sbus/lsi64854.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -25,7 +25,7 @@
  *
  */
 
-/*	$NetBSD: lsi64854.c,v 1.25 2005/02/27 00:27:02 perry Exp $ */
+/*	$NetBSD: lsi64854.c,v 1.33 2008/04/28 20:23:50 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -42,13 +42,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/sparc64/sbus/lsi64854reg.h
==============================================================================
--- head/sys/sparc64/sbus/lsi64854reg.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sbus/lsi64854reg.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,4 +1,4 @@
-/*	$NetBSD: lsi64854reg.h,v 1.5 2001/03/29 02:58:39 petrov Exp $ */
+/*	$NetBSD: lsi64854reg.h,v 1.6 2008/04/28 20:23:50 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.

Modified: head/sys/sparc64/sbus/lsi64854var.h
==============================================================================
--- head/sys/sparc64/sbus/lsi64854var.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sbus/lsi64854var.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,4 +1,4 @@
-/*	$NetBSD: lsi64854var.h,v 1.6 2005/02/04 02:10:36 perry Exp $ */
+/*	$NetBSD: lsi64854var.h,v 1.12 2008/04/28 20:23:50 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.

Modified: head/sys/sparc64/sbus/ofw_sbus.h
==============================================================================
--- head/sys/sparc64/sbus/ofw_sbus.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sbus/ofw_sbus.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -26,7 +26,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- *	from: NetBSD: sbusvar.h,v 1.12 2001/09/24 23:49:34 eeh Exp
+ *	from: NetBSD: sbusvar.h,v 1.15 2008/04/28 20:23:36 martin Exp
  *
  * $FreeBSD$
  */

Modified: head/sys/sparc64/sbus/sbus.c
==============================================================================
--- head/sys/sparc64/sbus/sbus.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sbus/sbus.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,51 +1,7 @@
 /*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2002 Eduardo Horvath
  * All rights reserved.
  *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Paul Kranenburg.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed 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
- * 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.
- */
-/*-
- * Copyright (c) 1992, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * 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, Lawrence Berkeley Laboratory.
- *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -54,24 +10,24 @@
  * 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
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
+ * 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 SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
+ *
+ *	from: NetBSD: sbus.c,v 1.50 2002/06/20 18:26:24 eeh Exp
  */
 /*-
- * Copyright (c) 1999 Eduardo Horvath
  * Copyright (c) 2002 by Thomas Moestl .
  * Copyright (c) 2005 Marius Strobl 
  * All rights reserved.
@@ -93,9 +49,6 @@
  * 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.
- *
- *	from: @(#)sbus.c	8.1 (Berkeley) 6/11/93
- *	from: NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp
  */
 
 #include 

Modified: head/sys/sparc64/sbus/sbusvar.h
==============================================================================
--- head/sys/sparc64/sbus/sbusvar.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sbus/sbusvar.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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
@@ -71,7 +64,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)sbusvar.h	8.1 (Berkeley) 6/11/93
- *	from: NetBSD: sbusvar.h,v 1.7 1999/06/05 05:30:43 mrg Exp
+ *	from: NetBSD: sbusvar.h,v 1.15 2008/04/28 20:23:36 martin Exp
  *
  * $FreeBSD$
  */

Modified: head/sys/sparc64/sparc64/bus_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/bus_machdep.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sparc64/bus_machdep.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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
@@ -93,7 +86,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)machdep.c	8.6 (Berkeley) 1/14/94
- *	from: NetBSD: machdep.c,v 1.111 2001/09/15 07:13:40 eeh Exp
+ *	from: NetBSD: machdep.c,v 1.221 2008/04/28 20:23:37 martin Exp
  *	and
  *	from: FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.24 2001/08/15
  */

Modified: head/sys/sparc64/sparc64/iommu.c
==============================================================================
--- head/sys/sparc64/sparc64/iommu.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sparc64/sparc64/iommu.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
- * Copyright (c) 2001-2003 Thomas Moestl
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -11,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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -25,49 +22,13 @@
  * 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.
- */
-/*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Paul Kranenburg.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed 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
- * 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.
+ *	from: NetBSD: iommu.c,v 1.82 2008/05/30 02:29:37 mrg Exp
  */
 /*-
- * Copyright (c) 1992, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
+ * Copyright (c) 1999-2002 Eduardo Horvath
+ * Copyright (c) 2001-2003 Thomas Moestl
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -77,25 +38,22 @@
  * 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
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
+ * 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 SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: sbus.c,v 1.13 1999/05/23 07:24:02 mrg Exp
- *	from: @(#)sbus.c	8.1 (Berkeley) 6/11/93
- *	from: NetBSD: iommu.c,v 1.42 2001/08/06 22:02:58 eeh Exp
+ *	from: NetBSD: sbus.c,v 1.50 2002/06/20 18:26:24 eeh Exp
  */
 
 #include 

Modified: head/sys/sun4v/include/_inttypes.h
==============================================================================
--- head/sys/sun4v/include/_inttypes.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sun4v/include/_inttypes.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -26,7 +26,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- *	From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $
+ *	From: $NetBSD: int_fmtio.h,v 1.4 2008/04/28 20:23:36 martin Exp $
  * $FreeBSD$
  */
 

Modified: head/sys/sun4v/include/_stdint.h
==============================================================================
--- head/sys/sun4v/include/_stdint.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sun4v/include/_stdint.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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/sun4v/include/bus.h
==============================================================================
--- head/sys/sun4v/include/bus.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sun4v/include/bus.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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
@@ -65,7 +58,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * 	from: NetBSD: bus.h,v 1.28 2001/07/19 15:32:19 thorpej Exp
+ * 	from: NetBSD: bus.h,v 1.58 2008/04/28 20:23:36 martin Exp
  *	and
  *	from: FreeBSD: src/sys/alpha/include/bus.h,v 1.9 2001/01/09
  *

Modified: head/sys/sun4v/include/bus_dma.h
==============================================================================
--- head/sys/sun4v/include/bus_dma.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sun4v/include/bus_dma.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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
@@ -65,7 +58,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * 	from: NetBSD: bus.h,v 1.28 2001/07/19 15:32:19 thorpej Exp
+ * 	from: NetBSD: bus.h,v 1.58 2008/04/28 20:23:36 martin Exp
  *	and
  *	from: FreeBSD: src/sys/alpha/include/bus.h,v 1.9 2001/01/09
  *

Modified: head/sys/sun4v/include/ofw_nexus.h
==============================================================================
--- head/sys/sun4v/include/ofw_nexus.h	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sun4v/include/ofw_nexus.h	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,5 +1,4 @@
 /*-
- * Copyright (c) 1998, 1999 Eduardo E. Horvath
  * Copyright (c) 1999 Matthew R. Green
  * All rights reserved.
  *
@@ -11,6 +10,32 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 1998, 1999 Eduardo E. Horvath
+ * 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.
  * 3. The name of the author may not be used to endorse or promote products
  *    derived from this software without specific prior written permission.
  *
@@ -26,7 +51,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	from: NetBSD: psychoreg.h,v 1.8 2001/09/10 16:17:06 eeh Exp
+ *	from: NetBSD: psychoreg.h,v 1.14 2008/05/30 02:29:37 mrg Exp
  *
  * $FreeBSD$
  */

Modified: head/sys/sun4v/sun4v/bus_machdep.c
==============================================================================
--- head/sys/sun4v/sun4v/bus_machdep.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sun4v/sun4v/bus_machdep.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -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
@@ -93,7 +86,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)machdep.c	8.6 (Berkeley) 1/14/94
- *	from: NetBSD: machdep.c,v 1.111 2001/09/15 07:13:40 eeh Exp
+ *	from: NetBSD: machdep.c,v 1.221 2008/04/28 20:23:37 martin Exp
  *	and
  *	from: FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.24 2001/08/15
  */

Modified: head/sys/sun4v/sun4v/hviommu.c
==============================================================================
--- head/sys/sun4v/sun4v/hviommu.c	Sat Mar 12 14:09:43 2011	(r219566)
+++ head/sys/sun4v/sun4v/hviommu.c	Sat Mar 12 14:33:32 2011	(r219567)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
- * Copyright (c) 2001-2003 Thomas Moestl
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -11,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 SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -25,49 +22,13 @@
  * 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.
- */
-/*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Paul Kranenburg.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed 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
- * 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.
+ *	from: NetBSD: iommu.c,v 1.82 2008/05/30 02:29:37 mrg Exp
  */
 /*-
- * Copyright (c) 1992, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
+ * Copyright (c) 1999-2002 Eduardo Horvath
+ * Copyright (c) 2001-2003 Thomas Moestl
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -77,25 +38,22 @@
  * 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
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
+ * 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 SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 14:47:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B2F2B106566C;
	Sat, 12 Mar 2011 14:47:54 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A27448FC1C;
	Sat, 12 Mar 2011 14:47: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 p2CElsxs021924;
	Sat, 12 Mar 2011 14:47:54 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CEls9q021921;
	Sat, 12 Mar 2011 14:47:54 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103121447.p2CEls9q021921@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 12 Mar 2011 14:47: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: r219568 - head/tools/regression/doat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 14:47:54 -0000

Author: brucec
Date: Sat Mar 12 14:47:54 2011
New Revision: 219568
URL: http://svn.freebsd.org/changeset/base/219568

Log:
  Fix warnings and style(9) issues.
  Set WARNS to 6.

Modified:
  head/tools/regression/doat/Makefile
  head/tools/regression/doat/doat.c

Modified: head/tools/regression/doat/Makefile
==============================================================================
--- head/tools/regression/doat/Makefile	Sat Mar 12 14:33:32 2011	(r219567)
+++ head/tools/regression/doat/Makefile	Sat Mar 12 14:47:54 2011	(r219568)
@@ -3,5 +3,6 @@
 PROG=	doat
 
 NO_MAN=
+WARNS?=6
 
 .include 

Modified: head/tools/regression/doat/doat.c
==============================================================================
--- head/tools/regression/doat/doat.c	Sat Mar 12 14:33:32 2011	(r219567)
+++ head/tools/regression/doat/doat.c	Sat Mar 12 14:47:54 2011	(r219568)
@@ -26,25 +26,31 @@
  * $FreeBSD$
  */
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
+
+void cleanup(void);
+void setup(void);
+void setup_once(void);
 
 union param {
 	int		i;
-	char		*cp;
+	const char	*cp;
 	mode_t		m;
 	dev_t		d;
 	void		*vp;
 	uid_t		u;
 	gid_t		g;
-	char		**cpp;
+	const char	**cpp;
 };
 
 struct testcase {
@@ -55,7 +61,7 @@ struct testcase {
 struct test {
 	int	syscall;
 	int	num_of_cases;
-	char	*name;
+	const char *name;
 	struct testcase	tests[10];	/* no more than 10 tests */
 	
 };
@@ -64,21 +70,21 @@ struct test *tests;
 #define	NUM_OF_TESTS	14		/* we dont want the fexecve test to run */
 
 char *absolute_path = NULL;
-char *relative_path = "tmp/";
-char *not_dir_path = "/bin/date";
+const char *relative_path = "tmp/";
+const char *not_dir_path = "/bin/date";
 
-char *file = "foo";
+const char *file = "foo";
 char *absolute_file = NULL;
 char *relative_file = NULL;
-char *symlinkf = "link";
-char *newlink = "nlink1";
-char *newlink2 = "nlink2";
-char *newlink3 = "nlink3";
-char *newdir = "newdir";
-char *fifo = "fifo";
-char *nod = "nod";
-char *newfile = "newfile";
-char *newslink = "nslink1";
+const char *symlinkf = "link";
+const char *newlink = "nlink1";
+const char *newlink2 = "nlink2";
+const char *newlink3 = "nlink3";
+const char *newdir = "newdir";
+const char *fifo = "fifo";
+const char *nod = "nod";
+const char *newfile = "newfile";
+const char *newslink = "nslink1";
 
 bool dir_exist = false;
 bool file_exist = false;
@@ -88,15 +94,14 @@ int rel_fd, abs_fd, notd_fd, exec_fd;
 
 struct timeval times[2];
 struct stat buf;
-char *pargv[2] = { "/bin/date", NULL };
+const char *pargv[2] = { "/bin/date", NULL };
 #define	PATH_MAX	1024
 char cbuf[PATH_MAX];
 
 void
-setup()
+setup(void)
 {
 	int i, error;
-	size_t siz;
 	struct stat sb;
 
 	tests = calloc(NUM_OF_TESTS, sizeof(struct test));
@@ -607,13 +612,13 @@ setup()
 }
 
 void
-cleanup()
+cleanup(void)
 {
 	system("/bin/sh -c 'rm -rf tmp'");
 }
 
 void
-setup_once()
+setup_once(void)
 {
 }
 
@@ -623,10 +628,13 @@ main(int argc, char *argv[])
 	int i,j;
 	int error;
 
+	(void)argc;
+	(void)argv;
+
 	setup();
 
 	for (i = 0; i < NUM_OF_TESTS; i++) {
-	   	printf("\nTest: %s\n", tests[i].name);
+		printf("\nTest: %s\n", tests[i].name);
 		for (j = 0; j < tests[i].num_of_cases; j++) {
 			error = syscall(tests[i].syscall,
 				tests[i].tests[j].params[0],
@@ -652,13 +660,10 @@ main(int argc, char *argv[])
 						printf("#%i ... OK\n", j);
 				}
 			}
-
-
 		}
 	}
 
 	cleanup();
 
-
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 14:57:11 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C189106566B;
	Sat, 12 Mar 2011 14:57:11 +0000 (UTC) (envelope-from osa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 09CC28FC13;
	Sat, 12 Mar 2011 14:57: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 p2CEvAUG022191;
	Sat, 12 Mar 2011 14:57:10 GMT (envelope-from osa@svn.freebsd.org)
Received: (from osa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CEvAhK022184;
	Sat, 12 Mar 2011 14:57:10 GMT (envelope-from osa@svn.freebsd.org)
Message-Id: <201103121457.p2CEvAhK022184@svn.freebsd.org>
From: "Sergey A. Osokin" 
Date: Sat, 12 Mar 2011 14:57:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219569 - in stable/8/usr.bin/calendar: .
	calendars/ru_RU.KOI8-R
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 14:57:11 -0000

Author: osa (ports committer)
Date: Sat Mar 12 14:57:10 2011
New Revision: 219569
URL: http://svn.freebsd.org/changeset/base/219569

Log:
  MFC r216697:
  
  Fix typo (Pashka -> Paskha).
  
  MFC r217025:
  
  Fix typo: March -> September.
  
  MFC r218471:
  
  Fix Paskha and Paskha-specific holidays.
  
  MFC r218473:
  
  Always convert Paskha day from Julian (old) to Gregorian (new)
  style by adding 13 days.  Bug introduced in 1.13 revision.
  
  MFC r218771:
  
  Fix the beginning day of the Great Lent, it starts on Monday
  for 7 weeks before Paskha.
  Fix the Exaltation of the Holy Cross day.
  Add more Twelve holidays (dvunadesyatye prazdniki).
  
  MFC r218797:
  
  Replace hard-coded value by Julian2Gregorian converter function.
  
  MFC r219174:
  
  Fix beginning day of the Carnival.
  
  MFC r219175:
  
  Expand the name of Palm Sunday holiday with more canonical Entry
  of the Lord into Jerusalem.
  Merge the Pentecost and Trinity Sunday holidays, they are synonyms.
  Remove Body of Christ day, nonexistent holiday for Orthodox Church.
  Fix typo in the name of Ioann The Baptist, introduced in previous
  commit.

Modified:
  stable/8/usr.bin/calendar/calendar.1
  stable/8/usr.bin/calendar/calendar.h
  stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox   (contents, props changed)
  stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan   (contents, props changed)
  stable/8/usr.bin/calendar/parsedata.c
  stable/8/usr.bin/calendar/paskha.c
Directory Properties:
  stable/8/usr.bin/calendar/   (props changed)

Modified: stable/8/usr.bin/calendar/calendar.1
==============================================================================
--- stable/8/usr.bin/calendar/calendar.1	Sat Mar 12 14:47:54 2011	(r219568)
+++ stable/8/usr.bin/calendar/calendar.1	Sat Mar 12 14:57:10 2011	(r219569)
@@ -128,7 +128,7 @@ The solar equinox in March.
 .It JunSolstice
 The solar solstice in June.
 .It SepEquinox
-The solar equinox in March.
+The solar equinox in September.
 .It DecSolstice
 The solar solstice in December.
 .It ChineseNewYear
@@ -155,7 +155,7 @@ The names of the recognized special days
 positive or negative integer, like:
 .Dq Easter+3
 or
-.Dq Pashka-4 .
+.Dq Paskha-4 .
 .Pp
 Weekdays may be followed by ``-4'' ...\& ``+5'' (aliases for
 last, first, second, third, fourth) for moving events like

Modified: stable/8/usr.bin/calendar/calendar.h
==============================================================================
--- stable/8/usr.bin/calendar/calendar.h	Sat Mar 12 14:47:54 2011	(r219568)
+++ stable/8/usr.bin/calendar/calendar.h	Sat Mar 12 14:57:10 2011	(r219569)
@@ -167,9 +167,10 @@ void	cal(void);
 void	closecal(FILE *);
 FILE	*opencal(void);
 
-/* ostern.c / pashka.c */
+/* ostern.c / paskha.c */
 int	paskha(int);
 int	easter(int);
+int	j2g(int);
 
 /* dates.c */
 extern int cumdaytab[][14];

Modified: stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox
==============================================================================
--- stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox	Sat Mar 12 14:47:54 2011	(r219568)
+++ stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox	Sat Mar 12 14:57:10 2011	(r219569)
@@ -11,24 +11,26 @@ LANG=ru_RU.KOI8-R
 Paskha=ðÁÓÈÁ
 
 21 ÓÅÎ	òÏÖÄÅÓÔ×Ï ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ
-28 ÓÅÎ	÷ÏÚÄ×ÉÖÅÎÉÅ ëÒÅÓÔÁ çÏÓÐÏÄÎÑ
+27 ÓÅÎ	÷ÏÚÄ×ÉÖÅÎÉÅ ëÒÅÓÔÁ çÏÓÐÏÄÎÑ
 14 ÏËÔ	ðÏËÒÏ× ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ
  4 ÄÅË	÷×ÅÄÅÎÉÅ ×Ï ÈÒÁÍ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ
  7 ÑÎ×	òÏÖÄÅÓÔ×Ï èÒÉÓÔÏ×Ï
+14 ÑÎ×	ïÂÒÅÚÁÎÉÅ çÏÓÐÏÄÎÅ
 19 ÑÎ×	âÏÇÏÑ×ÌÅÎÉÅ ÉÌÉ ëÒÅÝÅÎÉÅ çÏÓÐÏÄÎÅ
 15 ÆÅ×	óÒÅÔÅÎÉÅ çÏÓÐÏÄÎÅ
-ðÁÓÈÁ-46	÷ÅÌÉËÉÊ ðÏÓÔ
-ðÁÓÈÁ-7	÷ÅÒÂÎÏÅ ÷ÏÓËÒÅÓÅÎØÅ
+ðÁÓÈÁ-48	÷ÅÌÉËÉÊ ðÏÓÔ
+ðÁÓÈÁ-7	÷ÈÏÄ çÏÓÐÏÄÅÎØ × éÅÒÕÓÁÌÉÍ. ÷ÅÒÂÎÏÅ ÷ÏÓËÒÅÓÅÎØÅ
 ðÁÓÈÁ-3	÷ÅÌÉËÉÊ þÅÔ×ÅÒÇ
 ðÁÓÈÁ-2	óÔÒÁÓÔÎÁÑ ðÑÔÎÉÃÁ
 ðÁÓÈÁ	÷ÏÓËÒÅÓÅÎÉÅ èÒÉÓÔÏ×Ï
 ðÁÓÈÁ+39	÷ÏÚÎÅÓÅÎÉÅ
-ðÁÓÈÁ+49	ðÑÔÉÄÅÓÑÔÎÉÃÁ
-ðÁÓÈÁ+56	ôÒÏÉÃÉÎ äÅÎØ
-ðÁÓÈÁ+60	ðÒÁÚÄÎÉË ôÅÌÁ èÒÉÓÔÏ×Á
+ðÁÓÈÁ+49	äÅÎØ ó×ÑÔÏÊ ôÒÏÉÃÙ. ðÑÔÉÄÅÓÑÔÎÉÃÁ
  7 ÁÐÒ	âÌÁÇÏ×ÅÝÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ
+ 7 ÉÀÌ	òÏÖÄÅÓÔ×Ï éÏÁÎÎÁ ðÒÅÄÔÅÞÉ
+12 ÉÀÌ	äÅÎØ Ó×ÑÔÙÈ ÐÅÒ×Ï×ÅÒÈÏ×ÎÙÈ ÁÐÏÓÔÏÌÏ× ðÅÔÒÁ É ðÁ×ÌÁ
 19 Á×Ç	ðÒÅÏÂÒÁÖÅÎÉÅ çÏÓÐÏÄÎÅ
 28 Á×Ç	õÓÐÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ
+11 ÓÅÎ	õÓÅËÎÏ×ÅÎÉÅ ÇÌÁ×Ù éÏÁÎÎÁ ðÒÅÄÔÅÞÉ
 
 #endif /* !_ru_RU_KOI8_R_orthodox_ */
 

Modified: stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan
==============================================================================
--- stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan	Sat Mar 12 14:47:54 2011	(r219568)
+++ stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan	Sat Mar 12 14:57:10 2011	(r219569)
@@ -17,7 +17,7 @@ Paskha=ðÁÓÈÁ
 29 ÆÅ×	äÅÎØ ëÁÝÅÑ
  1 ÍÁÒ	äÅÎØ íÁÒÅÎÙ
 14 ÍÁÒ	îÏ×ÙÊ çÏÄ, ï×ÓÅÎØ ÍÁÌÙÊ
-ðÁÓÈÁ-47	íÁÓÌÅÎÉÃÁ
+ðÁÓÈÁ-55	íÁÓÌÅÎÉÃÁ
 ðÁÓÈÁ+7	ëÒÁÓÎÁÑ çÏÒËÁ
 ðÁÓÈÁ+16	òÁÄÕÎÉÃÁ
 20 ÍÁÒ*	÷ÅÓÅÎÎÉÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ

Modified: stable/8/usr.bin/calendar/parsedata.c
==============================================================================
--- stable/8/usr.bin/calendar/parsedata.c	Sat Mar 12 14:47:54 2011	(r219568)
+++ stable/8/usr.bin/calendar/parsedata.c	Sat Mar 12 14:57:10 2011	(r219569)
@@ -80,7 +80,7 @@ static char *floattotime(double f);
  * ModifierIndex	::=	'Second' | 'Third' | 'Fourth' | 'Fifth' |
  *				'First' | 'Last'
  * 
- * SpecialDay		::=	'Easter' | 'Pashka' | 'ChineseNewYear'
+ * SpecialDay		::=	'Easter' | 'Paskha' | 'ChineseNewYear'
  *
  */
 static int
@@ -459,6 +459,7 @@ parsedaymonth(char *date, int *yearp, in
 
 			yearinfo->mondays = mondaytab[isleap(year)];
 			yearinfo->ieaster = easter(year);
+			yearinfo->ipaskha = paskha(year);
 			fpom(year, UTCOffset, yearinfo->ffullmoon,
 			    yearinfo->fnewmoon);
 			fpom(year, UTCOFFSET_CNY, yearinfo->ffullmooncny,

Modified: stable/8/usr.bin/calendar/paskha.c
==============================================================================
--- stable/8/usr.bin/calendar/paskha.c	Sat Mar 12 14:47:54 2011	(r219568)
+++ stable/8/usr.bin/calendar/paskha.c	Sat Mar 12 14:57:10 2011	(r219569)
@@ -36,8 +36,17 @@ __FBSDID("$FreeBSD$");
 #define	PASKHA		"paskha"
 #define	PASKHALEN	(sizeof(PASKHA) - 1)
 
+/* return difference in days between Julian and Gregorian calendars */
+int
+j2g(int year)
+{
+	return (year < 1500) ?
+		0 :
+		10 + (year/100 - 16) - ((year/100 - 16) / 4);
+}
+
 /* return year day for Orthodox Easter using Gauss formula */
-/* (old style result) */
+/* (new style result) */
 
 int
 paskha(int R) /*year*/
@@ -53,5 +62,5 @@ paskha(int R) /*year*/
 	d = (19 * a + x) % 30;
 	e = (2 * b + 4 * c + 6 * d + y) % 7;
 	cumday = cumdaytab[isleap(R)];
-	return (((cumday[3] + 1) + 22) + (d + e));
+	return (((cumday[3] + 1) + 22) + (d + e) + j2g(R));
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 16:45:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAA0A106566B;
	Sat, 12 Mar 2011 16:45:15 +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 B145D8FC1B;
	Sat, 12 Mar 2011 16:45: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 p2CGjFB6024391;
	Sat, 12 Mar 2011 16:45:15 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CGjF3p024387;
	Sat, 12 Mar 2011 16:45:15 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103121645.p2CGjF3p024387@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 12 Mar 2011 16:45: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: r219570 - head/sys/netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 16:45:16 -0000

Author: bz
Date: Sat Mar 12 16:45:15 2011
New Revision: 219570
URL: http://svn.freebsd.org/changeset/base/219570

Log:
  Push a possible "unbind" in some situation from in6_pcbsetport() to
  callers.  This also fixes a problem when the prison call could set
  the inp->in6p_laddr (laddr) and a following priv_check_cred() call
  would return an error and will allow us to merge the IPv4 and IPv6
  implementation.
  
  MFC after:	2 weeks

Modified:
  head/sys/netinet6/in6_pcb.c
  head/sys/netinet6/in6_src.c
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/in6_pcb.c
==============================================================================
--- head/sys/netinet6/in6_pcb.c	Sat Mar 12 14:57:10 2011	(r219569)
+++ head/sys/netinet6/in6_pcb.c	Sat Mar 12 16:45:15 2011	(r219570)
@@ -256,8 +256,11 @@ in6_pcbbind(register struct inpcb *inp, 
 		inp->in6p_laddr = sin6->sin6_addr;
 	}
 	if (lport == 0) {
-		if ((error = in6_pcbsetport(&inp->in6p_laddr, inp, cred)) != 0)
+		if ((error = in6_pcbsetport(&inp->in6p_laddr, inp, cred)) != 0) {
+			/* Undo an address bind that may have occurred. */
+			inp->in6p_laddr = in6addr_any;
 			return (error);
+		}
 	} else {
 		inp->inp_lport = lport;
 		if (in_pcbinshash(inp) != 0) {

Modified: head/sys/netinet6/in6_src.c
==============================================================================
--- head/sys/netinet6/in6_src.c	Sat Mar 12 14:57:10 2011	(r219569)
+++ head/sys/netinet6/in6_src.c	Sat Mar 12 16:45:15 2011	(r219570)
@@ -925,11 +925,8 @@ in6_pcbsetport(struct in6_addr *laddr, s
 	count = last - first;
 
 	do {
-		if (count-- < 0) {	/* completely used? */
-			/* Undo an address bind that may have occurred. */
-			inp->in6p_laddr = in6addr_any;
+		if (count-- < 0)	/* completely used? */
 			return (EADDRNOTAVAIL);
-		}
 		++*lastport;
 		if (*lastport < first || *lastport > last)
 			*lastport = first;

Modified: head/sys/netinet6/udp6_usrreq.c
==============================================================================
--- head/sys/netinet6/udp6_usrreq.c	Sat Mar 12 14:57:10 2011	(r219569)
+++ head/sys/netinet6/udp6_usrreq.c	Sat Mar 12 16:45:15 2011	(r219570)
@@ -656,8 +656,11 @@ udp6_output(struct inpcb *inp, struct mb
 			goto release;
 		}
 		if (inp->inp_lport == 0 &&
-		    (error = in6_pcbsetport(laddr, inp, td->td_ucred)) != 0)
+		    (error = in6_pcbsetport(laddr, inp, td->td_ucred)) != 0) {
+			/* Undo an address bind that may have occurred. */
+			inp->in6p_laddr = in6addr_any;
 			goto release;
+		}
 	} else {
 		if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
 			error = ENOTCONN;

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 16:50:40 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5BBF91065676;
	Sat, 12 Mar 2011 16:50:40 +0000 (UTC)
	(envelope-from kargl@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B4F58FC16;
	Sat, 12 Mar 2011 16:50:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2CGoeoR024536;
	Sat, 12 Mar 2011 16:50:40 GMT (envelope-from kargl@svn.freebsd.org)
Received: (from kargl@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CGoePR024529;
	Sat, 12 Mar 2011 16:50:40 GMT (envelope-from kargl@svn.freebsd.org)
Message-Id: <201103121650.p2CGoePR024529@svn.freebsd.org>
From: Steve Kargl 
Date: Sat, 12 Mar 2011 16:50: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: r219571 - in head/lib/msun: . man src
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 16:50:40 -0000

Author: kargl
Date: Sat Mar 12 16:50:39 2011
New Revision: 219571
URL: http://svn.freebsd.org/changeset/base/219571

Log:
  Implement the long double version for the cube root function, cbrtl.
  The algorithm uses Newton's iterations with a crude estimate of the
  cube root to converge to a result.
  
  Reviewed by:	bde
  Approved by:	das

Modified:
  head/lib/msun/Makefile
  head/lib/msun/Symbol.map
  head/lib/msun/man/math.3
  head/lib/msun/man/sqrt.3
  head/lib/msun/src/math.h
  head/lib/msun/src/s_cbrt.c

Modified: head/lib/msun/Makefile
==============================================================================
--- head/lib/msun/Makefile	Sat Mar 12 16:45:15 2011	(r219570)
+++ head/lib/msun/Makefile	Sat Mar 12 16:50:39 2011	(r219571)
@@ -93,8 +93,8 @@ COMMON_SRCS+=	s_copysignl.c s_fabsl.c s_
 COMMON_SRCS+=	e_acosl.c e_asinl.c e_atan2l.c e_fmodl.c \
 	e_hypotl.c e_remainderl.c e_sqrtl.c \
 	invtrig.c k_cosl.c k_sinl.c k_tanl.c \
-	s_atanl.c s_ceill.c s_cosl.c s_cprojl.c s_csqrtl.c s_exp2l.c \
-	s_floorl.c s_fmal.c \
+	s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \
+	s_csqrtl.c s_exp2l.c s_floorl.c s_fmal.c \
 	s_frexpl.c s_logbl.c s_nanl.c s_nextafterl.c s_nexttoward.c \
 	s_remquol.c s_rintl.c s_scalbnl.c \
 	s_sinl.c s_tanl.c s_truncl.c w_cabsl.c
@@ -197,7 +197,8 @@ MLINKS+=scalbn.3 scalbln.3 scalbn.3 scal
 MLINKS+=scalbn.3 scalbnf.3 scalbn.3 scalbnl.3
 MLINKS+=sin.3 sinf.3 sin.3 sinl.3
 MLINKS+=sinh.3 sinhf.3
-MLINKS+=sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 sqrtf.3 sqrt.3 sqrtl.3
+MLINKS+=sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 cbrtl.3 sqrt.3 sqrtf.3 \
+	sqrt.3 sqrtl.3
 MLINKS+=tan.3 tanf.3 tan.3 tanl.3
 MLINKS+=tanh.3 tanhf.3
 MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3

Modified: head/lib/msun/Symbol.map
==============================================================================
--- head/lib/msun/Symbol.map	Sat Mar 12 16:45:15 2011	(r219570)
+++ head/lib/msun/Symbol.map	Sat Mar 12 16:50:39 2011	(r219571)
@@ -222,6 +222,7 @@ FBSD_1.1 {
 /* First added in 9.0-CURRENT */
 FBSD_1.2 {
 	__isnanf;
+	cbrtl;
 	cexp;
 	cexpf;
 	log2;

Modified: head/lib/msun/man/math.3
==============================================================================
--- head/lib/msun/man/math.3	Sat Mar 12 16:45:15 2011	(r219570)
+++ head/lib/msun/man/math.3	Sat Mar 12 16:50:39 2011	(r219571)
@@ -220,12 +220,11 @@ and
 .Vt long double
 values, were written for or imported into subsequent versions of FreeBSD.
 .Sh BUGS
-The
-.Fn cbrt
-function and many of the transcendental functions
-are not available in their
+Some of the
 .Vt "long double"
-variants.
+math functions in
+.St -isoC-99
+are not available.
 .Pp
 Many of the routines to compute transcendental functions produce
 inaccurate results in other than the default rounding mode.

Modified: head/lib/msun/man/sqrt.3
==============================================================================
--- head/lib/msun/man/sqrt.3	Sat Mar 12 16:45:15 2011	(r219570)
+++ head/lib/msun/man/sqrt.3	Sat Mar 12 16:50:39 2011	(r219571)
@@ -28,12 +28,13 @@
 .\"     from: @(#)sqrt.3	6.4 (Berkeley) 5/6/91
 .\" $FreeBSD$
 .\"
-.Dd March 1, 2008
+.Dd March 5, 2011
 .Dt SQRT 3
 .Os
 .Sh NAME
 .Nm cbrt ,
 .Nm cbrtf ,
+.Nm cbrtl ,
 .Nm sqrt ,
 .Nm sqrtf ,
 .Nm sqrtl
@@ -46,6 +47,8 @@
 .Fn cbrt "double x"
 .Ft float
 .Fn cbrtf "float x"
+.Ft long double
+.Fn cbrtl "long double x"
 .Ft double
 .Fn sqrt "double x"
 .Ft float
@@ -54,9 +57,10 @@
 .Fn sqrtl "long double x"
 .Sh DESCRIPTION
 The
-.Fn cbrt
-and the
-.Fn cbrtf
+.Fn cbrt ,
+.Fn cbrtf ,
+and
+.Fn cbrtl
 functions compute
 the cube root of
 .Ar x .
@@ -67,12 +71,14 @@ The
 and
 .Fn sqrtl
 functions compute the
-non-negative square root of x.
+non-negative square root of
+.Ar x .
 .Sh RETURN VALUES
 The
-.Fn cbrt
-and the
-.Fn cbrtf
+.Fn cbrt ,
+.Fn cbrtf ,
+and
+.Fn cbrtl
 functions return the requested cube root.
 The
 .Fn sqrt ,
@@ -94,6 +100,7 @@ raises an invalid exception and causes a
 The
 .Fn cbrt ,
 .Fn cbrtf ,
+.Fn cbrtl ,
 .Fn sqrt ,
 .Fn sqrtf ,
 and
@@ -109,3 +116,7 @@ The
 .Fn sqrtl
 function appeared in
 .Fx 8.0 .
+The
+.Fn cbrtl
+function appeared in
+.Fx 9.0 .

Modified: head/lib/msun/src/math.h
==============================================================================
--- head/lib/msun/src/math.h	Sat Mar 12 16:45:15 2011	(r219570)
+++ head/lib/msun/src/math.h	Sat Mar 12 16:50:39 2011	(r219571)
@@ -411,9 +411,7 @@ long double	atan2l(long double, long dou
 long double	atanhl(long double);
 #endif
 long double	atanl(long double);
-#if 0
 long double	cbrtl(long double);
-#endif
 long double	ceill(long double);
 long double	copysignl(long double, long double) __pure2;
 #if 0

Modified: head/lib/msun/src/s_cbrt.c
==============================================================================
--- head/lib/msun/src/s_cbrt.c	Sat Mar 12 16:45:15 2011	(r219570)
+++ head/lib/msun/src/s_cbrt.c	Sat Mar 12 16:50:39 2011	(r219571)
@@ -111,3 +111,7 @@ cbrt(double x)
 
 	return(t);
 }
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(cbrt, cbrtl);
+#endif

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 17:03:41 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7238F106568B;
	Sat, 12 Mar 2011 17:03:41 +0000 (UTC)
	(envelope-from kargl@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 61ADF8FC0A;
	Sat, 12 Mar 2011 17:03: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 p2CH3fRw024936;
	Sat, 12 Mar 2011 17:03:41 GMT (envelope-from kargl@svn.freebsd.org)
Received: (from kargl@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CH3foM024933;
	Sat, 12 Mar 2011 17:03:41 GMT (envelope-from kargl@svn.freebsd.org)
Message-Id: <201103121703.p2CH3foM024933@svn.freebsd.org>
From: Steve Kargl 
Date: Sat, 12 Mar 2011 17:03: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: r219572 - head/lib/msun
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 17:03:41 -0000

Author: kargl
Date: Sat Mar 12 17:03:41 2011
New Revision: 219572
URL: http://svn.freebsd.org/changeset/base/219572

Log:
  Temporary disable the building of cbrtl until I
  can determine why svn will not allow one to commit
  a new file.
  
  Approved by:	das (implicit)

Modified:
  head/lib/msun/Makefile
  head/lib/msun/Symbol.map

Modified: head/lib/msun/Makefile
==============================================================================
--- head/lib/msun/Makefile	Sat Mar 12 16:50:39 2011	(r219571)
+++ head/lib/msun/Makefile	Sat Mar 12 17:03:41 2011	(r219572)
@@ -93,7 +93,7 @@ COMMON_SRCS+=	s_copysignl.c s_fabsl.c s_
 COMMON_SRCS+=	e_acosl.c e_asinl.c e_atan2l.c e_fmodl.c \
 	e_hypotl.c e_remainderl.c e_sqrtl.c \
 	invtrig.c k_cosl.c k_sinl.c k_tanl.c \
-	s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \
+	s_atanl.c s_ceill.c s_cosl.c s_cprojl.c \
 	s_csqrtl.c s_exp2l.c s_floorl.c s_fmal.c \
 	s_frexpl.c s_logbl.c s_nanl.c s_nextafterl.c s_nexttoward.c \
 	s_remquol.c s_rintl.c s_scalbnl.c \

Modified: head/lib/msun/Symbol.map
==============================================================================
--- head/lib/msun/Symbol.map	Sat Mar 12 16:50:39 2011	(r219571)
+++ head/lib/msun/Symbol.map	Sat Mar 12 17:03:41 2011	(r219572)
@@ -222,7 +222,6 @@ FBSD_1.1 {
 /* First added in 9.0-CURRENT */
 FBSD_1.2 {
 	__isnanf;
-	cbrtl;
 	cexp;
 	cexpf;
 	log2;

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 17:05:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A0D07106566C;
	Sat, 12 Mar 2011 17:05:18 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 90D1E8FC0A;
	Sat, 12 Mar 2011 17:05: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 p2CH5IC3025004;
	Sat, 12 Mar 2011 17:05:18 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CH5IPs025002;
	Sat, 12 Mar 2011 17:05:18 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201103121705.p2CH5IPs025002@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Sat, 12 Mar 2011 17:05: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: r219573 - head/sbin/geom/class/part
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 17:05:18 -0000

Author: ae
Date: Sat Mar 12 17:05:18 2011
New Revision: 219573
URL: http://svn.freebsd.org/changeset/base/219573

Log:
  Document GEOM_PART_EBR_COMPAT option.
  
  MFC after:	2 weeks

Modified:
  head/sbin/geom/class/part/gpart.8

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Sat Mar 12 17:03:41 2011	(r219572)
+++ head/sbin/geom/class/part/gpart.8	Sat Mar 12 17:05:18 2011	(r219573)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 9, 2011
+.Dd March 12, 2011
 .Dt GPART 8
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@ lines in your kernel configuration file:
 .Cd "options GEOM_PART_APM"
 .Cd "options GEOM_PART_BSD"
 .Cd "options GEOM_PART_EBR"
+.Cd "options GEOM_PART_EBR_COMPAT"
 .Cd "options GEOM_PART_GPT"
 .Cd "options GEOM_PART_MBR"
 .Cd "options GEOM_PART_PC98"
@@ -58,6 +59,11 @@ The
 option adds support for the Extended Boot Record (EBR),
 which is used to define a logical partition.
 The
+.Dv GEOM_PART_EBR_COMPAT
+option enables the backward compatibility for the partition names
+of the EBR scheme. Also it makes impossible any types of actions
+with such partitions.
+The
 .Dv GEOM_PART_GPT
 option adds support for the GUID Partition Table (GPT)
 found on Intel Itanium computers and Intel-based Macintosh computers.

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 17:05:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B54931065677;
	Sat, 12 Mar 2011 17:05:42 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90])
	by mx1.freebsd.org (Postfix) with ESMTP id 6E7878FC23;
	Sat, 12 Mar 2011 17:05:42 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id B26A725D3899;
	Sat, 12 Mar 2011 16:49:02 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id DE2DB159A997;
	Sat, 12 Mar 2011 16:49:01 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id 74+DhPT1a7JQ; Sat, 12 Mar 2011 16:49:01 +0000 (UTC)
Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id E57B1159A993;
	Sat, 12 Mar 2011 16:49:00 +0000 (UTC)
Date: Sat, 12 Mar 2011 16:49:00 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-head@freebsd.org
In-Reply-To: <201103121645.p2CGjF3p024387@svn.freebsd.org>
Message-ID: 
References: <201103121645.p2CGjF3p024387@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: 
Subject: Re: svn commit: r219570 - head/sys/netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 17:05:42 -0000

On Sat, 12 Mar 2011, Bjoern A. Zeeb wrote:

> Author: bz
> Date: Sat Mar 12 16:45:15 2011
> New Revision: 219570
> URL: http://svn.freebsd.org/changeset/base/219570
>
> Log:
>  Push a possible "unbind" in some situation from in6_pcbsetport() to
>  callers.  This also fixes a problem when the prison call could set
>  the inp->in6p_laddr (laddr) and a following priv_check_cred() call
>  would return an error and will allow us to merge the IPv4 and IPv6
>  implementation.

While for IPv4 most of the calls were adjusted that we do not pass the
inp->inp_laddr directly but a working copy and merge them back at the
end if there was no error. For IPv6 these changes were not really
done.  Since we have started to fix that partly, but we should do a
full sweep.

/bz

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 17:38:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E82A9106566B;
	Sat, 12 Mar 2011 17:38:22 +0000 (UTC)
	(envelope-from minimarmot@gmail.com)
Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com
	[209.85.161.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 6CA768FC17;
	Sat, 12 Mar 2011 17:38:22 +0000 (UTC)
Received: by gxk28 with SMTP id 28so589467gxk.13
	for ; Sat, 12 Mar 2011 09:38:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=EBoQgxlVN7QGwqp+IlFXZAX36KeA005D+d2PaxOfl/s=;
	b=RCzE2iYECXzbHB+D/gDjB5FfKibhwLm87xzNvB2bDRnewNkwjQ4+q3jNrISr+tfMQR
	TFUaQsMncYc/LHkYUSzhXmgPbTggkR4blHLdvOGp072VgTSekrmEo3g/+bV8nK19sJ+I
	FcFZ6h/fNfufhy8OD2jCFJyKBsx/+9eDxIKSE=
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=YKN5/0ZDr/E/2GGwF5TEJy2ci7C3IfJIQ4vxS8BFwbOcKbyhTZoBnWnCrf7biW1Udt
	NnTtJeO7LyxMHyow5qRaNyuWnh/Hs+QwfnDF4yGnJ4xhZxfOQxduQWLLHnaa1AK2V/Mq
	THvHABmxObg5iNbxJivGI2qiyC/a/6b82Mvr8=
MIME-Version: 1.0
Received: by 10.146.215.25 with SMTP id n25mr15618496yag.19.1299950104405;
	Sat, 12 Mar 2011 09:15:04 -0800 (PST)
Received: by 10.147.170.7 with HTTP; Sat, 12 Mar 2011 09:15:04 -0800 (PST)
In-Reply-To: <201103121705.p2CH5IPs025002@svn.freebsd.org>
References: <201103121705.p2CH5IPs025002@svn.freebsd.org>
Date: Sat, 12 Mar 2011 12:15:04 -0500
Message-ID: 
From: Ben Kaduk 
To: "Andrey V. Elsukov" 
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: r219573 - head/sbin/geom/class/part
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 17:38:23 -0000

On Sat, Mar 12, 2011 at 12:05 PM, Andrey V. Elsukov  wrote:
> Author: ae
> Date: Sat Mar 12 17:05:18 2011
> New Revision: 219573
> URL: http://svn.freebsd.org/changeset/base/219573
>
> Log:
> =A0Document GEOM_PART_EBR_COMPAT option.
>
> =A0MFC after: =A0 =A02 weeks
>
> Modified:
> =A0head/sbin/geom/class/part/gpart.8
>
> Modified: head/sbin/geom/class/part/gpart.8
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=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/sbin/geom/class/part/gpart.8 =A0 Sat Mar 12 17:03:41 2011 =A0 =
=A0 =A0 =A0(r219572)
> +++ head/sbin/geom/class/part/gpart.8 =A0 Sat Mar 12 17:05:18 2011 =A0 =
=A0 =A0 =A0(r219573)
> @@ -24,7 +24,7 @@
> =A0.\"
> =A0.\" $FreeBSD$
> =A0.\"
> -.Dd March 9, 2011
> +.Dd March 12, 2011
> =A0.Dt GPART 8
> =A0.Os
> =A0.Sh NAME
> @@ -38,6 +38,7 @@ lines in your kernel configuration file:
> =A0.Cd "options GEOM_PART_APM"
> =A0.Cd "options GEOM_PART_BSD"
> =A0.Cd "options GEOM_PART_EBR"
> +.Cd "options GEOM_PART_EBR_COMPAT"
> =A0.Cd "options GEOM_PART_GPT"
> =A0.Cd "options GEOM_PART_MBR"
> =A0.Cd "options GEOM_PART_PC98"
> @@ -58,6 +59,11 @@ The
> =A0option adds support for the Extended Boot Record (EBR),
> =A0which is used to define a logical partition.
> =A0The
> +.Dv GEOM_PART_EBR_COMPAT
> +option enables the backward compatibility for the partition names

I think just "enables backward compatibility" is more standard English
usage.  Not knowing much about the EBR scheme, I would also guess that
"for partition names in the EBR scheme" is what is intended here, but
that would be something of a guess.

> +of the EBR scheme. Also it makes impossible any types of actions
> +with such partitions.

Judging by, e.g. r216755 of g_part_ebr.c, it seems that the sense of
"impossible" is reversed.  I think "It also allows such partitions to
be modified" might be what is intended?

-Ben Kaduk

> +The
> =A0.Dv GEOM_PART_GPT
> =A0option adds support for the GUID Partition Table (GPT)
> =A0found on Intel Itanium computers and Intel-based Macintosh computers.

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 18:23:27 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FC98106564A
	for ; Sat, 12 Mar 2011 18:23:27 +0000 (UTC)
	(envelope-from bu7cher@yandex.ru)
Received: from forward5.mail.yandex.net (forward5.mail.yandex.net
	[77.88.46.21]) by mx1.freebsd.org (Postfix) with ESMTP id 201DF8FC12
	for ; Sat, 12 Mar 2011 18:23:25 +0000 (UTC)
Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104])
	by forward5.mail.yandex.net (Yandex) with ESMTP id CC7961202C94;
	Sat, 12 Mar 2011 21:11:09 +0300 (MSK)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
	t=1299953469; bh=cCWrtEGadL4wyBMo44YssJHy9myEzRT06HHjhahbBKU=;
	h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References:
	In-Reply-To:Content-Type;
	b=ez0TQvhVnzyWbs2y7NW8s5yQJNmZ3vazUO7PF6GX766njlq0BMSesIRcdJ0j31uVq
	862lZwQ6xL5FPWizApCnxDXPX/zF2J+Bj3SEdU9ZxGjicW5JN0c9R2cnPbfJwVsiUF
	uJfipNwTRNWaHC6auqPbwLUhdQojXqIijDH6D2yQ=
Received: from [178.141.127.141] (dynamic-178-141-127-141.kirov.comstar-r.ru
	[178.141.127.141])
	by smtp4.mail.yandex.net (Yandex) with ESMTPSA id 8596C64980B6;
	Sat, 12 Mar 2011 21:11:09 +0300 (MSK)
Message-ID: <4D7BB726.3000209@yandex.ru>
Date: Sat, 12 Mar 2011 21:10:46 +0300
From: "Andrey V. Elsukov" 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110309 Thunderbird/3.1.9
MIME-Version: 1.0
To: Ben Kaduk 
References: <201103121705.p2CH5IPs025002@svn.freebsd.org>
	
In-Reply-To: 
X-Enigmail-Version: 1.1.2
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enigD4BAFFBBCDF5E583C87385E0"
Cc: svn-src-all@freebsd.org
Subject: Re: svn commit: r219573 - head/sbin/geom/class/part
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 18:23:27 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigD4BAFFBBCDF5E583C87385E0
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

On 12.03.2011 20:15, Ben Kaduk wrote:
> I think just "enables backward compatibility" is more standard English
> usage.  Not knowing much about the EBR scheme, I would also guess that
> "for partition names in the EBR scheme" is what is intended here, but
> that would be something of a guess.

Partitions from EBR have names like they were in FreeBSD prior to
GEOM_PART. E.g. ad0s5, ad0s6,... But without this option they may be
like these:
> gpart show -p ada2s3
=3D>         0  1830660048           ada2s3  EBR  (873G)
           0    17767890  ada2s3+00000001  !6  (8.5G)
    17767890         189                   - free -  (95K)
    17768079     1023939  ada2s3+00282034  ntfs  (500M)
    18792018  1481207994                   - free -  (706G)
  1500000012     1023939  ada2s3+23809525  fat32  (500M)
  1501023951      204750  ada2s3+23825778  fat32  (100M)
  1501228701   329431347                   - free -  (157G)
> ls -1 /dev/ada2s3*
/dev/ada2s3
/dev/ada2s3+00000001
/dev/ada2s3+00282034
/dev/ada2s3+23809525
/dev/ada2s3+23825778

So, do you recommend to change first sentence to:
"The GEOM_PART_EBR_COMPAT option enables backward compatibility for
partition names in the EBR scheme."

>> +of the EBR scheme. Also it makes impossible any types of actions
>> +with such partitions.
>=20
> Judging by, e.g. r216755 of g_part_ebr.c, it seems that the sense of
> "impossible" is reversed.  I think "It also allows such partitions to
> be modified" might be what is intended?

r216755 only allows destroy partition table, but you can not modify nor
partition, nor partition table.

--=20
WBR, Andrey V. Elsukov


--------------enigD4BAFFBBCDF5E583C87385E0
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iQEcBAEBAgAGBQJNe7cqAAoJEAHF6gQQyKF6f1MH/i2qh8E04mHq+ETaAk2qmHJQ
SmiN8NCLubDrgK0XN0p67GklVtOtMgT9PHPy3dah2CtsWOKkKnym4jyHPDqREsrl
LcsT8N5xVAGQ3XVLz4Qi8pi33hpa+haQ6vUfsJhOjX8NLxdRiPVB3b0qJvXhfhfJ
xPvFl38nufJl2JS7FmyEgSt3HfviBQ/Fh9ceHrYQmghoMG5YBfxCzMArW2Vj+lnj
GovQv3tRnMOCz8pIL7fQdCVNfpwMKe3sH/NPp9YYIuZqbgaWoxdjqIfPQ35O+jZl
WsXxSiKAeAlGnpvfmvZ+qYC7JWm1oyYG2TxXustnYYhOofFRg1LcknzEZeS0jKs=
=/qg/
-----END PGP SIGNATURE-----

--------------enigD4BAFFBBCDF5E583C87385E0--

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 19:05:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BDA87106564A;
	Sat, 12 Mar 2011 19:05:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AD50E8FC0A;
	Sat, 12 Mar 2011 19:05: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 p2CJ5d9H027398;
	Sat, 12 Mar 2011 19:05:39 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CJ5dNo027396;
	Sat, 12 Mar 2011 19:05:39 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103121905.p2CJ5dNo027396@svn.freebsd.org>
From: Glen Barber 
Date: Sat, 12 Mar 2011 19:05: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: r219574 - head/sbin/ifconfig
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 19:05:39 -0000

Author: gjb (doc committer)
Date: Sat Mar 12 19:05:39 2011
New Revision: 219574
URL: http://svn.freebsd.org/changeset/base/219574

Log:
  Add example of using 'scan' for wireless networks, similarly to
  OpenBSD's ifconfig(8).
  
  PR:		151952
  Submitted by:	Jared (rhyous of yahoo com)
  MFC after:	1 week

Modified:
  head/sbin/ifconfig/ifconfig.8

Modified: head/sbin/ifconfig/ifconfig.8
==============================================================================
--- head/sbin/ifconfig/ifconfig.8	Sat Mar 12 17:05:18 2011	(r219573)
+++ head/sbin/ifconfig/ifconfig.8	Sat Mar 12 19:05:39 2011	(r219574)
@@ -2537,6 +2537,10 @@ Create the software network interface
 Destroy the software network interface
 .Li gif1 :
 .Dl # ifconfig gif1 destroy
+.Pp
+Scan for wireless networks using
+.Li wlan0 :
+.Dl # ifconfig wlan0 scan
 .Sh DIAGNOSTICS
 Messages indicating the specified interface does not exist, the
 requested address is unknown, or the user is not privileged and

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 19:07:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9DB8F106564A;
	Sat, 12 Mar 2011 19:07:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D7A98FC0A;
	Sat, 12 Mar 2011 19:07: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 p2CJ7Jq2027472;
	Sat, 12 Mar 2011 19:07:19 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CJ7JLX027470;
	Sat, 12 Mar 2011 19:07:19 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103121907.p2CJ7JLX027470@svn.freebsd.org>
From: Glen Barber 
Date: Sat, 12 Mar 2011 19:07: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: r219575 - head/sbin/ifconfig
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 19:07:19 -0000

Author: gjb (doc committer)
Date: Sat Mar 12 19:07:19 2011
New Revision: 219575
URL: http://svn.freebsd.org/changeset/base/219575

Log:
  Remove unneeded newline.
  
  MFC after:	1 week

Modified:
  head/sbin/ifconfig/ifconfig.8

Modified: head/sbin/ifconfig/ifconfig.8
==============================================================================
--- head/sbin/ifconfig/ifconfig.8	Sat Mar 12 19:05:39 2011	(r219574)
+++ head/sbin/ifconfig/ifconfig.8	Sat Mar 12 19:07:19 2011	(r219575)
@@ -2527,7 +2527,6 @@ to use 100baseTX, full duplex Ethernet m
 .Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex
 .Pp
 Label the em0 interface as an uplink:
-.Pp
 .Dl # ifconfig em0 description \&"Uplink to Gigabit Switch 2\&"
 .Pp
 Create the software network interface

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 19:37:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C71B21065672;
	Sat, 12 Mar 2011 19:37:35 +0000 (UTC)
	(envelope-from kargl@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B56688FC13;
	Sat, 12 Mar 2011 19:37: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 p2CJbZpD028150;
	Sat, 12 Mar 2011 19:37:35 GMT (envelope-from kargl@svn.freebsd.org)
Received: (from kargl@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CJbZnq028146;
	Sat, 12 Mar 2011 19:37:35 GMT (envelope-from kargl@svn.freebsd.org)
Message-Id: <201103121937.p2CJbZnq028146@svn.freebsd.org>
From: Steve Kargl 
Date: Sat, 12 Mar 2011 19:37: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: r219576 - in head/lib/msun: . src
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 19:37:35 -0000

Author: kargl
Date: Sat Mar 12 19:37:35 2011
New Revision: 219576
URL: http://svn.freebsd.org/changeset/base/219576

Log:
  Take two.  Add the missing file that should have been committed
  with r219571 and re-enable building of cbrtl.
  
  Implement the long double version for the cube root function, cbrtl.
  The algorithm uses Newton's iterations with a crude estimate of the
  cube root to converge to a result.
  
  Reviewed by:    bde
  Approved by:    das

Added:
  head/lib/msun/src/s_cbrtl.c   (contents, props changed)
Modified:
  head/lib/msun/Makefile
  head/lib/msun/Symbol.map

Modified: head/lib/msun/Makefile
==============================================================================
--- head/lib/msun/Makefile	Sat Mar 12 19:07:19 2011	(r219575)
+++ head/lib/msun/Makefile	Sat Mar 12 19:37:35 2011	(r219576)
@@ -93,7 +93,7 @@ COMMON_SRCS+=	s_copysignl.c s_fabsl.c s_
 COMMON_SRCS+=	e_acosl.c e_asinl.c e_atan2l.c e_fmodl.c \
 	e_hypotl.c e_remainderl.c e_sqrtl.c \
 	invtrig.c k_cosl.c k_sinl.c k_tanl.c \
-	s_atanl.c s_ceill.c s_cosl.c s_cprojl.c \
+	s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \
 	s_csqrtl.c s_exp2l.c s_floorl.c s_fmal.c \
 	s_frexpl.c s_logbl.c s_nanl.c s_nextafterl.c s_nexttoward.c \
 	s_remquol.c s_rintl.c s_scalbnl.c \

Modified: head/lib/msun/Symbol.map
==============================================================================
--- head/lib/msun/Symbol.map	Sat Mar 12 19:07:19 2011	(r219575)
+++ head/lib/msun/Symbol.map	Sat Mar 12 19:37:35 2011	(r219576)
@@ -222,6 +222,7 @@ FBSD_1.1 {
 /* First added in 9.0-CURRENT */
 FBSD_1.2 {
 	__isnanf;
+	cbrtl;
 	cexp;
 	cexpf;
 	log2;

Added: head/lib/msun/src/s_cbrtl.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/msun/src/s_cbrtl.c	Sat Mar 12 19:37:35 2011	(r219576)
@@ -0,0 +1,157 @@
+/*-
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2009-2011, Bruce D. Evans, Steven G. Kargl, David Schultz.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ * The argument reduction and testing for exceptional cases was
+ * written by Steven G. Kargl with input from Bruce D. Evans
+ * and David A. Schultz.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include "fpmath.h"    
+#include "math.h"
+#include "math_private.h"
+
+#define	BIAS	(LDBL_MAX_EXP - 1)
+
+static const unsigned
+    B1 = 709958130;	/* B1 = (127-127.0/3-0.03306235651)*2**23 */
+
+long double
+cbrtl(long double x)
+{
+	union IEEEl2bits u, v;
+	long double r, s, t, w;
+	double dr, dt, dx;
+	float ft, fx;
+	uint32_t hx;
+	uint16_t expsign;
+	int k;
+
+	u.e = x;
+	expsign = u.xbits.expsign;
+	k = expsign & 0x7fff;
+
+	/*
+	 * If x = +-Inf, then cbrt(x) = +-Inf.
+	 * If x = NaN, then cbrt(x) = NaN.
+	 */
+	if (k == BIAS + LDBL_MAX_EXP)
+		return (x + x);
+
+#ifdef __i386__
+	fp_prec_t oprec;
+
+	oprec = fpgetprec();
+	if (oprec != FP_PE)
+		fpsetprec(FP_PE);
+#endif
+
+	if (k == 0) {
+		/* If x = +-0, then cbrt(x) = +-0. */
+		if ((u.bits.manh | u.bits.manl) == 0) {
+#ifdef __i386__
+			if (oprec != FP_PE)
+				fpsetprec(oprec);
+#endif
+			return (x);
+	    	}
+		/* Adjust subnormal numbers. */
+		u.e *= 0x1.0p514;
+		k = u.bits.exp;
+		k -= BIAS + 514;
+ 	} else
+		k -= BIAS;
+	u.xbits.expsign = BIAS;
+	v.e = 1; 
+
+	x = u.e;
+	switch (k % 3) {
+	case 1:
+	case -2:
+		x = 2*x;
+		k--;
+		break;
+	case 2:
+	case -1:
+		x = 4*x;
+		k -= 2;
+		break;
+	}
+	v.xbits.expsign = (expsign & 0x8000) | (BIAS + k / 3);
+
+	/*
+	 * The following is the guts of s_cbrtf, with the handling of
+	 * special values removed and extra care for accuracy not taken,
+	 * but with most of the extra accuracy not discarded.
+	 */
+
+	/* ~5-bit estimate: */
+	fx = x;
+	GET_FLOAT_WORD(hx, fx);
+	SET_FLOAT_WORD(ft, ((hx & 0x7fffffff) / 3 + B1));
+
+	/* ~16-bit estimate: */
+	dx = x;
+	dt = ft;
+	dr = dt * dt * dt;
+	dt = dt * (dx + dx + dr) / (dx + dr + dr);
+
+	/* ~47-bit estimate: */
+	dr = dt * dt * dt;
+	dt = dt * (dx + dx + dr) / (dx + dr + dr);
+
+#if LDBL_MANT_DIG == 64
+	/*
+	 * dt is cbrtl(x) to ~47 bits (after x has been reduced to 1 <= x < 8).
+	 * Round it away from zero to 32 bits (32 so that t*t is exact, and
+	 * away from zero for technical reasons).
+	 */
+	volatile double vd2 = 0x1.0p32;
+	volatile double vd1 = 0x1.0p-31;
+	#define vd ((long double)vd2 + vd1)
+
+	t = dt + vd - 0x1.0p32;
+#elif LDBL_MANT_DIG == 113
+	/*
+	 * Round dt away from zero to 47 bits.  Since we don't trust the 47,
+	 * add 2 47-bit ulps instead of 1 to round up.  Rounding is slow and
+	 * might be avoidable in this case, since on most machines dt will
+	 * have been evaluated in 53-bit precision and the technical reasons
+	 * for rounding up might not apply to either case in cbrtl() since
+	 * dt is much more accurate than needed.
+	 */
+	t = dt + 0x2.0p-46 + 0x1.0p60L - 0x1.0p60;
+#else
+#error "Unsupported long double format"
+#endif
+
+	/*
+     	 * Final step Newton iteration to 64 or 113 bits with
+	 * error < 0.667 ulps
+	 */
+	s=t*t;				/* t*t is exact */
+	r=x/s;				/* error <= 0.5 ulps; |r| < |t| */
+	w=t+t;				/* t+t is exact */
+	r=(r-t)/(w+r);			/* r-t is exact; w+r ~= 3*t */
+	t=t+t*r;			/* error <= 0.5 + 0.5/3 + epsilon */
+
+	t *= v.e;
+#ifdef __i386__
+	if (oprec != FP_PE)
+		fpsetprec(oprec);
+#endif
+	return (t);
+}

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 19:57:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E18A1065676;
	Sat, 12 Mar 2011 19:57:30 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 5711C8FC19;
	Sat, 12 Mar 2011 19:57:30 +0000 (UTC)
Received: from outgoing.leidinger.net (p5B15640F.dip.t-dialin.net
	[91.21.100.15])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 57304844015;
	Sat, 12 Mar 2011 20:57:24 +0100 (CET)
Received: from unknown (IO.Leidinger.net [192.168.2.110])
	by outgoing.leidinger.net (Postfix) with ESMTP id 98E4F2A08;
	Sat, 12 Mar 2011 20:57:21 +0100 (CET)
Date: Sat, 12 Mar 2011 20:57:19 +0100
From: Alexander Leidinger 
To: Andriy Gapon 
Message-ID: <20110312205719.00004e67@unknown>
In-Reply-To: <201103120851.p2C8phoN010341@svn.freebsd.org>
References: <201103120851.p2C8phoN010341@svn.freebsd.org>
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: 57304844015.A6CBA
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=-0.923, required 6,
	autolearn=disabled, ALL_TRUSTED -1.00, TW_SV 0.08)
X-EBL-MailScanner-From: alexander@leidinger.net
X-EBL-MailScanner-Watermark: 1300564646.24487@fM88vG8FkygW2ekfPVd7ow
X-EBL-Spam-Status: No
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Artem Belevich 
Subject: Re: svn commit: r219559 - in head/sys: amd64/linux32
 compat/freebsd32 i386/linux kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 19:57:30 -0000

On Sat, 12 Mar 2011 08:51:43 +0000 (UTC) Andriy Gapon 
wrote:

> Author: avg
> Date: Sat Mar 12 08:51:43 2011
> New Revision: 219559
> URL: http://svn.freebsd.org/changeset/base/219559
> 
> Log:
>   add DTrace systrace support for linux32 and freebsd32 on amd64
> syscalls 
>   This commits makes necessary changes in syscall/sysent generation
>   infrastructure.

I assume this also includes syscall provider support for linux syscalls
on i386. Some questions below.

> Modified: head/sys/i386/linux/syscalls.master
> ==============================================================================
> --- head/sys/i386/linux/syscalls.master	Sat Mar 12 07:47:05 2011	(r219558)
> +++ head/sys/i386/linux/syscalls.master       Sat Mar 12 08:51:43 2011	(r219559)
> @@ -102,7 +102,7 @@
> 46	AUE_SETGID STD	{ int linux_setgid16(l_gid16_t gid); }
> 47	AUE_GETGID STD	{ int linux_getgid16(void); }
> 48	AUE_NULL STD	{ int linux_signal(l_int sig, \
> -				    l_handler_t handler); }
> +				    void *handler); }

What's wrong with l_handler_t?

> @@ -148,7 +148,7 @@
>  				    struct timeval *tp, \
>  				    struct timezone *tzp); }
>  79	AUE_SETTIMEOFDAY	NOPROTO	{ int
> settimeofday( \
> -				    struct timeval *tp, \
> +				    struct timeval *tv, \

What's wrong with tp?

Bye,
Alexander.

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 20:14:34 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 427F5106566B;
	Sat, 12 Mar 2011 20:14:34 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id C76A78FC14;
	Sat, 12 Mar 2011 20:14:33 +0000 (UTC)
Received: from outgoing.leidinger.net (p5B15640F.dip.t-dialin.net
	[91.21.100.15])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id B55BE844015;
	Sat, 12 Mar 2011 21:14:27 +0100 (CET)
Received: from unknown (IO.Leidinger.net [192.168.2.110])
	by outgoing.leidinger.net (Postfix) with ESMTP id EB1A52A0B;
	Sat, 12 Mar 2011 21:14:24 +0100 (CET)
Date: Sat, 12 Mar 2011 21:14:23 +0100
From: Alexander Leidinger 
To: Andriy Gapon 
Message-ID: <20110312211423.00000f34@unknown>
In-Reply-To: <201103120909.p2C99P2j010783@svn.freebsd.org>
References: <201103120909.p2C99P2j010783@svn.freebsd.org>
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: B55BE844015.A678B
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=0.317, required 6,
	autolearn=disabled, ALL_TRUSTED -1.00, SARE_LWSHORTT 1.24,
	TW_SV 0.08)
X-EBL-MailScanner-From: alexander@leidinger.net
X-EBL-MailScanner-Watermark: 1300565670.73712@bqYWLELFIjcB6y5aQ2dsnQ
X-EBL-Spam-Status: No
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Artem Belevich 
Subject: Re: svn commit: r219561 - in head/sys: cddl/dev/systrace
 modules/dtrace modules/dtrace/dtraceall modules/dtrace/systrace_freebsd32
 modules/dtrace/systrace_linux32
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 20:14:34 -0000

On Sat, 12 Mar 2011 09:09:25 +0000 (UTC) Andriy Gapon 
wrote:

> Author: avg
> Date: Sat Mar 12 09:09:25 2011
> New Revision: 219561
> URL: http://svn.freebsd.org/changeset/base/219561
> 
> Log:
>   add DTrace systrace support for linux32 and freebsd32 on amd64
> syscalls 
>   Add systrace_linux32 and systrace_freebsd32 modules which provide
>   support for tracing compat system calls in addition to native system
>   call tracing provided by systrace module.
>   
>   Provided that all the systrace modules are loaded now you can select
>   what syscalls to trace in the following manner:
>   
>   syscall::xxx:yyy - work on all system calls that match the
> specification syscall:freebsd:xxx:yyy - only native system calls
>   syscall:linux32:xxx:yyy - linux32 compat system calls
>   syscall:freebsd32:xxx:yyy - freebsd32 compat system calls on amd64

I am working on some SDT probes for the linuxulator. The way I handle it
there is to use "linuxulator" for the native size, and "linuxulator32"
for the current 32-bit linux emulation on amd64. When the amd64 arch
gets a native linux emulation (dchagin@ has patches) this would allow to
trace both in a sane way.

Is it possible to have "linux" as the modname on i386? Is it easy to
have both linux syscall types (64 bit and 32 bit) on amd64 in case
native support arrives in this code?

> Modified: head/sys/cddl/dev/systrace/systrace.c
> ==============================================================================
> --- head/sys/cddl/dev/systrace/systrace.c	Sat Mar 12 08:58:19
> 2011	(r219560) +++
> head/sys/cddl/dev/systrace/systrace.c	Sat Mar 12 09:09:25
> 2011	(r219561) @@ -59,17 +59,38 @@ #include 
>  
>  #ifdef LINUX_SYSTRACE
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> +#if defined(__amd64__)
> +#include 
> +#include 
> +#include 
> +#include 
> +#elif defined(__i386__)
> +#include 
> +#include 
> +#include 
> +#include 

This looks like there is also support for linux syscalls on 386.

> +#else
> +#error Only i386 and amd64 are supported.
> +#endif
>  extern struct sysent linux_sysent[];
> -#define	DEVNAME		"dtrace/linsystrace"
> -#define	PROVNAME	"linsyscall"
> +#define	MODNAME		"linux32"

But this looks like it will be named linux32 in any case. In the short
term I would prefer:
---snip---
#if defined(__amd64__)
#define	MODNAME	"linux32"
#elif defined(__i386__)
#define	MODNAME	"linux"
#endif
---snip---

>  #define	MAXSYSCALL	LINUX_SYS_MAXSYSCALL
>  #define	SYSCALLNAMES	linux_syscallnames
>  #define	SYSENT		linux_sysent

Bye,
Alexander.

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 20:36:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7DA78106566C;
	Sat, 12 Mar 2011 20:36:52 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 522CC8FC16;
	Sat, 12 Mar 2011 20:36: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 p2CKaqHF029358;
	Sat, 12 Mar 2011 20:36:52 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CKaq7W029355;
	Sat, 12 Mar 2011 20:36:52 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201103122036.p2CKaq7W029355@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 12 Mar 2011 20:36: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: r219577 - head/sys/dev/aic7xxx
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 20:36:52 -0000

Author: marius
Date: Sat Mar 12 20:36:52 2011
New Revision: 219577
URL: http://svn.freebsd.org/changeset/base/219577

Log:
  Allocate the DMA memory shared between the host and the controller as
  coherent.
  
  Approved by:	gibbs
  MFC after:	2 weeks

Modified:
  head/sys/dev/aic7xxx/aic79xx.c
  head/sys/dev/aic7xxx/aic7xxx.c

Modified: head/sys/dev/aic7xxx/aic79xx.c
==============================================================================
--- head/sys/dev/aic7xxx/aic79xx.c	Sat Mar 12 19:37:35 2011	(r219576)
+++ head/sys/dev/aic7xxx/aic79xx.c	Sat Mar 12 20:36:52 2011	(r219577)
@@ -6099,7 +6099,8 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
 		/* Allocate the next batch of hardware SCBs */
 		if (aic_dmamem_alloc(ahd, scb_data->hscb_dmat,
 				     (void **)&hscb_map->vaddr,
-				     BUS_DMA_NOWAIT, &hscb_map->dmamap) != 0) {
+				     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+				     &hscb_map->dmamap) != 0) {
 			free(hscb_map, M_DEVBUF);
 			return (0);
 		}
@@ -6132,7 +6133,8 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
 		/* Allocate the next batch of S/G lists */
 		if (aic_dmamem_alloc(ahd, scb_data->sg_dmat,
 				     (void **)&sg_map->vaddr,
-				     BUS_DMA_NOWAIT, &sg_map->dmamap) != 0) {
+				     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+				     &sg_map->dmamap) != 0) {
 			free(sg_map, M_DEVBUF);
 			return (0);
 		}
@@ -6397,7 +6399,7 @@ ahd_init(struct ahd_softc *ahd)
 	/* Allocation of driver data */
 	if (aic_dmamem_alloc(ahd, ahd->shared_data_dmat,
 			     (void **)&ahd->shared_data_map.vaddr,
-			     BUS_DMA_NOWAIT,
+			     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
 			     &ahd->shared_data_map.dmamap) != 0) {
 		return (ENOMEM);
 	}

Modified: head/sys/dev/aic7xxx/aic7xxx.c
==============================================================================
--- head/sys/dev/aic7xxx/aic7xxx.c	Sat Mar 12 19:37:35 2011	(r219576)
+++ head/sys/dev/aic7xxx/aic7xxx.c	Sat Mar 12 20:36:52 2011	(r219577)
@@ -4381,7 +4381,8 @@ ahc_init_scbdata(struct ahc_softc *ahc)
 	/* Allocation for our hscbs */
 	if (aic_dmamem_alloc(ahc, scb_data->hscb_dmat,
 			     (void **)&scb_data->hscbs,
-			     BUS_DMA_NOWAIT, &scb_data->hscb_dmamap) != 0) {
+			     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+			     &scb_data->hscb_dmamap) != 0) {
 		goto error_exit;
 	}
 
@@ -4549,7 +4550,8 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
 	/* Allocate S/G space for the next batch of SCBS */
 	if (aic_dmamem_alloc(ahc, scb_data->sg_dmat,
 			     (void **)&sg_map->sg_vaddr,
-			     BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) {
+			     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+			     &sg_map->sg_dmamap) != 0) {
 		free(sg_map, M_DEVBUF);
 		return (0);
 	}
@@ -4941,7 +4943,8 @@ ahc_init(struct ahc_softc *ahc)
 	/* Allocation of driver data */
 	if (aic_dmamem_alloc(ahc, ahc->shared_data_dmat,
 			     (void **)&ahc->qoutfifo,
-			     BUS_DMA_NOWAIT, &ahc->shared_data_dmamap) != 0) {
+			     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+			     &ahc->shared_data_dmamap) != 0) {
 		return (ENOMEM);
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 21:13:08 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 636D8106564A;
	Sat, 12 Mar 2011 21:13:08 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 513368FC0A;
	Sat, 12 Mar 2011 21:13: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 p2CLD8ea030207;
	Sat, 12 Mar 2011 21:13:08 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CLD8LO030205;
	Sat, 12 Mar 2011 21:13:08 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103122113.p2CLD8LO030205@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 12 Mar 2011 21:13: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: r219578 - head/etc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 21:13:08 -0000

Author: dougb
Date: Sat Mar 12 21:13:08 2011
New Revision: 219578
URL: http://svn.freebsd.org/changeset/base/219578

Log:
  Use the allexport option in load_rc_config() in order to avoid having
  to repeatedly read the conf files. Depending on what is enabled the
  files are being read anywhere from 15, 30, or more times currently.
  By loading the values in the environment this is reduced to 1, with
  perhaps a couple more, again depending on what is enabled.
  
  The speed-up for boot and shutdown is negligible when rc.conf is
  on local disk, noticable when accessing files over NFS, and dramatic
  when pulling rc.conf values from a database.
  
  This change also includes a minor optimization to the conditional
  for $_rc_conf_loaded.

Modified:
  head/etc/rc.subr

Modified: head/etc/rc.subr
==============================================================================
--- head/etc/rc.subr	Sat Mar 12 20:36:52 2011	(r219577)
+++ head/etc/rc.subr	Sat Mar 12 21:13:08 2011	(r219578)
@@ -998,9 +998,8 @@ load_rc_config()
 		err 3 'USAGE: load_rc_config name'
 	fi
 
-	if ${_rc_conf_loaded:-false}; then
-		:
-	else
+	if [ -z "$_rc_conf_loaded" ]; then
+		set -o allexport
 		if [ -r /etc/defaults/rc.conf ]; then
 			debug "Sourcing /etc/defaults/rc.conf"
 			. /etc/defaults/rc.conf
@@ -1010,6 +1009,7 @@ load_rc_config()
 			. /etc/rc.conf
 		fi
 		_rc_conf_loaded=true
+		set +o allexport
 	fi
 	if [ -f /etc/rc.conf.d/"$_name" ]; then
 		debug "Sourcing /etc/rc.conf.d/${_name}"

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 21:46:37 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7242D106564A;
	Sat, 12 Mar 2011 21:46:37 +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 5EDF98FC0A;
	Sat, 12 Mar 2011 21:46: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 p2CLkbip030952;
	Sat, 12 Mar 2011 21:46:37 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CLkb5a030948;
	Sat, 12 Mar 2011 21:46:37 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103122146.p2CLkb5a030948@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 12 Mar 2011 21:46: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: r219579 - in head/sys: netinet netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 21:46:37 -0000

Author: bz
Date: Sat Mar 12 21:46:37 2011
New Revision: 219579
URL: http://svn.freebsd.org/changeset/base/219579

Log:
  Merge the two identical implementations for local port selections from
  in_pcbbind_setup() and in6_pcbsetport() in a single in_pcb_lport().
  
  MFC after:	2 weeks

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h
  head/sys/netinet6/in6_src.c

Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c	Sat Mar 12 21:13:08 2011	(r219578)
+++ head/sys/netinet/in_pcb.c	Sat Mar 12 21:46:37 2011	(r219579)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
+#include "opt_inet.h"
 #include "opt_inet6.h"
 
 #include 
@@ -73,6 +74,7 @@ __FBSDID("$FreeBSD$");
 #ifdef INET6
 #include 
 #include 
+#include 
 #endif /* INET6 */
 
 
@@ -312,6 +314,124 @@ in_pcbbind(struct inpcb *inp, struct soc
 	return (0);
 }
 
+#if defined(INET) || defined(INET6)
+int
+in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp,
+    struct ucred *cred, int wild)
+{
+	struct inpcbinfo *pcbinfo;
+	struct inpcb *tmpinp;
+	unsigned short *lastport;
+	int count, dorandom, error;
+	u_short aux, first, last, lport;
+#ifdef INET
+	struct in_addr laddr;
+#endif
+
+	pcbinfo = inp->inp_pcbinfo;
+
+	/*
+	 * Because no actual state changes occur here, a global write lock on
+	 * the pcbinfo isn't required.
+	 */
+	INP_INFO_LOCK_ASSERT(pcbinfo);
+	INP_LOCK_ASSERT(inp);
+
+	if (inp->inp_flags & INP_HIGHPORT) {
+		first = V_ipport_hifirstauto;	/* sysctl */
+		last  = V_ipport_hilastauto;
+		lastport = &pcbinfo->ipi_lasthi;
+	} else if (inp->inp_flags & INP_LOWPORT) {
+		error = priv_check_cred(cred, PRIV_NETINET_RESERVEDPORT, 0);
+		if (error)
+			return (error);
+		first = V_ipport_lowfirstauto;	/* 1023 */
+		last  = V_ipport_lowlastauto;	/* 600 */
+		lastport = &pcbinfo->ipi_lastlow;
+	} else {
+		first = V_ipport_firstauto;	/* sysctl */
+		last  = V_ipport_lastauto;
+		lastport = &pcbinfo->ipi_lastport;
+	}
+	/*
+	 * For UDP, use random port allocation as long as the user
+	 * allows it.  For TCP (and as of yet unknown) connections,
+	 * use random port allocation only if the user allows it AND
+	 * ipport_tick() allows it.
+	 */
+	if (V_ipport_randomized &&
+		(!V_ipport_stoprandom || pcbinfo == &V_udbinfo))
+		dorandom = 1;
+	else
+		dorandom = 0;
+	/*
+	 * It makes no sense to do random port allocation if
+	 * we have the only port available.
+	 */
+	if (first == last)
+		dorandom = 0;
+	/* Make sure to not include UDP packets in the count. */
+	if (pcbinfo != &V_udbinfo)
+		V_ipport_tcpallocs++;
+	/*
+	 * Instead of having two loops further down counting up or down
+	 * make sure that first is always <= last and go with only one
+	 * code path implementing all logic.
+	 */
+	if (first > last) {
+		aux = first;
+		first = last;
+		last = aux;
+	}
+
+#ifdef INET
+	/* Make the compiler happy. */
+	laddr.s_addr = 0;
+	if ((inp->inp_vflag & INP_IPV4) != 0) {
+		KASSERT(laddrp != NULL, ("%s: laddrp NULL for v4 inp %p",
+		    __func__, inp));
+		laddr = *laddrp;
+	}
+#endif
+	lport = *lportp;
+
+	if (dorandom)
+		*lastport = first + (arc4random() % (last - first));
+
+	count = last - first;
+
+	do {
+		if (count-- < 0)	/* completely used? */
+			return (EADDRNOTAVAIL);
+		++*lastport;
+		if (*lastport < first || *lastport > last)
+			*lastport = first;
+		lport = htons(*lastport);
+
+#ifdef INET6
+		if ((inp->inp_vflag & INP_IPV6) != 0)
+			tmpinp = in6_pcblookup_local(pcbinfo,
+			    &inp->in6p_laddr, lport, wild, cred);
+#endif
+#if defined(INET) && defined(INET6)
+		else
+#endif
+#ifdef INET
+			tmpinp = in_pcblookup_local(pcbinfo, laddr,
+			    lport, wild, cred);
+#endif
+	} while (tmpinp != NULL);
+
+#ifdef INET
+	if ((inp->inp_vflag & INP_IPV4) != 0)
+		laddrp->s_addr = laddr.s_addr;
+#endif                 
+	*lportp = lport;
+
+	return (0);
+}
+#endif /* INET || INET6 */
+
 /*
  * Set up a bind operation on a PCB, performing port allocation
  * as required, but do not actually modify the PCB. Callers can
@@ -326,14 +446,12 @@ in_pcbbind_setup(struct inpcb *inp, stru
     u_short *lportp, struct ucred *cred)
 {
 	struct socket *so = inp->inp_socket;
-	unsigned short *lastport;
 	struct sockaddr_in *sin;
 	struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
 	struct in_addr laddr;
 	u_short lport = 0;
 	int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
 	int error;
-	int dorandom;
 
 	/*
 	 * Because no actual state changes occur here, a global write lock on
@@ -458,72 +576,10 @@ in_pcbbind_setup(struct inpcb *inp, stru
 	if (*lportp != 0)
 		lport = *lportp;
 	if (lport == 0) {
-		u_short first, last, aux;
-		int count;
-
-		if (inp->inp_flags & INP_HIGHPORT) {
-			first = V_ipport_hifirstauto;	/* sysctl */
-			last  = V_ipport_hilastauto;
-			lastport = &pcbinfo->ipi_lasthi;
-		} else if (inp->inp_flags & INP_LOWPORT) {
-			error = priv_check_cred(cred,
-			    PRIV_NETINET_RESERVEDPORT, 0);
-			if (error)
-				return error;
-			first = V_ipport_lowfirstauto;	/* 1023 */
-			last  = V_ipport_lowlastauto;	/* 600 */
-			lastport = &pcbinfo->ipi_lastlow;
-		} else {
-			first = V_ipport_firstauto;	/* sysctl */
-			last  = V_ipport_lastauto;
-			lastport = &pcbinfo->ipi_lastport;
-		}
-		/*
-		 * For UDP, use random port allocation as long as the user
-		 * allows it.  For TCP (and as of yet unknown) connections,
-		 * use random port allocation only if the user allows it AND
-		 * ipport_tick() allows it.
-		 */
-		if (V_ipport_randomized &&
-			(!V_ipport_stoprandom || pcbinfo == &V_udbinfo))
-			dorandom = 1;
-		else
-			dorandom = 0;
-		/*
-		 * It makes no sense to do random port allocation if
-		 * we have the only port available.
-		 */
-		if (first == last)
-			dorandom = 0;
-		/* Make sure to not include UDP packets in the count. */
-		if (pcbinfo != &V_udbinfo)
-			V_ipport_tcpallocs++;
-		/*
-		 * Instead of having two loops further down counting up or down
-		 * make sure that first is always <= last and go with only one
-		 * code path implementing all logic.
-		 */
-		if (first > last) {
-			aux = first;
-			first = last;
-			last = aux;
-		}
-
-		if (dorandom)
-			*lastport = first +
-				    (arc4random() % (last - first));
-
-		count = last - first;
+		error = in_pcb_lport(inp, &laddr, &lport, cred, wild);
+		if (error != 0)
+			return (error);
 
-		do {
-			if (count-- < 0)	/* completely used? */
-				return (EADDRNOTAVAIL);
-			++*lastport;
-			if (*lastport < first || *lastport > last)
-				*lastport = first;
-			lport = htons(*lastport);
-		} while (in_pcblookup_local(pcbinfo, laddr,
-		    lport, wild, cred));
 	}
 	*laddrp = laddr.s_addr;
 	*lportp = lport;

Modified: head/sys/netinet/in_pcb.h
==============================================================================
--- head/sys/netinet/in_pcb.h	Sat Mar 12 21:13:08 2011	(r219578)
+++ head/sys/netinet/in_pcb.h	Sat Mar 12 21:46:37 2011	(r219579)
@@ -491,6 +491,8 @@ void	in_pcbinfo_init(struct inpcbinfo *,
 void	in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);
 int	in_pcballoc(struct socket *, struct inpcbinfo *);
 int	in_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *);
+int	in_pcb_lport(struct inpcb *, struct in_addr *, u_short *,
+	    struct ucred *, int);
 int	in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *,
 	    u_short *, struct ucred *);
 int	in_pcbconnect(struct inpcb *, struct sockaddr *, struct ucred *);

Modified: head/sys/netinet6/in6_src.c
==============================================================================
--- head/sys/netinet6/in6_src.c	Sat Mar 12 21:13:08 2011	(r219578)
+++ head/sys/netinet6/in6_src.c	Sat Mar 12 21:46:37 2011	(r219579)
@@ -850,9 +850,11 @@ int
 in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred)
 {
 	struct socket *so = inp->inp_socket;
-	u_int16_t lport = 0, first, last, *lastport;
-	int count, error, wild = 0, dorandom;
+	u_int16_t lport = 0;
+	int error, wild = 0;
+#ifdef INVARIANTS
 	struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
+#endif
 
 	INP_INFO_WLOCK_ASSERT(pcbinfo);
 	INP_WLOCK_ASSERT(inp);
@@ -868,71 +870,9 @@ in6_pcbsetport(struct in6_addr *laddr, s
 
 	inp->inp_flags |= INP_ANONPORT;
 
-	if (inp->inp_flags & INP_HIGHPORT) {
-		first = V_ipport_hifirstauto;	/* sysctl */
-		last  = V_ipport_hilastauto;
-		lastport = &pcbinfo->ipi_lasthi;
-	} else if (inp->inp_flags & INP_LOWPORT) {
-		error = priv_check_cred(cred, PRIV_NETINET_RESERVEDPORT, 0);
-		if (error)
-			return error;
-		first = V_ipport_lowfirstauto;	/* 1023 */
-		last  = V_ipport_lowlastauto;	/* 600 */
-		lastport = &pcbinfo->ipi_lastlow;
-	} else {
-		first = V_ipport_firstauto;	/* sysctl */
-		last  = V_ipport_lastauto;
-		lastport = &pcbinfo->ipi_lastport;
-	}
-
-	/*
-	 * For UDP, use random port allocation as long as the user
-	 * allows it.  For TCP (and as of yet unknown) connections,
-	 * use random port allocation only if the user allows it AND
-	 * ipport_tick() allows it.
-	 */
-	if (V_ipport_randomized &&
-	    (!V_ipport_stoprandom || pcbinfo == &V_udbinfo))
-		dorandom = 1;
-	else
-		dorandom = 0;
-	/*
-	 * It makes no sense to do random port allocation if
-	 * we have the only port available.
-	 */
-	if (first == last)
-		dorandom = 0;
-	/* Make sure to not include UDP packets in the count. */
-	if (pcbinfo != &V_udbinfo)
-		V_ipport_tcpallocs++;
-
-	/*
-	 * Instead of having two loops further down counting up or down
-	 * make sure that first is always <= last and go with only one
-	 * code path implementing all logic.
-	 */
-	if (first > last) {
-		u_int16_t aux;
-
-		aux = first;
-		first = last;
-		last = aux;
-	}
-
-	if (dorandom)
-		*lastport = first + (arc4random() % (last - first));
-
-	count = last - first;
-
-	do {
-		if (count-- < 0)	/* completely used? */
-			return (EADDRNOTAVAIL);
-		++*lastport;
-		if (*lastport < first || *lastport > last)
-			*lastport = first;
-		lport = htons(*lastport);
-	} while (in6_pcblookup_local(pcbinfo, &inp->in6p_laddr,
-	    lport, wild, cred));
+	error = in_pcb_lport(inp, NULL, &lport, cred, wild);
+	if (error != 0)
+		return (error);
 
 	inp->inp_lport = lport;
 	if (in_pcbinshash(inp) != 0) {

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 21:50:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D61D1065672;
	Sat, 12 Mar 2011 21:50: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 3B23A8FC21;
	Sat, 12 Mar 2011 21:50: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 p2CLongF031067;
	Sat, 12 Mar 2011 21:50:49 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CLonxl031065;
	Sat, 12 Mar 2011 21:50:49 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103122150.p2CLonxl031065@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 12 Mar 2011 21:50: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: r219580 - head/sys/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 21:50:49 -0000

Author: bz
Date: Sat Mar 12 21:50:48 2011
New Revision: 219580
URL: http://svn.freebsd.org/changeset/base/219580

Log:
  INET6 for some time needed in_pcb.c so make sure we compile it in case of
  no inet.
  
  MFC after:	2 weeks

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Mar 12 21:46:37 2011	(r219579)
+++ head/sys/conf/files	Sat Mar 12 21:50:48 2011	(r219580)
@@ -2625,7 +2625,7 @@ netinet/in_gif.c		optional gif inet | ne
 netinet/ip_gre.c		optional gre inet
 netinet/ip_id.c			optional inet
 netinet/in_mcast.c		optional inet
-netinet/in_pcb.c		optional inet
+netinet/in_pcb.c		optional inet | inet6
 netinet/in_proto.c		optional inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
 netinet/in_rmx.c		optional inet

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 21:51:57 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EA61106564A;
	Sat, 12 Mar 2011 21:51:57 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C1B28FC19;
	Sat, 12 Mar 2011 21:51: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 p2CLpvqu031129;
	Sat, 12 Mar 2011 21:51:57 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2CLpvMl031127;
	Sat, 12 Mar 2011 21:51:57 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201103122151.p2CLpvMl031127@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Sat, 12 Mar 2011 21:51: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: r219581 - head/sbin/geom/class/part
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 21:51:57 -0000

Author: ae
Date: Sat Mar 12 21:51:56 2011
New Revision: 219581
URL: http://svn.freebsd.org/changeset/base/219581

Log:
  Fix grammar.
  
  Pointed out:	Ben Kaduk
  MFC after:	2 weeks

Modified:
  head/sbin/geom/class/part/gpart.8

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Sat Mar 12 21:50:48 2011	(r219580)
+++ head/sbin/geom/class/part/gpart.8	Sat Mar 12 21:51:56 2011	(r219581)
@@ -60,8 +60,8 @@ option adds support for the Extended Boo
 which is used to define a logical partition.
 The
 .Dv GEOM_PART_EBR_COMPAT
-option enables the backward compatibility for the partition names
-of the EBR scheme. Also it makes impossible any types of actions
+option enables backward compatibility for partition names
+in the EBR scheme. Also it makes impossible any types of actions
 with such partitions.
 The
 .Dv GEOM_PART_GPT

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 21:58:09 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCD41106566B
	for ; Sat, 12 Mar 2011 21:58:09 +0000 (UTC)
	(envelope-from kaduk@mit.edu)
Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU
	[18.7.68.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9867F8FC24
	for ; Sat, 12 Mar 2011 21:58:09 +0000 (UTC)
X-AuditID: 12074424-b7b0bae000000a05-bf-4d7be8eb7c35
Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
	by dmz-mailsec-scanner-7.mit.edu (Symantec Brightmail Gateway) with
	SMTP id 19.EB.02565.BE8EB7D4; Sat, 12 Mar 2011 16:43:07 -0500 (EST)
Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
	by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id p2CLh6Hm028620; 
	Sat, 12 Mar 2011 16:43:07 -0500
Received: from multics.mit.edu (MULTICS.MIT.EDU [18.187.1.73])
	(authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU)
	by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p2CLh5A8004213
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sat, 12 Mar 2011 16:43:06 -0500 (EST)
Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308)
	id p2CLh4V0027108; Sat, 12 Mar 2011 16:43:04 -0500 (EST)
Date: Sat, 12 Mar 2011 16:43:04 -0500 (EST)
From: Benjamin Kaduk 
To: "Andrey V. Elsukov" 
In-Reply-To: <4D7BB726.3000209@yandex.ru>
Message-ID: 
References: <201103121705.p2CH5IPs025002@svn.freebsd.org>
	
	<4D7BB726.3000209@yandex.ru>
User-Agent: Alpine 1.10 (GSO 962 2008-03-14)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Brightmail-Tracker: AAAAAA==
Cc: svn-src-all@freebsd.org
Subject: Re: svn commit: r219573 - head/sbin/geom/class/part
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 21:58:09 -0000

On Sat, 12 Mar 2011, Andrey V. Elsukov wrote:

> On 12.03.2011 20:15, Ben Kaduk wrote:
>> I think just "enables backward compatibility" is more standard English
>> usage.  Not knowing much about the EBR scheme, I would also guess that
>> "for partition names in the EBR scheme" is what is intended here, but
>> that would be something of a guess.
>
> Partitions from EBR have names like they were in FreeBSD prior to
> GEOM_PART. E.g. ad0s5, ad0s6,... But without this option they may be
> like these:
>> gpart show -p ada2s3
> =>         0  1830660048           ada2s3  EBR  (873G)
>           0    17767890  ada2s3+00000001  !6  (8.5G)
>    17767890         189                   - free -  (95K)
>    17768079     1023939  ada2s3+00282034  ntfs  (500M)
>    18792018  1481207994                   - free -  (706G)
>  1500000012     1023939  ada2s3+23809525  fat32  (500M)
>  1501023951      204750  ada2s3+23825778  fat32  (100M)
>  1501228701   329431347                   - free -  (157G)
>> ls -1 /dev/ada2s3*
> /dev/ada2s3
> /dev/ada2s3+00000001
> /dev/ada2s3+00282034
> /dev/ada2s3+23809525
> /dev/ada2s3+23825778
>
> So, do you recommend to change first sentence to:
> "The GEOM_PART_EBR_COMPAT option enables backward compatibility for
> partition names in the EBR scheme."

Yes.


Thanks,

Ben Kaduk

From owner-svn-src-all@FreeBSD.ORG  Sat Mar 12 23:08:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE2741065680;
	Sat, 12 Mar 2011 23:08:31 +0000 (UTC) (envelope-from jilles@stack.nl)
Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107])
	by mx1.freebsd.org (Postfix) with ESMTP id 46E838FC17;
	Sat, 12 Mar 2011 23:08:31 +0000 (UTC)
Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132])
	by mx1.stack.nl (Postfix) with ESMTP id 4DFF31DD68A;
	Sun, 13 Mar 2011 00:08:30 +0100 (CET)
Received: by turtle.stack.nl (Postfix, from userid 1677)
	id 41370173A6; Sun, 13 Mar 2011 00:08:30 +0100 (CET)
Date: Sun, 13 Mar 2011 00:08:30 +0100
From: Jilles Tjoelker 
To: Doug Barton 
Message-ID: <20110312230830.GA269@stack.nl>
References: <201103122113.p2CLD8LO030205@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201103122113.p2CLD8LO030205@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219578 - head/etc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 12 Mar 2011 23:08:31 -0000

On Sat, Mar 12, 2011 at 09:13:08PM +0000, Doug Barton wrote:
> Author: dougb
> Date: Sat Mar 12 21:13:08 2011
> New Revision: 219578
> URL: http://svn.freebsd.org/changeset/base/219578

> Log:
>   Use the allexport option in load_rc_config() in order to avoid having
>   to repeatedly read the conf files. Depending on what is enabled the
>   files are being read anywhere from 15, 30, or more times currently.
>   By loading the values in the environment this is reduced to 1, with
>   perhaps a couple more, again depending on what is enabled.

I wonder if it is a good idea to pollute the environment of many daemons
with this. Although sshd and cron clean it up, there is at least one
daemon that passes the environment on. One of those is devd. While that
saves four /etc/rc.conf reads on my minimalistic 9-current VM, it
implies that devd must be restarted to pick up changes to /etc/rc.conf.
That seems a POLA violation.

With the old code, my VM reads rc.conf nine times at boot. One of them
is the initial load, four of them are via devd and the other four are
because rc.d scripts call each other via execve(2) instead of via the
run_rc_script function. The latter four can be avoided but the other
five seem unavoidable.

I found this by adding the following line to /etc/rc.conf:
echo "rc.conf is being read at $(date) by $(ps -p $$ -o pid= -o ppid= -o args=)" >/dev/console

(The new code reads rc.conf once.)

>   The speed-up for boot and shutdown is negligible when rc.conf is
>   on local disk, noticable when accessing files over NFS, and dramatic
>   when pulling rc.conf values from a database.

>   This change also includes a minor optimization to the conditional
>   for $_rc_conf_loaded.

I don't know if we ever supported 'set -u' in rc.d scripts, but this
definitely breaks it. To fix this, test "${_rc_conf_loaded-}" instead of
"$_rc_conf_loaded"

> Modified:
>   head/etc/rc.subr
> 
> Modified: head/etc/rc.subr
> ==============================================================================
> --- head/etc/rc.subr	Sat Mar 12 20:36:52 2011	(r219577)
> +++ head/etc/rc.subr	Sat Mar 12 21:13:08 2011	(r219578)
> @@ -998,9 +998,8 @@ load_rc_config()
>  		err 3 'USAGE: load_rc_config name'
>  	fi
>  
> -	if ${_rc_conf_loaded:-false}; then
> -		:
> -	else
> +	if [ -z "$_rc_conf_loaded" ]; then
> +		set -o allexport
>  		if [ -r /etc/defaults/rc.conf ]; then
>  			debug "Sourcing /etc/defaults/rc.conf"
>  			. /etc/defaults/rc.conf
> @@ -1010,6 +1009,7 @@ load_rc_config()
>  			. /etc/rc.conf
>  		fi
>  		_rc_conf_loaded=true
> +		set +o allexport
>  	fi
>  	if [ -f /etc/rc.conf.d/"$_name" ]; then
>  		debug "Sourcing /etc/rc.conf.d/${_name}"

-- 
Jilles Tjoelker