From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 00:39: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 71F4D1065676; Sun, 20 Nov 2011 00:39:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6113C8FC14; Sun, 20 Nov 2011 00:39:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK0dF8n067270; Sun, 20 Nov 2011 00:39:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK0dFju067267; Sun, 20 Nov 2011 00:39:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111200039.pAK0dFju067267@svn.freebsd.org> From: Rick Macklem Date: Sun, 20 Nov 2011 00:39: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: r227743 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 00:39:15 -0000 Author: rmacklem Date: Sun Nov 20 00:39:15 2011 New Revision: 227743 URL: http://svn.freebsd.org/changeset/base/227743 Log: Post r223774 the NFSv4 client never uses the linked list with the head nfsc_defunctlockowner. This patch simply removes the code that loops through this always empty list, since the code no longer does anything useful. It should not have any effect on the client's behaviour. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfsclstate.h head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfsclstate.h ============================================================================== --- head/sys/fs/nfs/nfsclstate.h Sat Nov 19 22:14:08 2011 (r227742) +++ head/sys/fs/nfs/nfsclstate.h Sun Nov 20 00:39:15 2011 (r227743) @@ -48,7 +48,6 @@ struct nfsclclient { struct nfsclownerhead nfsc_owner; struct nfscldeleghead nfsc_deleg; struct nfscldeleghash nfsc_deleghash[NFSCLDELEGHASHSIZE]; - struct nfscllockownerhead nfsc_defunctlockowner; struct nfsv4lock nfsc_lock; struct proc *nfsc_renewthread; struct nfsmount *nfsc_nmp; Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sat Nov 19 22:14:08 2011 (r227742) +++ head/sys/fs/nfsclient/nfs_clstate.c Sun Nov 20 00:39:15 2011 (r227743) @@ -699,7 +699,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr { struct nfsclclient *clp; struct nfsclclient *newclp = NULL; - struct nfscllockowner *lp, *nlp; struct mount *mp; struct nfsmount *nmp; char uuid[HOSTUUIDLEN]; @@ -744,7 +743,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr TAILQ_INIT(&clp->nfsc_deleg); for (i = 0; i < NFSCLDELEGHASHSIZE; i++) LIST_INIT(&clp->nfsc_deleghash[i]); - LIST_INIT(&clp->nfsc_defunctlockowner); clp->nfsc_flags = NFSCLFLAGS_INITED; clp->nfsc_clientidrev = 1; clp->nfsc_cbident = nfscl_nextcbident(); @@ -793,11 +791,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr NFSUNLOCKCLSTATE(); return (EACCES); } - /* get rid of defunct lockowners */ - LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list, - nlp) { - nfscl_freelockowner(lp, 0); - } /* * If RFC3530 Sec. 14.2.33 is taken literally, * NFSERR_CLIDINUSE will be returned persistently for the @@ -1537,13 +1530,6 @@ nfscl_cleanclient(struct nfsclclient *cl { struct nfsclowner *owp, *nowp; struct nfsclopen *op, *nop; - struct nfscllockowner *lp, *nlp; - - - /* get rid of defunct lockowners */ - LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list, nlp) { - nfscl_freelockowner(lp, 0); - } /* Now, all the OpenOwners, etc. */ LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) { @@ -1717,12 +1703,6 @@ nfscl_cleanup_common(struct nfsclclient } owp = nowp; } - - /* and check the defunct list */ - LIST_FOREACH(lp, &clp->nfsc_defunctlockowner, nfsl_list) { - if (!NFSBCMP(lp->nfsl_owner, own, NFSV4CL_LOCKNAMELEN)) - lp->nfsl_defunct = 1; - } } #if defined(APPLEKEXT) || defined(__FreeBSD__) @@ -1735,7 +1715,6 @@ static void nfscl_cleanupkext(struct nfsclclient *clp) { struct nfsclowner *owp, *nowp; - struct nfscllockowner *lp; NFSPROCLISTLOCK(); NFSLOCKCLSTATE(); @@ -1743,12 +1722,6 @@ nfscl_cleanupkext(struct nfsclclient *cl if (nfscl_procdoesntexist(owp->nfsow_owner)) nfscl_cleanup_common(clp, owp->nfsow_owner); } - - /* and check the defunct list */ - LIST_FOREACH(lp, &clp->nfsc_defunctlockowner, nfsl_list) { - if (nfscl_procdoesntexist(lp->nfsl_owner)) - lp->nfsl_defunct = 1; - } NFSUNLOCKCLSTATE(); NFSPROCLISTUNLOCK(); } @@ -1905,11 +1878,6 @@ nfscl_recover(struct nfsclclient *clp, s NFSUNLOCKREQ(); splx(s); - /* get rid of defunct lockowners */ - LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list, nlp) { - nfscl_freelockowner(lp, 0); - } - /* * Now, mark all delegations "need reclaim". */ @@ -2157,7 +2125,6 @@ nfscl_recover(struct nfsclclient *clp, s APPLESTATIC int nfscl_hasexpired(struct nfsclclient *clp, u_int32_t clidrev, NFSPROC_T *p) { - struct nfscllockowner *lp, *nlp; struct nfsmount *nmp; struct ucred *cred; int igotlock = 0, error, trycnt; @@ -2207,12 +2174,6 @@ nfscl_hasexpired(struct nfsclclient *clp clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | NFSCLFLAGS_RECOVER); } else { - /* get rid of defunct lockowners */ - LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list, - nlp) { - nfscl_freelockowner(lp, 0); - } - /* * Expire the state for the client. */ @@ -2486,25 +2447,6 @@ nfscl_renewthread(struct nfsclclient *cl owp = nowp; } - /* also search the defunct list */ - lp = LIST_FIRST(&clp->nfsc_defunctlockowner); - while (lp != NULL) { - nlp = LIST_NEXT(lp, nfsl_list); - if (lp->nfsl_defunct) { - LIST_FOREACH(olp, &lh, nfsl_list) { - if (!NFSBCMP(olp->nfsl_owner, lp->nfsl_owner, - NFSV4CL_LOCKNAMELEN)) - break; - } - if (olp == NULL) { - LIST_REMOVE(lp, nfsl_list); - LIST_INSERT_HEAD(&lh, lp, nfsl_list); - } else { - nfscl_freelockowner(lp, 0); - } - } - lp = nlp; - } /* and release defunct lock owners */ LIST_FOREACH_SAFE(lp, &lh, nfsl_list, nlp) { nfscl_freelockowner(lp, 0); From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 01:18: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 4B158106564A; Sun, 20 Nov 2011 01:18:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210858FC0C; Sun, 20 Nov 2011 01:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK1Im3a068587; Sun, 20 Nov 2011 01:18:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK1ImgM068585; Sun, 20 Nov 2011 01:18:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111200118.pAK1ImgM068585@svn.freebsd.org> From: Rick Macklem Date: Sun, 20 Nov 2011 01:18: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: r227744 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 01:18:48 -0000 Author: rmacklem Date: Sun Nov 20 01:18:47 2011 New Revision: 227744 URL: http://svn.freebsd.org/changeset/base/227744 Log: Since the nfscl_cleanup() function isn't used by the FreeBSD NFSv4 client, delete the code and fix up the related comments. This should not have any functional effect on the client. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sun Nov 20 00:39:15 2011 (r227743) +++ head/sys/fs/nfsclient/nfs_clstate.c Sun Nov 20 01:18:47 2011 (r227744) @@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$"); * the granularity of the OpenOwner, then code must be added to * serialize Ops on the OpenOwner.) * - When to get rid of OpenOwners and LockOwners. - * - When a process exits, it calls nfscl_cleanup(), which goes - * through the client list looking for all Open and Lock Owners. + * - The function nfscl_cleanup_common() is executed after a process exits. + * It goes through the client list looking for all Open and Lock Owners. * When one is found, it is marked "defunct" or in the case of * an OpenOwner without any Opens, freed. * The renew thread scans for defunct Owners and gets rid of them, @@ -1630,33 +1630,9 @@ nfscl_expireclient(struct nfsclclient *c } } -#ifndef __FreeBSD__ /* - * Called from exit() upon process termination. - */ -APPLESTATIC void -nfscl_cleanup(NFSPROC_T *p) -{ - struct nfsclclient *clp; - u_int8_t own[NFSV4CL_LOCKNAMELEN]; - - if (!nfscl_inited) - return; - nfscl_filllockowner(p->td_proc, own, F_POSIX); - - NFSLOCKCLSTATE(); - /* - * Loop through all the clientids, looking for the OpenOwners. - */ - LIST_FOREACH(clp, &nfsclhead, nfsc_list) - nfscl_cleanup_common(clp, own); - NFSUNLOCKCLSTATE(); -} -#endif /* !__FreeBSD__ */ - -/* - * Common code used by nfscl_cleanup() and nfscl_cleanupkext(). - * Must be called with CLSTATE lock held. + * This function must be called after the process represented by "own" has + * exited. Must be called with CLSTATE lock held. */ static void nfscl_cleanup_common(struct nfsclclient *clp, u_int8_t *own) @@ -1707,9 +1683,7 @@ nfscl_cleanup_common(struct nfsclclient #if defined(APPLEKEXT) || defined(__FreeBSD__) /* - * Simulate the call nfscl_cleanup() by looking for open owners associated - * with processes that no longer exist, since a call to nfscl_cleanup() - * can't be patched into exit(). + * Find open/lock owners for processes that have exited. */ static void nfscl_cleanupkext(struct nfsclclient *clp) @@ -2556,8 +2530,8 @@ tryagain: #if defined(APPLEKEXT) || defined(__FreeBSD__) /* - * Simulate the calls to nfscl_cleanup() when a process - * exits, since the call can't be patched into exit(). + * Call nfscl_cleanupkext() once per second to check for + * open/lock owners where the process has exited. */ { struct timespec mytime; From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 01:20: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 574AE106564A; Sun, 20 Nov 2011 01:20:51 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45AA98FC12; Sun, 20 Nov 2011 01:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK1KpIR068701; Sun, 20 Nov 2011 01:20:51 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK1KphT068695; Sun, 20 Nov 2011 01:20:51 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111200120.pAK1KphT068695@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 20 Nov 2011 01:20: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: r227745 - in head/sys: conf kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 01:20:51 -0000 Author: lstewart Date: Sun Nov 20 01:20:50 2011 New Revision: 227745 URL: http://svn.freebsd.org/changeset/base/227745 Log: Provide high-level functions to access the feed-forward absolute and difference clocks. Each routine can output an upper bound on the absolute time or time interval requested. Different flavours of absolute time can be requested, for example with or without leap seconds, monotonic or not, etc. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au) Added: head/sys/kern/kern_ffclock.c (contents, props changed) Modified: head/sys/conf/files head/sys/sys/timeffc.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Nov 20 01:18:47 2011 (r227744) +++ head/sys/conf/files Sun Nov 20 01:20:50 2011 (r227745) @@ -2341,6 +2341,7 @@ kern/kern_event.c standard kern/kern_exec.c standard kern/kern_exit.c standard kern/kern_fail.c standard +kern/kern_ffclock.c optional ffclock kern/kern_fork.c standard kern/kern_gzio.c optional gzio kern/kern_hhook.c standard Added: head/sys/kern/kern_ffclock.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/kern_ffclock.c Sun Nov 20 01:20:50 2011 (r227745) @@ -0,0 +1,129 @@ +/*- + * Copyright (c) 2011 The University of Melbourne + * All rights reserved. + * + * This software was developed by Julien Ridoux at the University of Melbourne + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 + +extern struct ffclock_estimate ffclock_estimate; +extern struct bintime ffclock_boottime; + +/* + * Feed-forward clock absolute time. This should be the preferred way to read + * the feed-forward clock for "wall-clock" type time. The flags allow to compose + * various flavours of absolute time (e.g. with or without leap seconds taken + * into account). If valid pointers are provided, the ffcounter value and an + * upper bound on clock error associated with the bintime are provided. + * NOTE: use ffclock_convert_abs() to differ the conversion of a ffcounter value + * read earlier. + */ +void +ffclock_abstime(ffcounter *ffcount, struct bintime *bt, + struct bintime *error_bound, uint32_t flags) +{ + struct ffclock_estimate cest; + ffcounter ffc; + ffcounter update_ffcount; + ffcounter ffdelta_error; + + /* Get counter and corresponding time. */ + if ((flags & FFCLOCK_FAST) == FFCLOCK_FAST) + ffclock_last_tick(&ffc, bt, flags); + else { + ffclock_read_counter(&ffc); + ffclock_convert_abs(ffc, bt, flags); + } + + /* Current ffclock estimate, use update_ffcount as generation number. */ + do { + update_ffcount = ffclock_estimate.update_ffcount; + bcopy(&ffclock_estimate, &cest, sizeof(struct ffclock_estimate)); + } while (update_ffcount != ffclock_estimate.update_ffcount); + + /* + * Leap second adjustment. Total as seen by synchronisation algorithm + * since it started. cest.leapsec_next is the ffcounter prediction of + * when the next leapsecond occurs. + */ + if ((flags & FFCLOCK_LEAPSEC) == FFCLOCK_LEAPSEC) { + bt->sec -= cest.leapsec_total; + if (ffc > cest.leapsec_next) + bt->sec -= cest.leapsec; + } + + /* Boot time adjustment, for uptime/monotonic clocks. */ + if ((flags & FFCLOCK_UPTIME) == FFCLOCK_UPTIME) { + bintime_sub(bt, &ffclock_boottime); + } + + /* Compute error bound if a valid pointer has been passed. */ + if (error_bound) { + ffdelta_error = ffc - cest.update_ffcount; + ffclock_convert_diff(ffdelta_error, error_bound); + /* 18446744073709 = int(2^64/1e12), err_bound_rate in [ps/s] */ + bintime_mul(error_bound, cest.errb_rate * + (uint64_t)18446744073709LL); + /* 18446744073 = int(2^64 / 1e9), since err_abs in [ns] */ + bintime_addx(error_bound, cest.errb_abs * + (uint64_t)18446744073LL); + } + + if (ffcount) + *ffcount = ffc; +} + +/* + * Feed-forward difference clock. This should be the preferred way to convert a + * time interval in ffcounter values into a time interval in seconds. If a valid + * pointer is passed, an upper bound on the error in computing the time interval + * in seconds is provided. + */ +void +ffclock_difftime(ffcounter ffdelta, struct bintime *bt, + struct bintime *error_bound) +{ + ffcounter update_ffcount; + uint32_t err_rate; + + ffclock_convert_diff(ffdelta, bt); + + if (error_bound) { + do { + update_ffcount = ffclock_estimate.update_ffcount; + err_rate = ffclock_estimate.errb_rate; + } while (update_ffcount != ffclock_estimate.update_ffcount); + + ffclock_convert_diff(ffdelta, error_bound); + /* 18446744073709 = int(2^64/1e12), err_bound_rate in [ps/s] */ + bintime_mul(error_bound, err_rate * (uint64_t)18446744073709LL); + } +} Modified: head/sys/sys/timeffc.h ============================================================================== --- head/sys/sys/timeffc.h Sun Nov 20 01:18:47 2011 (r227744) +++ head/sys/sys/timeffc.h Sun Nov 20 01:20:50 2011 (r227745) @@ -105,6 +105,29 @@ void ffclock_last_tick(ffcounter *ffcoun void ffclock_convert_abs(ffcounter ffcount, struct bintime *bt, uint32_t flags); void ffclock_convert_diff(ffcounter ffdelta, struct bintime *bt); +/* + * Feed-forward clock routines. + * + * These functions rely on the timecounters and ffclock_estimates stored in + * fftimehands. Note that the error_bound parameter is not the error of the + * clock but an upper bound on the error of the absolute time or time interval + * returned. + * + * ffclock_abstime(): retrieves current time as counter value and convert this + * timestamp in seconds. The value (in seconds) of the converted timestamp + * depends on the flags passed: for a given counter value, different + * conversions are possible. Different clock models can be selected by + * combining flags (for example (FFCLOCK_LERP|FFCLOCK_UPTIME) produces + * linearly interpolated uptime). + * ffclock_difftime(): computes a time interval in seconds based on an interval + * measured in ffcounter units. This should be the preferred way to measure + * small time intervals very accurately. + */ +void ffclock_abstime(ffcounter *ffcount, struct bintime *bt, + struct bintime *error_bound, uint32_t flags); +void ffclock_difftime(ffcounter ffdelta, struct bintime *bt, + struct bintime *error_bound); + #endif /* _KERNEL */ #endif /* __BSD_VISIBLE */ #endif /* _SYS_TIMEFF_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 01:48: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 E774B106566C; Sun, 20 Nov 2011 01:48:22 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D73488FC0C; Sun, 20 Nov 2011 01:48:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK1mMKa069568; Sun, 20 Nov 2011 01:48:22 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK1mMSH069566; Sun, 20 Nov 2011 01:48:22 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111200148.pAK1mMSH069566@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 20 Nov 2011 01:48: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: r227746 - 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: Sun, 20 Nov 2011 01:48:23 -0000 Author: lstewart Date: Sun Nov 20 01:48:22 2011 New Revision: 227746 URL: http://svn.freebsd.org/changeset/base/227746 Log: Fix a whitespace nit. Submitted by: Julien Ridoux (jridoux at unimelb edu au) Modified: head/sys/sys/timeffc.h Modified: head/sys/sys/timeffc.h ============================================================================== --- head/sys/sys/timeffc.h Sun Nov 20 01:20:50 2011 (r227745) +++ head/sys/sys/timeffc.h Sun Nov 20 01:48:22 2011 (r227746) @@ -71,7 +71,7 @@ struct ffclock_estimate { * time by ffclock_convert_abs(). * FAST: do not read the hardware counter, return feed-forward clock time * at last tick. The time returned has the resolution of the kernel - * tick (1/hz [s]). + * tick (1/hz [s]). * LERP: linear interpolation of ffclock time to guarantee monotonic time. * LEAPSEC: include leap seconds. * UPTIME: removes time of boot. From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 03:49: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 6D015106564A; Sun, 20 Nov 2011 03:49:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id F3B598FC08; Sun, 20 Nov 2011 03:49:09 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAK3n6ua015859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Nov 2011 14:49:07 +1100 Date: Sun, 20 Nov 2011 14:49:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Schultz In-Reply-To: <20111114191914.GA58676@zim.MIT.EDU> Message-ID: <20111120140428.A1000@besplex.bde.org> References: <201111131618.pADGIm2n099696@svn.freebsd.org> <20111114082129.GA1596@mole.fafoe.narf.at> <4EC0E6C2.4010509@FreeBSD.org> <20111114180235.GA58284@zim.MIT.EDU> <3B8C1412-E18D-47E3-A09D-4847DD078963@FreeBSD.org> <20111114191914.GA58676@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, David Chisnall , svn-src-all@freebsd.org, Dimitry Andric , Stefan Farfeleder , svn-src-head@freebsd.org Subject: Re: svn commit: r227487 - 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, 20 Nov 2011 03:49:10 -0000 On Mon, 14 Nov 2011, David Schultz wrote: > On Mon, Nov 14, 2011, David Chisnall wrote: >> On 14 Nov 2011, at 18:02, David Schultz wrote: >> >>> On Mon, Nov 14, 2011, Dimitry Andric wrote: >>>> On 2011-11-14 09:21, Stefan Farfeleder wrote: >>>>> On Sun, Nov 13, 2011 at 04:18:48PM +0000, David Chisnall wrote: >>>>>> Author: theraven >>>>>> Date: Sun Nov 13 16:18:48 2011 >>>>>> New Revision: 227487 >>>>>> URL: http://svn.freebsd.org/changeset/base/227487 >>>>>> >>>>>> Log: >>>>>> The spec says that FILE must be defined in wchar.h, but it wasn't. It >>>>>> is now. Also hide some macros in C++ mode that will break C++ >>>>>> namespaced calls. >>>>>> >>>>>> Approved by: dim (mentor) >>>>> >>>>> I think this change is wrong. Whic spec are you referring to? C99 >>>>> defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is used >>>>> as parameter type for functions but that does not mean it is exported to >>>>> user space. Also, this change doesn't even declare `FILE'. It only declares an incomplete struct for `FILE', just like the old version except for a different spelling which gives namespace pollution that was carefully avoided. >>>> http://pubs.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html Just another bug in POSIX. Another bug in it is its wording, which is either too fuzzy or too strict. It says that FILE is defined (sic) as "described in ". If this is interpreted strictly, then it says that must declare FILE completely iff declares it completely. FILE should be opaque, so it should not be declared completely in either, but FreeBSD still supports old optimized inline or macro versions for a few of the interfaces in , so it must declare FILE completely in . Thus POSIX strictly requires FILE to be declared completely in too. But nothing in needs to dereference FILE, so doesn't need to declare it completely. I doubt that POSIX is so broken as to require this intentionally. >>> It's a niggling detail, but that's an extension to the C standard, >>> so properly speaking, it belongs in an >>> #if __POSIX_VISIBLE >= 200809 || XSI_VISIBLE >>> (or something like that). The formals were struct __sFILE * >>> instead of FILE * for that reason -- see r103177. >>> >>> P.S. You're looking at a very old version of POSIX. Check out: >>> http://pubs.opengroup.org/onlinepubs/9699919799/ Too hard to search using lynx. >> The C99 and C1x specifications both seem to require stdio.h to be included before wchar.h. I think this therefore places including wchar.h and not stdio.h in the category of undefined (or, at least, not defined) behaviour, so we are free to do anything in this case. I would say that accepting the code and working as the programmer expected is the least harmful thing to do here. This is what Darwin libc does (actually, it #includes stdio.h in wchar.h). Just another bug in Darwin. FreeBSD had the full namespace pollution from too, until this was fixed in r103177. > The C99 standard has plenty of examples of programs including > but not . The latter is only required to call > the functions that take a FILE * parameter. It's mostly an Not even that in FreeBSD (but C99 and portability requires it). The functions can be called without knowing a complete declaration of FILE or anything else in . E.g., getwc(NULL), or more usefully, getwc(fp) where fp is a FILE * passed as a parameter to the function that calls getwc(). This depends on the implementation detail that none of the functions dereferences FILE *. If we want to punish unportable callers that don't include strictly before including and using one of the functions, perhaps that can be arranged. > academic point because no sane programmer would ever create a new > type named FILE, but FreeBSD actually did right by C99 before you > reverted r103177. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 05:32: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 9EF2A1065675; Sun, 20 Nov 2011 05:32:12 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2618FC18; Sun, 20 Nov 2011 05:32:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK5WC0D077163; Sun, 20 Nov 2011 05:32:12 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK5WC4o077159; Sun, 20 Nov 2011 05:32:12 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111200532.pAK5WC4o077159@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 20 Nov 2011 05:32: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: r227747 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 05:32:12 -0000 Author: lstewart Date: Sun Nov 20 05:32:12 2011 New Revision: 227747 URL: http://svn.freebsd.org/changeset/base/227747 Log: - Provide a sysctl interface to change the active system clock at runtime. - Wrap [get]{bin,nano,micro}[up]time() functions of sys/time.h to allow requesting time from either the feedback or the feed-forward clock. If a feedback (e.g. ntpd) and feed-forward (e.g. radclock) daemon are both running on the system, both kernel clocks are updated but only one serves time. - Add similar wrappers for the feed-forward difference clock. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au) Modified: head/sys/kern/kern_ffclock.c head/sys/kern/kern_tc.c head/sys/sys/timeffc.h Modified: head/sys/kern/kern_ffclock.c ============================================================================== --- head/sys/kern/kern_ffclock.c Sun Nov 20 01:48:22 2011 (r227746) +++ head/sys/kern/kern_ffclock.c Sun Nov 20 05:32:12 2011 (r227747) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include @@ -127,3 +129,215 @@ ffclock_difftime(ffcounter ffdelta, stru bintime_mul(error_bound, err_rate * (uint64_t)18446744073709LL); } } + +/* + * Sysctl for the Feed-Forward Clock. + */ + +static int ffclock_version = 2; +SYSCTL_NODE(_kern, OID_AUTO, ffclock, CTLFLAG_RW, 0, + "Feed-Forward Clock Support"); +SYSCTL_INT(_kern_ffclock, OID_AUTO, version, CTLFLAG_RD, &ffclock_version, 0, + "Version of Feed-Forward Clock Support"); + +/* + * Sysctl to select which clock is read when calling any of the + * [get]{bin,nano,micro}[up]time() functions. + */ +char *sysclocks[] = {"feedback", "feed-forward"}; + +#define NUM_SYSCLOCKS (sizeof(sysclocks) / sizeof(*sysclocks)) + +/* Report or change the active timecounter hardware. */ +static int +sysctl_kern_ffclock_choice(SYSCTL_HANDLER_ARGS) +{ + struct sbuf *s; + int clk, error; + + s = sbuf_new_for_sysctl(NULL, NULL, 16 * NUM_SYSCLOCKS, req); + if (s == NULL) + return (ENOMEM); + + for (clk = 0; clk < NUM_SYSCLOCKS; clk++) { + sbuf_cat(s, sysclocks[clk]); + if (clk + 1 < NUM_SYSCLOCKS) + sbuf_cat(s, " "); + } + error = sbuf_finish(s); + sbuf_delete(s); + + return (error); +} + +SYSCTL_PROC(_kern_ffclock, OID_AUTO, choice, CTLTYPE_STRING | CTLFLAG_RD, + 0, 0, sysctl_kern_ffclock_choice, "A", "Clock paradigms available"); + +extern int sysclock_active; + +static int +sysctl_kern_ffclock_active(SYSCTL_HANDLER_ARGS) +{ + char newclock[32]; + int error; + + switch (sysclock_active) { + case SYSCLOCK_FBCK: + strlcpy(newclock, sysclocks[SYSCLOCK_FBCK], sizeof(newclock)); + break; + case SYSCLOCK_FFWD: + strlcpy(newclock, sysclocks[SYSCLOCK_FFWD], sizeof(newclock)); + break; + } + + error = sysctl_handle_string(oidp, &newclock[0], sizeof(newclock), req); + if (error != 0 || req->newptr == NULL) + return (error); + if (strncmp(newclock, sysclocks[SYSCLOCK_FBCK], + sizeof(sysclocks[SYSCLOCK_FBCK])) == 0) + sysclock_active = SYSCLOCK_FBCK; + else if (strncmp(newclock, sysclocks[SYSCLOCK_FFWD], + sizeof(sysclocks[SYSCLOCK_FFWD])) == 0) + sysclock_active = SYSCLOCK_FFWD; + else + return (EINVAL); + + return (error); +} + +SYSCTL_PROC(_kern_ffclock, OID_AUTO, active, CTLTYPE_STRING | CTLFLAG_RW, + 0, 0, sysctl_kern_ffclock_active, "A", "Kernel clock selected"); + +/* + * High level functions to access the Feed-Forward Clock. + */ +void +ffclock_bintime(struct bintime *bt) +{ + + ffclock_abstime(NULL, bt, NULL, FFCLOCK_LERP | FFCLOCK_LEAPSEC); +} + +void +ffclock_nanotime(struct timespec *tsp) +{ + struct bintime bt; + + ffclock_abstime(NULL, &bt, NULL, FFCLOCK_LERP | FFCLOCK_LEAPSEC); + bintime2timespec(&bt, tsp); +} + +void +ffclock_microtime(struct timeval *tvp) +{ + struct bintime bt; + + ffclock_abstime(NULL, &bt, NULL, FFCLOCK_LERP | FFCLOCK_LEAPSEC); + bintime2timeval(&bt, tvp); +} + +void +ffclock_getbintime(struct bintime *bt) +{ + + ffclock_abstime(NULL, bt, NULL, + FFCLOCK_LERP | FFCLOCK_LEAPSEC | FFCLOCK_FAST); +} + +void +ffclock_getnanotime(struct timespec *tsp) +{ + struct bintime bt; + + ffclock_abstime(NULL, &bt, NULL, + FFCLOCK_LERP | FFCLOCK_LEAPSEC | FFCLOCK_FAST); + bintime2timespec(&bt, tsp); +} + +void +ffclock_getmicrotime(struct timeval *tvp) +{ + struct bintime bt; + + ffclock_abstime(NULL, &bt, NULL, + FFCLOCK_LERP | FFCLOCK_LEAPSEC | FFCLOCK_FAST); + bintime2timeval(&bt, tvp); +} + +void +ffclock_binuptime(struct bintime *bt) +{ + + ffclock_abstime(NULL, bt, NULL, FFCLOCK_LERP | FFCLOCK_UPTIME); +} + +void +ffclock_nanouptime(struct timespec *tsp) +{ + struct bintime bt; + + ffclock_abstime(NULL, &bt, NULL, FFCLOCK_LERP | FFCLOCK_UPTIME); + bintime2timespec(&bt, tsp); +} + +void +ffclock_microuptime(struct timeval *tvp) +{ + struct bintime bt; + + ffclock_abstime(NULL, &bt, NULL, FFCLOCK_LERP | FFCLOCK_UPTIME); + bintime2timeval(&bt, tvp); +} + +void +ffclock_getbinuptime(struct bintime *bt) +{ + + ffclock_abstime(NULL, bt, NULL, + FFCLOCK_LERP | FFCLOCK_UPTIME | FFCLOCK_FAST); +} + +void +ffclock_getnanouptime(struct timespec *tsp) +{ + struct bintime bt; + + ffclock_abstime(NULL, &bt, NULL, + FFCLOCK_LERP | FFCLOCK_UPTIME | FFCLOCK_FAST); + bintime2timespec(&bt, tsp); +} + +void +ffclock_getmicrouptime(struct timeval *tvp) +{ + struct bintime bt; + + ffclock_abstime(NULL, &bt, NULL, + FFCLOCK_LERP | FFCLOCK_UPTIME | FFCLOCK_FAST); + bintime2timeval(&bt, tvp); +} + +void +ffclock_bindifftime(ffcounter ffdelta, struct bintime *bt) +{ + + ffclock_difftime(ffdelta, bt, NULL); +} + +void +ffclock_nanodifftime(ffcounter ffdelta, struct timespec *tsp) +{ + struct bintime bt; + + ffclock_difftime(ffdelta, &bt, NULL); + bintime2timespec(&bt, tsp); +} + +void +ffclock_microdifftime(ffcounter ffdelta, struct timeval *tvp) +{ + struct bintime bt; + + ffclock_difftime(ffdelta, &bt, NULL); + bintime2timeval(&bt, tvp); +} Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sun Nov 20 01:48:22 2011 (r227746) +++ head/sys/kern/kern_tc.c Sun Nov 20 05:32:12 2011 (r227747) @@ -177,6 +177,144 @@ tc_delta(struct timehands *th) * the comment in for a description of these 12 functions. */ +#ifdef FFCLOCK +static void +fbclock_binuptime(struct bintime *bt) +{ + struct timehands *th; + unsigned int gen; + + do { + th = timehands; + gen = th->th_generation; + *bt = th->th_offset; + bintime_addx(bt, th->th_scale * tc_delta(th)); + } while (gen == 0 || gen != th->th_generation); +} + +static void +fbclock_nanouptime(struct timespec *tsp) +{ + struct bintime bt; + + binuptime(&bt); + bintime2timespec(&bt, tsp); +} + +static void +fbclock_microuptime(struct timeval *tvp) +{ + struct bintime bt; + + binuptime(&bt); + bintime2timeval(&bt, tvp); +} + +static void +fbclock_bintime(struct bintime *bt) +{ + + binuptime(bt); + bintime_add(bt, &boottimebin); +} + +static void +fbclock_nanotime(struct timespec *tsp) +{ + struct bintime bt; + + bintime(&bt); + bintime2timespec(&bt, tsp); +} + +static void +fbclock_microtime(struct timeval *tvp) +{ + struct bintime bt; + + bintime(&bt); + bintime2timeval(&bt, tvp); +} + +static void +fbclock_getbinuptime(struct bintime *bt) +{ + struct timehands *th; + unsigned int gen; + + do { + th = timehands; + gen = th->th_generation; + *bt = th->th_offset; + } while (gen == 0 || gen != th->th_generation); +} + +static void +fbclock_getnanouptime(struct timespec *tsp) +{ + struct timehands *th; + unsigned int gen; + + do { + th = timehands; + gen = th->th_generation; + bintime2timespec(&th->th_offset, tsp); + } while (gen == 0 || gen != th->th_generation); +} + +static void +fbclock_getmicrouptime(struct timeval *tvp) +{ + struct timehands *th; + unsigned int gen; + + do { + th = timehands; + gen = th->th_generation; + bintime2timeval(&th->th_offset, tvp); + } while (gen == 0 || gen != th->th_generation); +} + +static void +fbclock_getbintime(struct bintime *bt) +{ + struct timehands *th; + unsigned int gen; + + do { + th = timehands; + gen = th->th_generation; + *bt = th->th_offset; + } while (gen == 0 || gen != th->th_generation); + bintime_add(bt, &boottimebin); +} + +static void +fbclock_getnanotime(struct timespec *tsp) +{ + struct timehands *th; + unsigned int gen; + + do { + th = timehands; + gen = th->th_generation; + *tsp = th->th_nanotime; + } while (gen == 0 || gen != th->th_generation); +} + +static void +fbclock_getmicrotime(struct timeval *tvp) +{ + struct timehands *th; + unsigned int gen; + + do { + th = timehands; + gen = th->th_generation; + *tvp = th->th_microtime; + } while (gen == 0 || gen != th->th_generation); +} +#else /* !FFCLOCK */ void binuptime(struct bintime *bt) { @@ -313,6 +451,7 @@ getmicrotime(struct timeval *tvp) *tvp = th->th_microtime; } while (gen == 0 || gen != th->th_generation); } +#endif /* FFCLOCK */ #ifdef FFCLOCK /* @@ -322,6 +461,8 @@ getmicrotime(struct timeval *tvp) * necessary. */ +int sysclock_active = SYSCLOCK_FBCK; + /* Feed-forward clock estimates kept updated by the synchronization daemon. */ struct ffclock_estimate ffclock_estimate; struct bintime ffclock_boottime; /* Feed-forward boot time estimate. */ @@ -329,6 +470,38 @@ uint32_t ffclock_status; /* Feed-forwar int8_t ffclock_updated; /* New estimates are available. */ struct mtx ffclock_mtx; /* Mutex on ffclock_estimate. */ +struct sysclock_ops { + int active; + void (*binuptime) (struct bintime *bt); + void (*nanouptime) (struct timespec *tsp); + void (*microuptime) (struct timeval *tvp); + void (*bintime) (struct bintime *bt); + void (*nanotime) (struct timespec *tsp); + void (*microtime) (struct timeval *tvp); + void (*getbinuptime) (struct bintime *bt); + void (*getnanouptime) (struct timespec *tsp); + void (*getmicrouptime) (struct timeval *tvp); + void (*getbintime) (struct bintime *bt); + void (*getnanotime) (struct timespec *tsp); + void (*getmicrotime) (struct timeval *tvp); +}; + +static struct sysclock_ops sysclock = { + .active = SYSCLOCK_FBCK, + .binuptime = fbclock_binuptime, + .nanouptime = fbclock_nanouptime, + .microuptime = fbclock_microuptime, + .bintime = fbclock_bintime, + .nanotime = fbclock_nanotime, + .microtime = fbclock_microtime, + .getbinuptime = fbclock_getbinuptime, + .getnanouptime = fbclock_getnanouptime, + .getmicrouptime = fbclock_getmicrouptime, + .getbintime = fbclock_getbintime, + .getnanotime = fbclock_getnanotime, + .getmicrotime = fbclock_getmicrotime +}; + struct fftimehands { struct ffclock_estimate cest; struct bintime tick_time; @@ -621,6 +794,46 @@ ffclock_change_tc(struct timehands *th) fftimehands = ffth; } +static void +change_sysclock(int new_sysclock) +{ + + sysclock.active = new_sysclock; + + switch (sysclock.active) { + case SYSCLOCK_FBCK: + sysclock.binuptime = fbclock_binuptime; + sysclock.nanouptime = fbclock_nanouptime; + sysclock.microuptime = fbclock_microuptime; + sysclock.bintime = fbclock_bintime; + sysclock.nanotime = fbclock_nanotime; + sysclock.microtime = fbclock_microtime; + sysclock.getbinuptime = fbclock_getbinuptime; + sysclock.getnanouptime = fbclock_getnanouptime; + sysclock.getmicrouptime = fbclock_getmicrouptime; + sysclock.getbintime = fbclock_getbintime; + sysclock.getnanotime = fbclock_getnanotime; + sysclock.getmicrotime = fbclock_getmicrotime; + break; + case SYSCLOCK_FFWD: + sysclock.binuptime = ffclock_binuptime; + sysclock.nanouptime = ffclock_nanouptime; + sysclock.microuptime = ffclock_microuptime; + sysclock.bintime = ffclock_bintime; + sysclock.nanotime = ffclock_nanotime; + sysclock.microtime = ffclock_microtime; + sysclock.getbinuptime = ffclock_getbinuptime; + sysclock.getnanouptime = ffclock_getnanouptime; + sysclock.getmicrouptime = ffclock_getmicrouptime; + sysclock.getbintime = ffclock_getbintime; + sysclock.getnanotime = ffclock_getnanotime; + sysclock.getmicrotime = ffclock_getmicrotime; + break; + default: + break; + } +} + /* * Retrieve feed-forward counter and time of last kernel tick. */ @@ -731,6 +944,90 @@ ffclock_read_counter(ffcounter *ffcount) *ffcount += delta; } + +void +binuptime(struct bintime *bt) +{ + + sysclock.binuptime(bt); +} + +void +nanouptime(struct timespec *tsp) +{ + + sysclock.nanouptime(tsp); +} + +void +microuptime(struct timeval *tvp) +{ + + sysclock.microuptime(tvp); +} + +void +bintime(struct bintime *bt) +{ + + sysclock.bintime(bt); +} + +void +nanotime(struct timespec *tsp) +{ + + sysclock.nanotime(tsp); +} + +void +microtime(struct timeval *tvp) +{ + + sysclock.microtime(tvp); +} + +void +getbinuptime(struct bintime *bt) +{ + + sysclock.getbinuptime(bt); +} + +void +getnanouptime(struct timespec *tsp) +{ + + sysclock.getnanouptime(tsp); +} + +void +getmicrouptime(struct timeval *tvp) +{ + + sysclock.getmicrouptime(tvp); +} + +void +getbintime(struct bintime *bt) +{ + + sysclock.getbintime(bt); +} + +void +getnanotime(struct timespec *tsp) +{ + + sysclock.getnanotime(tsp); +} + +void +getmicrotime(struct timeval *tvp) +{ + + sysclock.getmicrouptime(tvp); +} #endif /* FFCLOCK */ /* @@ -971,6 +1268,11 @@ tc_windup(void) scale /= th->th_counter->tc_frequency; th->th_scale = scale * 2; +#ifdef FFCLOCK + if (sysclock_active != sysclock.active) + change_sysclock(sysclock_active); +#endif + /* * Now that the struct timehands is again consistent, set the new * generation number, making sure to not make it zero. @@ -980,8 +1282,21 @@ tc_windup(void) th->th_generation = ogen; /* Go live with the new struct timehands. */ - time_second = th->th_microtime.tv_sec; - time_uptime = th->th_offset.sec; +#ifdef FFCLOCK + switch (sysclock_active) { + case SYSCLOCK_FBCK: +#endif + time_second = th->th_microtime.tv_sec; + time_uptime = th->th_offset.sec; +#ifdef FFCLOCK + break; + case SYSCLOCK_FFWD: + time_second = fftimehands->tick_time_lerp.sec; + time_uptime = fftimehands->tick_time_lerp.sec - ffclock_boottime.sec; + break; + } +#endif + timehands = th; } @@ -1261,6 +1576,7 @@ inittimecounter(void *dummy) #ifdef FFCLOCK ffclock_init(); + change_sysclock(sysclock_active); #endif /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); Modified: head/sys/sys/timeffc.h ============================================================================== --- head/sys/sys/timeffc.h Sun Nov 20 01:48:22 2011 (r227746) +++ head/sys/sys/timeffc.h Sun Nov 20 05:32:12 2011 (r227747) @@ -56,6 +56,13 @@ struct ffclock_estimate { #ifdef _KERNEL /* + * Index into the sysclocks array for obtaining the ASCII name of a particular + * sysclock. + */ +#define SYSCLOCK_FBCK 0 +#define SYSCLOCK_FFWD 1 + +/* * Parameters of counter characterisation required by feed-forward algorithms. */ #define FFCLOCK_SKM_SCALE 1024 @@ -128,6 +135,35 @@ void ffclock_abstime(ffcounter *ffcount, void ffclock_difftime(ffcounter ffdelta, struct bintime *bt, struct bintime *error_bound); +/* + * Wrapper routines to return current absolute time using the feed-forward + * clock. These functions are named after those defined in , which + * contains a description of the original ones. + */ +void ffclock_bintime(struct bintime *bt); +void ffclock_nanotime(struct timespec *tsp); +void ffclock_microtime(struct timeval *tvp); + +void ffclock_getbintime(struct bintime *bt); +void ffclock_getnanotime(struct timespec *tsp); +void ffclock_getmicrotime(struct timeval *tvp); + +void ffclock_binuptime(struct bintime *bt); +void ffclock_nanouptime(struct timespec *tsp); +void ffclock_microuptime(struct timeval *tvp); + +void ffclock_getbinuptime(struct bintime *bt); +void ffclock_getnanouptime(struct timespec *tsp); +void ffclock_getmicrouptime(struct timeval *tvp); + +/* + * Wrapper routines to convert a time interval specified in ffcounter units into + * seconds using the current feed-forward clock estimates. + */ +void ffclock_bindifftime(ffcounter ffdelta, struct bintime *bt); +void ffclock_nanodifftime(ffcounter ffdelta, struct timespec *tsp); +void ffclock_microdifftime(ffcounter ffdelta, struct timeval *tvp); + #endif /* _KERNEL */ #endif /* __BSD_VISIBLE */ #endif /* _SYS_TIMEFF_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 08:29: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 10DEB106564A; Sun, 20 Nov 2011 08:29:24 +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 008468FC08; Sun, 20 Nov 2011 08:29:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK8TNSj082617; Sun, 20 Nov 2011 08:29:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK8TNm7082615; Sun, 20 Nov 2011 08:29:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111200829.pAK8TNm7082615@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 20 Nov 2011 08:29: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: r227748 - 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, 20 Nov 2011 08:29:24 -0000 Author: hselasky Date: Sun Nov 20 08:29:23 2011 New Revision: 227748 URL: http://svn.freebsd.org/changeset/base/227748 Log: Minor style change: Simplify the description of pause() and shorten the KASSERT message in pause. Also add a clamp for the timo argument in the non-KASSERT case. Suggested by: Bruce Evans MFC after: 1 week Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sun Nov 20 05:32:12 2011 (r227747) +++ head/sys/kern/kern_synch.c Sun Nov 20 08:29:23 2011 (r227748) @@ -325,25 +325,24 @@ msleep_spin(void *ident, struct mtx *mtx } /* - * pause() is almost like tsleep() except that the intention is to not - * be explicitly woken up by another thread. Instead, the current - * thread simply wishes to sleep until the timeout expires. It is - * implemented using a dummy wait channel. During cold bootup pause() - * will use the DELAY() function instead of tsleep() to wait the given - * number of system ticks. The passed "timo" argument must not be - * negative and also greater than zero. + * pause() delays the calling thread by the given number of system ticks. + * During cold bootup, pause() uses the DELAY() function instead of + * the tsleep() function to do the waiting. The "timo" argument must be + * greater than zero. */ int pause(const char *wmesg, int timo) { + KASSERT(timo > 0, ("pause: timo must be > 0")); - KASSERT(timo > 0, ("pause: a positive and non-zero " - "timeout is required")); + /* silently convert invalid timeouts */ + if (timo < 1) + timo = 1; if (cold) { /* * We delay one HZ at a time to avoid overflowing the - * DELAY() argument: + * system specific DELAY() function(s): */ while (timo >= hz) { DELAY(1000000); From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 08:36: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 9C3931065670; Sun, 20 Nov 2011 08:36:18 +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 8C0C78FC0A; Sun, 20 Nov 2011 08:36:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK8aIUK082866; Sun, 20 Nov 2011 08:36:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK8aIEq082864; Sun, 20 Nov 2011 08:36:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111200836.pAK8aIEq082864@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 20 Nov 2011 08:36: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: r227749 - 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, 20 Nov 2011 08:36:18 -0000 Author: hselasky Date: Sun Nov 20 08:36:18 2011 New Revision: 227749 URL: http://svn.freebsd.org/changeset/base/227749 Log: Given that the typical usage of pause() is pause("zzz", hz / N), where N can be greater than hz in some cases, simply ignore a timeout value of zero. Suggested by: Bruce Evans MFC after: 1 week Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sun Nov 20 08:29:23 2011 (r227748) +++ head/sys/kern/kern_synch.c Sun Nov 20 08:36:18 2011 (r227749) @@ -333,7 +333,7 @@ msleep_spin(void *ident, struct mtx *mtx int pause(const char *wmesg, int timo) { - KASSERT(timo > 0, ("pause: timo must be > 0")); + KASSERT(timo >= 0, ("pause: timo must be >= 0")); /* silently convert invalid timeouts */ if (timo < 1) From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 12:18: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 DFD22106566C; Sun, 20 Nov 2011 12:18:21 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE98D8FC0C; Sun, 20 Nov 2011 12:18:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKCILMg091928; Sun, 20 Nov 2011 12:18:21 GMT (envelope-from miwi@svn.freebsd.org) Received: (from miwi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKCILSQ091911; Sun, 20 Nov 2011 12:18:21 GMT (envelope-from miwi@svn.freebsd.org) Message-Id: <201111201218.pAKCILSQ091911@svn.freebsd.org> From: Martin Wilke Date: Sun, 20 Nov 2011 12: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: r227750 - 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: Sun, 20 Nov 2011 12:18:22 -0000 Author: miwi Date: Sun Nov 20 12:18:21 2011 New Revision: 227750 URL: http://svn.freebsd.org/changeset/base/227750 Log: - Add missing usb and ucom devices PR: usb/160301 Submitted by: Garrett Cooper Reviewed by: hselasky Approved by: hselasky, rwatson (mentor) MFC after: 3 Days Modified: head/share/man/man4/u3g.4 head/share/man/man4/uark.4 head/share/man/man4/ubsa.4 head/share/man/man4/ubser.4 head/share/man/man4/uchcom.4 head/share/man/man4/ucycom.4 head/share/man/man4/ufoma.4 head/share/man/man4/uftdi.4 head/share/man/man4/uipaq.4 head/share/man/man4/umcs.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 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/u3g.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2008 +.Dd November 20, 2011 .Dt U3G 4 .Os .Sh NAME @@ -29,6 +29,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device u3g" .Ed .Pp Modified: head/share/man/man4/uark.4 ============================================================================== --- head/share/man/man4/uark.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/uark.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 15, 2006 +.Dd November 20, 2011 .Dt UARK 4 .Os .Sh NAME @@ -27,6 +27,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device uark" .Ed .Pp Modified: head/share/man/man4/ubsa.4 ============================================================================== --- head/share/man/man4/ubsa.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/ubsa.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2008 +.Dd November 20, 2011 .Dt UBSA 4 .Os .Sh NAME @@ -39,6 +39,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device ubsa" .Ed .Pp Modified: head/share/man/man4/ubser.4 ============================================================================== --- head/share/man/man4/ubser.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/ubser.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd November 20, 2011 .Dt UBSER 4 .Os .Sh NAME @@ -39,6 +39,8 @@ To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device ubser" .Ed .Pp Modified: head/share/man/man4/uchcom.4 ============================================================================== --- head/share/man/man4/uchcom.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/uchcom.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2009 +.Dd November 20, 2011 .Dt UCHCOM 4 .Os .Sh NAME @@ -40,6 +40,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device uchcom" .Ed .Pp Modified: head/share/man/man4/ucycom.4 ============================================================================== --- head/share/man/man4/ucycom.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/ucycom.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd November 20, 2011 .Dt UCYCOM 4 .Os .Sh NAME @@ -38,6 +38,8 @@ To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device ucycom" .Ed .Pp Modified: head/share/man/man4/ufoma.4 ============================================================================== --- head/share/man/man4/ufoma.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/ufoma.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd November 20, 2011 .Dt UFOMA 4 .Os .Sh NAME @@ -38,6 +38,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device ufoma" .Ed .Pp Modified: head/share/man/man4/uftdi.4 ============================================================================== --- head/share/man/man4/uftdi.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/uftdi.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd November 20, 2011 .Dt UFTDI 4 .Os .Sh NAME @@ -40,6 +40,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device uftdi" .Ed .Pp Modified: head/share/man/man4/uipaq.4 ============================================================================== --- head/share/man/man4/uipaq.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/uipaq.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2008 +.Dd November 20, 2011 .Dt UIPAQ 4 .Os .Sh NAME @@ -41,6 +41,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device uipaq" .Ed .Pp Modified: head/share/man/man4/umcs.4 ============================================================================== --- head/share/man/man4/umcs.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/umcs.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2010 +.Dd November 20, 2011 .Dt UMCS 4 .Os .Sh NAME @@ -39,6 +39,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device umcs" .Ed .Pp Modified: head/share/man/man4/umct.4 ============================================================================== --- head/share/man/man4/umct.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/umct.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd November 20, 2011 .Dt UMCT 4 .Os .Sh NAME @@ -36,6 +36,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device umct" .Ed .Pp Modified: head/share/man/man4/umodem.4 ============================================================================== --- head/share/man/man4/umodem.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/umodem.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd November 20, 2011 .Dt UMODEM 4 .Os .Sh NAME @@ -40,6 +40,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device umodem" .Ed .Pp Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/uplcom.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 11, 2011 +.Dd November 20, 2011 .Dt UPLCOM 4 .Os .Sh NAME @@ -40,6 +40,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device uplcom" .Ed .Pp Modified: head/share/man/man4/uslcom.4 ============================================================================== --- head/share/man/man4/uslcom.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/uslcom.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2007 +.Dd November 20, 2011 .Dt USLCOM 4 .Os .Sh NAME @@ -27,6 +27,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device uslcom" .Ed .Pp Modified: head/share/man/man4/uvisor.4 ============================================================================== --- head/share/man/man4/uvisor.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/uvisor.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd November 20, 2011 .Dt UVISOR 4 .Os .Sh NAME @@ -40,6 +40,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device uvisor" .Ed .Pp Modified: head/share/man/man4/uvscom.4 ============================================================================== --- head/share/man/man4/uvscom.4 Sun Nov 20 08:36:18 2011 (r227749) +++ head/share/man/man4/uvscom.4 Sun Nov 20 12:18:21 2011 (r227750) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd November 20, 2011 .Dt UVSCOM 4 .Os .Sh NAME @@ -40,6 +40,8 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" .Cd "device uvscom" .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 12:26: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 2FE851065670; Sun, 20 Nov 2011 12:26:21 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2041F8FC0A; Sun, 20 Nov 2011 12:26:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKCQKbt092321; Sun, 20 Nov 2011 12:26:20 GMT (envelope-from miwi@svn.freebsd.org) Received: (from miwi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKCQKEc092319; Sun, 20 Nov 2011 12:26:20 GMT (envelope-from miwi@svn.freebsd.org) Message-Id: <201111201226.pAKCQKEc092319@svn.freebsd.org> From: Martin Wilke Date: Sun, 20 Nov 2011 12:26: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: r227751 - 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: Sun, 20 Nov 2011 12:26:21 -0000 Author: miwi Date: Sun Nov 20 12:26:20 2011 New Revision: 227751 URL: http://svn.freebsd.org/changeset/base/227751 Log: - Add support for Add LOGITECH Webcam C100 - While here whitespace fixes PR: usb/161559 Submitted by: Sergey Zaykov Reviewed by: hselasky Approved by: hselasky, rwatson (mentor) Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Nov 20 12:18:21 2011 (r227750) +++ head/sys/dev/usb/usbdevs Sun Nov 20 12:26:20 2011 (r227751) @@ -664,7 +664,7 @@ vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless -vendor MATRIXORBITAL 0x1b3d Matrix Orbital +vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink vendor TCTMOBILE 0x1bbb TCT Mobile vendor WAGO 0x1be3 WAGO Kontakttechnik GmbH. @@ -2091,6 +2091,7 @@ product LOGITECH M4848 0x0301 M4848 mou product LOGITECH PAGESCAN 0x040f PageScan product LOGITECH QUICKCAMWEB 0x0801 QuickCam Web product LOGITECH QUICKCAMPRO 0x0810 QuickCam Pro +product LOGITECH WEBCAMC100 0X0817 Webcam C100 product LOGITECH QUICKCAMEXP 0x0840 QuickCam Express product LOGITECH QUICKCAM 0x0850 QuickCam product LOGITECH QUICKCAMPRO3 0x0990 QuickCam Pro 9000 @@ -2136,7 +2137,7 @@ product MACALLY MOUSE1 0x0101 mouse /* Marvell Technology Group, Ltd. products */ product MARVELL SHEEVAPLUG 0x9e8f SheevaPlug serial interface - + /* Matrix Orbital products */ product MATRIXORBITAL MOUA 0x0153 Martrix Orbital MOU-Axxxx LCD displays From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 13:11: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 BF7E4106566C; Sun, 20 Nov 2011 13:11:29 +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 ACDBF8FC0A; Sun, 20 Nov 2011 13:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKDBTMm093757; Sun, 20 Nov 2011 13:11:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKDBTwV093752; Sun, 20 Nov 2011 13:11:29 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111201311.pAKDBTwV093752@svn.freebsd.org> From: Martin Matuska Date: Sun, 20 Nov 2011 13:11: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: r227752 - in head/cddl: contrib/opensolaris/cmd/zdb contrib/opensolaris/cmd/zstreamdump usr.bin/zstreamdump usr.sbin/zdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 13:11:29 -0000 Author: mm Date: Sun Nov 20 13:11:29 2011 New Revision: 227752 URL: http://svn.freebsd.org/changeset/base/227752 Log: Update and desolarization of zdb(8) and zstreamdump(1) manual pages: - synchronized to match new vendor code [1] - removed ATTRIBUTES sections - updated SEE ALSO sections - properly updated copyright information (required by CDDL) - remove empty lines via MANFILTER Obtained from: Illumos [1] MFC after: 5 days Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 head/cddl/usr.bin/zstreamdump/Makefile head/cddl/usr.sbin/zdb/Makefile Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Nov 20 12:26:20 2011 (r227751) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Nov 20 13:11:29 2011 (r227752) @@ -3,7 +3,8 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH zdb 1M "31 Oct 2005" "SunOS 5.11" "System Administration Commands" +.\" Portions Copyright 2011 Martin Matuska +.TH ZDB 8 "Oct 31, 2005" .SH NAME zdb \- ZFS debugger .SH SYNOPSIS @@ -15,70 +16,50 @@ zdb \- ZFS debugger .SH DESCRIPTION .sp .LP -The \fBzdb\fR command is used by support engineers to diagnose failures and gather statistics. Since the \fBZFS\fR file system is always consistent on disk and is self-repairing, \fBzdb\fR should only be run under the direction by a support engineer. +The \fBzdb\fR command is used by support engineers to diagnose failures and +gather statistics. Since the \fBZFS\fR file system is always consistent on disk +and is self-repairing, \fBzdb\fR should only be run under the direction by a +support engineer. .sp .LP -If no arguments are specified, \fBzdb\fR, performs basic consistency checks on the pool and associated datasets, and report any problems detected. +If no arguments are specified, \fBzdb\fR, performs basic consistency checks on +the pool and associated datasets, and report any problems detected. .sp .LP -Any options supported by this command are internal to Sun and subject to change at any time. +Any options supported by this command are internal to Sun and subject to change +at any time. .SH EXIT STATUS .sp .LP The following exit values are returned: .sp .ne 2 -.mk .na \fB\fB0\fR\fR .ad .RS 5n -.rt The pool is consistent. .RE .sp .ne 2 -.mk .na \fB\fB1\fR\fR .ad .RS 5n -.rt An error was detected. .RE .sp .ne 2 -.mk .na \fB\fB2\fR\fR .ad .RS 5n -.rt Invalid command line options were specified. .RE -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -tab() box; -cw(2.75i) |cw(2.75i) -lw(2.75i) |lw(2.75i) -. -ATTRIBUTE TYPEATTRIBUTE VALUE -_ -AvailabilitySUNWzfsu -_ -Interface StabilityUnstable -.TE - .SH SEE ALSO .sp .LP -\fBzfs\fR(1M), \fBzpool\fR(1M), \fBattributes\fR(5) +zfs(8), zpool(8) Modified: head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Sun Nov 20 12:26:20 2011 (r227751) +++ head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 Sun Nov 20 13:11:29 2011 (r227752) @@ -3,7 +3,8 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH zstreamdump 1M "21 Sep 2009" "SunOS 5.11" "System Administration Commands" +.\" Portions Copyright 2011 Martin Matuska +.TH ZSTREAMDUMP 1 "Sep 21, 2009" .SH NAME zstreamdump \- filter data in zfs send stream .SH SYNOPSIS @@ -15,14 +16,15 @@ zstreamdump \- filter data in zfs send s .SH DESCRIPTION .sp .LP -The \fBzstreamdump\fR utility reads from the output of the \fBzfs send\fR command, then displays headers and some statistics from that output. See \fBzfs\fR(1M). +The \fBzstreamdump\fR utility reads from the output of the \fBzfs send\fR +command, then displays headers and some statistics from that output. See +\fBzfs\fR(1M). .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 -.mk .na \fB\fB-C\fR\fR .ad @@ -33,7 +35,6 @@ Suppress the validation of checksums. .sp .ne 2 -.mk .na \fB\fB-v\fR\fR .ad @@ -42,26 +43,7 @@ Suppress the validation of checksums. Verbose. Dump all headers, not only begin and end headers. .RE -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -tab() box; -cw(2.75i) |cw(2.75i) -lw(2.75i) |lw(2.75i) -. -ATTRIBUTE TYPEATTRIBUTE VALUE -_ -AvailabilitySUNWzfsu -_ -Interface StabilityUncommitted -.TE - .SH SEE ALSO .sp .LP -\fBzfs\fR(1M), \fBattributes\fR(5) +zfs(8) Modified: head/cddl/usr.bin/zstreamdump/Makefile ============================================================================== --- head/cddl/usr.bin/zstreamdump/Makefile Sun Nov 20 12:26:20 2011 (r227751) +++ head/cddl/usr.bin/zstreamdump/Makefile Sun Nov 20 13:11:29 2011 (r227752) @@ -24,4 +24,6 @@ LDADD= -lm -lnvpair -lumem -lzpool -lpth CSTD= c99 +MANFILTER= sed -e '/^$$/d' + .include Modified: head/cddl/usr.sbin/zdb/Makefile ============================================================================== --- head/cddl/usr.sbin/zdb/Makefile Sun Nov 20 12:26:20 2011 (r227751) +++ head/cddl/usr.sbin/zdb/Makefile Sun Nov 20 13:11:29 2011 (r227752) @@ -27,5 +27,6 @@ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} $ ${LIBUUTIL} ${LIBZFS} ${LIBZPOOL} LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool +MANFILTER= sed -e '/^$$/d' .include From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 14:45: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 B71A4106564A; Sun, 20 Nov 2011 14:45:42 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A28DA8FC0C; Sun, 20 Nov 2011 14:45:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKEjgRr096697; Sun, 20 Nov 2011 14:45:42 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKEjgNR096676; Sun, 20 Nov 2011 14:45:42 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111201445.pAKEjgNR096676@svn.freebsd.org> From: David Chisnall Date: Sun, 20 Nov 2011 14:45: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: r227753 - in head: contrib/gdtoa include lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 14:45:42 -0000 Author: theraven Date: Sun Nov 20 14:45:42 2011 New Revision: 227753 URL: http://svn.freebsd.org/changeset/base/227753 Log: Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor) Added: head/include/_xlocale_ctype.h (contents, props changed) head/include/xlocale.h (contents, props changed) head/lib/libc/locale/DESIGN.xlocale (contents, props changed) head/lib/libc/locale/ctype.c (contents, props changed) head/lib/libc/locale/duplocale.3 (contents, props changed) head/lib/libc/locale/freelocale.3 (contents, props changed) head/lib/libc/locale/newlocale.3 (contents, props changed) head/lib/libc/locale/querylocale.3 (contents, props changed) head/lib/libc/locale/uselocale.3 (contents, props changed) head/lib/libc/locale/xlocale.3 (contents, props changed) head/lib/libc/locale/xlocale.c (contents, props changed) head/lib/libc/locale/xlocale_private.h (contents, props changed) Modified: head/contrib/gdtoa/gdtoaimp.h head/contrib/gdtoa/strtod.c head/contrib/gdtoa/strtodg.c head/contrib/gdtoa/strtof.c head/contrib/gdtoa/strtorQ.c head/contrib/gdtoa/strtord.c head/contrib/gdtoa/strtorx.c head/include/Makefile head/include/locale.h head/include/runetype.h head/include/stdlib.h head/lib/libc/gdtoa/machdep_ldisQ.c head/lib/libc/gdtoa/machdep_ldisd.c head/lib/libc/gdtoa/machdep_ldisx.c head/lib/libc/gen/fnmatch.c head/lib/libc/gen/glob.c head/lib/libc/locale/Makefile.inc head/lib/libc/locale/Symbol.map head/lib/libc/locale/ascii.c head/lib/libc/locale/big5.c head/lib/libc/locale/btowc.c head/lib/libc/locale/collate.c head/lib/libc/locale/collate.h head/lib/libc/locale/collcmp.c head/lib/libc/locale/euc.c head/lib/libc/locale/gb18030.c head/lib/libc/locale/gb2312.c head/lib/libc/locale/gbk.c head/lib/libc/locale/lmessages.c head/lib/libc/locale/lmessages.h head/lib/libc/locale/lmonetary.c head/lib/libc/locale/lmonetary.h head/lib/libc/locale/lnumeric.c head/lib/libc/locale/lnumeric.h head/lib/libc/locale/localeconv.3 head/lib/libc/locale/localeconv.c head/lib/libc/locale/mblen.c head/lib/libc/locale/mblocal.h head/lib/libc/locale/mbrlen.c head/lib/libc/locale/mbrtowc.c head/lib/libc/locale/mbsinit.c head/lib/libc/locale/mbsnrtowcs.c head/lib/libc/locale/mbsrtowcs.c head/lib/libc/locale/mbstowcs.c head/lib/libc/locale/mbtowc.c head/lib/libc/locale/mskanji.c head/lib/libc/locale/nextwctype.c head/lib/libc/locale/nl_langinfo.c head/lib/libc/locale/none.c head/lib/libc/locale/runetype.c head/lib/libc/locale/setlocale.c head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/table.c head/lib/libc/locale/tolower.c head/lib/libc/locale/toupper.c head/lib/libc/locale/utf8.c head/lib/libc/locale/wcrtomb.c head/lib/libc/locale/wcsftime.c head/lib/libc/locale/wcsnrtombs.c head/lib/libc/locale/wcsrtombs.c head/lib/libc/locale/wcstod.c head/lib/libc/locale/wcstof.c head/lib/libc/locale/wcstoimax.c head/lib/libc/locale/wcstol.c head/lib/libc/locale/wcstold.c head/lib/libc/locale/wcstoll.c head/lib/libc/locale/wcstombs.c head/lib/libc/locale/wcstoul.c head/lib/libc/locale/wcstoull.c head/lib/libc/locale/wcstoumax.c head/lib/libc/locale/wctob.c head/lib/libc/locale/wctomb.c head/lib/libc/locale/wctrans.c head/lib/libc/locale/wctype.c head/lib/libc/locale/wcwidth.c head/lib/libc/regex/regcomp.c head/lib/libc/stdio/Symbol.map head/lib/libc/stdio/asprintf.c head/lib/libc/stdio/fgetwc.c head/lib/libc/stdio/fgetwln.c head/lib/libc/stdio/fgetws.c head/lib/libc/stdio/fprintf.c head/lib/libc/stdio/fputwc.c head/lib/libc/stdio/fputws.c head/lib/libc/stdio/fscanf.c head/lib/libc/stdio/fwprintf.c head/lib/libc/stdio/fwscanf.c head/lib/libc/stdio/getwc.c head/lib/libc/stdio/getwchar.c head/lib/libc/stdio/local.h head/lib/libc/stdio/printf.c head/lib/libc/stdio/printfcommon.h head/lib/libc/stdio/putwc.c head/lib/libc/stdio/putwchar.c head/lib/libc/stdio/scanf.c head/lib/libc/stdio/snprintf.c head/lib/libc/stdio/sprintf.c head/lib/libc/stdio/sscanf.c head/lib/libc/stdio/swprintf.c head/lib/libc/stdio/swscanf.c head/lib/libc/stdio/ungetwc.c head/lib/libc/stdio/vasprintf.c head/lib/libc/stdio/vdprintf.c head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfscanf.c head/lib/libc/stdio/vfwprintf.c head/lib/libc/stdio/vfwscanf.c head/lib/libc/stdio/vprintf.c head/lib/libc/stdio/vscanf.c head/lib/libc/stdio/vsnprintf.c head/lib/libc/stdio/vsprintf.c head/lib/libc/stdio/vsscanf.c head/lib/libc/stdio/vswprintf.c head/lib/libc/stdio/vswscanf.c head/lib/libc/stdio/vwprintf.c head/lib/libc/stdio/vwscanf.c head/lib/libc/stdio/wprintf.c head/lib/libc/stdio/wscanf.c head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/atof.c head/lib/libc/stdlib/atoi.c head/lib/libc/stdlib/atol.c head/lib/libc/stdlib/atoll.c head/lib/libc/stdlib/strfmon.c head/lib/libc/stdlib/strtoimax.c head/lib/libc/stdlib/strtol.c head/lib/libc/stdlib/strtoll.c head/lib/libc/stdlib/strtoul.c head/lib/libc/stdlib/strtoull.c head/lib/libc/stdlib/strtoumax.c head/lib/libc/stdtime/strftime.c head/lib/libc/stdtime/strptime.c head/lib/libc/stdtime/timelocal.c head/lib/libc/stdtime/timelocal.h head/lib/libc/string/Symbol.map head/lib/libc/string/strcasecmp.c head/lib/libc/string/strcasestr.c head/lib/libc/string/strcoll.c head/lib/libc/string/strxfrm.c head/lib/libc/string/wcscoll.c head/lib/libc/string/wcswidth.c head/lib/libc/string/wcsxfrm.c Modified: head/contrib/gdtoa/gdtoaimp.h ============================================================================== --- head/contrib/gdtoa/gdtoaimp.h Sun Nov 20 13:11:29 2011 (r227752) +++ head/contrib/gdtoa/gdtoaimp.h Sun Nov 20 14:45:42 2011 (r227753) @@ -201,6 +201,7 @@ THIS SOFTWARE. #include "namespace.h" #include #include "un-namespace.h" +#include "xlocale_private.h" #ifdef KR_headers #define Char char @@ -525,11 +526,11 @@ extern void memcpy_D2A ANSI((void*, cons #define strtoIQ __strtoIQ #define strtoIx __strtoIx #define strtoIxL __strtoIxL -#define strtord __strtord +#define strtord_l __strtord_l #define strtordd __strtordd #define strtorf __strtorf -#define strtorQ __strtorQ -#define strtorx __strtorx +#define strtorQ_l __strtorQ_l +#define strtorx_l __strtorx_l #define strtorxL __strtorxL #define strtodI __strtodI #define strtopd __strtopd @@ -634,7 +635,7 @@ extern void memcpy_D2A ANSI((void*, cons extern Bigint *s2b ANSI((CONST char*, int, int, ULong, int)); extern Bigint *set_ones ANSI((Bigint*, int)); extern char *strcp ANSI((char*, const char*)); - extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*)); + extern int strtodg_l ANSI((CONST char*, char**, FPI*, Long*, ULong*, locale_t)); extern int strtoId ANSI((CONST char *, char **, double *, double *)); extern int strtoIdd ANSI((CONST char *, char **, double *, double *)); @@ -644,17 +645,18 @@ extern void memcpy_D2A ANSI((void*, cons extern int strtoIx ANSI((CONST char *, char **, void *, void *)); extern int strtoIxL ANSI((CONST char *, char **, void *, void *)); extern double strtod ANSI((const char *s00, char **se)); + extern double strtod_l ANSI((const char *s00, char **se, locale_t)); extern int strtopQ ANSI((CONST char *, char **, Void *)); extern int strtopf ANSI((CONST char *, char **, float *)); extern int strtopd ANSI((CONST char *, char **, double *)); extern int strtopdd ANSI((CONST char *, char **, double *)); extern int strtopx ANSI((CONST char *, char **, Void *)); extern int strtopxL ANSI((CONST char *, char **, Void *)); - extern int strtord ANSI((CONST char *, char **, int, double *)); + extern int strtord_l ANSI((CONST char *, char **, int, double *, locale_t)); extern int strtordd ANSI((CONST char *, char **, int, double *)); extern int strtorf ANSI((CONST char *, char **, int, float *)); - extern int strtorQ ANSI((CONST char *, char **, int, void *)); - extern int strtorx ANSI((CONST char *, char **, int, void *)); + extern int strtorQ_l ANSI((CONST char *, char **, int, void *, locale_t)); + extern int strtorx_l ANSI((CONST char *, char **, int, void *, locale_t)); extern int strtorxL ANSI((CONST char *, char **, int, void *)); extern Bigint *sum ANSI((Bigint*, Bigint*)); extern int trailz ANSI((Bigint*)); Modified: head/contrib/gdtoa/strtod.c ============================================================================== --- head/contrib/gdtoa/strtod.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/contrib/gdtoa/strtod.c Sun Nov 20 14:45:42 2011 (r227753) @@ -82,11 +82,11 @@ sulp #endif /*}*/ double -strtod +strtod_l #ifdef KR_headers - (s00, se) CONST char *s00; char **se; + (s00, se, loc) CONST char *s00; char **se; locale_t loc #else - (CONST char *s00, char **se) + (CONST char *s00, char **se, locale_t loc) #endif { #ifdef Avoid_Underflow @@ -108,14 +108,14 @@ strtod #endif #ifdef USE_LOCALE /*{{*/ #ifdef NO_LOCALE_CACHE - char *decimalpoint = localeconv()->decimal_point; + char *decimalpoint = localeconv_l(loc)->decimal_point; int dplen = strlen(decimalpoint); #else char *decimalpoint; static char *decimalpoint_cache; static int dplen; if (!(s0 = decimalpoint_cache)) { - s0 = localeconv()->decimal_point; + s0 = localeconv_l(loc)->decimal_point; if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) { strcpy(decimalpoint_cache, s0); s0 = decimalpoint_cache; @@ -1074,3 +1074,14 @@ strtod return sign ? -dval(&rv) : dval(&rv); } + double +strtod +#ifdef KR_headers + (s00, se, loc) CONST char *s00; char **se; locale_t +#else + (CONST char *s00, char **se) +#endif +{ + return strtod_l(s00, se, __get_locale()); +} + Modified: head/contrib/gdtoa/strtodg.c ============================================================================== --- head/contrib/gdtoa/strtodg.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/contrib/gdtoa/strtodg.c Sun Nov 20 14:45:42 2011 (r227753) @@ -313,12 +313,12 @@ mantbits(U *d) } int -strtodg +strtodg_l #ifdef KR_headers - (s00, se, fpi, exp, bits) - CONST char *s00; char **se; FPI *fpi; Long *exp; ULong *bits; + (s00, se, fpi, exp, bits, loc) + CONST char *s00; char **se; FPI *fpi; Long *exp; ULong *bits; locale_t loc; #else - (CONST char *s00, char **se, FPI *fpi, Long *exp, ULong *bits) + (CONST char *s00, char **se, FPI *fpi, Long *exp, ULong *bits, locale_t loc) #endif { int abe, abits, asub; @@ -334,14 +334,14 @@ strtodg Bigint *ab, *bb, *bb1, *bd, *bd0, *bs, *delta, *rvb, *rvb0; #ifdef USE_LOCALE /*{{*/ #ifdef NO_LOCALE_CACHE - char *decimalpoint = localeconv()->decimal_point; + char *decimalpoint = localeconv_l(loc)->decimal_point; int dplen = strlen(decimalpoint); #else char *decimalpoint; static char *decimalpoint_cache; static int dplen; if (!(s0 = decimalpoint_cache)) { - s0 = localeconv()->decimal_point; + s0 = localeconv_l(loc)->decimal_point; if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) { strcpy(decimalpoint_cache, s0); s0 = decimalpoint_cache; Modified: head/contrib/gdtoa/strtof.c ============================================================================== --- head/contrib/gdtoa/strtof.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/contrib/gdtoa/strtof.c Sun Nov 20 14:45:42 2011 (r227753) @@ -35,9 +35,9 @@ THIS SOFTWARE. float #ifdef KR_headers -strtof(s, sp) CONST char *s; char **sp; +strtof_l(s, sp, loc) CONST char *s; char **sp; locale_t loc; #else -strtof(CONST char *s, char **sp) +strtof_l(CONST char *s, char **sp, locale_t loc) #endif { static FPI fpi0 = { 24, 1-127-24+1, 254-127-24+1, 1, SI }; @@ -51,7 +51,7 @@ strtof(CONST char *s, char **sp) #define fpi &fpi0 #endif - k = strtodg(s, sp, fpi, &exp, bits); + k = strtodg_l(s, sp, fpi, &exp, bits, loc); switch(k & STRTOG_Retmask) { case STRTOG_NoNumber: case STRTOG_Zero: @@ -82,3 +82,13 @@ strtof(CONST char *s, char **sp) u.L[0] |= 0x80000000L; return u.f; } + float +#ifdef KR_headers +strtof(s, sp) CONST char *s; char **sp; +#else +strtof(CONST char *s, char **sp) +#endif +{ + return strtof_l(s, sp, __get_locale()); +} + Modified: head/contrib/gdtoa/strtorQ.c ============================================================================== --- head/contrib/gdtoa/strtorQ.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/contrib/gdtoa/strtorQ.c Sun Nov 20 14:45:42 2011 (r227753) @@ -103,9 +103,10 @@ ULtoQ(ULong *L, ULong *bits, Long exp, i int #ifdef KR_headers -strtorQ(s, sp, rounding, L) CONST char *s; char **sp; int rounding; void *L; +strtorQ_l(s, sp, rounding, L, locale) CONST char *s; char **sp; int rounding; +void *L; locale_t locale; #else -strtorQ(CONST char *s, char **sp, int rounding, void *L) +strtorQ_l(CONST char *s, char **sp, int rounding, void *L, locale_t locale) #endif { static FPI fpi0 = { 113, 1-16383-113+1, 32766-16383-113+1, 1, SI }; @@ -120,7 +121,7 @@ strtorQ(CONST char *s, char **sp, int ro fpi1.rounding = rounding; fpi = &fpi1; } - k = strtodg(s, sp, fpi, &exp, bits); + k = strtodg_l(s, sp, fpi, &exp, bits, locale); ULtoQ((ULong*)L, bits, exp, k); return k; } Modified: head/contrib/gdtoa/strtord.c ============================================================================== --- head/contrib/gdtoa/strtord.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/contrib/gdtoa/strtord.c Sun Nov 20 14:45:42 2011 (r227753) @@ -70,9 +70,10 @@ ULtod(ULong *L, ULong *bits, Long exp, i int #ifdef KR_headers -strtord(s, sp, rounding, d) CONST char *s; char **sp; int rounding; double *d; +strtord_l(s, sp, rounding, d, locale) CONST char *s; char **sp; int rounding; +double *d; locale_t locale; #else -strtord(CONST char *s, char **sp, int rounding, double *d) +strtord_l(CONST char *s, char **sp, int rounding, double *d, locale_t locale) #endif { static FPI fpi0 = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI }; @@ -87,7 +88,8 @@ strtord(CONST char *s, char **sp, int ro fpi1.rounding = rounding; fpi = &fpi1; } - k = strtodg(s, sp, fpi, &exp, bits); + k = strtodg_l(s, sp, fpi, &exp, bits, locale); ULtod((ULong*)d, bits, exp, k); return k; } + Modified: head/contrib/gdtoa/strtorx.c ============================================================================== --- head/contrib/gdtoa/strtorx.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/contrib/gdtoa/strtorx.c Sun Nov 20 14:45:42 2011 (r227753) @@ -106,9 +106,10 @@ ULtox(UShort *L, ULong *bits, Long exp, int #ifdef KR_headers -strtorx(s, sp, rounding, L) CONST char *s; char **sp; int rounding; void *L; +strtorx_l(s, sp, rounding, L, locale) CONST char *s; char **sp; int rounding; +void *L; locale_t locale; #else -strtorx(CONST char *s, char **sp, int rounding, void *L) +strtorx_l(CONST char *s, char **sp, int rounding, void *L, locale_t locale) #endif { static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI }; @@ -123,7 +124,7 @@ strtorx(CONST char *s, char **sp, int ro fpi1.rounding = rounding; fpi = &fpi1; } - k = strtodg(s, sp, fpi, &exp, bits); + k = strtodg_l(s, sp, fpi, &exp, bits, locale); ULtox((UShort*)L, bits, exp, k); return k; } Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Nov 20 13:11:29 2011 (r227752) +++ head/include/Makefile Sun Nov 20 14:45:42 2011 (r227753) @@ -24,7 +24,7 @@ INCS= a.out.h ar.h assert.h bitstring.h strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h vis.h \ - wchar.h wctype.h wordexp.h + wchar.h wctype.h wordexp.h xlocale.h _xlocale_ctype.h MHDRS= float.h floatingpoint.h stdarg.h Added: head/include/_xlocale_ctype.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/_xlocale_ctype.h Sun Nov 20 14:45:42 2011 (r227753) @@ -0,0 +1,162 @@ +/*- + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions * are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 _XLOCALE_H_ +#error This header should only be included by , never directly. +#endif + +#ifndef _XLOCALE_CTYPE_H_ +__BEGIN_DECLS +unsigned long ___runetype_l(__ct_rune_t, locale_t) __pure; +__ct_rune_t ___tolower_l(__ct_rune_t, locale_t) __pure; +__ct_rune_t ___toupper_l(__ct_rune_t, locale_t) __pure; +_RuneLocale *__runes_for_locale(locale_t, int*); +__END_DECLS +#endif + +#ifndef _XLOCALE_INLINE +#if __GNUC__ && !__GNUC_STDC_INLINE__ +#define _XLOCALE_INLINE extern inline +#else +#define _XLOCALE_INLINE inline +#endif +#endif + +#ifdef XLOCALE_WCTYPES +static __inline int +__maskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (_c < 0 || _c >= _CACHED_RUNES) ? ___runetype_l(_c, locale) : + runes->__runetype[_c] & _f; +} + +static __inline int +__istype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + return (!!__maskrune_l(_c, _f, locale)); +} + +#define XLOCALE_ISCTYPE(fname, cat) \ + _XLOCALE_INLINE int isw##fname##_l(int c, locale_t l)\ + { return __istype_l(c, cat, l); } +#else +static __inline int +__sbmaskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (_c < 0 || _c >= mb_sb_limit) ? 0 : + runes->__runetype[_c] & _f; +} + +static __inline int +__sbistype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + return (!!__sbmaskrune_l(_c, _f, locale)); +} + +#define XLOCALE_ISCTYPE(fname, cat) \ + _XLOCALE_INLINE int is##fname##_l(int c, locale_t l)\ + { return __sbistype_l(c, cat, l); } +#endif + +XLOCALE_ISCTYPE(alnum, _CTYPE_A|_CTYPE_D) +XLOCALE_ISCTYPE(alpha, _CTYPE_A) +XLOCALE_ISCTYPE(blank, _CTYPE_B) +XLOCALE_ISCTYPE(cntrl, _CTYPE_C) +XLOCALE_ISCTYPE(digit, _CTYPE_D) +XLOCALE_ISCTYPE(graph, _CTYPE_G) +XLOCALE_ISCTYPE(hexnumber, _CTYPE_X) +XLOCALE_ISCTYPE(ideogram, _CTYPE_I) +XLOCALE_ISCTYPE(lower, _CTYPE_L) +XLOCALE_ISCTYPE(number, _CTYPE_D) +XLOCALE_ISCTYPE(phonogram, _CTYPE_Q) +XLOCALE_ISCTYPE(print, _CTYPE_R) +XLOCALE_ISCTYPE(punct, _CTYPE_P) +XLOCALE_ISCTYPE(rune, 0xFFFFFF00L) +XLOCALE_ISCTYPE(space, _CTYPE_S) +XLOCALE_ISCTYPE(special, _CTYPE_T) +XLOCALE_ISCTYPE(upper, _CTYPE_U) +XLOCALE_ISCTYPE(xdigit, _CTYPE_X) +#undef XLOCALE_ISCTYPE + +#ifdef XLOCALE_WCTYPES +_XLOCALE_INLINE int towlower_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= _CACHED_RUNES) ? ___tolower_l(c, locale) : + runes->__maplower[c]; +} +_XLOCALE_INLINE int towupper_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= _CACHED_RUNES) ? ___toupper_l(c, locale) : + runes->__mapupper[c]; +} +_XLOCALE_INLINE int +__wcwidth_l(__ct_rune_t _c, locale_t locale) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, locale); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} +int iswctype_l(wint_t wc, wctype_t charclass, locale_t locale); +wctype_t wctype_l(const char *property, locale_t locale); +wint_t towctrans_l(wint_t wc, wctrans_t desc, locale_t locale); +wint_t nextwctype_l(wint_t wc, wctype_t wct, locale_t locale); +wctrans_t wctrans_l(const char *charclass, locale_t locale); +#undef XLOCALE_WCTYPES +#else +_XLOCALE_INLINE int digittoint_l(int c, locale_t locale) +{ return __sbmaskrune_l((c), 0xFF, locale); } + +_XLOCALE_INLINE int tolower_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= mb_sb_limit) ? c : + runes->__maplower[c]; +} +_XLOCALE_INLINE int toupper_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= mb_sb_limit) ? c : + runes->__mapupper[c]; +} +#endif Modified: head/include/locale.h ============================================================================== --- head/include/locale.h Sun Nov 20 13:11:29 2011 (r227752) +++ head/include/locale.h Sun Nov 20 14:45:42 2011 (r227753) @@ -79,4 +79,52 @@ struct lconv *localeconv(void); char *setlocale(int, const char *); __END_DECLS +#if __POSIX_VISIBLE >= 200809 + +#define LC_COLLATE_MASK (1<<0) +#define LC_CTYPE_MASK (1<<1) +#define LC_MESSAGES_MASK (1<<2) +#define LC_MONETARY_MASK (1<<3) +#define LC_NUMERIC_MASK (1<<4) +#define LC_TIME_MASK (1<<5) +#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \ + LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) + +#define LC_GLOBAL_LOCALE ((locale_t)-1) + +__BEGIN_DECLS + +typedef struct _xlocale *locale_t; +/** + * Creates a new locale. + */ +locale_t newlocale(int mask, const char *locale, locale_t base); + +/** + * Returns an identical duplicate of the passed locale. The returned locale + * must be freed with freelocale(). The returned locale will share components + * with the original. + */ +locale_t duplocale(locale_t base); +/* + * Free a locale_t. This is quite a poorly named function. It actually + * disclaims a reference to a locale_t, rather than freeing it. + */ +int freelocale(locale_t loc); + +/* + * Returns the name of the locale for a particular component of a locale_t. + */ +const char *querylocale(int mask, locale_t loc); + +/* + * Installs the specified locale_t as this thread's locale. + */ +locale_t uselocale(locale_t loc); + +__END_DECLS + +#endif /* __POSIX_VISIBLE >= 200809 */ + + #endif /* _LOCALE_H_ */ Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Sun Nov 20 13:11:29 2011 (r227752) +++ head/include/runetype.h Sun Nov 20 14:45:42 2011 (r227753) @@ -83,8 +83,14 @@ typedef struct { } _RuneLocale; #define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */ - -extern _RuneLocale _DefaultRuneLocale; +__BEGIN_DECLS +extern const _RuneLocale _DefaultRuneLocale; +__attribute__((deprecated)) extern _RuneLocale *_CurrentRuneLocale; +/* TODO: This is called quite a lot, so we should use a __thread variable when + * it's available. */ +extern _RuneLocale *__getCurrentRuneLocale(void); +#define _CurrentRuneLocale (__getCurrentRuneLocale()) +__END_DECLS #endif /* !_RUNETYPE_H_ */ Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sun Nov 20 13:11:29 2011 (r227752) +++ head/include/stdlib.h Sun Nov 20 14:45:42 2011 (r227753) @@ -71,10 +71,11 @@ typedef struct { #define RAND_MAX 0x7fffffff +__BEGIN_DECLS extern int __mb_cur_max; -#define MB_CUR_MAX __mb_cur_max +extern int ___mb_cur_max(void); +#define MB_CUR_MAX (___mb_cur_max()) -__BEGIN_DECLS void abort(void) __dead2; int abs(int) __pure2; int atexit(void (*)(void)); Added: head/include/xlocale.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale.h Sun Nov 20 14:45:42 2011 (r227753) @@ -0,0 +1,258 @@ +/*- + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 _XLOCALE_H_ +#define _XLOCALE_H_ + +#include + +__BEGIN_DECLS + +/* + * Extended locale versions of the locale-aware functions from string.h. + * + * Include before to expose these. + */ +#ifdef _STRING_H_ +int strcoll_l(const char *, const char *, locale_t); +size_t strxfrm_l(char *, const char *, size_t, locale_t); +int strcasecmp_l(const char *, const char *, locale_t); +char *strcasestr_l(const char *, const char *, locale_t); +int strncasecmp_l(const char *, const char *, size_t, locale_t); +#endif +/* + * Extended locale versions of the locale-aware functions from inttypes.h. + * + * Include before to expose these. + */ +#ifdef _INTTYPES_H_ +intmax_t +strtoimax_l(const char * __restrict, char ** __restrict, int, locale_t); +uintmax_t +strtoumax_l(const char * __restrict, char ** __restrict, int, locale_t); +intmax_t +wcstoimax_l(const wchar_t * __restrict, wchar_t ** __restrict, int , locale_t); +uintmax_t +wcstoumax_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +#endif +/* + * Extended locale versions of the locale-aware functions from monetary.h. + * + * Include before to expose these. + */ +#ifdef _MONETARY_H_ +ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...) +# if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 + __attribute__((__format__ (__strfmon__, 4, 5))) +# endif + ; +#endif + +/* + * Extended locale versions of the locale-aware functions from stdlib.h. + * + * Include before to expose these. + */ +#ifdef _STDLIB_H_ +double atof_l(const char *, locale_t); +int atoi_l(const char *, locale_t); +long atol_l(const char *, locale_t); +long long atoll_l(const char *, locale_t); +int mblen_l(const char *, size_t, locale_t); +size_t +mbstowcs_l(wchar_t * __restrict, const char * __restrict, size_t, locale_t); +int +mbtowc_l(wchar_t * __restrict, const char * __restrict, size_t, locale_t); +double strtod_l(const char *, char **, locale_t); +float strtof_l(const char *, char **, locale_t); +long strtol_l(const char *, char **, int, locale_t); +long double strtold_l(const char *, char **, locale_t); +long long strtoll_l(const char *, char **, int, locale_t); +unsigned long strtoul_l(const char *, char **, int, locale_t); +unsigned long long strtoull_l(const char *, char **, int, locale_t); +size_t +wcstombs_l(char * __restrict, const wchar_t * __restrict, size_t, locale_t); +int wctomb_l(char *, wchar_t, locale_t); + +int ___mb_cur_max_l(locale_t); +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) + +#endif +/* + * Extended locale versions of the locale-aware functions from time.h. + * + * Include before to expose these. + */ +#ifdef _TIME_H_ +size_t +strftime_l(char * __restrict, size_t, const char * __restrict, const + struct tm * __restrict, locale_t) +# if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 + __attribute__((__format__ (__strftime__, 3, 0))) +# endif + ; +char * +strptime_l(const char * __restrict, const char * __restrict, + struct tm * __restrict, locale_t); +#endif +#ifdef _LANGINFO_H_ +char *nl_langinfo_l(nl_item, locale_t); +#endif +#ifdef _CTYPE_H_ +#include <_xlocale_ctype.h> +#endif +#ifdef _WCTYPE_H_ +#define XLOCALE_WCTYPES 1 +#include <_xlocale_ctype.h> +#endif + +#ifdef _STDIO_H_ +int fprintf_l(FILE * __restrict, locale_t, const char * __restrict, ...) + __printflike(3, 4); +int fscanf_l(FILE * __restrict, locale_t, const char * __restrict, ...) + __scanflike(3, 4); +int printf_l(locale_t, const char * __restrict, ...) __printflike(2, 3); +int scanf_l(locale_t, const char * __restrict, ...) __scanflike(2, 3); +int sprintf_l(char * __restrict, locale_t, const char * __restrict, ...) + __printflike(3, 4); +int sscanf_l(const char * __restrict, locale_t, const char * __restrict, ...) + __scanflike(3, 4); +int vfprintf_l(FILE * __restrict, locale_t, const char * __restrict, __va_list) + __printflike(3, 0); +int vprintf_l(locale_t, const char * __restrict, __va_list) __printflike(2, 0); +int vsprintf_l(char * __restrict, locale_t, const char * __restrict, __va_list) + __printflike(3, 0); + +int snprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, + ...) __printflike(4, 5); +int vfscanf_l(FILE * __restrict, locale_t, const char * __restrict, __va_list) + __scanflike(3, 0); +int vscanf_l(locale_t, const char * __restrict, __va_list) __scanflike(2, 0); +int vsnprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, + va_list) __printflike(4, 0); +int vsscanf_l(const char * __restrict, locale_t, const char * __restrict, + va_list) __scanflike(3, 0); +int dprintf_l(int, locale_t, const char * __restrict, ...) __printflike(3, 4); +int vdprintf_l(int, locale_t, const char * __restrict, __va_list) + __printflike(3, 0); +int asprintf_l(char **, locale_t, const char *, ...) __printflike(3, 4); +int vasprintf_l(char **, locale_t, const char *, __va_list) __printflike(3, 0); +#endif +#ifdef _WCHAR_H_ +wint_t btowc_l(int, locale_t); +wint_t fgetwc_l(FILE *, locale_t); +wchar_t * +fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t); +wint_t fputwc_l(wchar_t, FILE *, locale_t); +int +fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t); +int +fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + ...); +int +fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); +wint_t getwc_l(FILE *, locale_t); +wint_t getwchar_l(locale_t); +size_t +mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict, locale_t); +size_t +mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict, locale_t); +int mbsinit_l(const mbstate_t *, locale_t); +size_t +mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, + mbstate_t * __restrict, locale_t); +wint_t putwc_l(wchar_t, FILE *, locale_t); +wint_t putwchar_l(wchar_t, locale_t); +int +swprintf_l(wchar_t * __restrict, size_t n, locale_t, + const wchar_t * __restrict, ...); +int +swscanf_l(const wchar_t * __restrict, locale_t, const wchar_t * __restrict, + ...); +wint_t ungetwc_l(wint_t, FILE *, locale_t); +int +vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + __va_list); +int +vswprintf_l(wchar_t * __restrict, size_t n, locale_t, + const wchar_t * __restrict, __va_list); +int vwprintf_l(locale_t, const wchar_t * __restrict, __va_list); +size_t +wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t); +int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); +size_t +wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict, + const struct tm * __restrict, locale_t); +size_t +wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, + mbstate_t * __restrict, locale_t); +double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long +wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +unsigned long +wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +int wcswidth_l(const wchar_t *, size_t, locale_t); +size_t +wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t, locale_t); +int wctob_l(wint_t, locale_t); +int wcwidth_l(wchar_t, locale_t); +int wprintf_l(locale_t, const wchar_t * __restrict, ...); +int wscanf_l(locale_t, const wchar_t * __restrict, ...); + +int +vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + __va_list); +int vswscanf_l(const wchar_t * __restrict, locale_t, +const wchar_t *__restrict, __va_list); +int vwscanf_l(locale_t, const wchar_t * __restrict, __va_list); +float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long double +wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long long +wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +unsigned long long +wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +size_t +mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, size_t, + mbstate_t * __restrict, locale_t); +int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); +int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); +size_t +wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, size_t, + mbstate_t * __restrict, locale_t); + +#endif + +struct lconv *localeconv_l(locale_t); +__END_DECLS + +#endif Modified: head/lib/libc/gdtoa/machdep_ldisQ.c ============================================================================== --- head/lib/libc/gdtoa/machdep_ldisQ.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/lib/libc/gdtoa/machdep_ldisQ.c Sun Nov 20 14:45:42 2011 (r227753) @@ -2,6 +2,11 @@ * Copyright (c) 2003 David Schultz * All rights reserved. * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -38,10 +43,10 @@ __FBSDID("$FreeBSD$"); #include "gdtoaimp.h" long double -strtold(const char * __restrict s, char ** __restrict sp) +strtold_l(const char * __restrict s, char ** __restrict sp, locale_t locale) { long double result; - strtorQ(s, sp, FLT_ROUNDS, &result); + strtorQ_l(s, sp, FLT_ROUNDS, &result, locale); return result; } Modified: head/lib/libc/gdtoa/machdep_ldisd.c ============================================================================== --- head/lib/libc/gdtoa/machdep_ldisd.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/lib/libc/gdtoa/machdep_ldisd.c Sun Nov 20 14:45:42 2011 (r227753) @@ -2,6 +2,11 @@ * Copyright (c) 2003 David Schultz * All rights reserved. * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -34,10 +39,11 @@ __FBSDID("$FreeBSD$"); #include "gdtoaimp.h" +#undef strtold_l long double -strtold(const char * __restrict s, char ** __restrict sp) +strtold_l(const char * __restrict s, char ** __restrict sp, locale_t locale) { - return strtod(s, sp); + return strtod_l(s, sp, locale); } Modified: head/lib/libc/gdtoa/machdep_ldisx.c ============================================================================== --- head/lib/libc/gdtoa/machdep_ldisx.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/lib/libc/gdtoa/machdep_ldisx.c Sun Nov 20 14:45:42 2011 (r227753) @@ -2,6 +2,11 @@ * Copyright (c) 2003 David Schultz * All rights reserved. * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -38,10 +43,11 @@ __FBSDID("$FreeBSD$"); #include "gdtoaimp.h" long double -strtold(const char * __restrict s, char ** __restrict sp) +strtold_l(const char * __restrict s, char ** __restrict sp, locale_t locale) { long double result; + FIX_LOCALE(locale); - strtorx(s, sp, FLT_ROUNDS, &result); + strtorx_l(s, sp, FLT_ROUNDS, &result, locale); return result; } Modified: head/lib/libc/gen/fnmatch.c ============================================================================== --- head/lib/libc/gen/fnmatch.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/lib/libc/gen/fnmatch.c Sun Nov 20 14:45:42 2011 (r227753) @@ -5,6 +5,11 @@ * This code is derived from software contributed to Berkeley by * Guido van Rossum. * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -222,6 +227,8 @@ rangematch(pattern, test, flags, newp, p wchar_t c, c2; size_t pclen; const char *origpat; + struct xlocale_collate *table = + (struct xlocale_collate*)__get_locale()->components[XLC_COLLATE]; /* * A bracket expression starting with an unquoted circumflex @@ -276,10 +283,10 @@ rangematch(pattern, test, flags, newp, p if (flags & FNM_CASEFOLD) c2 = towlower(c2); - if (__collate_load_error ? + if (table->__collate_load_error ? c <= test && test <= c2 : - __collate_range_cmp(c, test) <= 0 - && __collate_range_cmp(test, c2) <= 0 + __collate_range_cmp(table, c, test) <= 0 + && __collate_range_cmp(table, test, c2) <= 0 ) ok = 1; } else if (c == test) Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Sun Nov 20 13:11:29 2011 (r227752) +++ head/lib/libc/gen/glob.c Sun Nov 20 14:45:42 2011 (r227753) @@ -5,6 +5,11 @@ * This code is derived from software contributed to Berkeley by * Guido van Rossum. * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -751,6 +756,8 @@ match(Char *name, Char *pat, Char *paten { int ok, negate_range; Char c, k; + struct xlocale_collate *table = + (struct xlocale_collate*)__get_locale()->components[XLC_COLLATE]; while (pat < patend) { c = *pat++; @@ -775,10 +782,10 @@ match(Char *name, Char *pat, Char *paten ++pat; while (((c = *pat++) & M_MASK) != M_END) if ((*pat & M_MASK) == M_RNG) { - if (__collate_load_error ? + if (table->__collate_load_error ? CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) : - __collate_range_cmp(CHAR(c), CHAR(k)) <= 0 - && __collate_range_cmp(CHAR(k), CHAR(pat[1])) <= 0 + __collate_range_cmp(table, CHAR(c), CHAR(k)) <= 0 + && __collate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0 ) ok = 1; pat += 2; Added: head/lib/libc/locale/DESIGN.xlocale ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/locale/DESIGN.xlocale Sun Nov 20 14:45:42 2011 (r227753) @@ -0,0 +1,159 @@ +$FreeBSD$ + +Design of xlocale +================= + +The xlocale APIs come from Darwin, although a subset is now part of POSIX 2008. +They fall into two broad categories: + +- Manipulation of per-thread locales (POSIX) +- Locale-aware functions taking an explicit locale argument (Darwin) + +This document describes the implementation of these APIs for FreeBSD. + +Goals +----- + +The overall goal of this implementation is to be compatible with the Darwin +version. Additionally, it should include minimal changes to the existing +locale code. A lot of the existing locale code originates with 4BSD or earlier +and has had over a decade of testing. Replacing this code, unless absolutely +necessary, gives us the potential for more bugs without much benefit. + +With this in mind, various libc-private functions have been modified to take a +locale_t parameter. This causes a compiler error if they are accidentally +called without a locale. This approach was taken, rather than adding _l +variants of these functions, to make it harder for accidental uses of the +global-locale versions to slip in. + +Locale Objects +-------------- + +A locale is encapsulated in a `locale_t`, which is an opaque type: a pointer to +a `struct _xlocale`. The name `_xlocale` is unfortunate, as it does not fit +well with existing conventions, but is used because this is the name the Darwin +implementation gives to this structure and so may be used by existing (bad) code. + +This structure should include all of the information corresponding to a locale. +A locale_t is almost immutable after creation. There are no functions that modify it, +and it can therefore be used without locking. It is the responsibility of the +caller to ensure that a locale is not deallocated during a call that uses it. + +Each locale contains a number of components, one for each of the categories +supported by `setlocale()`. These are likewise immutable after creation. This +differs from the Darwin implementation, which includes a deprecated +`setinvalidrune()` function that can modify the rune locale. + +The exception to these mutability rules is a set of `mbstate_t` flags stored +with each locale. These are used by various functions that previously had a +static local `mbstate_t` variable. + +The components are reference counted, and so can be aliased between locale +objects. This makes copying locales very cheap. + +The Global Locale +----------------- + +All locales and locale components are reference counted. The global locale, +however, is special. It, and all of its components, are static and so no +malloc() memory is required when using a single locale. + +This means that threads using the global locale are subject to the same +constraints as with the pre-xlocale libc. Calls to any locale-aware functions *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 15:00: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 11E011065672; Sun, 20 Nov 2011 15:00:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 008D38FC17; Sun, 20 Nov 2011 15:00:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKF0j3u097327; Sun, 20 Nov 2011 15:00:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKF0jQ2097315; Sun, 20 Nov 2011 15:00:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111201500.pAKF0jQ2097315@svn.freebsd.org> From: Michael Tuexen Date: Sun, 20 Nov 2011 15:00: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: r227755 - in head: lib/libc/net 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: Sun, 20 Nov 2011 15:00:46 -0000 Author: tuexen Date: Sun Nov 20 15:00:45 2011 New Revision: 227755 URL: http://svn.freebsd.org/changeset/base/227755 Log: Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option. Retire the the now unused sctp_udp_tunneling_for_client_enable sysctl variable. MFC after: 3 months. Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sun Nov 20 14:51:27 2011 (r227754) +++ head/lib/libc/net/sctp_sys_calls.c Sun Nov 20 15:00:45 2011 (r227755) @@ -413,6 +413,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PEER_ADDR_THLDS: ((struct sctp_paddrthlds *)arg)->spt_assoc_id = id; break; + case SCTP_REMOTE_UDP_ENCAPS_PORT: + ((struct sctp_udpencaps *)arg)->sue_assoc_id = id; + break; case SCTP_MAX_BURST: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp.h Sun Nov 20 15:00:45 2011 (r227755) @@ -120,6 +120,7 @@ struct sctp_paramhdr { #define SCTP_DEFAULT_SNDINFO 0x00000021 #define SCTP_DEFAULT_PRINFO 0x00000022 #define SCTP_PEER_ADDR_THLDS 0x00000023 +#define SCTP_REMOTE_UDP_ENCAPS_PORT 0x00000024 /* * read-only options Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp_output.c Sun Nov 20 15:00:45 2011 (r227755) @@ -4062,6 +4062,12 @@ sctp_lowlevel_chunk_output(struct sctp_i } } if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_handle_no_route(stcb, net, so_locked); + SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); + sctp_m_freem(m); + return (EHOSTUNREACH); + } udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -4413,6 +4419,12 @@ sctp_lowlevel_chunk_output(struct sctp_i ip6h->ip6_src = lsa6->sin6_addr; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_handle_no_route(stcb, net, so_locked); + SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); + sctp_m_freem(m); + return (EHOSTUNREACH); + } udp = (struct udphdr *)((caddr_t)ip6h + sizeof(struct ip6_hdr)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -10965,6 +10977,10 @@ sctp_send_shutdown_complete2(struct mbuf return; } if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp = (struct udphdr *)comp_cp; udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -11925,6 +11941,10 @@ sctp_send_abort(struct mbuf *m, int iphl udp = (struct udphdr *)abm; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; /* set udp->uh_ulen later */ @@ -12186,6 +12206,10 @@ sctp_send_operr_to(struct mbuf *m, int i udp = (struct udphdr *)sh_out; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; /* set udp->uh_ulen later */ Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp_pcb.c Sun Nov 20 15:00:45 2011 (r227755) @@ -2650,6 +2650,7 @@ sctp_inpcb_alloc(struct socket *so, uint #ifdef INET6 m->default_flowlabel = 0; #endif + m->port = 0; /* encapsulation disabled by default */ sctp_auth_set_default_chunks(m->local_auth_chunks); LIST_INIT(&m->shared_keys); /* add default NULL key as key id 0 */ @@ -3993,13 +3994,9 @@ sctp_add_remote_addr(struct sctp_tcb *st net->RTO = 0; net->RTO_measured = 0; stcb->asoc.numnets++; - *(&net->ref_count) = 1; + net->ref_count = 1; net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; - if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { - net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); - } else { - net->port = 0; - } + net->port = stcb->asoc.port; net->dscp = stcb->asoc.default_dscp; #ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp_pcb.h Sun Nov 20 15:00:45 2011 (r227755) @@ -328,6 +328,7 @@ struct sctp_pcb { uint8_t default_dscp; char current_secret_number; char last_secret_number; + uint16_t port; /* remote UDP encapsulation port */ }; #ifndef SCTP_ALIGNMENT Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp_structs.h Sun Nov 20 15:00:45 2011 (r227755) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used as a bit mask */ +/* The upper byte is used a a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { @@ -1213,6 +1213,7 @@ struct sctp_association { uint8_t sctp_cmt_pf; uint8_t use_precise_time; uint32_t sctp_features; + uint16_t port; /* remote UDP encapsulation port */ /* * The mapping array is used to track out of order sequences above * last_acked_seq. 0 indicates packet missing 1 indicates packet Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp_sysctl.c Sun Nov 20 15:00:45 2011 (r227755) @@ -122,7 +122,6 @@ sctp_init_sysctls() #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif - SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable) = SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = SCTPCTL_UDP_TUNNELING_PORT_DEFAULT; SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) = SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; @@ -666,10 +665,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), SCTPCTL_RTTVAR_DCCCECN_MIN, SCTPCTL_RTTVAR_DCCCECN_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); -/* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ -#if !defined(__FreeBSD__) || defined(INET) - RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); @@ -1089,10 +1084,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT /* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ #if !defined(__FreeBSD__) || defined(INET) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp_sysctl.h Sun Nov 20 15:00:45 2011 (r227755) @@ -110,7 +110,6 @@ struct sctp_sysctl { #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif - uint32_t sctp_udp_tunneling_for_client_enable; uint32_t sctp_udp_tunneling_port; uint32_t sctp_enable_sack_immediately; uint32_t sctp_vtag_time_wait; @@ -464,12 +463,6 @@ struct sctp_sysctl { #define SCTPCTL_MOBILITY_FASTHANDOFF_MAX 1 #define SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT SCTP_DEFAULT_MOBILITY_FASTHANDOFF -/* Enable SCTP/UDP tunneling for clients*/ -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC "Enable SCTP/UDP tunneling for client" -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN 0 -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX 1 -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN - /* Enable SCTP/UDP tunneling port */ #define SCTPCTL_UDP_TUNNELING_PORT_DESC "Set the SCTP/UDP tunneling port" #define SCTPCTL_UDP_TUNNELING_PORT_MIN 0 Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp_uio.h Sun Nov 20 15:00:45 2011 (r227755) @@ -671,6 +671,12 @@ struct sctp_timeouts { uint32_t stimo_shutdownack; }; +struct sctp_udpencaps { + sctp_assoc_t sue_assoc_id; + struct sockaddr_storage sue_address; + uint16_t sue_port; +}; + struct sctp_cwnd_args { struct sctp_nets *net; /* network to *//* FIXME: LP64 issue */ uint32_t cwnd_new_value;/* cwnd in k */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctp_usrreq.c Sun Nov 20 15:00:45 2011 (r227755) @@ -3208,6 +3208,92 @@ flags_out: } break; } + case SCTP_REMOTE_UDP_ENCAPS_PORT: + { + struct sctp_udpencaps *encaps; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, *optsize); + SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); + + if (stcb) { + net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + } else { + /* + * We increment here since + * sctp_findassociation_ep_addr() wil do a + * decrement if it finds the stcb as long as + * the locked tcb (last argument) is NOT a + * TCB.. aka NULL. + */ + net = NULL; + SCTP_INP_INCR_REF(inp); + stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + if (stcb == NULL) { + SCTP_INP_DECR_REF(inp); + } + } + if (stcb && (net == NULL)) { + struct sockaddr *sa; + + sa = (struct sockaddr *)&encaps->sue_address; +#ifdef INET + if (sa->sa_family == AF_INET) { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)sa; + if (sin->sin_addr.s_addr) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } else +#endif +#ifdef INET6 + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } else +#endif + { + error = EAFNOSUPPORT; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } + if (stcb) { + if (net) { + encaps->sue_port = net->port; + } else { + encaps->sue_port = stcb->asoc.port; + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + encaps->sue_port = inp->sctp_ep.port; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_paddrparams); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -4526,7 +4612,6 @@ sctp_setopt(struct socket *so, int optna break; } case SCTP_PEER_ADDR_PARAMS: - /* Applies to the specific association */ { struct sctp_paddrparams *paddrp; struct sctp_nets *net; @@ -5583,6 +5668,89 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_REMOTE_UDP_ENCAPS_PORT: + { + struct sctp_udpencaps *encaps; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, optsize); + SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); + if (stcb) { + net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + } else { + /* + * We increment here since + * sctp_findassociation_ep_addr() wil do a + * decrement if it finds the stcb as long as + * the locked tcb (last argument) is NOT a + * TCB.. aka NULL. + */ + net = NULL; + SCTP_INP_INCR_REF(inp); + stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + if (stcb == NULL) { + SCTP_INP_DECR_REF(inp); + } + } + if (stcb && (net == NULL)) { + struct sockaddr *sa; + + sa = (struct sockaddr *)&encaps->sue_address; +#ifdef INET + if (sa->sa_family == AF_INET) { + + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)sa; + if (sin->sin_addr.s_addr) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_TCB_UNLOCK(stcb); + error = EINVAL; + break; + } + } else +#endif +#ifdef INET6 + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_TCB_UNLOCK(stcb); + error = EINVAL; + break; + } + } else +#endif + { + error = EAFNOSUPPORT; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } + if (stcb) { + if (net) { + net->port = encaps->sue_port; + } else { + stcb->asoc.port = encaps->sue_port; + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->sctp_ep.port = encaps->sue_port; + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Nov 20 14:51:27 2011 (r227754) +++ head/sys/netinet/sctputil.c Sun Nov 20 15:00:45 2011 (r227755) @@ -1117,6 +1117,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->authinfo.recv_keyid = 0; LIST_INIT(&asoc->shared_keys); asoc->marked_retrans = 0; + asoc->port = m->sctp_ep.port; asoc->timoinit = 0; asoc->timodata = 0; asoc->timosack = 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 15:18: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 AF37A1065670; Sun, 20 Nov 2011 15:18:49 +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 94D048FC14; Sun, 20 Nov 2011 15:18:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKFInjJ097996; Sun, 20 Nov 2011 15:18:49 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKFInfS097994; Sun, 20 Nov 2011 15:18:49 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201111201518.pAKFInfS097994@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 20 Nov 2011 15:18: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: r227757 - 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: Sun, 20 Nov 2011 15:18:49 -0000 Author: des Date: Sun Nov 20 15:18:49 2011 New Revision: 227757 URL: http://svn.freebsd.org/changeset/base/227757 Log: key_load_private() ignores the passphrase argument if the private key is unencrypted. This defeats the nullok check, because it means a non-null passphrase will successfully unlock the key. To address this, try at first to load the key without a passphrase. If this succeeds and the user provided a non-empty passphrase *or* nullok is false, reject the key. MFC after: 1 week Noticed by: Guy Helmer 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 Sun Nov 20 15:06:39 2011 (r227756) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Sun Nov 20 15:18:49 2011 (r227757) @@ -93,7 +93,8 @@ static char *const pam_ssh_agent_envp[] * struct pam_ssh_key containing the key and its comment. */ static struct pam_ssh_key * -pam_ssh_load_key(const char *dir, const char *kfn, const char *passphrase) +pam_ssh_load_key(const char *dir, const char *kfn, const char *passphrase, + int nullok) { struct pam_ssh_key *psk; char fn[PATH_MAX]; @@ -103,7 +104,21 @@ pam_ssh_load_key(const char *dir, const if (snprintf(fn, sizeof(fn), "%s/%s", dir, kfn) > (int)sizeof(fn)) return (NULL); comment = NULL; - key = key_load_private(fn, passphrase, &comment); + /* + * If the key is unencrypted, OpenSSL ignores the passphrase, so + * it will seem like the user typed in the right one. This allows + * a user to circumvent nullok by providing a dummy passphrase. + * Verify that the key really *is* encrypted by trying to load it + * with an empty passphrase, and if the key is not encrypted, + * accept only an empty passphrase. + */ + key = key_load_private(fn, NULL, &comment); + if (key != NULL && !(*passphrase == '\0' && nullok)) { + key_free(key); + return (NULL); + } + if (key == NULL) + key = key_load_private(fn, passphrase, &comment); if (key == NULL) { openpam_log(PAM_LOG_DEBUG, "failed to load key from %s", fn); return (NULL); @@ -170,9 +185,6 @@ pam_sm_authenticate(pam_handle_t *pamh, if (pam_err != PAM_SUCCESS) return (pam_err); - if (*passphrase == '\0' && !nullok) - goto skip_keys; - /* switch to user credentials */ pam_err = openpam_borrow_cred(pamh, pwd); if (pam_err != PAM_SUCCESS) @@ -180,7 +192,7 @@ pam_sm_authenticate(pam_handle_t *pamh, /* try to load keys from all keyfiles we know of */ for (kfn = pam_ssh_keyfiles; *kfn != NULL; ++kfn) { - psk = pam_ssh_load_key(pwd->pw_dir, *kfn, passphrase); + psk = pam_ssh_load_key(pwd->pw_dir, *kfn, passphrase, nullok); if (psk != NULL) { pam_set_data(pamh, *kfn, psk, pam_ssh_free_key); ++nkeys; @@ -190,7 +202,6 @@ pam_sm_authenticate(pam_handle_t *pamh, /* switch back to arbitrator credentials */ openpam_restore_cred(pamh); - skip_keys: /* * If we tried an old token and didn't get anything, and * try_first_pass was specified, try again after prompting the From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 16:33: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 CD009106566C; Sun, 20 Nov 2011 16:33:09 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BACE48FC17; Sun, 20 Nov 2011 16:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKGX9ue000408; Sun, 20 Nov 2011 16:33:09 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKGX9fs000402; Sun, 20 Nov 2011 16:33:09 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111201633.pAKGX9fs000402@svn.freebsd.org> From: Attilio Rao Date: Sun, 20 Nov 2011 16:33: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: r227758 - in head/sys: amd64/conf dev/ppbus kern 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: Sun, 20 Nov 2011 16:33:09 -0000 Author: attilio Date: Sun Nov 20 16:33:09 2011 New Revision: 227758 URL: http://svn.freebsd.org/changeset/base/227758 Log: Introduce macro stubs in the mutex implementation that will be always defined and will allow consumers, willing to provide options, file and line to locking requests, to not worry about options redefining the interfaces. This is typically useful when there is the need to build another locking interface on top of the mutex one. The introduced functions that consumers can use are: - mtx_lock_flags_ - mtx_unlock_flags_ - mtx_lock_spin_flags_ - mtx_unlock_spin_flags_ - mtx_assert_ - thread_lock_flags_ Spare notes: - Likely we can get rid of all the 'INVARIANTS' specification in the ppbus code by using the same macro as done in this patch (but this is left to the ppbus maintainer) - all the other locking interfaces may require a similar cleanup, where the most notable case is sx which will allow a further cleanup of vm_map locking facilities - The patch should be fully compatible with older branches, thus a MFC is previewed (infact it uses all the underlying mechanisms already present). Comments review by: eadler, Ben Kaduk Discussed with: kib, jhb MFC after: 1 month Modified: head/sys/amd64/conf/GENERIC head/sys/dev/ppbus/ppb_base.c head/sys/kern/kern_mutex.c head/sys/sys/mutex.h head/sys/vm/vm_map.c Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Nov 20 15:18:49 2011 (r227757) +++ head/sys/amd64/conf/GENERIC Sun Nov 20 16:33:09 2011 (r227758) @@ -73,11 +73,11 @@ options KDB # Enable kernel debugger options DDB # Support DDB. options GDB # Support remote GDB. options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +#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 Modified: head/sys/dev/ppbus/ppb_base.c ============================================================================== --- head/sys/dev/ppbus/ppb_base.c Sun Nov 20 15:18:49 2011 (r227757) +++ head/sys/dev/ppbus/ppb_base.c Sun Nov 20 16:33:09 2011 (r227758) @@ -236,11 +236,8 @@ ppb_unlock(device_t bus) void _ppb_assert_locked(device_t bus, const char *file, int line) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); - _mtx_assert(ppb->ppc_lock, MA_OWNED, file, line); -#endif + mtx_assert_(DEVTOSOFTC(bus)->ppc_lock, MA_OWNED, file, line); } void Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sun Nov 20 15:18:49 2011 (r227757) +++ head/sys/kern/kern_mutex.c Sun Nov 20 16:33:09 2011 (r227758) @@ -274,7 +274,7 @@ _mtx_unlock_spin_flags(struct mtx *m, in * is already owned, it will recursively acquire the lock. */ int -_mtx_trylock(struct mtx *m, int opts, const char *file, int line) +mtx_trylock_flags_(struct mtx *m, int opts, const char *file, int line) { #ifdef LOCK_PROFILING uint64_t waittime = 0; @@ -540,7 +540,7 @@ _mtx_lock_spin(struct mtx *m, uintptr_t #endif /* SMP */ void -_thread_lock_flags(struct thread *td, int opts, const char *file, int line) +thread_lock_flags_(struct thread *td, int opts, const char *file, int line) { struct mtx *m; uintptr_t tid; Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sun Nov 20 15:18:49 2011 (r227757) +++ head/sys/sys/mutex.h Sun Nov 20 16:33:09 2011 (r227758) @@ -81,6 +81,10 @@ * of the kernel via macros, thus allowing us to use the cpp LOCK_FILE * and LOCK_LINE. These functions should not be called directly by any * code using the API. Their macros cover their functionality. + * Functions with a `_' suffix are the entrypoint for the common + * KPI covering both compat shims and fast path case. These can be + * used by consumers willing to pass options, file and line + * informations, in an option-independent way. * * [See below for descriptions] * @@ -88,6 +92,8 @@ void mtx_init(struct mtx *m, const char *name, const char *type, int opts); void mtx_destroy(struct mtx *m); void mtx_sysinit(void *arg); +int mtx_trylock_flags_(struct mtx *m, int opts, const char *file, + int line); void mutex_init(void); void _mtx_lock_sleep(struct mtx *m, uintptr_t tid, int opts, const char *file, int line); @@ -97,7 +103,6 @@ void _mtx_lock_spin(struct mtx *m, uintp const char *file, int line); #endif void _mtx_unlock_spin(struct mtx *m, int opts, const char *file, int line); -int _mtx_trylock(struct mtx *m, int opts, const char *file, int line); void _mtx_lock_flags(struct mtx *m, int opts, const char *file, int line); void _mtx_unlock_flags(struct mtx *m, int opts, const char *file, int line); void _mtx_lock_spin_flags(struct mtx *m, int opts, const char *file, @@ -107,12 +112,12 @@ void _mtx_unlock_spin_flags(struct mtx * #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _mtx_assert(const struct mtx *m, int what, const char *file, int line); #endif -void _thread_lock_flags(struct thread *, int, const char *, int); +void thread_lock_flags_(struct thread *, int, const char *, int); #define thread_lock(tdp) \ - _thread_lock_flags((tdp), 0, __FILE__, __LINE__) + thread_lock_flags_((tdp), 0, __FILE__, __LINE__) #define thread_lock_flags(tdp, opt) \ - _thread_lock_flags((tdp), (opt), __FILE__, __LINE__) + thread_lock_flags_((tdp), (opt), __FILE__, __LINE__) #define thread_unlock(tdp) \ mtx_unlock_spin((tdp)->td_lock) @@ -290,27 +295,48 @@ extern struct mtx_pool *mtxpool_sleep; #error LOCK_DEBUG not defined, include before #endif #if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE) -#define mtx_lock_flags(m, opts) \ - _mtx_lock_flags((m), (opts), LOCK_FILE, LOCK_LINE) -#define mtx_unlock_flags(m, opts) \ - _mtx_unlock_flags((m), (opts), LOCK_FILE, LOCK_LINE) -#define mtx_lock_spin_flags(m, opts) \ - _mtx_lock_spin_flags((m), (opts), LOCK_FILE, LOCK_LINE) -#define mtx_unlock_spin_flags(m, opts) \ - _mtx_unlock_spin_flags((m), (opts), LOCK_FILE, LOCK_LINE) +#define mtx_lock_flags_(m, opts, file, line) \ + _mtx_lock_flags((m), (opts), (file), (line)) +#define mtx_unlock_flags_(m, opts, file, line) \ + _mtx_unlock_flags((m), (opts), (file), (line)) +#define mtx_lock_spin_flags_(m, opts, file, line) \ + _mtx_lock_spin_flags((m), (opts), (file), (line)) +#define mtx_unlock_spin_flags_(m, opts, file, line) \ + _mtx_unlock_spin_flags((m), (opts), (file), (line)) #else /* LOCK_DEBUG == 0 && !MUTEX_NOINLINE */ +#define mtx_lock_flags_(m, opts, file, line) \ + __mtx_lock((m), curthread, (opts), (file), (line)) +#define mtx_unlock_flags_(m, opts, file, line) \ + __mtx_unlock((m), curthread, (opts), (file), (line)) +#define mtx_lock_spin_flags_(m, opts, file, line) \ + __mtx_lock_spin((m), curthread, (opts), (file), (line)) +#define mtx_unlock_spin_flags_(m, opts, file, line) \ + __mtx_unlock_spin((m)) +#endif /* LOCK_DEBUG > 0 || MUTEX_NOINLINE */ + +#ifdef INVARIANTS +#define mtx_assert_(m, what, file, line) \ + _mtx_assert((m), (what), (file), (line)) + +#define GIANT_REQUIRED mtx_assert_(&Giant, MA_OWNED, __FILE__, __LINE__) + +#else /* INVARIANTS */ +#define mtx_assert_(m, what, file, line) (void)0 +#define GIANT_REQUIRED +#endif /* INVARIANTS */ + #define mtx_lock_flags(m, opts) \ - __mtx_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + mtx_lock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_flags(m, opts) \ - __mtx_unlock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + mtx_unlock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_lock_spin_flags(m, opts) \ - __mtx_lock_spin((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + mtx_lock_spin_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_spin_flags(m, opts) \ - __mtx_unlock_spin((m)) -#endif /* LOCK_DEBUG > 0 || MUTEX_NOINLINE */ - + mtx_unlock_spin_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_trylock_flags(m, opts) \ - _mtx_trylock((m), (opts), LOCK_FILE, LOCK_LINE) + mtx_trylock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) +#define mtx_assert(m, what) \ + mtx_assert_((m), (what), __FILE__, __LINE__) #define mtx_sleep(chan, mtx, pri, wmesg, timo) \ _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (timo)) @@ -398,17 +424,6 @@ struct mtx_args { #define MA_NOTRECURSED LA_NOTRECURSED #endif -#ifdef INVARIANTS -#define mtx_assert(m, what) \ - _mtx_assert((m), (what), __FILE__, __LINE__) - -#define GIANT_REQUIRED mtx_assert(&Giant, MA_OWNED) - -#else /* INVARIANTS */ -#define mtx_assert(m, what) (void)0 -#define GIANT_REQUIRED -#endif /* INVARIANTS */ - /* * Common lock type names. */ Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Nov 20 15:18:49 2011 (r227757) +++ head/sys/vm/vm_map.c Sun Nov 20 16:33:09 2011 (r227758) @@ -464,7 +464,7 @@ _vm_map_lock(vm_map_t map, const char *f { if (map->system_map) - _mtx_lock_flags(&map->system_mtx, 0, file, line); + mtx_lock_flags_(&map->system_mtx, 0, file, line); else (void)_sx_xlock(&map->lock, 0, file, line); map->timestamp++; @@ -489,7 +489,7 @@ _vm_map_unlock(vm_map_t map, const char { if (map->system_map) - _mtx_unlock_flags(&map->system_mtx, 0, file, line); + mtx_unlock_flags_(&map->system_mtx, 0, file, line); else { _sx_xunlock(&map->lock, file, line); vm_map_process_deferred(); @@ -501,7 +501,7 @@ _vm_map_lock_read(vm_map_t map, const ch { if (map->system_map) - _mtx_lock_flags(&map->system_mtx, 0, file, line); + mtx_lock_flags_(&map->system_mtx, 0, file, line); else (void)_sx_slock(&map->lock, 0, file, line); } @@ -511,7 +511,7 @@ _vm_map_unlock_read(vm_map_t map, const { if (map->system_map) - _mtx_unlock_flags(&map->system_mtx, 0, file, line); + mtx_unlock_flags_(&map->system_mtx, 0, file, line); else { _sx_sunlock(&map->lock, file, line); vm_map_process_deferred(); @@ -524,7 +524,7 @@ _vm_map_trylock(vm_map_t map, const char int error; error = map->system_map ? - !_mtx_trylock(&map->system_mtx, 0, file, line) : + !mtx_trylock_flags_(&map->system_mtx, 0, file, line) : !_sx_try_xlock(&map->lock, file, line); if (error == 0) map->timestamp++; @@ -537,7 +537,7 @@ _vm_map_trylock_read(vm_map_t map, const int error; error = map->system_map ? - !_mtx_trylock(&map->system_mtx, 0, file, line) : + !mtx_trylock_flags_(&map->system_mtx, 0, file, line) : !_sx_try_slock(&map->lock, file, line); return (error == 0); } @@ -558,9 +558,7 @@ _vm_map_lock_upgrade(vm_map_t map, const unsigned int last_timestamp; if (map->system_map) { -#ifdef INVARIANTS - _mtx_assert(&map->system_mtx, MA_OWNED, file, line); -#endif + mtx_assert_(&map->system_mtx, MA_OWNED, file, line); } else { if (!_sx_try_upgrade(&map->lock, file, line)) { last_timestamp = map->timestamp; @@ -586,9 +584,7 @@ _vm_map_lock_downgrade(vm_map_t map, con { if (map->system_map) { -#ifdef INVARIANTS - _mtx_assert(&map->system_mtx, MA_OWNED, file, line); -#endif + mtx_assert_(&map->system_mtx, MA_OWNED, file, line); } else _sx_downgrade(&map->lock, file, line); } @@ -609,13 +605,14 @@ vm_map_locked(vm_map_t map) return (sx_xlocked(&map->lock)); } +/* XXX: INVARIANTS here is still necessary because of sx support. */ #ifdef INVARIANTS static void _vm_map_assert_locked(vm_map_t map, const char *file, int line) { if (map->system_map) - _mtx_assert(&map->system_mtx, MA_OWNED, file, line); + mtx_assert_(&map->system_mtx, MA_OWNED, file, line); else _sx_assert(&map->lock, SA_XLOCKED, file, line); } @@ -626,7 +623,7 @@ _vm_map_assert_locked_read(vm_map_t map, { if (map->system_map) - _mtx_assert(&map->system_mtx, MA_OWNED, file, line); + mtx_assert_(&map->system_mtx, MA_OWNED, file, line); else _sx_assert(&map->lock, SA_SLOCKED, file, line); } @@ -661,7 +658,7 @@ _vm_map_unlock_and_wait(vm_map_t map, in mtx_lock(&map_sleep_mtx); if (map->system_map) - _mtx_unlock_flags(&map->system_mtx, 0, file, line); + mtx_unlock_flags_(&map->system_mtx, 0, file, line); else _sx_xunlock(&map->lock, file, line); return (msleep(&map->root, &map_sleep_mtx, PDROP | PVM, "vmmaps", From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 16:36: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 E7C4F106564A; Sun, 20 Nov 2011 16:36:02 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D78098FC08; Sun, 20 Nov 2011 16:36:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKGa2WF000527; Sun, 20 Nov 2011 16:36:02 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKGa20l000525; Sun, 20 Nov 2011 16:36:02 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111201636.pAKGa20l000525@svn.freebsd.org> From: Attilio Rao Date: Sun, 20 Nov 2011 16:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227759 - 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: Sun, 20 Nov 2011 16:36:03 -0000 Author: attilio Date: Sun Nov 20 16:36:02 2011 New Revision: 227759 URL: http://svn.freebsd.org/changeset/base/227759 Log: Revert part of the r227758 which crept in. Pointy hat: attilio X-MFC: r227758 Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Nov 20 16:33:09 2011 (r227758) +++ head/sys/amd64/conf/GENERIC Sun Nov 20 16:36:02 2011 (r227759) @@ -73,11 +73,11 @@ options KDB # Enable kernel debugger options DDB # Support DDB. options GDB # Support remote GDB. options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking +options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +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 Sun Nov 20 16:46: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 08CAB1065672; Sun, 20 Nov 2011 16:46:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2E848FC12; Sun, 20 Nov 2011 16:46:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKGkoOt000919; Sun, 20 Nov 2011 16:46:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKGkoTs000916; Sun, 20 Nov 2011 16:46:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111201646.pAKGkoTs000916@svn.freebsd.org> From: Rick Macklem Date: Sun, 20 Nov 2011 16:46: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: r227760 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 16:46:51 -0000 Author: rmacklem Date: Sun Nov 20 16:46:50 2011 New Revision: 227760 URL: http://svn.freebsd.org/changeset/base/227760 Log: Add two arguments to the nfsrpc_rellockown() function in the NFSv4 client. This does not change the client's behaviour, but prepares the code so that nfsrpc_rellockown() can be called elsewhere in a future commit. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Sun Nov 20 16:36:02 2011 (r227759) +++ head/sys/fs/nfs/nfs_var.h Sun Nov 20 16:46:50 2011 (r227760) @@ -418,8 +418,8 @@ int nfsrpc_pathconf(vnode_t, struct nfsv struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *); int nfsrpc_renew(struct nfsclclient *, struct ucred *, NFSPROC_T *); -int nfsrpc_rellockown(struct nfsmount *, struct nfscllockowner *, - struct ucred *, NFSPROC_T *); +int nfsrpc_rellockown(struct nfsmount *, struct nfscllockowner *, uint8_t *, + int, struct ucred *, NFSPROC_T *); int nfsrpc_getdirpath(struct nfsmount *, u_char *, struct ucred *, NFSPROC_T *); int nfsrpc_delegreturn(struct nfscldeleg *, struct ucred *, Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Nov 20 16:36:02 2011 (r227759) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Nov 20 16:46:50 2011 (r227760) @@ -649,7 +649,8 @@ nfsrpc_doclose(struct nfsmount *nmp, str * puts on the wire has the file handle for this file appended * to it, so it can be done now. */ - (void)nfsrpc_rellockown(nmp, lp, tcred, p); + (void)nfsrpc_rellockown(nmp, lp, lp->nfsl_open->nfso_fh, + lp->nfsl_open->nfso_fhlen, tcred, p); } /* @@ -4027,7 +4028,7 @@ nfsrpc_renew(struct nfsclclient *clp, st */ APPLESTATIC int nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllockowner *lp, - struct ucred *cred, NFSPROC_T *p) + uint8_t *fh, int fhlen, struct ucred *cred, NFSPROC_T *p) { struct nfsrv_descript nfsd, *nd = &nfsd; u_int32_t *tl; @@ -4039,10 +4040,8 @@ nfsrpc_rellockown(struct nfsmount *nmp, *tl++ = nmp->nm_clp->nfsc_clientid.lval[0]; *tl = nmp->nm_clp->nfsc_clientid.lval[1]; NFSBCOPY(lp->nfsl_owner, own, NFSV4CL_LOCKNAMELEN); - NFSBCOPY(lp->nfsl_open->nfso_fh, &own[NFSV4CL_LOCKNAMELEN], - lp->nfsl_open->nfso_fhlen); - (void)nfsm_strtom(nd, own, NFSV4CL_LOCKNAMELEN + - lp->nfsl_open->nfso_fhlen); + NFSBCOPY(fh, &own[NFSV4CL_LOCKNAMELEN], fhlen); + (void)nfsm_strtom(nd, own, NFSV4CL_LOCKNAMELEN + fhlen); nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 17:05: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 586D1106564A; Sun, 20 Nov 2011 17:05:26 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 467A08FC0C; Sun, 20 Nov 2011 17:05:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKH5QxF001614; Sun, 20 Nov 2011 17:05:26 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKH5QqO001611; Sun, 20 Nov 2011 17:05:26 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111201705.pAKH5QqO001611@svn.freebsd.org> From: Christian Brueffer Date: Sun, 20 Nov 2011 17:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227761 - in stable/9/release/doc: en_US.ISO8859-1/hardware 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, 20 Nov 2011 17:05:26 -0000 Author: brueffer Date: Sun Nov 20 17:05:25 2011 New Revision: 227761 URL: http://svn.freebsd.org/changeset/base/227761 Log: MFC: r227275 Add qlxgb(4) to the hardware notes. Approved by: re (kib) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml stable/9/release/doc/share/misc/dev.archlist.txt Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 16:46:50 2011 (r227760) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:05:25 2011 (r227761) @@ -948,6 +948,8 @@ &hwlist.pcn; + &hwlist.qlxgb; + &hwlist.re; &hwlist.rl; Modified: stable/9/release/doc/share/misc/dev.archlist.txt ============================================================================== --- stable/9/release/doc/share/misc/dev.archlist.txt Sun Nov 20 16:46:50 2011 (r227760) +++ stable/9/release/doc/share/misc/dev.archlist.txt Sun Nov 20 17:05:25 2011 (r227761) @@ -100,6 +100,7 @@ ohci i386,pc98,ia64,amd64,powerpc oltr i386 pcn i386,pc98,ia64,amd64 pst i386 +qlxgb amd64 rc i386 ral i386,amd64 rue i386,pc98,amd64 From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 17:06: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 6CD72106564A; Sun, 20 Nov 2011 17:06:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B9D08FC0C; Sun, 20 Nov 2011 17:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKH6KkA001697; Sun, 20 Nov 2011 17:06:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKH6KEJ001694; Sun, 20 Nov 2011 17:06:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111201706.pAKH6KEJ001694@svn.freebsd.org> From: Christian Brueffer Date: Sun, 20 Nov 2011 17:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227762 - in releng/9.0/release/doc: en_US.ISO8859-1/hardware 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, 20 Nov 2011 17:06:20 -0000 Author: brueffer Date: Sun Nov 20 17:06:20 2011 New Revision: 227762 URL: http://svn.freebsd.org/changeset/base/227762 Log: MFC: r227275 Add qlxgb(4) to the hardware notes. Approved by: re (kib) Modified: releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml releng/9.0/release/doc/share/misc/dev.archlist.txt Directory Properties: releng/9.0/release/ (props changed) Modified: releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:05:25 2011 (r227761) +++ releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:06:20 2011 (r227762) @@ -948,6 +948,8 @@ &hwlist.pcn; + &hwlist.qlxgb; + &hwlist.re; &hwlist.rl; Modified: releng/9.0/release/doc/share/misc/dev.archlist.txt ============================================================================== --- releng/9.0/release/doc/share/misc/dev.archlist.txt Sun Nov 20 17:05:25 2011 (r227761) +++ releng/9.0/release/doc/share/misc/dev.archlist.txt Sun Nov 20 17:06:20 2011 (r227762) @@ -100,6 +100,7 @@ ohci i386,pc98,ia64,amd64,powerpc oltr i386 pcn i386,pc98,ia64,amd64 pst i386 +qlxgb amd64 rc i386 ral i386,amd64 rue i386,pc98,amd64 From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 17:08: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 096771065672; Sun, 20 Nov 2011 17:08:33 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC2148FC14; Sun, 20 Nov 2011 17:08:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKH8Wpb001810; Sun, 20 Nov 2011 17:08:32 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKH8WYn001808; Sun, 20 Nov 2011 17:08:32 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111201708.pAKH8WYn001808@svn.freebsd.org> From: Christian Brueffer Date: Sun, 20 Nov 2011 17:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227763 - stable/9/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 17:08:33 -0000 Author: brueffer Date: Sun Nov 20 17:08:32 2011 New Revision: 227763 URL: http://svn.freebsd.org/changeset/base/227763 Log: MFC: r227466, r227480, r227516 Add mps(4) and mvs(4) to the hardware notes. Approved by: re (kib) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:06:20 2011 (r227762) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:08:32 2011 (r227763) @@ -798,8 +798,12 @@ &hwlist.mly; + &hwlist.mps; + &hwlist.mpt; + &hwlist.mvs; + &hwlist.ncr; &hwlist.ncv; From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 17: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 72ED5106564A; Sun, 20 Nov 2011 17:09:13 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61FDC8FC08; Sun, 20 Nov 2011 17:09:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKH9Dhx001875; Sun, 20 Nov 2011 17:09:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKH9Dn4001873; Sun, 20 Nov 2011 17:09:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111201709.pAKH9Dn4001873@svn.freebsd.org> From: Christian Brueffer Date: Sun, 20 Nov 2011 17:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227764 - releng/9.0/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 17:09:13 -0000 Author: brueffer Date: Sun Nov 20 17:09:13 2011 New Revision: 227764 URL: http://svn.freebsd.org/changeset/base/227764 Log: MFC: r227466, r227480, r227516 Add mps(4) and mvs(4) to the hardware notes. Approved by: re (kib) Modified: releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: releng/9.0/release/ (props changed) Modified: releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:08:32 2011 (r227763) +++ releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:09:13 2011 (r227764) @@ -798,8 +798,12 @@ &hwlist.mly; + &hwlist.mps; + &hwlist.mpt; + &hwlist.mvs; + &hwlist.ncr; &hwlist.ncv; From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 17:11: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 239AF1065670; Sun, 20 Nov 2011 17:11:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 125C18FC19; Sun, 20 Nov 2011 17:11:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKHBBPd002001; Sun, 20 Nov 2011 17:11:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKHBBXT001999; Sun, 20 Nov 2011 17:11:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111201711.pAKHBBXT001999@svn.freebsd.org> From: Christian Brueffer Date: Sun, 20 Nov 2011 17:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227765 - stable/9/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 17:11:12 -0000 Author: brueffer Date: Sun Nov 20 17:11:11 2011 New Revision: 227765 URL: http://svn.freebsd.org/changeset/base/227765 Log: MFC: r227742 Add 2010 and 2011 copyrights. Approved by: re (kib) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:09:13 2011 (r227764) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:11:11 2011 (r227765) @@ -30,6 +30,8 @@ 2007 2008 2009 + 2010 + 2011 The &os; Documentation Project From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 17:11: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 07CC41065676; Sun, 20 Nov 2011 17:11:50 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB2CC8FC0C; Sun, 20 Nov 2011 17:11:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKHBnHH002065; Sun, 20 Nov 2011 17:11:49 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKHBnRB002063; Sun, 20 Nov 2011 17:11:49 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111201711.pAKHBnRB002063@svn.freebsd.org> From: Christian Brueffer Date: Sun, 20 Nov 2011 17:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227766 - releng/9.0/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 17:11:50 -0000 Author: brueffer Date: Sun Nov 20 17:11:49 2011 New Revision: 227766 URL: http://svn.freebsd.org/changeset/base/227766 Log: MFC: r227742 Add 2010 and 2011 copyrights. Approved by: re (kib) Modified: releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: releng/9.0/release/ (props changed) Modified: releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:11:11 2011 (r227765) +++ releng/9.0/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:11:49 2011 (r227766) @@ -30,6 +30,8 @@ 2007 2008 2009 + 2010 + 2011 The &os; Documentation Project From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 17:15: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 447C21065675; Sun, 20 Nov 2011 17:15:33 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324288FC17; Sun, 20 Nov 2011 17:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKHFWld002226; Sun, 20 Nov 2011 17:15:32 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKHFWWp002224; Sun, 20 Nov 2011 17:15:32 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111201715.pAKHFWWp002224@svn.freebsd.org> From: Christian Brueffer Date: Sun, 20 Nov 2011 17:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227767 - in stable/8/release: doc/en_US.ISO8859-1/hardware picobsd/floppy.tree/sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 17:15:33 -0000 Author: brueffer Date: Sun Nov 20 17:15:32 2011 New Revision: 227767 URL: http://svn.freebsd.org/changeset/base/227767 Log: MFC: r227466, r227480, r227516 Add mps(4) and mvs(4) to the hardware notes. Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:11:49 2011 (r227766) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:15:32 2011 (r227767) @@ -745,8 +745,12 @@ &hwlist.mly; + &hwlist.mps; + &hwlist.mpt; + &hwlist.mvs; + &hwlist.ncr; &hwlist.ncv; From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 18:01: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 BC990106566B; Sun, 20 Nov 2011 18:01:45 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA7908FC1F; Sun, 20 Nov 2011 18:01:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKI1jDC003699; Sun, 20 Nov 2011 18:01:45 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKI1jrk003697; Sun, 20 Nov 2011 18:01:45 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111201801.pAKI1jrk003697@svn.freebsd.org> From: Christian Brueffer Date: Sun, 20 Nov 2011 18:01: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: r227768 - in stable/8/release: doc/en_US.ISO8859-1/hardware picobsd/floppy.tree/sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 18:01:45 -0000 Author: brueffer Date: Sun Nov 20 18:01:45 2011 New Revision: 227768 URL: http://svn.freebsd.org/changeset/base/227768 Log: MFC: r227742 Add 2010 and 2011 copyrights. Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 17:15:32 2011 (r227767) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 20 18:01:45 2011 (r227768) @@ -30,6 +30,8 @@ 2007 2008 2009 + 2010 + 2011 The &os; Documentation Project From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 19:05: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 87D421065675; Sun, 20 Nov 2011 19:05:32 +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 780FE8FC08; Sun, 20 Nov 2011 19:05:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKJ5WKm005707; Sun, 20 Nov 2011 19:05:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKJ5W3o005705; Sun, 20 Nov 2011 19:05:32 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201111201905.pAKJ5W3o005705@svn.freebsd.org> From: Glen Barber Date: Sun, 20 Nov 2011 19:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227769 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 19:05:32 -0000 Author: gjb (doc committer) Date: Sun Nov 20 19:05:32 2011 New Revision: 227769 URL: http://svn.freebsd.org/changeset/base/227769 Log: Add a note to src/Makefile that explains that 'rm' runs twice because the second invocation only needs to operate on files with the immutable flag set. Submitted by: arundel (via private email) (original version) Discussed on: -toolchain@ MFC after: 3 days Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Nov 20 18:01:45 2011 (r227768) +++ head/Makefile Sun Nov 20 19:05:32 2011 (r227769) @@ -185,7 +185,10 @@ buildworld: upgrade_checks # files with chflags set, so this unsets them and tries the 'rm' a # second time. There are situations where this target will be cleaning # some directories via more than one method, but that duplication is -# needed to correctly handle all the possible situations. +# needed to correctly handle all the possible situations. Removing all +# files without the immutable flag set in the first 'rm' instance saves +# time, because 'chflags' will need to operate on fewer files (with the +# immutable flag set) afterwards. # BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} cleanworld: From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 19:05: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 6DB061065676; Sun, 20 Nov 2011 19:05:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 29FBD8FC15; Sun, 20 Nov 2011 19:05:49 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pAKJ0EcZ049452 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 20 Nov 2011 12:00:14 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <201111200836.pAK8aIEq082864@svn.freebsd.org> Date: Sun, 20 Nov 2011 12:00:13 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <229B993A-8F52-42B3-AE87-7DB4451AA9D0@bsdimp.com> References: <201111200836.pAK8aIEq082864@svn.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sun, 20 Nov 2011 12:00:14 -0700 (MST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227749 - 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, 20 Nov 2011 19:05:49 -0000 Is this right? Passing 0 to timo causes a panic? That can't be good. Wanrer On Nov 20, 2011, at 1:36 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Sun Nov 20 08:36:18 2011 > New Revision: 227749 > URL: http://svn.freebsd.org/changeset/base/227749 >=20 > Log: > Given that the typical usage of pause() is pause("zzz", hz / N), = where N can > be greater than hz in some cases, simply ignore a timeout value of = zero. >=20 > Suggested by: Bruce Evans > MFC after: 1 week >=20 > Modified: > head/sys/kern/kern_synch.c >=20 > Modified: head/sys/kern/kern_synch.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/kern/kern_synch.c Sun Nov 20 08:29:23 2011 = (r227748) > +++ head/sys/kern/kern_synch.c Sun Nov 20 08:36:18 2011 = (r227749) > @@ -333,7 +333,7 @@ msleep_spin(void *ident, struct mtx *mtx > int > pause(const char *wmesg, int timo) > { > - KASSERT(timo > 0, ("pause: timo must be > 0")); > + KASSERT(timo >=3D 0, ("pause: timo must be >=3D 0")); >=20 > /* silently convert invalid timeouts */ > if (timo < 1) >=20 >=20 From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 19:16:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 68606106566B; Sun, 20 Nov 2011 19:16:21 +0000 (UTC) Date: Sun, 20 Nov 2011 19:16:21 +0000 From: Alexander Best To: Glen Barber Message-ID: <20111120191621.GA22281@freebsd.org> References: <201111201905.pAKJ5W3o005705@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111201905.pAKJ5W3o005705@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227769 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 19:16:21 -0000 On Sun Nov 20 11, Glen Barber wrote: > Author: gjb (doc committer) > Date: Sun Nov 20 19:05:32 2011 > New Revision: 227769 > URL: http://svn.freebsd.org/changeset/base/227769 > > Log: > Add a note to src/Makefile that explains that 'rm' runs twice because the > second invocation only needs to operate on files with the immutable flag thanks for taking care of this one. :) are we sure we're only dealing with the immutable flag? since chflags is being invoked as 'chflags -R 0' and not 'chflags -R noschg', wouldn't it be better to refer to "file flags" in general and not only to the "immutable flag"? cheers. alex > set. > > Submitted by: arundel (via private email) (original version) > Discussed on: -toolchain@ > MFC after: 3 days > > Modified: > head/Makefile > > Modified: head/Makefile > ============================================================================== > --- head/Makefile Sun Nov 20 18:01:45 2011 (r227768) > +++ head/Makefile Sun Nov 20 19:05:32 2011 (r227769) > @@ -185,7 +185,10 @@ buildworld: upgrade_checks > # files with chflags set, so this unsets them and tries the 'rm' a > # second time. There are situations where this target will be cleaning > # some directories via more than one method, but that duplication is > -# needed to correctly handle all the possible situations. > +# needed to correctly handle all the possible situations. Removing all > +# files without the immutable flag set in the first 'rm' instance saves > +# time, because 'chflags' will need to operate on fewer files (with the > +# immutable flag set) afterwards. > # > BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} > cleanworld: From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 19:27:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 401181065670; Sun, 20 Nov 2011 19:27:53 +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 303A28FC1E; Sun, 20 Nov 2011 19:27:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKJRrsl006419; Sun, 20 Nov 2011 19:27:53 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKJRr2P006417; Sun, 20 Nov 2011 19:27:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201111201927.pAKJRr2P006417@svn.freebsd.org> From: Glen Barber Date: Sun, 20 Nov 2011 19:27: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: r227770 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 19:27:53 -0000 Author: gjb (doc committer) Date: Sun Nov 20 19:27:52 2011 New Revision: 227770 URL: http://svn.freebsd.org/changeset/base/227770 Log: Fix the note in r227769 to be less specific to the immutable flag. Submitted by: arundel MFC after: 3 days X-MFC-With: r227769 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Nov 20 19:05:32 2011 (r227769) +++ head/Makefile Sun Nov 20 19:27:52 2011 (r227770) @@ -186,9 +186,8 @@ buildworld: upgrade_checks # second time. There are situations where this target will be cleaning # some directories via more than one method, but that duplication is # needed to correctly handle all the possible situations. Removing all -# files without the immutable flag set in the first 'rm' instance saves -# time, because 'chflags' will need to operate on fewer files (with the -# immutable flag set) afterwards. +# files without file flags set in the first 'rm' instance saves +# time, because 'chflags' will need to operate on fewer files afterwards. # BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} cleanworld: From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 19:29:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A696C1065672 for ; Sun, 20 Nov 2011 19:29:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id 6EA808FC12 for ; Sun, 20 Nov 2011 19:29:53 +0000 (UTC) Received: (qmail 60522 invoked by uid 0); 20 Nov 2011 14:29:52 -0500 Received: from unknown (HELO glenbarber.us) (76.124.49.145) by 0 with SMTP; 20 Nov 2011 14:29:52 -0500 Date: Sun, 20 Nov 2011 14:29:50 -0500 From: Glen Barber To: Alexander Best Message-ID: <20111120192950.GB9383@glenbarber.us> References: <201111201905.pAKJ5W3o005705@svn.freebsd.org> <20111120191621.GA22281@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cvVnyQ+4j833TQvp" Content-Disposition: inline In-Reply-To: <20111120191621.GA22281@freebsd.org> X-Operating-System: FreeBSD 9.0-PRERELEASE amd64 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: r227769 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 19:29:53 -0000 --cvVnyQ+4j833TQvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 20, 2011 at 07:16:21PM +0000, Alexander Best wrote: > On Sun Nov 20 11, Glen Barber wrote: > > Author: gjb (doc committer) > > Date: Sun Nov 20 19:05:32 2011 > > New Revision: 227769 > > URL: http://svn.freebsd.org/changeset/base/227769 > >=20 > > Log: > > Add a note to src/Makefile that explains that 'rm' runs twice because= the > > second invocation only needs to operate on files with the immutable f= lag >=20 > thanks for taking care of this one. :) >=20 > are we sure we're only dealing with the immutable flag? since chflags is = being > invoked as 'chflags -R 0' and not 'chflags -R noschg', wouldn't it be bet= ter to > refer to "file flags" in general and not only to the "immutable flag"? You are correct, I didn't think about the 'undeletable' flag. I've committed a followup with 227770. Thanks. Glen --=20 Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project --cvVnyQ+4j833TQvp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJOyVUuAAoJEFJPDDeguUaj8EgIALf2U6tRrwJxcaioIDd60QIl rJYsRkb12qh9D6UWSn8e20ZS7jlu37yYRw8X7AJSBJfYfkMb/zugBdw2rjPgUOJh mxXl4+02XbBk9zT1XmcNgehn03fIDkwCdfEd7Fvck088Kh3Cqls+2nJEgDroAfZg xseM5lbXy7wpaK0PMMeS3AvheCN03u3+iOUK/pzf6sPYQzgJ3Zryn1S/GtbG99GV 0jB/Bn6blasB7n9W6kjM+H5C0R7Gx3Cspfyt5LFievybKiycMzhqvn0SwgR96MWu Yo/Qu5J2gFAPZ/GQ/Q+rZTxW3GeJLC5LBCHiqqH7Mi8GCNvoqMV1VSRzVrE4NXs= =n9qJ -----END PGP SIGNATURE----- --cvVnyQ+4j833TQvp-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 20:05: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 F210F106566B; Sun, 20 Nov 2011 20:05: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 E23568FC14; Sun, 20 Nov 2011 20:05:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKK5l7s007589; Sun, 20 Nov 2011 20:05:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKK5l91007587; Sun, 20 Nov 2011 20:05:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201111202005.pAKK5l91007587@svn.freebsd.org> From: Glen Barber Date: Sun, 20 Nov 2011 20:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227771 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 20:05:48 -0000 Author: gjb (doc committer) Date: Sun Nov 20 20:05:47 2011 New Revision: 227771 URL: http://svn.freebsd.org/changeset/base/227771 Log: Replace 'chflags' with 'file flags' in a comment, since 'chflags' is a command, not a flag itself. While here, wrap a line for readability. Submitted by: arundel MFC after: 3 days X-MFC-With: 227769, 227770 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Nov 20 19:27:52 2011 (r227770) +++ head/Makefile Sun Nov 20 20:05:47 2011 (r227771) @@ -182,12 +182,12 @@ buildworld: upgrade_checks # # In the following, the first 'rm' in a series will usually remove all # files and directories. If it does not, then there are probably some -# files with chflags set, so this unsets them and tries the 'rm' a +# files with file flags set, so this unsets them and tries the 'rm' a # second time. There are situations where this target will be cleaning # some directories via more than one method, but that duplication is # needed to correctly handle all the possible situations. Removing all -# files without file flags set in the first 'rm' instance saves -# time, because 'chflags' will need to operate on fewer files afterwards. +# files without file flags set in the first 'rm' instance saves time, +# because 'chflags' will need to operate on fewer files afterwards. # BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} cleanworld: From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 21:48: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 93598106566B; Sun, 20 Nov 2011 21:48:50 +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 829AA8FC0C; Sun, 20 Nov 2011 21:48:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAKLmoDE010792; Sun, 20 Nov 2011 21:48:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAKLmohx010789; Sun, 20 Nov 2011 21:48:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201111202148.pAKLmohx010789@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Nov 2011 21:48: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: r227773 - in head: bin/sh tools/regression/bin/sh/parameters X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Nov 2011 21:48:50 -0000 Author: jilles Date: Sun Nov 20 21:48:50 2011 New Revision: 227773 URL: http://svn.freebsd.org/changeset/base/227773 Log: sh: Allow unsetting OPTIND. Note that only assigning the decimal value 1 resets getopts, as before. Added: head/tools/regression/bin/sh/parameters/optind1.0 (contents, props changed) Modified: head/bin/sh/options.c Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sun Nov 20 21:47:25 2011 (r227772) +++ head/bin/sh/options.c Sun Nov 20 21:48:50 2011 (r227773) @@ -401,9 +401,10 @@ setcmd(int argc, char **argv) void getoptsreset(const char *value) { - if (number(value) == 1) { + while (*value == '0') + value++; + if (strcmp(value, "1") == 0) shellparam.reset = 1; - } } /* Added: head/tools/regression/bin/sh/parameters/optind1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parameters/optind1.0 Sun Nov 20 21:48:50 2011 (r227773) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +unset OPTIND && [ -z "$OPTIND" ] From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 00:02: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 0C8721065675; Mon, 21 Nov 2011 00:02:50 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEC178FC13; Mon, 21 Nov 2011 00:02:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL02nSU015273; Mon, 21 Nov 2011 00:02:49 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL02nML015271; Mon, 21 Nov 2011 00:02:49 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201111210002.pAL02nML015271@svn.freebsd.org> From: Warren Block Date: Mon, 21 Nov 2011 00:02: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: r227774 - 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: Mon, 21 Nov 2011 00:02:50 -0000 Author: wblock (doc committer) Date: Mon Nov 21 00:02:49 2011 New Revision: 227774 URL: http://svn.freebsd.org/changeset/base/227774 Log: Add a section that explicitly describes partitioning schemes. Modify existing sections to refer to the new one. Rearrange partitioning scheme list so MBR and EBR types are together. Also add several corrections for grammar, clarity, and consistency. Approved by: gjb (mentor) MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Sun Nov 20 21:48:50 2011 (r227773) +++ head/sbin/geom/class/part/gpart.8 Mon Nov 21 00:02:49 2011 (r227774) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2011 +.Dd October 26, 2011 .Dt GPART 8 .Os .Sh NAME @@ -37,52 +37,20 @@ lines in your kernel configuration file: .Bd -ragged -offset indent .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_EBR" +.Cd "options GEOM_PART_EBR_COMPAT" .Cd "options GEOM_PART_PC98" .Cd "options GEOM_PART_VTOC8" .Ed .Pp -The -.Dv GEOM_PART_APM -option adds support for the Apple Partition Map (APM) -found on Apple Macintosh computers. -The -.Dv GEOM_PART_BSD -option adds support for the traditional -.Bx -disklabel. -The -.Dv GEOM_PART_EBR -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 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 -option adds support for the GUID Partition Table (GPT) -found on Intel Itanium computers and Intel-based Macintosh computers. -The -.Dv GEOM_PART_MBR -option adds support for the Master Boot Record (MBR) -found on PCs and used on many removable media. -The -.Dv GEOM_PART_PC98 -option adds support for the MBR variant as used on -NEC PC-98 computers. -The -.Dv GEOM_PART_VTOC8 -option adds support for Sun's SMI VTOC8 label as -found on computers based on -.Tn SPARC64 -and -.Tn UltraSPARC. +These options provide support for the various types of partitioning +schemes supported by the +.Ns Nm +utility. See +.Sx "PARTITIONING SCHEMES" +below for more details. .Pp Usage of the .Ns Nm @@ -190,7 +158,7 @@ utility: The .Nm utility is used to partition GEOM providers, normally disks. -The first argument of which is the action to be taken: +The first argument is the action to be taken: .Bl -tag -width ".Cm bootcode" .\" ==== ADD ==== .It Cm add @@ -245,7 +213,7 @@ about its use. .El .\" ==== BACKUP ==== .It Cm backup -Dump a partition table to standard output in special format used by +Dump a partition table to standard output in a special format used by the .Cm restore action. .\" ==== BOOTCODE ==== @@ -290,18 +258,17 @@ about its use. .It Cm commit Commit any pending changes for geom .Ar geom . -All actions are being committed by default and will not result in +All actions are committed by default and will not result in pending changes. Actions can be modified with the .Fl f Ar flags -option so that they are not being committed by default. -As such, they become pending. +option so that they are not committed, but become pending. Pending changes are reflected by the geom and the .Nm utility, but they are not actually written to disk. The .Cm commit -action will write any and all pending changes to disk. +action will write all pending changes to disk. .\" ==== CREATE ==== .It Cm create Create a new partitioning scheme on a provider given by @@ -309,16 +276,16 @@ Create a new partitioning scheme on a pr The .Fl s Ar scheme option determines the scheme to use. -The kernel needs to have support for a particular scheme before +The kernel must have support for a particular scheme before that scheme can be used to partition a disk. .Pp Additional options include: .Bl -tag -width 10n .It Fl n Ar entries The number of entries in the partition table. -Every partitioning scheme has a minimum and a maximum number of entries -and this option allows tables to be created with the number of entries -that lies anywhere between the minimum and the maximum. +Every partitioning scheme has a minimum and maximum number of entries. +This option allows tables to be created with a number of entries +that is within the limits. Some schemes have a maximum equal to the minimum and some schemes have a maximum large enough to be considered unlimited. By default, partition tables are created with the minimum number of @@ -392,7 +359,7 @@ about its use. .El .\" ==== RECOVER ==== .It Cm recover -Recover corrupt partition's scheme metadata on the geom +Recover a corrupt partition's scheme metadata on the geom .Ar geom . See the section entitled .Sx RECOVERING @@ -489,7 +456,7 @@ or all geoms if none are specified. Additional options include: .Bl -tag -width 10n .It Fl l -For partition schemes that support partition labels print them +For partitioning schemes that support partition labels, print them instead of partition type. .It Fl p Show provider names instead of partition indexes. @@ -520,39 +487,93 @@ below for a discussion about its use. .El .El -.\" +.Sh PARTITIONING SCHEMES +Several partitioning schemes are supported by the +.Nm +utility: +.Bl -tag -width ".Cm VTOC8" +.It Cm APM +Apple Partition Map, used by PowerPC(R) Macintosh(R) computers. +Requires the +.Cd GEOM_PART_APM +kernel option. +.It Cm BSD +BSD disklabel without an MBR. +Sometimes called +.Dq dangerously dedicated mode . +.Po +See +.Xr bsdlabel 8 for more information. +.Pc +Requires the +.Cm GEOM_PART_BSD +kernel option. +.It Cm GPT +GUID Partition Table is used on Intel-based Macintosh computers and +gradually replacing MBR on most PCs and other systems. +Requires the +.Cm GEOM_PART_GPT +kernel option. +.It Cm MBR +Master Boot Record is used on PCs and removable media. +Requires the +.Cm GEOM_PART_MBR +kernel option. +The +.Cm GEOM_PART_EBR +option adds support for the Extended Boot Record (EBR), +which is used to define a logical partition. +The +.Cm GEOM_PART_EBR_COMPAT +option enables backward compatibility for partition names +in the EBR scheme. +It also prevents any type of actions on such partitions. +.It Cm PC98 +An MBR variant for NEC PC-98 and compatible computers. +Requires the +.Cm GEOM_PART_PC98 +kernel option. +.It Cm VTOC8 +Sun's SMI Volume Table Of Contents, used by +.Tn SPARC64 +and +.Tn UltraSPARC +computers. +Requires the +.Cm GEOM_PART_VTOC8 +kernel option. +.El .Sh PARTITION TYPES Partition types are identified on disk by particular strings or magic values. The .Nm -utility uses symbolic names for common partition types to avoid the -user needing to know these values or other details of the partitioning +utility uses symbolic names for common partition types so the user +does not need to know these values or other details of the partitioning scheme in question. The .Nm utility also allows the user to specify scheme-specific partition types for partition types that do not have symbolic names. -The symbolic names currently understood are: +Symbolic names currently understood are: .Bl -tag -width ".Cm freebsd-vinum" .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. -Usually it used by GRUB 2 loader when the partition table is GPT. +Usually it is used by the GRUB 2 loader for GPT partitioning schemes. The scheme-specific type is .Qq Li "!21686148-6449-6E6F-744E-656564454649" . .It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). -In such cases, the GPT partitioning scheme is being used and the +In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as .Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . .It Cm freebsd A .Fx -partition that uses the +partition subdivided into filesystems with a .Bx -disklabel to sub-divide the -partition into file systems. +disklabel. This is a legacy partition type and should not be used for the APM or GPT schemes. The scheme-specific types are @@ -581,7 +602,7 @@ for GPT, and tag 0x0901 for VTOC8. .It Cm freebsd-ufs A .Fx -partition that contains a UFS or UFS2 file system. +partition that contains a UFS or UFS2 filesystem. The scheme-specific types are .Qq Li "!FreeBSD-UFS" for APM, @@ -606,7 +627,7 @@ for APM, .Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. .It Cm mbr -A partition that is sub-partitioned by a master boot record (MBR). +A partition that is sub-partitioned by a Master Boot Record (MBR). This type is known as .Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. @@ -712,27 +733,28 @@ The scheme-specific attributes for PC98: .Fx supports several partitioning schemes and each scheme uses different bootstrap code. -The bootstrap code is located in the specific disk area for each partitioning -scheme and also it might have different size. +The bootstrap code is located in a specific disk area for each partitioning +scheme, and may vary in size for different schemes. .Pp -The bootstrap code could be separated into two types. -The first one is embedded in the partitioning scheme's metadata, the second -type is located on the specific partition. -The embedding bootstrap code should be done only with the +Bootstrap code can be separated into two types. +The first type is embedded in the partitioning scheme's metadata, while the +second type is located on a specific partition. +Embedding bootstrap code should only be done with the .Cm gpart bootcode -command with +command with the .Fl b Ar bootcode option. -The GEOM PART class has knowlege on how to embed bootstrap code into specific -partitioning scheme metadata without damage. +The GEOM PART class knows how to safely embed bootstrap code into +specific partitioning scheme metadata without causing any damage. .Pp -The Master Boot Record (MBR) uses 512-bytes bootstrap code image, embedded into -partition table's metadata area. +The Master Boot Record (MBR) uses a 512-byte bootstrap code image, embedded +into the partition table's metadata area. There are two variants of this bootstrap code: .Pa /boot/mbr and .Pa /boot/boot0 . -The first one searches partition with +.Pa /boot/mbr +searches for a partition with the .Cm active attribute (see the .Sx ATTRIBUTES @@ -740,9 +762,10 @@ section) in the partition table. Then it runs next bootstrap stage. The .Pa /boot/boot0 -image contains a boot manager with some additional interactive functions. +image contains a boot manager with some additional interactive functions +for multi-booting from a user-selected partition. .Pp -The BSD disklabel is usually created on top of the MBR partition (slice) +A BSD disklabel is usually created inside an MBR partition (slice) with type .Cm freebsd (see the @@ -750,17 +773,17 @@ with type section). It uses 8 KB size bootstrap code image .Pa /boot/boot , -embedded into partition table's metadata area. +embedded into the partition table's metadata area. .Pp Both types of bootstrap code are used to boot from the GUID Partition Table. -First of all, a protective MBR is embedded into first disk sector from the +First, a protective MBR is embedded into the first disk sector from the .Pa /boot/pmbr image. -It searches the +It searches the GPT .Cm freebsd-boot partition (see the .Sx "PARTITION TYPES" -section) in the GPT and runs next bootstrap stage from it. +section) in the GPT and runs the next bootstrap stage from it. The .Cm freebsd-boot partition should be smaller than 545 KB. @@ -768,37 +791,39 @@ There are two variants of bootstrap code .Pa /boot/gptboot and .Pa /boot/gptzfsboot . -The first one is used to boot from UFS. -It searches in the GPT partition with type -.Cm freebsd-ufs , -and it runs the third bootstrap stage ( -.Pa /boot/loader ) -if it is found. +.Pa /boot/gptboot +is used to boot from UFS. +It searches +.Cm freebsd-ufs +GPT partitions and starts +.Pa /boot/loader +.Pq the third bootstrap stage +if found. The .Pa /boot/gptzfsboot is used to boot from ZFS. -It searches partition with type +It searches .Cm freebsd-zfs -and starts +GPT partitions and starts .Pa /boot/zfsloader -from it. +if found. .Pp The VTOC8 scheme does not support embedding bootstrap code. Instead, the 8 KBytes bootstrap code image .Pa /boot/boot1 -should be written with +should be written with the .Cm gpart bootcode -command with +command with the .Fl p Ar bootcode option to all sufficiently large VTOC8 partitions. To do this the .Fl i Ar index -option could be ommited. +option could be omitted. .Pp The APM scheme also does not support embedding bootstrap code. Instead, the 800 KBytes bootstrap code image .Pa /boot/boot1.hfs -should be written with +should be written with the .Cm gpart bootcode command to a partition of type .Cm freebsd-boot , @@ -829,21 +854,22 @@ action or reverted with the action. .Sh RECOVERING The GEOM PART class supports recovering of partition tables only for GPT. -The GUID partition table has a primary and secondary (backup) copy of -metadata for redundance, these are stored at the begining and the end -of the device respectively. -As a result of having two copies, it is acceptable to have some corruption -within the metadata that is not fatal to the working of GPT. -When the kernel detects corrupt metadata it marks this table as corrupt and -reports the corruption. -Any operations on corrupt tables are prohibited except for +The GUID primary metadata is stored at the beginning of the device. +For redundancy, a secondary +.Pq backup +copy of the metadata is stored at the end of the device. +As a result of having two copies, some corruption of metadata is not +fatal to the working of GPT. +When the kernel detects corrupt metadata, it marks this table as corrupt +and reports the problem. .Cm destroy and -.Cm recover . +.Cm recover +are the only operations allowed on corrupt tables. .Pp If the first sector of a provider is corrupt, the kernel can not detect GPT -even if partition table itself is not corrupt. -You can rewrite the protective MBR using the +even if the partition table itself is not corrupt. +The protective MBR can be rewritten using the .Xr dd 1 command, to restore the ability to detect the GPT. The copy of the protective MBR is usually located in the @@ -874,7 +900,7 @@ will report about corrupt tables. If the size of the device has changed (e.g.\& volume expansion) the secondary GPT header will no longer be located in the last sector. This is not a metadata corruption, but it is dangerous because any -corruption of the primary GPT will lead to loss of partition table. +corruption of the primary GPT will lead to loss of the partition table. This problem is reported by the kernel with the message: .Bd -literal -offset indent GEOM: provider: the secondary GPT header is not in the last LBA. @@ -913,13 +939,13 @@ rejected with a diagnostic message: .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES -Create GPT scheme on +Create a GPT scheme on .Pa ad0 : .Bd -literal -offset indent /sbin/gpart create -s GPT ad0 .Ed .Pp -Embed GPT bootstrap code into protective MBR: +Embed GPT bootstrap code into a protective MBR: .Bd -literal -offset indent /sbin/gpart bootcode -b /boot/pmbr ad0 .Ed @@ -935,9 +961,11 @@ This partition must be larger than .Pa /boot/gptboot , or the GPT boot you are planning to write, but smaller than 545 KB. A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but let's use 128 blocks (64 KB) here in -this example, in order to reserve some space for potential -future need (e.g.\& from a ZFS partition). +booting from UFS but 128 blocks (64 KB) is used in +this example to reserve some space for potential +future need (e.g.\& a larger +.Pa /boot/gptzfsboot +for booting from a ZFS partition). .Bd -literal -offset indent /sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 @@ -945,17 +973,17 @@ future need (e.g.\& from a ZFS partition .Pp Create a 512MB-sized .Cm freebsd-ufs -partition that would contain UFS where the system boots from: +partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed .Pp -Create MBR scheme on +Create an MBR scheme on .Pa ada0 , -then create 30GB-sized +then create a 30GB-sized .Fx slice, mark it active and -install +install the .Nm boot0 boot manager: .Bd -literal -offset indent @@ -965,16 +993,16 @@ boot manager: /sbin/gpart bootcode -b /boot/boot0 ada0 .Ed .Pp -Now create +Now create a .Bx scheme .Pf ( Bx -label) with ability to have up to 20 partitions: +label) with space for up to 20 partitions: .Bd -literal -offset indent /sbin/gpart create -s BSD -n 20 ada0s1 .Ed .Pp -Create 1GB-sized UFS partition and 4GB-sized swap partition: +Create a 1GB-sized UFS partition and a 4GB-sized swap partition: .Bd -literal -offset indent /sbin/gpart add -t freebsd-ufs -s 1G ada0s1 /sbin/gpart add -t freebsd-swap -s 4G ada0s1 @@ -987,7 +1015,7 @@ label: /sbin/gpart bootcode -b /boot/boot ada0s1 .Ed .Pp -Create VTOC8 scheme on +Create a VTOC8 scheme on .Pa da0 : .Bd -literal -offset indent /sbin/gpart create -s VTOC8 da0 @@ -995,36 +1023,36 @@ Create VTOC8 scheme on .Pp Create a 512MB-sized .Cm freebsd-ufs -partition that would contain UFS where the system boots from: +partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent /sbin/gpart add -s 512M -t freebsd-ufs da0 .Ed .Pp Create a 15GB-sized .Cm freebsd-ufs -partition that would contain UFS and aligned on 4KB boundaries: +partition to contain a UFS filesystem and aligned on 4KB boundaries: .Bd -literal -offset indent /sbin/gpart add -s 15G -t freebsd-ufs -a 4k da0 .Ed .Pp -After having created all required partitions, embed bootstrap code into them: +After creating all required partitions, embed bootstrap code into them: .Bd -literal -offset indent /sbin/gpart bootcode -p /boot/boot1 da0 .Ed .Pp -Create backup of partition table from +Create a backup of the partition table from .Pa da0 : .Bd -literal -offset indent /sbin/gpart backup da0 > da0.backup .Ed .Pp -Restore partition table from backup to +Restore the partition table from the backup to .Pa da0 : .Bd -literal -offset indent /sbin/gpart restore -l da0 < /mnt/da0.backup .Ed .Pp -Clone partition table from +Clone the partition table from .Pa ada0 to .Pa ada1 From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 00:49: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 2C7A3106566B; Mon, 21 Nov 2011 00:49: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 1BC518FC1A; Mon, 21 Nov 2011 00:49:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL0nlR2016708; Mon, 21 Nov 2011 00:49:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL0nkW9016705; Mon, 21 Nov 2011 00:49:46 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201111210049.pAL0nkW9016705@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 21 Nov 2011 00:49: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: r227775 - in head: lib/clang 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, 21 Nov 2011 00:49:47 -0000 Author: nwhitehorn Date: Mon Nov 21 00:49:46 2011 New Revision: 227775 URL: http://svn.freebsd.org/changeset/base/227775 Log: Connect LLVM/clang to the build on powerpc64. After the binutils 2.17.50 import, it works without issue. Modified: head/lib/clang/clang.build.mk head/share/mk/bsd.own.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Mon Nov 21 00:02:49 2011 (r227774) +++ head/lib/clang/clang.build.mk Mon Nov 21 00:49:46 2011 (r227775) @@ -9,7 +9,7 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG # Correct for gcc miscompilation when compiling on PPC with -O2 -.if ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -O1 .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Nov 21 00:02:49 2011 (r227774) +++ head/share/mk/bsd.own.mk Mon Nov 21 00:49:46 2011 (r227775) @@ -428,15 +428,14 @@ __T=${TARGET_ARCH} .else __T=${MACHINE_ARCH} .endif -# Clang is only for x86 and 32-bit powerpc right now, by default. -.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc" +# Clang is only for x86 and powerpc right now, by default. +.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} __DEFAULT_YES_OPTIONS+=CLANG .else __DEFAULT_NO_OPTIONS+=CLANG .endif -# FDT is needed only for arm, mips and powerpc (and not powerpc64) -.if ${__T} == "arm" || ${__T} == "armeb" || ${__T} == "powerpc" || \ - ${__T:Mmips*} +# FDT is needed only for arm, mips and powerpc +.if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*} __DEFAULT_YES_OPTIONS+=FDT .else __DEFAULT_NO_OPTIONS+=FDT From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 01:26: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 50BAC106564A; Mon, 21 Nov 2011 01:26:11 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1408FC0A; Mon, 21 Nov 2011 01:26:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL1QBO5017947; Mon, 21 Nov 2011 01:26:11 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL1QAkg017923; Mon, 21 Nov 2011 01:26:10 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111210126.pAL1QAkg017923@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 21 Nov 2011 01:26: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: r227776 - in head: lib/libc/sys sys/amd64/linux32 sys/compat/freebsd32 sys/conf sys/i386/linux sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 01:26:11 -0000 Author: lstewart Date: Mon Nov 21 01:26:10 2011 New Revision: 227776 URL: http://svn.freebsd.org/changeset/base/227776 Log: - Add the ffclock_getcounter(), ffclock_getestimate() and ffclock_setestimate() system calls to provide feed-forward clock management capabilities to userspace processes. ffclock_getcounter() returns the current value of the kernel's feed-forward clock counter. ffclock_getestimate() returns the current feed-forward clock parameter estimates and ffclock_setestimate() updates the feed-forward clock parameter estimates. - Document the syscalls in the ffclock.2 man page. - Regenerate the script-derived syscall related files. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au) Added: head/lib/libc/sys/ffclock.2 (contents, props changed) Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/sys/amd64/linux32/linux32_proto.h head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/compat/freebsd32/syscalls.master head/sys/conf/files head/sys/i386/linux/linux_proto.h head/sys/kern/init_sysent.c head/sys/kern/kern_ffclock.c head/sys/kern/makesyscalls.sh head/sys/kern/syscalls.c head/sys/kern/syscalls.master head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h head/sys/sys/timeffc.h Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Mon Nov 21 00:49:46 2011 (r227775) +++ head/lib/libc/sys/Makefile.inc Mon Nov 21 01:26:10 2011 (r227776) @@ -80,7 +80,7 @@ MAN+= abort2.2 accept.2 access.2 acct.2 bind.2 brk.2 cap_enter.2 cap_new.2 chdir.2 chflags.2 \ chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 closefrom.2 \ connect.2 cpuset.2 cpuset_getaffinity.2 dup.2 execve.2 _exit.2 \ - extattr_get_file.2 fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \ + extattr_get_file.2 fcntl.2 ffclock.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 \ getloginclass.2 getpeername.2 getpgrp.2 getpid.2 getpriority.2 \ @@ -142,6 +142,8 @@ MLINKS+=extattr_get_file.2 extattr.2 \ extattr_get_file.2 extattr_set_fd.2 \ extattr_get_file.2 extattr_set_file.2 \ extattr_get_file.2 extattr_set_link.2 +MLINKS+=ffclock.2 ffclock_getcounter.2 ffclock.2 ffclock_getestimate.2 \ + ffclock.2 ffclock_setestimate.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 MLINKS+=getdirentries.2 getdents.2 MLINKS+=getfh.2 lgetfh.2 Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Mon Nov 21 00:49:46 2011 (r227775) +++ head/lib/libc/sys/Symbol.map Mon Nov 21 01:26:10 2011 (r227776) @@ -365,6 +365,9 @@ FBSD_1.2 { cap_getmode; cap_new; cap_getrights; + ffclock_getcounter; + ffclock_getestimate; + ffclock_setestimate; getloginclass; pdfork; pdgetpid; Added: head/lib/libc/sys/ffclock.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/ffclock.2 Mon Nov 21 01:26:10 2011 (r227776) @@ -0,0 +1,177 @@ +.\" Copyright (c) 2011 The University of Melbourne +.\" All rights reserved. +.\" +.\" This documentation was written by Julien Ridoux at the University of +.\" Melbourne under sponsorship from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE 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 November 21, 2011 +.Dt FFCLOCK 2 +.Os +.Sh NAME +.Nm ffclock_getcounter , +.Nm ffclock_getestimate , +.Nm ffclock_setestimate +.Nd Retrieve feed-forward counter, get and set feed-forward clock estimates. +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/timeffc.h +.Ft int +.Fn ffclock_getcounter "ffcounter *ffcount" +.Ft int +.Fn ffclock_getestimate "struct ffclock_estimate *cest" +.Ft int +.Fn ffclock_setestimate "struct ffclock_estimate *cest" +.Sh DESCRIPTION +The ffclock is an alternative method to synchronise the system clock. +The ffclock implements a feed-forward paradigm and decouples the timestamping +and timekeeping kernel functions. +This ensures that past clock errors do not affect current timekeeping, an +approach radically different from the feedback alternative implemented by the +ntpd daemon when adjusting the system clock. +The feed-forward approach has demonstrated better performance and higher +robustness than a feedback approach when synchronising over the network. +.Pp +In the feed-forward context, a +.Em timestamp +is a cumulative value of the ticks of the timecounter, which can be converted +into seconds by using the feed-forward +.Em clock estimates. +.Pp +The +.Fn ffclock_getcounter +system call allows the calling process to retrieve the current value of the +feed-forward counter maintained by the kernel. +.Pp +The +.Fn ffclock_getestimate +and +.Fn ffclock_setestimate +system calls allow the caller to get and set the kernel's feed-forward clock +parameter estimates respectively. +The +.Fn ffclock_setestimate +system call should be invoked by a single instance of a feed-forward +synchronisation daemon. +The +.Fn ffclock_getestimate +system call can be called by any process to retrieve the feed-forward clock +estimates. +.Pp +The feed-forward approach does not require that the clock estimates be retrieved +every time a timestamp is to be converted into seconds. +The number of system calls can therefore be greatly reduced if the calling +process retrieves the clock estimates from the clock synchronisation daemon +instead. +The +.Fn ffclock_getestimate +must be used when the feed-forward synchronisation daemon is not running +.Po see +.Sx USAGE +below +.Pc . +.Pp +The clock parameter estimates structure pointed to by +.Fa cest +is defined in +.In sys/timeffc.h +as: +.Bd -literal +struct ffclock_estimate { + struct bintime update_time; /* Time of last estimates update. */ + ffcounter update_ffcount; /* Counter value at last update. */ + ffcounter leapsec_next; /* Counter value of next leap second. */ + uint64_t period; /* Estimate of counter period. */ + uint32_t errb_abs; /* Bound on absolute clock error [ns]. */ + uint32_t errb_rate; /* Bound on counter rate error [ps/s]. */ + uint32_t status; /* Clock status. */ + int16_t leapsec_total; /* All leap seconds seen so far. */ + int8_t leapsec; /* Next leap second (in {-1,0,1}). */ +}; +.Ed +.Pp +Only the super-user may set the feed-forward clock estimates. +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +The following error codes may be set in +.Va errno : +.Bl -tag -width Er +.It Bq Er EFAULT +The +.Fa ffcount +or +.Fa cest +pointer referenced invalid memory. +.It Bq Er EPERM +A user other than the super-user attempted to set the feed-forward clock +parameter estimates. +.El +.Sh USAGE +The feed-forward paradigm enables the definition of specialised clock functions. +.Pp +In its simplest form, +.Fn ffclock_getcounter +can be used to establish strict order between events or to measure small time +intervals very accurately with a minimum performance cost. +.Pp +Different methods exist to access absolute time +.Po or +.Qq wall-clock time +.Pc tracked by the ffclock. +The simplest method uses the ffclock sysctl interface +.Va kern.ffclock +to make the system clock return the ffclock time. +The +.Xr clock_gettime 2 +system call can then be used to retrieve the current time seen by the +feed-forward clock. +Note that this setting affects the entire system and that a feed-forward +synchronisation daemon should be running. +.Pp +A less automated method consists of retrieving the feed-forward counter +timestamp from the kernel and using the feed-forward clock parameter estimates +to convert the timestamp into seconds. +The feed-forward clock parameter estimates can be retrieved from the kernel or +from the synchronisation daemon directly (preferred). +This method allows converting timestamps using different clock models as needed +by the application, while collecting meaningful upper bounds on current clock +error. +.Sh SEE ALSO +.Xr date 1 , +.Xr adjtime 2 , +.Xr clock_gettime 2 , +.Xr ctime 3 +.Sh HISTORY +Feed-forward clock support first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The feed-forward clock support was written by +.An Julien Ridoux Aq jridoux@unimelb.edu.au +in collaboration with +.An Darryl Veitch Aq dveitch@unimelb.edu.au +at the University of Melbourne under sponsorship from the FreeBSD Foundation. Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/amd64/linux32/linux32_proto.h Mon Nov 21 01:26:10 2011 (r227776) @@ -12,6 +12,7 @@ #include #include #include +#include #include #include Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 21 01:26:10 2011 (r227776) @@ -12,6 +12,7 @@ #include #include #include +#include #include #include Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Mon Nov 21 01:26:10 2011 (r227776) @@ -207,6 +207,9 @@ #define FREEBSD32_SYS_freebsd32_clock_settime 233 #define FREEBSD32_SYS_freebsd32_clock_getres 234 #define FREEBSD32_SYS_freebsd32_nanosleep 240 +#define FREEBSD32_SYS_ffclock_getcounter 241 +#define FREEBSD32_SYS_ffclock_setestimate 242 +#define FREEBSD32_SYS_ffclock_getestimate 243 #define FREEBSD32_SYS_minherit 250 #define FREEBSD32_SYS_rfork 251 #define FREEBSD32_SYS_openbsd_poll 252 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Nov 21 01:26:10 2011 (r227776) @@ -251,9 +251,9 @@ const char *freebsd32_syscallnames[] = { "#238", /* 238 = timer_gettime */ "#239", /* 239 = timer_getoverrun */ "freebsd32_nanosleep", /* 240 = freebsd32_nanosleep */ - "#241", /* 241 = nosys */ - "#242", /* 242 = nosys */ - "#243", /* 243 = nosys */ + "ffclock_getcounter", /* 241 = ffclock_getcounter */ + "ffclock_setestimate", /* 242 = ffclock_setestimate */ + "ffclock_getestimate", /* 243 = ffclock_getestimate */ "#244", /* 244 = nosys */ "#245", /* 245 = nosys */ "#246", /* 246 = nosys */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Mon Nov 21 01:26:10 2011 (r227776) @@ -288,9 +288,9 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 238 = timer_gettime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 239 = timer_getoverrun */ { AS(freebsd32_nanosleep_args), (sy_call_t *)freebsd32_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = freebsd32_nanosleep */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 241 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 242 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 243 = nosys */ + { AS(ffclock_getcounter_args), (sy_call_t *)sys_ffclock_getcounter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = ffclock_getcounter */ + { AS(ffclock_setestimate_args), (sy_call_t *)sys_ffclock_setestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = ffclock_setestimate */ + { AS(ffclock_getestimate_args), (sy_call_t *)sys_ffclock_getestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 243 = ffclock_getestimate */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 244 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 245 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 246 = nosys */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Nov 21 01:26:10 2011 (r227776) @@ -1203,6 +1203,27 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* ffclock_getcounter */ + case 241: { + struct ffclock_getcounter_args *p = params; + uarg[0] = (intptr_t) p->ffcount; /* ffcounter * */ + *n_args = 1; + break; + } + /* ffclock_setestimate */ + case 242: { + struct ffclock_setestimate_args *p = params; + uarg[0] = (intptr_t) p->cest; /* struct ffclock_estimate * */ + *n_args = 1; + break; + } + /* ffclock_getestimate */ + case 243: { + struct ffclock_getestimate_args *p = params; + uarg[0] = (intptr_t) p->cest; /* struct ffclock_estimate * */ + *n_args = 1; + break; + } /* minherit */ case 250: { struct minherit_args *p = params; @@ -4940,6 +4961,36 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* ffclock_getcounter */ + case 241: + switch(ndx) { + case 0: + p = "ffcounter *"; + break; + default: + break; + }; + break; + /* ffclock_setestimate */ + case 242: + switch(ndx) { + case 0: + p = "struct ffclock_estimate *"; + break; + default: + break; + }; + break; + /* ffclock_getestimate */ + case 243: + switch(ndx) { + case 0: + p = "struct ffclock_estimate *"; + break; + default: + break; + }; + break; /* minherit */ case 250: switch(ndx) { @@ -8824,6 +8875,21 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* ffclock_getcounter */ + case 241: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ffclock_setestimate */ + case 242: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ffclock_getestimate */ + case 243: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* minherit */ case 250: if (ndx == 0 || ndx == 1) Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/compat/freebsd32/syscalls.master Mon Nov 21 01:26:10 2011 (r227776) @@ -447,9 +447,11 @@ 240 AUE_NULL STD { int freebsd32_nanosleep( \ const struct timespec32 *rqtp, \ struct timespec32 *rmtp); } -241 AUE_NULL UNIMPL nosys -242 AUE_NULL UNIMPL nosys -243 AUE_NULL UNIMPL nosys +241 AUE_NULL NOPROTO { int ffclock_getcounter(ffcounter *ffcount); } +242 AUE_NULL NOPROTO { int ffclock_setestimate( \ + struct ffclock_estimate *cest); } +243 AUE_NULL NOPROTO { int ffclock_getestimate( \ + struct ffclock_estimate *cest); } 244 AUE_NULL UNIMPL nosys 245 AUE_NULL UNIMPL nosys 246 AUE_NULL UNIMPL nosys Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/conf/files Mon Nov 21 01:26:10 2011 (r227776) @@ -2341,7 +2341,7 @@ kern/kern_event.c standard kern/kern_exec.c standard kern/kern_exit.c standard kern/kern_fail.c standard -kern/kern_ffclock.c optional ffclock +kern/kern_ffclock.c standard kern/kern_fork.c standard kern/kern_gzio.c optional gzio kern/kern_hhook.c standard Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/i386/linux/linux_proto.h Mon Nov 21 01:26:10 2011 (r227776) @@ -12,6 +12,7 @@ #include #include #include +#include #include #include Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/kern/init_sysent.c Mon Nov 21 01:26:10 2011 (r227776) @@ -275,9 +275,9 @@ struct sysent sysent[] = { { AS(ktimer_gettime_args), (sy_call_t *)sys_ktimer_gettime, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 238 = ktimer_gettime */ { AS(ktimer_getoverrun_args), (sy_call_t *)sys_ktimer_getoverrun, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 239 = ktimer_getoverrun */ { AS(nanosleep_args), (sy_call_t *)sys_nanosleep, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 240 = nanosleep */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 241 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 242 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 243 = nosys */ + { AS(ffclock_getcounter_args), (sy_call_t *)sys_ffclock_getcounter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = ffclock_getcounter */ + { AS(ffclock_setestimate_args), (sy_call_t *)sys_ffclock_setestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = ffclock_setestimate */ + { AS(ffclock_getestimate_args), (sy_call_t *)sys_ffclock_getestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 243 = ffclock_getestimate */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 244 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 245 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 246 = nosys */ Modified: head/sys/kern/kern_ffclock.c ============================================================================== --- head/sys/kern/kern_ffclock.c Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/kern/kern_ffclock.c Mon Nov 21 01:26:10 2011 (r227776) @@ -30,14 +30,29 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ffclock.h" + #include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include #include #include +#ifdef FFCLOCK + extern struct ffclock_estimate ffclock_estimate; extern struct bintime ffclock_boottime; +extern int8_t ffclock_updated; +extern struct mtx ffclock_mtx; /* * Feed-forward clock absolute time. This should be the preferred way to read @@ -208,6 +223,12 @@ sysctl_kern_ffclock_active(SYSCTL_HANDLE SYSCTL_PROC(_kern_ffclock, OID_AUTO, active, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, sysctl_kern_ffclock_active, "A", "Kernel clock selected"); +int sysctl_kern_ffclock_ffcounter_bypass = 0; + +SYSCTL_INT(_kern_ffclock, OID_AUTO, ffcounter_bypass, CTLFLAG_RW, + &sysctl_kern_ffclock_ffcounter_bypass, 0, + "Use reliable hardware timecounter as the Feed-Forward Counter"); + /* * High level functions to access the Feed-Forward Clock. */ @@ -341,3 +362,112 @@ ffclock_microdifftime(ffcounter ffdelta, ffclock_difftime(ffdelta, &bt, NULL); bintime2timeval(&bt, tvp); } + +/* + * System call allowing userland applications to retrieve the current value of + * the Feed-Forward Clock counter. + */ +#ifndef _SYS_SYSPROTO_H_ +struct ffclock_getcounter_args { + ffcounter *ffcount; +}; +#endif +/* ARGSUSED */ +int +sys_ffclock_getcounter(struct thread *td, struct ffclock_getcounter_args *uap) +{ + ffcounter ffcount; + int error; + + ffcount = 0; + ffclock_read_counter(&ffcount); + if (ffcount == 0) + return (EAGAIN); + error = copyout(&ffcount, uap->ffcount, sizeof(ffcounter)); + + return (error); +} + +/* + * System call allowing the synchronisation daemon to push new feed-foward clock + * estimates to the kernel. Acquire ffclock_mtx to prevent concurrent updates + * and ensure data consistency. + * NOTE: ffclock_updated signals the fftimehands that new estimates are + * available. The updated estimates are picked up by the fftimehands on next + * tick, which could take as long as 1/hz seconds (if ticks are not missed). + */ +#ifndef _SYS_SYSPROTO_H_ +struct ffclock_setestimate_args { + struct ffclock_estimate *cest; +}; +#endif +/* ARGSUSED */ +int +sys_ffclock_setestimate(struct thread *td, struct ffclock_setestimate_args *uap) +{ + struct ffclock_estimate cest; + int error; + + /* Reuse of PRIV_CLOCK_SETTIME. */ + if ((error = priv_check(td, PRIV_CLOCK_SETTIME)) != 0) + return (error); + + if ((error = copyin(uap->cest, &cest, sizeof(struct ffclock_estimate))) + != 0) + return (error); + + mtx_lock(&ffclock_mtx); + memcpy(&ffclock_estimate, &cest, sizeof(struct ffclock_estimate)); + ffclock_updated++; + mtx_unlock(&ffclock_mtx); + return (error); +} + +/* + * System call allowing userland applications to retrieve the clock estimates + * stored within the kernel. It is useful to kickstart the synchronisation + * daemon with the kernel's knowledge of hardware timecounter. + */ +#ifndef _SYS_SYSPROTO_H_ +struct ffclock_getestimate_args { + struct ffclock_estimate *cest; +}; +#endif +/* ARGSUSED */ +int +sys_ffclock_getestimate(struct thread *td, struct ffclock_getestimate_args *uap) +{ + struct ffclock_estimate cest; + int error; + + mtx_lock(&ffclock_mtx); + memcpy(&cest, &ffclock_estimate, sizeof(struct ffclock_estimate)); + mtx_unlock(&ffclock_mtx); + error = copyout(&cest, uap->cest, sizeof(struct ffclock_estimate)); + return (error); +} + +#else /* !FFCLOCK */ + +int +sys_ffclock_getcounter(struct thread *td, struct ffclock_getcounter_args *uap) +{ + + return (ENOSYS); +} + +int +sys_ffclock_setestimate(struct thread *td, struct ffclock_setestimate_args *uap) +{ + + return (ENOSYS); +} + +int +sys_ffclock_getestimate(struct thread *td, struct ffclock_getestimate_args *uap) +{ + + return (ENOSYS); +} + +#endif /* FFCLOCK */ Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/kern/makesyscalls.sh Mon Nov 21 01:26:10 2011 (r227776) @@ -154,6 +154,7 @@ s/\$//g printf "#include \n" > sysarg printf "#include \n" > sysarg printf "#include \n" > sysarg + printf "#include \n" > sysarg printf "#include \n" > sysarg printf "#include \n\n" > sysarg printf "#include \n\n" > sysarg Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/kern/syscalls.c Mon Nov 21 01:26:10 2011 (r227776) @@ -248,9 +248,9 @@ const char *syscallnames[] = { "ktimer_gettime", /* 238 = ktimer_gettime */ "ktimer_getoverrun", /* 239 = ktimer_getoverrun */ "nanosleep", /* 240 = nanosleep */ - "#241", /* 241 = nosys */ - "#242", /* 242 = nosys */ - "#243", /* 243 = nosys */ + "ffclock_getcounter", /* 241 = ffclock_getcounter */ + "ffclock_setestimate", /* 242 = ffclock_setestimate */ + "ffclock_getestimate", /* 243 = ffclock_getestimate */ "#244", /* 244 = nosys */ "#245", /* 245 = nosys */ "#246", /* 246 = nosys */ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/kern/syscalls.master Mon Nov 21 01:26:10 2011 (r227776) @@ -456,9 +456,11 @@ 239 AUE_NULL STD { int ktimer_getoverrun(int timerid); } 240 AUE_NULL STD { int nanosleep(const struct timespec *rqtp, \ struct timespec *rmtp); } -241 AUE_NULL UNIMPL nosys -242 AUE_NULL UNIMPL nosys -243 AUE_NULL UNIMPL nosys +241 AUE_NULL STD { int ffclock_getcounter(ffcounter *ffcount); } +242 AUE_NULL STD { int ffclock_setestimate( \ + struct ffclock_estimate *cest); } +243 AUE_NULL STD { int ffclock_getestimate( \ + struct ffclock_estimate *cest); } 244 AUE_NULL UNIMPL nosys 245 AUE_NULL UNIMPL nosys 246 AUE_NULL UNIMPL nosys Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/kern/systrace_args.c Mon Nov 21 01:26:10 2011 (r227776) @@ -1337,6 +1337,27 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* ffclock_getcounter */ + case 241: { + struct ffclock_getcounter_args *p = params; + uarg[0] = (intptr_t) p->ffcount; /* ffcounter * */ + *n_args = 1; + break; + } + /* ffclock_setestimate */ + case 242: { + struct ffclock_setestimate_args *p = params; + uarg[0] = (intptr_t) p->cest; /* struct ffclock_estimate * */ + *n_args = 1; + break; + } + /* ffclock_getestimate */ + case 243: { + struct ffclock_getestimate_args *p = params; + uarg[0] = (intptr_t) p->cest; /* struct ffclock_estimate * */ + *n_args = 1; + break; + } /* ntp_gettime */ case 248: { struct ntp_gettime_args *p = params; @@ -5381,6 +5402,36 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* ffclock_getcounter */ + case 241: + switch(ndx) { + case 0: + p = "ffcounter *"; + break; + default: + break; + }; + break; + /* ffclock_setestimate */ + case 242: + switch(ndx) { + case 0: + p = "struct ffclock_estimate *"; + break; + default: + break; + }; + break; + /* ffclock_getestimate */ + case 243: + switch(ndx) { + case 0: + p = "struct ffclock_estimate *"; + break; + default: + break; + }; + break; /* ntp_gettime */ case 248: switch(ndx) { @@ -9398,6 +9449,21 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* ffclock_getcounter */ + case 241: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ffclock_setestimate */ + case 242: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ffclock_getestimate */ + case 243: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* ntp_gettime */ case 248: if (ndx == 0 || ndx == 1) Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/sys/syscall.h Mon Nov 21 01:26:10 2011 (r227776) @@ -216,6 +216,9 @@ #define SYS_ktimer_gettime 238 #define SYS_ktimer_getoverrun 239 #define SYS_nanosleep 240 +#define SYS_ffclock_getcounter 241 +#define SYS_ffclock_setestimate 242 +#define SYS_ffclock_getestimate 243 #define SYS_ntp_gettime 248 #define SYS_minherit 250 #define SYS_rfork 251 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/sys/syscall.mk Mon Nov 21 01:26:10 2011 (r227776) @@ -168,6 +168,9 @@ MIASM = \ ktimer_gettime.o \ ktimer_getoverrun.o \ nanosleep.o \ + ffclock_getcounter.o \ + ffclock_setestimate.o \ + ffclock_getestimate.o \ ntp_gettime.o \ minherit.o \ rfork.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/sys/sysproto.h Mon Nov 21 01:26:10 2011 (r227776) @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -726,6 +727,15 @@ struct nanosleep_args { char rqtp_l_[PADL_(const struct timespec *)]; const struct timespec * rqtp; char rqtp_r_[PADR_(const struct timespec *)]; char rmtp_l_[PADL_(struct timespec *)]; struct timespec * rmtp; char rmtp_r_[PADR_(struct timespec *)]; }; +struct ffclock_getcounter_args { + char ffcount_l_[PADL_(ffcounter *)]; ffcounter * ffcount; char ffcount_r_[PADR_(ffcounter *)]; +}; +struct ffclock_setestimate_args { + char cest_l_[PADL_(struct ffclock_estimate *)]; struct ffclock_estimate * cest; char cest_r_[PADR_(struct ffclock_estimate *)]; +}; +struct ffclock_getestimate_args { + char cest_l_[PADL_(struct ffclock_estimate *)]; struct ffclock_estimate * cest; char cest_r_[PADR_(struct ffclock_estimate *)]; +}; struct ntp_gettime_args { char ntvp_l_[PADL_(struct ntptimeval *)]; struct ntptimeval * ntvp; char ntvp_r_[PADR_(struct ntptimeval *)]; }; @@ -1894,6 +1904,9 @@ int sys_ktimer_settime(struct thread *, int sys_ktimer_gettime(struct thread *, struct ktimer_gettime_args *); int sys_ktimer_getoverrun(struct thread *, struct ktimer_getoverrun_args *); int sys_nanosleep(struct thread *, struct nanosleep_args *); +int sys_ffclock_getcounter(struct thread *, struct ffclock_getcounter_args *); +int sys_ffclock_setestimate(struct thread *, struct ffclock_setestimate_args *); +int sys_ffclock_getestimate(struct thread *, struct ffclock_getestimate_args *); int sys_ntp_gettime(struct thread *, struct ntp_gettime_args *); int sys_minherit(struct thread *, struct minherit_args *); int sys_rfork(struct thread *, struct rfork_args *); @@ -2581,6 +2594,9 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_ktimer_gettime AUE_NULL #define SYS_AUE_ktimer_getoverrun AUE_NULL #define SYS_AUE_nanosleep AUE_NULL +#define SYS_AUE_ffclock_getcounter AUE_NULL +#define SYS_AUE_ffclock_setestimate AUE_NULL +#define SYS_AUE_ffclock_getestimate AUE_NULL #define SYS_AUE_ntp_gettime AUE_NULL #define SYS_AUE_minherit AUE_MINHERIT #define SYS_AUE_rfork AUE_RFORK Modified: head/sys/sys/timeffc.h ============================================================================== --- head/sys/sys/timeffc.h Mon Nov 21 00:49:46 2011 (r227775) +++ head/sys/sys/timeffc.h Mon Nov 21 01:26:10 2011 (r227776) @@ -164,6 +164,15 @@ void ffclock_bindifftime(ffcounter ffdel void ffclock_nanodifftime(ffcounter ffdelta, struct timespec *tsp); void ffclock_microdifftime(ffcounter ffdelta, struct timeval *tvp); +#else /* !_KERNEL */ + +/* Feed-Forward Clock system calls. */ +__BEGIN_DECLS +int ffclock_getcounter(ffcounter *ffcount); +int ffclock_getestimate(struct ffclock_estimate *cest); +int ffclock_setestimate(struct ffclock_estimate *cest); +__END_DECLS + #endif /* _KERNEL */ #endif /* __BSD_VISIBLE */ #endif /* _SYS_TIMEFF_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 02:03: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 54904106566B; Mon, 21 Nov 2011 02:03:19 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 442CC8FC15; Mon, 21 Nov 2011 02:03:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL23JEa019100; Mon, 21 Nov 2011 02:03:19 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL23JX4019098; Mon, 21 Nov 2011 02:03:19 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201111210203.pAL23JX4019098@svn.freebsd.org> From: Warren Block Date: Mon, 21 Nov 2011 02:03: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: r227777 - 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: Mon, 21 Nov 2011 02:03:19 -0000 Author: wblock (doc committer) Date: Mon Nov 21 02:03:18 2011 New Revision: 227777 URL: http://svn.freebsd.org/changeset/base/227777 Log: Fix date. Approved by: gjb (mentor) MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Nov 21 01:26:10 2011 (r227776) +++ head/sbin/geom/class/part/gpart.8 Mon Nov 21 02:03:18 2011 (r227777) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2011 +.Dd November 20, 2011 .Dt GPART 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 03:37: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 60414106566C; Mon, 21 Nov 2011 03:37:13 +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 EFDBA8FC18; Mon, 21 Nov 2011 03:37:12 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAL3b2J5028494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Nov 2011 14:37:05 +1100 Date: Mon, 21 Nov 2011 14:37:02 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh In-Reply-To: <229B993A-8F52-42B3-AE87-7DB4451AA9D0@bsdimp.com> Message-ID: <20111121134538.R1108@besplex.bde.org> References: <201111200836.pAK8aIEq082864@svn.freebsd.org> <229B993A-8F52-42B3-AE87-7DB4451AA9D0@bsdimp.com> 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, Hans Petter Selasky Subject: Re: svn commit: r227749 - 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: Mon, 21 Nov 2011 03:37:13 -0000 On Sun, 20 Nov 2011, Warner Losh wrote: > Is this right? Passing 0 to timo causes a panic? That can't be good. Because it reverses the natural order of conversations. > On Nov 20, 2011, at 1:36 AM, Hans Petter Selasky wrote: >> Log: >> Given that the typical usage of pause() is pause("zzz", hz / N), where N can >> be greater than hz in some cases, simply ignore a timeout value of zero. >> >> Suggested by: Bruce Evans >> MFC after: 1 week >> >> Modified: >> head/sys/kern/kern_synch.c >> >> Modified: head/sys/kern/kern_synch.c >> ============================================================================== >> --- head/sys/kern/kern_synch.c Sun Nov 20 08:29:23 2011 (r227748) >> +++ head/sys/kern/kern_synch.c Sun Nov 20 08:36:18 2011 (r227749) >> @@ -333,7 +333,7 @@ msleep_spin(void *ident, struct mtx *mtx >> int >> pause(const char *wmesg, int timo) >> { >> - KASSERT(timo > 0, ("pause: timo must be > 0")); >> + KASSERT(timo >= 0, ("pause: timo must be >= 0")); >> >> /* silently convert invalid timeouts */ >> if (timo < 1) I tried to get Hans to remove the KASSERT() and its panic in one of my many reviews of changes to usb_pause() and pause(), but got confused in my review of this commit. I said that this commit restores the old KASSERT() which gives panics for a timeout of 0, but it actually completes changing the KASSERT() so that it doesn't give panics in this case. I got confused because the comments and the code are inconsistent in different ways than before (and KASSERT() has its usual negative logic complications): - a previous comment says, verbosely, that "the timeout must be greater than zero" - the previous KASSERT() requires, consisely, that "timo must be > 0". This was consistent with the comment. The new KASSERT() is inconsistent with the comment. - the "silently convert invalid timeouts" code, which was added on my request in the previous commit, was unreachable in all cases that it handles when INVARIANTS is configured. Now it is reachable for timeouts of 0. It remains unreachable for timeouts of < 0. The verbose previous comment is not as verbose as this mail, so it doesn't describe all the cases. timo isn't a function, so 0 can't be passed to it. Passing a timeout of 0 to various functions has various behaviours: - passing a timeout of 0 to msleep() is supported and means no timeout (= a timeout of infinity). (Negative timeouts don't seem to be properly handled by msleep(). They are neither rejected not silently fixed up, but are passed on.) - passing a timeout of 0 (or < 0) to callout_reset() makes no sense, but is not considered harmful enough the panic on. It was silently fixed up to be a timeout of 1. - passing a timeout of 0 (or < 0) to pause() makes no sense, but was considered to be harmful enough to panic on for a timeout of 0, while negative timeouts were just passed on. (pause()'s main comment says that it is like tsleep(), but it is really like DELAY(). Thus its timeout isn't really a (maximum) timeout, but is a (minimum) DELAY(). Another minor problem with the API or documentation is that it isn't clear if the caller is responsible for handling the implementation detail that pause(msg, 1) only delays for a fractional tick iff it is implemented using tsleep(); the caller must ask for a "timeout" of of 2 if it wants a delay of strictly >= 1 tick. Returning early is OK for a maximum timeout but not for a minimum delay. Non-hardware callers probably don't care about getting a minimum, but usb callers do. usb_pause() has always adds 1 tick to handle this and rounding errors.) After Hans' first change, negative timeouts were considered harmful enough to panic on too. I thought that this was silly, since pause() is unimportant compared with callout_reset() -- who cares if it is passed an invalid timeout? -- and asked him to change to the silent fixup used by callout_reset(). This is now done for timeouts of 0, but not for timeouts of < 0 in the INVARIANTS case (since the KASSERT() is still there for them). Checking for timeouts of < 0 in pause() is getting close to checking for parity errors in the CPU in pause(). msleep() is much more important, but never did either. pause() grew some additional complications that I don't like. Hans noticed that DELAY(n) overflows for large n on arm. So pause() now avoids passing large n to DELAY(). Probably no other callers of DELAY() do this, and no callers of pause() need large n for DELAY(). Why is top posting considered harmful? Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 04: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 CF082106564A; Mon, 21 Nov 2011 04:17:24 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B42318FC08; Mon, 21 Nov 2011 04:17:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL4HOJG023559; Mon, 21 Nov 2011 04:17:24 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL4HOdi023556; Mon, 21 Nov 2011 04:17:24 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111210417.pAL4HOdi023556@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 21 Nov 2011 04: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: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 04:17:25 -0000 Author: lstewart Date: Mon Nov 21 04:17:24 2011 New Revision: 227778 URL: http://svn.freebsd.org/changeset/base/227778 Log: - When feed-forward clock support is compiled in, change the BPF header to contain both a regular timestamp obtained from the system clock and the current feed-forward ffcounter value. This enables new possibilities including comparison of timekeeping performance and timestamp correction during post processing. - Add the net.bpf.ffclock_tstamp sysctl to provide a choice between timestamping packets using the feedback or feed-forward system clock. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au) Modified: head/sys/net/bpf.c head/sys/net/bpf.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon Nov 21 02:03:18 2011 (r227777) +++ head/sys/net/bpf.c Mon Nov 21 04:17:24 2011 (r227778) @@ -1,12 +1,17 @@ /*- * Copyright (c) 1990, 1991, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. + * Copyright (c) 2011 The FreeBSD Foundation. + * All rights reserved. * * This code is derived from the Stanford/CMU enet packet filter, * (net/enet.c) distributed as part of 4.3BSD, and code contributed * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence * Berkeley Laboratory. * + * Portions of this software were developed by Julien Ridoux at the University + * of Melbourne under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -39,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" #include "opt_compat.h" +#include "opt_ffclock.h" #include "opt_netgraph.h" #include @@ -55,6 +61,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef FFCLOCK +#include +#endif #include #include @@ -90,8 +99,13 @@ MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); #define PRINET 26 /* interruptible */ +#ifdef FFCLOCK +#define SIZEOF_BPF_HDR(type) \ + (offsetof(type, ffcount_stamp) + sizeof(((type *)0)->ffcount_stamp)) +#else #define SIZEOF_BPF_HDR(type) \ (offsetof(type, bh_hdrlen) + sizeof(((type *)0)->bh_hdrlen)) +#endif #ifdef COMPAT_FREEBSD32 #include @@ -111,6 +125,9 @@ struct bpf_hdr32 { uint32_t bh_datalen; /* original length of packet */ uint16_t bh_hdrlen; /* length of bpf header (this struct plus alignment padding) */ +#ifdef FFCLOCK + ffcounter ffcount_stamp; /* ffcounter timestamp of packet */ +#endif }; #endif @@ -151,9 +168,16 @@ static int bpf_setif(struct bpf_d *, str static void bpf_timed_out(void *); static __inline void bpf_wakeup(struct bpf_d *); +#ifdef FFCLOCK +static void catchpacket(struct bpf_d *, u_char *, unsigned int, + unsigned int, void (*)(struct bpf_d *, caddr_t, + unsigned int, void *, unsigned int), struct bintime *, + ffcounter *); +#else static void catchpacket(struct bpf_d *, u_char *, u_int, u_int, void (*)(struct bpf_d *, caddr_t, u_int, void *, u_int), struct bintime *); +#endif static void reset_d(struct bpf_d *); static int bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd); static int bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *); @@ -172,6 +196,12 @@ SYSCTL_INT(_net_bpf, OID_AUTO, zerocopy_ &bpf_zerocopy_enable, 0, "Enable new zero-copy BPF buffer sessions"); static SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_MPSAFE | CTLFLAG_RW, bpf_stats_sysctl, "bpf statistics portal"); +#ifdef FFCLOCK +static int bpf_ffclock_tstamp = 0; +SYSCTL_INT(_net_bpf, OID_AUTO, ffclock_tstamp, CTLFLAG_RW, + &bpf_ffclock_tstamp, 0, + "Set BPF to timestamp using Feed-Forward clock by default"); +#endif static d_open_t bpfopen; static d_read_t bpfread; @@ -698,6 +728,15 @@ bpfopen(struct cdev *dev, int flags, int callout_init_mtx(&d->bd_callout, &d->bd_mtx, 0); knlist_init_mtx(&d->bd_sel.si_note, &d->bd_mtx); +#ifdef FFCLOCK + /* + * Set the timestamping mode for this device, i.e. which clock is used. + * The default option is to use the feedback/ntpd system clock. + */ + if (bpf_ffclock_tstamp) + d->bd_tstamp = d->bd_tstamp | BPF_T_FFCLOCK; +#endif + return (0); } @@ -1776,8 +1815,13 @@ bpf_ts_quality(int tstype) return (BPF_TSTAMP_NORMAL); } +#ifdef FFCLOCK +static int +bpf_gettime(struct bintime *bt, ffcounter *ffcount, int tstype, struct mbuf *m) +#else static int bpf_gettime(struct bintime *bt, int tstype, struct mbuf *m) +#endif { struct m_tag *tag; int quality; @@ -1793,11 +1837,31 @@ bpf_gettime(struct bintime *bt, int tsty return (BPF_TSTAMP_EXTERN); } } - if (quality == BPF_TSTAMP_NORMAL) - binuptime(bt); - else - getbinuptime(bt); - + if (quality == BPF_TSTAMP_NORMAL) { +#ifdef FFCLOCK + if ((tstype & BPF_T_FFCLOCK) == 0) { + ffclock_read_counter(ffcount); +#endif + binuptime(bt); +#ifdef FFCLOCK + } else { + if ((tstype & BPF_T_MONOTONIC) == 0) + ffclock_abstime(ffcount, bt, NULL, + (FFCLOCK_LERP | FFCLOCK_LEAPSEC)); + else + ffclock_abstime(ffcount, bt, NULL, + (FFCLOCK_LERP | FFCLOCK_UPTIME)); + } +#endif + } else { +#ifdef FFCLOCK + if ((tstype & BPF_T_FFCLOCK) == BPF_T_FFCLOCK) + ffclock_abstime(ffcount, bt, NULL, + (FFCLOCK_LERP | FFCLOCK_LEAPSEC | FFCLOCK_FAST)); + else +#endif + getbinuptime(bt); + } return (quality); } @@ -1817,6 +1881,9 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, #endif u_int slen; int gottime; +#ifdef FFCLOCK + ffcounter ffcount; +#endif gottime = BPF_TSTAMP_NONE; BPFIF_LOCK(bp); @@ -1838,13 +1905,24 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, slen = bpf_filter(d->bd_rfilter, pkt, pktlen, pktlen); if (slen != 0) { d->bd_fcount++; - if (gottime < bpf_ts_quality(d->bd_tstamp)) + if (gottime < bpf_ts_quality(d->bd_tstamp)) { +#ifdef FFCLOCK + gottime = bpf_gettime(&bt, &ffcount, + d->bd_tstamp, NULL); +#else gottime = bpf_gettime(&bt, d->bd_tstamp, NULL); +#endif + } #ifdef MAC if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0) #endif +#ifdef FFCLOCK + catchpacket(d, pkt, pktlen, slen, + bpf_append_bytes, &bt, &ffcount); +#else catchpacket(d, pkt, pktlen, slen, bpf_append_bytes, &bt); +#endif } BPFD_UNLOCK(d); } @@ -1868,6 +1946,9 @@ bpf_mtap(struct bpf_if *bp, struct mbuf #endif u_int pktlen, slen; int gottime; +#ifdef FFCLOCK + ffcounter ffcount; +#endif /* Skip outgoing duplicate packets. */ if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) { @@ -1895,12 +1976,24 @@ bpf_mtap(struct bpf_if *bp, struct mbuf if (slen != 0) { d->bd_fcount++; if (gottime < bpf_ts_quality(d->bd_tstamp)) + { +#ifdef FFCLOCK + gottime = bpf_gettime(&bt, &ffcount, + d->bd_tstamp, m); +#else gottime = bpf_gettime(&bt, d->bd_tstamp, m); +#endif + } #ifdef MAC if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0) #endif +#ifdef FFCLOCK + catchpacket(d, (u_char *)m, pktlen, slen, + bpf_append_mbuf, &bt, &ffcount); +#else catchpacket(d, (u_char *)m, pktlen, slen, bpf_append_mbuf, &bt); +#endif } BPFD_UNLOCK(d); } @@ -1919,6 +2012,9 @@ bpf_mtap2(struct bpf_if *bp, void *data, struct bpf_d *d; u_int pktlen, slen; int gottime; +#ifdef FFCLOCK + ffcounter ffcount; +#endif /* Skip outgoing duplicate packets. */ if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) { @@ -1948,12 +2044,24 @@ bpf_mtap2(struct bpf_if *bp, void *data, if (slen != 0) { d->bd_fcount++; if (gottime < bpf_ts_quality(d->bd_tstamp)) + { +#ifdef FFCLOCK + gottime = bpf_gettime(&bt, &ffcount, + d->bd_tstamp, m); +#else gottime = bpf_gettime(&bt, d->bd_tstamp, m); +#endif + } #ifdef MAC if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0) #endif +#ifdef FFCLOCK + catchpacket(d, (u_char *)m, pktlen, slen, + bpf_append_mbuf, &bt, &ffcount); +#else catchpacket(d, (u_char *)&mb, pktlen, slen, bpf_append_mbuf, &bt); +#endif } BPFD_UNLOCK(d); } @@ -2002,11 +2110,17 @@ bpf_bintime2ts(struct bintime *bt, struc struct timeval tsm; struct timespec tsn; - if ((tstype & BPF_T_MONOTONIC) == 0) { - bt2 = *bt; - bintime_add(&bt2, &boottimebin); - bt = &bt2; +#ifdef FFCLOCK + if ((tstype & BPF_T_FFCLOCK) == 0) { +#endif + if ((tstype & BPF_T_MONOTONIC) == 0) { + bt2 = *bt; + bintime_add(&bt2, &boottimebin); + bt = &bt2; + } +#ifdef FFCLOCK } +#endif switch (BPF_T_FORMAT(tstype)) { case BPF_T_MICROTIME: bintime2timeval(bt, &tsm); @@ -2032,10 +2146,17 @@ bpf_bintime2ts(struct bintime *bt, struc * bpf_append_mbuf is passed in to copy mbuf chains. In the latter case, * pkt is really an mbuf. */ +#ifdef FFCLOCK +static void +catchpacket(struct bpf_d *d, u_char *pkt, unsigned int pktlen, + unsigned int snaplen, void (*cpfn)(struct bpf_d *, caddr_t, unsigned int, + void *, unsigned int), struct bintime *bt, ffcounter *ffcount) +#else static void catchpacket(struct bpf_d *d, u_char *pkt, u_int pktlen, u_int snaplen, void (*cpfn)(struct bpf_d *, caddr_t, u_int, void *, u_int), struct bintime *bt) +#endif { struct bpf_xhdr hdr; #ifndef BURN_BRIDGES @@ -2123,6 +2244,9 @@ catchpacket(struct bpf_d *d, u_char *pkt if (d->bd_compat32) { bzero(&hdr32_old, sizeof(hdr32_old)); if (do_timestamp) { +#ifdef FFCLOCK + hdr32_old.ffcount_stamp = *ffcount; +#endif hdr32_old.bh_tstamp.tv_sec = ts.bt_sec; hdr32_old.bh_tstamp.tv_usec = ts.bt_frac; } @@ -2136,6 +2260,9 @@ catchpacket(struct bpf_d *d, u_char *pkt #endif bzero(&hdr_old, sizeof(hdr_old)); if (do_timestamp) { +#ifdef FFCLOCK + hdr_old.ffcount_stamp = *ffcount; +#endif hdr_old.bh_tstamp.tv_sec = ts.bt_sec; hdr_old.bh_tstamp.tv_usec = ts.bt_frac; } @@ -2154,7 +2281,12 @@ catchpacket(struct bpf_d *d, u_char *pkt */ bzero(&hdr, sizeof(hdr)); if (do_timestamp) + { +#ifdef FFCLOCK + hdr.ffcount_stamp = *ffcount; +#endif bpf_bintime2ts(bt, &hdr.bh_tstamp, tstype); + } hdr.bh_datalen = pktlen; hdr.bh_hdrlen = hdrlen; hdr.bh_caplen = caplen; Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon Nov 21 02:03:18 2011 (r227777) +++ head/sys/net/bpf.h Mon Nov 21 04:17:24 2011 (r227778) @@ -1,12 +1,17 @@ /*- * Copyright (c) 1990, 1991, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. * * This code is derived from the Stanford/CMU enet packet filter, * (net/enet.c) distributed as part of 4.3BSD, and code contributed * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence * Berkeley Laboratory. * + * Portions of this software were developed by Julien Ridoux at the University + * of Melbourne under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -170,11 +175,21 @@ enum bpf_direction { #define BPF_T_MONOTONIC 0x0200 #define BPF_T_MONOTONIC_FAST (BPF_T_FAST | BPF_T_MONOTONIC) #define BPF_T_FLAG_MASK 0x0300 +#ifdef FFCLOCK +#define BPF_T_FFCLOCK 0x8000 +#define BPF_T_CLOCK_MASK 0x8000 +#endif #define BPF_T_FORMAT(t) ((t) & BPF_T_FORMAT_MASK) #define BPF_T_FLAG(t) ((t) & BPF_T_FLAG_MASK) +#ifdef FFCLOCK +#define BPF_T_VALID(t) \ + ((t) == BPF_T_NONE || (BPF_T_FORMAT(t) != BPF_T_NONE && \ + ((t) & ~(BPF_T_FORMAT_MASK | BPF_T_FLAG_MASK | BPF_T_CLOCK_MASK)) == 0)) +#else #define BPF_T_VALID(t) \ ((t) == BPF_T_NONE || (BPF_T_FORMAT(t) != BPF_T_NONE && \ ((t) & ~(BPF_T_FORMAT_MASK | BPF_T_FLAG_MASK)) == 0)) +#endif #define BPF_T_MICROTIME_FAST (BPF_T_MICROTIME | BPF_T_FAST) #define BPF_T_NANOTIME_FAST (BPF_T_NANOTIME | BPF_T_FAST) @@ -199,6 +214,9 @@ struct bpf_xhdr { bpf_u_int32 bh_datalen; /* original length of packet */ u_short bh_hdrlen; /* length of bpf header (this struct plus alignment padding) */ +#ifdef FFCLOCK + ffcounter ffcount_stamp; /* feed-forward counter timestamp */ +#endif }; /* Obsolete */ struct bpf_hdr { @@ -207,6 +225,9 @@ struct bpf_hdr { bpf_u_int32 bh_datalen; /* original length of packet */ u_short bh_hdrlen; /* length of bpf header (this struct plus alignment padding) */ +#ifdef FFCLOCK + ffcounter ffcount_stamp; /* feed-forward counter timestamp */ +#endif }; #ifdef _KERNEL #define MTAG_BPF 0x627066 From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 04:35: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 0F92D106566B; Mon, 21 Nov 2011 04:35: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 F2E688FC0A; Mon, 21 Nov 2011 04:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL4ZN4M024154; Mon, 21 Nov 2011 04:35:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL4ZNdh024152; Mon, 21 Nov 2011 04:35:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201111210435.pAL4ZNdh024152@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 21 Nov 2011 04:35: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: r227779 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 04:35:24 -0000 Author: nwhitehorn Date: Mon Nov 21 04:35:23 2011 New Revision: 227779 URL: http://svn.freebsd.org/changeset/base/227779 Log: The PPC IRQ layer assumes that the IPI IRQ is the last IRQ on the PIC. This assumption is invalid and the code should be fixed, but humor it for now and set the "IPI" for PS3s in the non-SMP case to a large number. This fixes boot with a non-SMP kernel. Submitted by: geoffrey dot levand at mail dot ru MFC after: 1 week Modified: head/sys/powerpc/ps3/ps3pic.c Modified: head/sys/powerpc/ps3/ps3pic.c ============================================================================== --- head/sys/powerpc/ps3/ps3pic.c Mon Nov 21 04:17:24 2011 (r227778) +++ head/sys/powerpc/ps3/ps3pic.c Mon Nov 21 04:35:23 2011 (r227779) @@ -142,6 +142,8 @@ ps3pic_attach(device_t dev) lv1_construct_event_receive_port(&sc->sc_ipi_outlet[1]); lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_outlet[0], sc->sc_ipi_outlet[1], 0); +#else + sc->sc_ipi_outlet[0] = sc->sc_ipi_outlet[1] = 63; #endif powerpc_register_pic(dev, 0, sc->sc_ipi_outlet[0], 1, FALSE); From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 05:12: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 C16A0106566C; Mon, 21 Nov 2011 05:12:34 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5B2898FC17; Mon, 21 Nov 2011 05:12:33 +0000 (UTC) Received: by yenl11 with SMTP id l11so6189253yen.13 for ; Sun, 20 Nov 2011 21:12:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=j++teZ/4UiISzubH6gq1Ut2BmhQ/OXmY5vZE7oBjeN0=; b=CD0t1qq9nxqeVe4iHSxS+T1jiK2iaDZ5254MY80hhUfCHC6gBBVXBTA2jw8n/xXsYR QB0fpbN/eB2VXThstLjoNHlew4PDcW63lJIOLT1uiH68tntHjbUeunY0PXothRmbmprl cVhrKJDcjUgusbwWcD4etyoOGiqqpP0oslgHY= MIME-Version: 1.0 Received: by 10.236.174.2 with SMTP id w2mr17077429yhl.35.1321852352674; Sun, 20 Nov 2011 21:12:32 -0800 (PST) Received: by 10.236.110.174 with HTTP; Sun, 20 Nov 2011 21:12:32 -0800 (PST) In-Reply-To: <201111210417.pAL4HOdi023556@svn.freebsd.org> References: <201111210417.pAL4HOdi023556@svn.freebsd.org> Date: Mon, 21 Nov 2011 00:12:32 -0500 Message-ID: From: Ben Kaduk To: Lawrence Stewart 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: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 05:12:34 -0000 On Sun, Nov 20, 2011 at 11:17 PM, Lawrence Stewart w= rote: > Author: lstewart > Date: Mon Nov 21 04:17:24 2011 > New Revision: 227778 > URL: http://svn.freebsd.org/changeset/base/227778 > > Log: > =A0- When feed-forward clock support is compiled in, change the BPF heade= r to > =A0 =A0contain both a regular timestamp obtained from the system clock an= d the > =A0 =A0current feed-forward ffcounter value. This enables new possibiliti= es including Is it really necessary to make the ABI dependent on a kernel configuration option? This causes all sorts of headaches if loadable modules ever want to use that ABI, something that we just ran into with vm_page_t and friends and had a long thread on -current about. -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 05:55: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 2C1521065674; Mon, 21 Nov 2011 05:55:44 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id E2AE48FC13; Mon, 21 Nov 2011 05:55:43 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 93F8D7E8C8; Mon, 21 Nov 2011 16:39:20 +1100 (EST) Message-ID: <4EC9E408.9000304@freebsd.org> Date: Mon, 21 Nov 2011 16:39:20 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111006 Thunderbird/7.0.1 MIME-Version: 1.0 To: Ben Kaduk References: <201111210417.pAL4HOdi023556@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Julien Ridoux Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 05:55:44 -0000 On 11/21/11 16:12, Ben Kaduk wrote: > On Sun, Nov 20, 2011 at 11:17 PM, Lawrence Stewart wrote: >> Author: lstewart >> Date: Mon Nov 21 04:17:24 2011 >> New Revision: 227778 >> URL: http://svn.freebsd.org/changeset/base/227778 >> >> Log: >> - When feed-forward clock support is compiled in, change the BPF header to >> contain both a regular timestamp obtained from the system clock and the >> current feed-forward ffcounter value. This enables new possibilities including > > Is it really necessary to make the ABI dependent on a kernel > configuration option? This causes all sorts of headaches if loadable > modules ever want to use that ABI, something that we just ran into > with vm_page_t and friends and had a long thread on -current about. Fair question. Julien, if pcap and other consumers will happily ignore the new ffcount_stamp member in the bpf header, is there any reason to conditionally add the ffcounter into the header struct? Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 06:37: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 C5004106564A; Mon, 21 Nov 2011 06:37:20 +0000 (UTC) (envelope-from jrid@cubinlab.ee.unimelb.edu.au) Received: from mail-gw2.its.unimelb.edu.au (mail-gw2.its.unimelb.edu.au [128.250.5.151]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6A08FC0A; Mon, 21 Nov 2011 06:37:20 +0000 (UTC) Received: from emu.cubinlab.ee.unimelb.edu.au (cubinlab.ee.unimelb.edu.au [128.250.80.33]) by mail-gw2.its.unimelb.edu.au (Postfix) with ESMTPS id 8AE80541; Mon, 21 Nov 2011 17:18:52 +1100 (EST) Received: from jrid.cubinlab.ee.unimelb.edu.au (jrid.cubinlab.ee.unimelb.edu.au [10.0.1.128]) (authenticated bits=0) by emu.cubinlab.ee.unimelb.edu.au (8.14.4/8.14.4) with ESMTP id pAL6In3I005096 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 21 Nov 2011 17:18:50 +1100 (EST) (envelope-from jrid@cubinlab.ee.unimelb.edu.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Julien Ridoux In-Reply-To: <4EC9E408.9000304@freebsd.org> Date: Mon, 21 Nov 2011 17:18:48 +1100 Content-Transfer-Encoding: quoted-printable Message-Id: <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <4EC9E408.9000304@freebsd.org> To: Lawrence Stewart X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 06:37:20 -0000 On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: > On 11/21/11 16:12, Ben Kaduk wrote: >> On Sun, Nov 20, 2011 at 11:17 PM, Lawrence = Stewart wrote: >>> Author: lstewart >>> Date: Mon Nov 21 04:17:24 2011 >>> New Revision: 227778 >>> URL: http://svn.freebsd.org/changeset/base/227778 >>>=20 >>> Log: >>> - When feed-forward clock support is compiled in, change the BPF = header to >>> contain both a regular timestamp obtained from the system clock = and the >>> current feed-forward ffcounter value. This enables new = possibilities including >>=20 >> Is it really necessary to make the ABI dependent on a kernel >> configuration option? This causes all sorts of headaches if loadable >> modules ever want to use that ABI, something that we just ran into >> with vm_page_t and friends and had a long thread on -current about. >=20 > Fair question. Julien, if pcap and other consumers will happily ignore = the new ffcount_stamp member in the bpf header, is there any reason to = conditionally add the ffcounter into the header struct? It is a valid question indeed. The feedback I have received so far was = to not have the feed-forward clock support be a default kernel = configuration option. What follows is based on this assumption. The commit (r227747) introduces sysctl that are conditioned by the same = "FFCLOCK" kernel configuration option. If a loadable module tests for = the presence of this sysctl, it will know if the ffcount_stamp member is = available. Is it too much of a hack? Alternatively, if the ffcounter is added to the bpf header = unconditionally, the ffcount_stamp member can be set to 0. Loadable = modules will then see a consistent ABI but will retrieve a meaningless = value. I am not sure which option makes more sense, any preference? Cheers, Julien= From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 06:45: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 E2F5C1065672; Mon, 21 Nov 2011 06:45:12 +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 D2F098FC1A; Mon, 21 Nov 2011 06:45:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL6jC45028219; Mon, 21 Nov 2011 06:45:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL6jCPR028217; Mon, 21 Nov 2011 06:45:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111210645.pAL6jCPR028217@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Nov 2011 06:45: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: r227780 - head/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: Mon, 21 Nov 2011 06:45:13 -0000 Author: adrian Date: Mon Nov 21 06:45:12 2011 New Revision: 227780 URL: http://svn.freebsd.org/changeset/base/227780 Log: Always leave the -current kernel debugging options on. Modified: head/sys/mips/conf/AR91XX_BASE Modified: head/sys/mips/conf/AR91XX_BASE ============================================================================== --- head/sys/mips/conf/AR91XX_BASE Mon Nov 21 04:35:23 2011 (r227779) +++ head/sys/mips/conf/AR91XX_BASE Mon Nov 21 06:45:12 2011 (r227780) @@ -35,16 +35,15 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po # options NFS_LEGACYRPC # Debugging for use in -current -# options INVARIANTS -# options INVARIANT_SUPPORT -# options WITNESS -# options WITNESS_SKIPSPIN +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS +options WITNESS_SKIPSPIN options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories - # Wireless NIC cards options IEEE80211_DEBUG options IEEE80211_SUPPORT_MESH From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 07:02: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 B951B106566C; Mon, 21 Nov 2011 07:02:25 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3BD3C8FC0A; Mon, 21 Nov 2011 07:02:24 +0000 (UTC) Received: by yenl11 with SMTP id l11so6277046yen.13 for ; Sun, 20 Nov 2011 23:02:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=1LveNBb5N6MA3gsb2FzKFE/zthxXOHHGhEzdcddirR4=; b=fN9cFDS6WItxDs1PdXtbNxD8YzxCPZdBuaoC1cV+sQkg5vPqR9+JcplM+Vazd5DtP3 0+0z7fs8KZTVzvHA8DGUWxQa2HoieUel3+SO3Hu+ofsIBagbUOp6VYWcjVs8DEBgIWQc QNFsy3FlVtYGXxx4aNyx/g7bNWEHCJvvtIcYc= MIME-Version: 1.0 Received: by 10.182.59.49 with SMTP id w17mr2705206obq.37.1321858944508; Sun, 20 Nov 2011 23:02:24 -0800 (PST) Received: by 10.182.7.34 with HTTP; Sun, 20 Nov 2011 23:02:24 -0800 (PST) In-Reply-To: <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <4EC9E408.9000304@freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> Date: Sun, 20 Nov 2011 23:02:24 -0800 Message-ID: From: Garrett Cooper To: Julien Ridoux Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Lawrence Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 07:02:25 -0000 On Sun, Nov 20, 2011 at 10:18 PM, Julien Ridoux wrote: > > On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: > >> On 11/21/11 16:12, Ben Kaduk wrote: >>> On Sun, Nov 20, 2011 at 11:17 PM, Lawrence Stewart =A0wrote: >>>> Author: lstewart >>>> Date: Mon Nov 21 04:17:24 2011 >>>> New Revision: 227778 >>>> URL: http://svn.freebsd.org/changeset/base/227778 >>>> >>>> Log: >>>> =A0- When feed-forward clock support is compiled in, change the BPF he= ader to >>>> =A0 =A0contain both a regular timestamp obtained from the system clock= and the >>>> =A0 =A0current feed-forward ffcounter value. This enables new possibil= ities including >>> >>> Is it really necessary to make the ABI dependent on a kernel >>> configuration option? =A0This causes all sorts of headaches if loadable >>> modules ever want to use that ABI, something that we just ran into >>> with vm_page_t and friends and had a long thread on -current about. >> >> Fair question. Julien, if pcap and other consumers will happily ignore t= he new ffcount_stamp member in the bpf header, is there any reason to condi= tionally add the ffcounter into the header struct? > > It is a valid question indeed. The feedback I have received so far was to= not have the feed-forward clock support be a default kernel configuration = option. What follows is based on this assumption. > > The commit (r227747) introduces sysctl that are conditioned by the same "= FFCLOCK" kernel configuration option. If a loadable module tests for the pr= esence of this sysctl, it will know if the ffcount_stamp member is availabl= e. Is it too much of a hack? > > Alternatively, if the ffcounter is added to the bpf header unconditionall= y, the ffcount_stamp member can be set to 0. Loadable modules will then see= a consistent ABI but will retrieve a meaningless value. > > I am not sure which option makes more sense, any preference? struct inaddr, etc withstood sizing restrictions by adjusting the sin_family / sin_len values appropriate to how large the payload was made.. Could something similar be done for the ffcounter work (obscure behind a void* pointer, use a proper bitwise ORed value for the sin_len and sin_family, etc)? Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 07:28: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 1470E106564A; Mon, 21 Nov 2011 07:28:13 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id C8F7C8FC12; Mon, 21 Nov 2011 07:28:12 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 78AE17E820; Mon, 21 Nov 2011 18:28:10 +1100 (EST) Message-ID: <4EC9FD8A.5040401@freebsd.org> Date: Mon, 21 Nov 2011 18:28:10 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111006 Thunderbird/7.0.1 MIME-Version: 1.0 To: Julien Ridoux References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <4EC9E408.9000304@freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> In-Reply-To: <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ben Kaduk Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 07:28:13 -0000 On 11/21/11 17:18, Julien Ridoux wrote: > > On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: > >> On 11/21/11 16:12, Ben Kaduk wrote: >>> On Sun, Nov 20, 2011 at 11:17 PM, Lawrence >>> Stewart wrote: >>>> Author: lstewart Date: Mon Nov 21 04:17:24 2011 New Revision: >>>> 227778 URL: http://svn.freebsd.org/changeset/base/227778 >>>> >>>> Log: - When feed-forward clock support is compiled in, change >>>> the BPF header to contain both a regular timestamp obtained >>>> from the system clock and the current feed-forward ffcounter >>>> value. This enables new possibilities including >>> >>> Is it really necessary to make the ABI dependent on a kernel >>> configuration option? This causes all sorts of headaches if >>> loadable modules ever want to use that ABI, something that we >>> just ran into with vm_page_t and friends and had a long thread on >>> -current about. >> >> Fair question. Julien, if pcap and other consumers will happily >> ignore the new ffcount_stamp member in the bpf header, is there any >> reason to conditionally add the ffcounter into the header struct? > > It is a valid question indeed. The feedback I have received so far > was to not have the feed-forward clock support be a default kernel > configuration option. What follows is based on this assumption. > > The commit (r227747) introduces sysctl that are conditioned by the > same "FFCLOCK" kernel configuration option. If a loadable module > tests for the presence of this sysctl, it will know if the > ffcount_stamp member is available. Is it too much of a hack? > > Alternatively, if the ffcounter is added to the bpf header > unconditionally, the ffcount_stamp member can be set to 0. Loadable > modules will then see a consistent ABI but will retrieve a > meaningless value. > > I am not sure which option makes more sense, any preference? If I understand the issues correctly, I think the appropriate path forward is to remove the conditional change to the bpf header and have ffcount_stamp become a permanent member of the struct. We'll just leave the member uninitialised in the !FFCLOCK case. This change will make the patch un-MFCable, but I think that's ok. As to the issue of how a kernel module would detect if it's being loaded into a FFCLOCK enabled kernel, why wouldn't we expect modules to "#include opt_ffclock.h" and conditionally compile code based on FFCLOCK being defined? Is there a use case for run-time (as opposed to compile-time) module detection of feed-forward clock capabilities? Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 07:29: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 E8CD11065670; Mon, 21 Nov 2011 07:29:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 83E498FC13; Mon, 21 Nov 2011 07:29:11 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAL7T6jY001458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Nov 2011 18:29:08 +1100 Date: Mon, 21 Nov 2011 18:29:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker In-Reply-To: <20111109203528.GA29992@stack.nl> Message-ID: <20111121181134.A882@besplex.bde.org> References: <201111082354.pA8NsdhP055080@svn.freebsd.org> <20111109083545.GC1598@mole.fafoe.narf.at> <20111109203528.GA29992@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder , src-committers@freebsd.org Subject: Re: svn commit: r227369 - 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, 21 Nov 2011 07:29:12 -0000 On Wed, 9 Nov 2011, Jilles Tjoelker wrote: > On Wed, Nov 09, 2011 at 09:35:51AM +0100, Stefan Farfeleder wrote: >> On Tue, Nov 08, 2011 at 11:54:39PM +0000, Jilles Tjoelker wrote: >>> Author: jilles >>> Date: Tue Nov 8 23:54:39 2011 >>> New Revision: 227369 >>> URL: http://svn.freebsd.org/changeset/base/227369 > >>> Log: >>> sh: Remove undefined behaviour due to overflow in +/-/* in arithmetic. > >>> With i386 base gcc and i386 base clang, arith_yacc.o remains unchanged. > >>> Modified: >>> head/bin/sh/arith_yacc.c > >>> Modified: head/bin/sh/arith_yacc.c >>> ============================================================================== >>> --- head/bin/sh/arith_yacc.c Tue Nov 8 23:44:26 2011 (r227368) >>> +++ head/bin/sh/arith_yacc.c Tue Nov 8 23:54:39 2011 (r227369) >>> @@ -131,11 +131,11 @@ static arith_t do_binop(int op, arith_t >>> yyerror("divide error"); >>> return op == ARITH_REM ? a % b : a / b; >>> case ARITH_MUL: >>> - return a * b; >>> + return (uintmax_t)a * (uintmax_t)b; >>> case ARITH_ADD: >>> - return a + b; >>> + return (uintmax_t)a + (uintmax_t)b; >>> case ARITH_SUB: >>> - return a - b; >>> + return (uintmax_t)a - (uintmax_t)b; >>> case ARITH_LSHIFT: >>> return a << b; >>> case ARITH_RSHIFT: > >> Isn't the behaviour undefined too when you convert an out-of-range >> uintmax_t value back into an intmax_t value? > > The result is implementation-defined or an implementation-defined signal > is raised. C doesn't allow any signal, at least in C90 and n869.txt draft C99: % 6.3.1.3 Signed and unsigned integers % ... % [#3] Otherwise, the new type is signed and the value cannot % be represented in it; the result is implementation-defined. % J.3 Implementation-defined behavior % ... % J.3.5 Integers % % [#1] % ... % -- The result of converting an integer to a signed integer % type when the value cannot be represented in an object % of that type (6.3.1.3). n869.txt barely mentions signals, especially here. Its only literal match for "signal raised" is in Annex H for LIA, which says that if an arithmetic exception raises a signal, then the signal shall be SIGFPE, and this is mainly for floating point. It has many more literal matches for "exception raised", since Annex F for IEEE754 requires exceptions to be raised a lot; these exceptions normally don't generate signals. > GCC documentation (gcc.info 4.5 Integers implementation) says this > > ] * `The result of, or the signal raised by, converting an integer to a > ] signed integer type when the value cannot be represented in an > ] object of that type (C90 6.2.1.2, C99 6.3.1.3).' ", or the signal raised by, " in this seems to be a bug in gcc documentation. The documentation of implementation-defined behaviour shouldn't mention that specifed behaviour is implemented, at least without distinguishing the part that is as specified. > > ] For conversion to a type of width N, the value is reduced modulo > ] 2^N to be within range of the type; no signal is raised. > > which is exactly what we need. Of course, a correct implementation would give a random result, so that no one depends on implementation-defined behaviour. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 07:50: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 D062E106566C; Mon, 21 Nov 2011 07:50:29 +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 BFC4C8FC17; Mon, 21 Nov 2011 07:50:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL7oTg4030324; Mon, 21 Nov 2011 07:50:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL7oTBj030321; Mon, 21 Nov 2011 07:50:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111210750.pAL7oTBj030321@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 21 Nov 2011 07:50: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: r227781 - in head/sys/dev/usb: . wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 07:50:29 -0000 Author: hselasky Date: Mon Nov 21 07:50:29 2011 New Revision: 227781 URL: http://svn.freebsd.org/changeset/base/227781 Log: Add new USB IDs to RUN driver. PR: usb/162712 MFC after: 1 week Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Nov 21 06:45:12 2011 (r227780) +++ head/sys/dev/usb/usbdevs Mon Nov 21 07:50:29 2011 (r227781) @@ -2086,6 +2086,7 @@ product LINKSYS4 RT3070 0x0078 RT3070 product LINKSYS4 WUSB600NV2 0x0079 WUSB600N v2 /* Logitech products */ +product LOGITECH LANW300NU2 0x0166 LAN-W300N/U2 product LOGITECH M2452 0x0203 M2452 keyboard product LOGITECH M4848 0x0301 M4848 mouse product LOGITECH PAGESCAN 0x040f PageScan @@ -2182,6 +2183,7 @@ product MELCO RT2870_1 0x0148 RT2870 product MELCO RT2870_2 0x0150 RT2870 product MELCO WLIUCGN 0x015d WLI-UC-GN product MELCO WLIUCG301N 0x016f WLI-UC-G301N +product MELCO WLIUCGNM 0x01a2 WLI-UC-GNM /* Merlin products */ product MERLIN V620 0x1110 Merlin V620 Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Mon Nov 21 06:45:12 2011 (r227780) +++ head/sys/dev/usb/wlan/if_run.c Mon Nov 21 07:50:29 2011 (r227781) @@ -208,12 +208,14 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(LOGITEC, RT2870_1), RUN_DEV(LOGITEC, RT2870_2), RUN_DEV(LOGITEC, RT2870_3), + RUN_DEV(LOGITECH, LANW300NU2), RUN_DEV(MELCO, RT2870_1), RUN_DEV(MELCO, RT2870_2), RUN_DEV(MELCO, WLIUCAG300N), RUN_DEV(MELCO, WLIUCG300N), RUN_DEV(MELCO, WLIUCG301N), RUN_DEV(MELCO, WLIUCGN), + RUN_DEV(MELCO, WLIUCGNM), RUN_DEV(MOTOROLA4, RT2770), RUN_DEV(MOTOROLA4, RT3070), RUN_DEV(MSI, RT3070_1), From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 07: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 BE3E6106564A; Mon, 21 Nov 2011 07:55:37 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADD748FC13; Mon, 21 Nov 2011 07:55:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL7tbI7030530; Mon, 21 Nov 2011 07:55:37 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL7tbjR030528; Mon, 21 Nov 2011 07:55:37 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111210755.pAL7tbjR030528@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 21 Nov 2011 07:55: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: r227782 - head/sys/mips/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, 21 Nov 2011 07:55:37 -0000 Author: jchandra Date: Mon Nov 21 07:55:37 2011 New Revision: 227782 URL: http://svn.freebsd.org/changeset/base/227782 Log: XLP processors have the release 2 pagegrain register Add accessors to cpufunc.h Obtained from: prabhath at netlogicmicro com Modified: head/sys/mips/include/cpufunc.h Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Mon Nov 21 07:50:29 2011 (r227781) +++ head/sys/mips/include/cpufunc.h Mon Nov 21 07:55:37 2011 (r227782) @@ -272,6 +272,9 @@ MIPS_RW32_COP0(status, MIPS_COP_0_STATUS MIPS_RW32_COP0(entryhi, MIPS_COP_0_TLB_HI); MIPS_RW32_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); #endif +#ifdef CPU_NLM +MIPS_RW32_COP0_SEL(pagegrain, MIPS_COP_0_TLB_PG_MASK, 1); +#endif #if !defined(__mips_n64) && !defined(__mips_n32) /* !PHYSADDR_64_BIT */ MIPS_RW32_COP0(entrylo0, MIPS_COP_0_TLB_LO0); MIPS_RW32_COP0(entrylo1, MIPS_COP_0_TLB_LO1); From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 08:12: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 3BFA9106566B; Mon, 21 Nov 2011 08:12:37 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A01B8FC12; Mon, 21 Nov 2011 08:12:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAL8Cbf1031153; Mon, 21 Nov 2011 08:12:37 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAL8Cbb4031147; Mon, 21 Nov 2011 08:12:37 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111210812.pAL8Cbb4031147@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 21 Nov 2011 08:12: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: r227783 - in head/sys/mips/nlm: . 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: Mon, 21 Nov 2011 08:12:37 -0000 Author: jchandra Date: Mon Nov 21 08:12:36 2011 New Revision: 227783 URL: http://svn.freebsd.org/changeset/base/227783 Log: Merge XLP 3XX updates and related rework. * Update message station (CMS) code, read queue ids from PCI header. * Use interrupts to wakeup message handling threads on 3XX * Update PIC code, read interrupt information from PCI header instead of using fixed values. * Update PCI interrupt handling for the PIC change. * Update code for getting chip frequency, new code support XLP 3XX * Misc style(9) fixes In collaboration with: prabhath at netlogicmicro com (CMS/PIC) venkatesh at netlogicmicro.com (PCI) Added: head/sys/mips/nlm/hal/nlm_hal.c (contents, props changed) Modified: head/sys/mips/nlm/cms.c head/sys/mips/nlm/files.xlp head/sys/mips/nlm/hal/cop2.h head/sys/mips/nlm/hal/fmn.c head/sys/mips/nlm/hal/fmn.h head/sys/mips/nlm/hal/iomap.h head/sys/mips/nlm/hal/pcibus.h head/sys/mips/nlm/hal/pic.h head/sys/mips/nlm/msgring.h head/sys/mips/nlm/xlp.h head/sys/mips/nlm/xlp_machdep.c head/sys/mips/nlm/xlp_pci.c Modified: head/sys/mips/nlm/cms.c ============================================================================== --- head/sys/mips/nlm/cms.c Mon Nov 21 07:55:37 2011 (r227782) +++ head/sys/mips/nlm/cms.c Mon Nov 21 08:12:36 2011 (r227783) @@ -75,8 +75,8 @@ __FBSDID("$FreeBSD$"); * load */ struct msgring_thread { - struct thread *thread; /* msgring handler threads */ - int needed; /* thread needs to wake up */ + struct thread *thread; /* msgring handler threads */ + int needed; /* thread needs to wake up */ }; static struct msgring_thread msgring_threads[XLP_MAX_CORES * XLP_MAX_THREADS]; static struct proc *msgring_proc; /* all threads are under a proc */ @@ -91,142 +91,80 @@ struct tx_stn_handler { }; static struct tx_stn_handler msgmap[MSGRNG_NSTATIONS]; static struct mtx msgmap_lock; -uint64_t xlp_cms_base; uint32_t xlp_msg_thread_mask; -static int xlp_msg_threads_per_core = 3; /* Make tunable */ +static int xlp_msg_threads_per_core = 3; static void create_msgring_thread(int hwtid); static int msgring_process_fast_intr(void *arg); -/* - * Boot time init, called only once - */ -void -xlp_msgring_config(void) -{ - unsigned int thrmask, mask; - int i; - - /* TODO: Add other nodes */ - xlp_cms_base = nlm_get_cms_regbase(0); - - mtx_init(&msgmap_lock, "msgring", NULL, MTX_SPIN); - if (xlp_threads_per_core < xlp_msg_threads_per_core) - xlp_msg_threads_per_core = xlp_threads_per_core; - thrmask = ((1 << xlp_msg_threads_per_core) - 1); - /*thrmask <<= xlp_threads_per_core - xlp_msg_threads_per_core;*/ - mask = 0; - for (i = 0; i < XLP_MAX_CORES; i++) { - mask <<= XLP_MAX_THREADS; - mask |= thrmask; - } - xlp_msg_thread_mask = xlp_hw_thread_mask & mask; - printf("Initializing CMS...@%jx, Message handler thread mask %#jx\n", - (uintmax_t)xlp_cms_base, (uintmax_t)xlp_msg_thread_mask); -} -/* - * Initialize the messaging subsystem. - * - * Message Stations are shared among all threads in a cpu core, this - * has to be called once from every core which is online. +/* Debug counters */ +static int msgring_nintr[XLP_MAX_CORES * XLP_MAX_THREADS]; +static int msgring_wakeup_sleep[XLP_MAX_CORES * XLP_MAX_THREADS]; +static int msgring_wakeup_nosleep[XLP_MAX_CORES * XLP_MAX_THREADS]; +static int fmn_msgcount[XLP_MAX_CORES * XLP_MAX_THREADS][4]; +static int fmn_loops[XLP_MAX_CORES * XLP_MAX_THREADS]; + +/* Whether polled driver implementation */ +static int polled = 1; + +/* We do only i/o device credit setup here. CPU credit setup is now + * moved to xlp_msgring_cpu_init() so that the credits get setup + * only if the CPU exists. xlp_msgring_cpu_init() gets called from + * platform_init_ap; and this makes it easy for us to setup CMS + * credits for various types of XLP chips, with varying number of + * cpu's and cores. */ -void -xlp_msgring_iodi_config(void) -{ - void *cookie; - - xlp_msgring_config(); -/* nlm_cms_default_setup(0,0,0,0); */ - nlm_cms_credit_setup(50); - create_msgring_thread(0); - cpu_establish_hardintr("msgring", msgring_process_fast_intr, NULL, - NULL, IRQ_MSGRING, INTR_TYPE_NET, &cookie); -} - -void -nlm_cms_credit_setup(int credit) +static void +xlp_cms_credit_setup(int credit) { + uint64_t cmspcibase, cmsbase, pcibase; + uint32_t devoffset; + int dev, fn, maxqid; int src, qid, i; -#if 0 - /* there are a total of 18 src stations on XLP. */ - printf("Setting up CMS credits!\n"); - for (src=0; src<18; src++) { - for(qid=0; qid<1024; qid++) { - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); - } - } + for (i = 0; i < XLP_MAX_NODES; i++) { + cmspcibase = nlm_get_cms_pcibase(i); + if (!nlm_dev_exists(XLP_IO_CMS_OFFSET(i))) + continue; + cmsbase = nlm_get_cms_regbase(i); + maxqid = nlm_read_reg(cmspcibase, XLP_PCI_DEVINFO_REG0); + for (dev = 0; dev < 8; dev++) { + for (fn = 0; fn < 8; fn++) { + devoffset = XLP_HDR_OFFSET(i, 0, dev, fn); + if (nlm_dev_exists(devoffset) == 0) + continue; + pcibase = nlm_pcicfg_base(devoffset); + src = nlm_qidstart(pcibase); + if (src == 0) + continue; +#if 0 /* Debug */ + printf("Setup CMS credits for queues "); + printf("[%d to %d] from src %d\n", 0, + maxqid, src); #endif - printf("Setting up CMS credits!\n"); - /* CPU Credits */ - for (i = 1; i < 8; i++) { - src = (i << 4); - for (qid = 0; qid < 1024; qid++) - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); - } - /* PCIE Credits */ - for(i = 0; i < 4; i++) { - src = (256 + (i * 2)); - for(qid = 0; qid < 1024; qid++) - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); - } - /* DTE Credits */ - src = 264; - for (qid = 0; qid < 1024; qid++) - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); - /* RSA Credits */ - src = 272; - for (qid = 0; qid < 1024; qid++) - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); - - /* Crypto Credits */ - src = 281; - for (qid = 0; qid < 1024; qid++) - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); - - /* CMP Credits */ - src = 298; - for (qid = 0; qid < 1024; qid++) - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); - - /* POE Credits */ - src = 384; - for(qid = 0; qid < 1024; qid++) - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); - - /* NAE Credits */ - src = 476; - for(qid = 0; qid < 1024; qid++) - nlm_cms_setup_credits(xlp_cms_base, qid, src, credit); -} - -void -xlp_msgring_cpu_init(uint32_t cpuid) -{ - int queue,i; - - queue = CMS_CPU_PUSHQ(0, ((cpuid >> 2) & 0x7), (cpuid & 0x3), 0); - /* temp allocate 4 segments to each output queue */ - nlm_cms_alloc_onchip_q(xlp_cms_base, queue, 4); - /* Enable high watermark and non empty interrupt */ - nlm_cms_per_queue_level_intr(xlp_cms_base, queue,2,0); - for(i=0;i<8;i++) { - /* temp distribute the credits to all CPU stations */ - nlm_cms_setup_credits(xlp_cms_base, queue, i * 16, 8); + for (qid = 0; qid < maxqid; qid++) + nlm_cms_setup_credits(cmsbase, qid, + src, credit); + } + } } } void -xlp_cpu_msgring_handler(int bucket, int size, int code, int stid, - struct nlm_fmn_msg *msg, void *data) +xlp_msgring_cpu_init(int node, int cpu, int credit) { - int i; - - printf("vc:%d srcid:%d size:%d\n",bucket,stid,size); - for(i=0;imsg[%d]:0x%jx ", i, (uintmax_t)msg->msg[i]); + uint64_t cmspcibase = nlm_get_cms_pcibase(node); + uint64_t cmsbase = nlm_get_cms_regbase(node); + int qid, maxqid, src; + + maxqid = nlm_read_reg(cmspcibase, XLP_PCI_DEVINFO_REG0); + + /* cpu credit setup is done only from thread-0 of each core */ + if((cpu % 4) == 0) { + src = cpu << 2; /* each thread has 4 vc's */ + for (qid = 0; qid < maxqid; qid++) + nlm_cms_setup_credits(cmsbase, qid, src, credit); } - printf("\n"); } /* @@ -234,35 +172,100 @@ xlp_cpu_msgring_handler(int bucket, int * Use max_msgs = 0 to drain out all messages. */ int -xlp_handle_msg_vc(int vc, int max_msgs) +xlp_handle_msg_vc(u_int vcmask, int max_msgs) { struct nlm_fmn_msg msg; - int i, srcid = 0, size = 0, code = 0; + int srcid = 0, size = 0, code = 0; struct tx_stn_handler *he; uint32_t mflags, status; + int n_msgs = 0, vc, m, hwtid; + u_int msgmask; - for (i = 0; i < max_msgs; i++) { + + hwtid = nlm_cpuid(); + for (;;) { + /* check if VC empty */ mflags = nlm_save_flags_cop2(); - status = nlm_fmn_msgrcv(vc, &srcid, &size, &code, &msg); + status = nlm_read_c2_msgstatus1(); nlm_restore_flags(mflags); - if (status != 0) /* If there is no msg or error */ - break; - if (srcid < 0 && srcid >= 1024) { - printf("[%s]: bad src id %d\n", __func__, srcid); - continue; - } - he = &msgmap[srcid]; - if(he->action != NULL) - (he->action)(vc, size, code, srcid, &msg, he->arg); -#if 0 /* debug */ - else - printf("[%s]: No Handler for message from stn_id=%d," - " vc=%d, size=%d, msg0=%jx, dropping message\n", - __func__, srcid, vc, size, (uintmax_t)msg.msg[0]); + + msgmask = ((status >> 24) & 0xf) ^ 0xf; + msgmask &= vcmask; + if (msgmask == 0) + break; + m = 0; + for (vc = 0; vc < 4; vc++) { + if ((msgmask & (1 << vc)) == 0) + continue; + + mflags = nlm_save_flags_cop2(); + status = nlm_fmn_msgrcv(vc, &srcid, &size, &code, + &msg); + nlm_restore_flags(mflags); + if (status != 0) /* no msg or error */ + continue; + if (srcid < 0 && srcid >= 1024) { + printf("[%s]: bad src id %d\n", __func__, + srcid); + continue; + } + he = &msgmap[srcid]; + if(he->action != NULL) + (he->action)(vc, size, code, srcid, &msg, he->arg); +#if 1 /* defined DEBUG */ + else + printf("[%s]: No Handler for msg from stn %d," + " vc=%d, size=%d, msg0=%jx, droppinge\n", + __func__, srcid, vc, size, + (uintmax_t)msg.msg[0]); #endif + fmn_msgcount[hwtid][vc] += 1; + m++; /* msgs handled in this iter */ + } + if (m == 0) + break; /* nothing done in this iter */ + n_msgs += m; + if (max_msgs > 0 && n_msgs >= max_msgs) + break; } - return (i); + return (n_msgs); +} + +static void +xlp_discard_msg_vc(u_int vcmask) +{ + struct nlm_fmn_msg msg; + int srcid = 0, size = 0, code = 0, vc; + uint32_t mflags, status; + + for (vc = 0; vc < 4; vc++) { + for (;;) { + mflags = nlm_save_flags_cop2(); + status = nlm_fmn_msgrcv(vc, &srcid, + &size, &code, &msg); + nlm_restore_flags(mflags); + + /* break if there is no msg or error */ + if (status != 0) + break; + } + } +} + +void +xlp_cms_enable_intr(int node, int cpu, int type, int watermark) +{ + uint64_t cmsbase; + int i, qid; + + cmsbase = nlm_get_cms_regbase(node); + + for (i = 0; i < 4; i++) { + qid = (i + (cpu * 4)) & 0x7f; + nlm_cms_per_queue_level_intr(cmsbase, qid, type, watermark); + nlm_cms_per_queue_timer_intr(cmsbase, qid, 0x1, 0); + } } static int @@ -274,6 +277,7 @@ msgring_process_fast_intr(void *arg) cpu = nlm_cpuid(); mthd = &msgring_threads[cpu]; + msgring_nintr[cpu]++; td = mthd->thread; /* clear pending interrupts */ @@ -283,24 +287,24 @@ msgring_process_fast_intr(void *arg) mthd->needed = 1; thread_lock(td); if (TD_AWAITING_INTR(td)) { + msgring_wakeup_sleep[cpu]++; TD_CLR_IWAIT(td); sched_add(td, SRQ_INTR); - } + } else + msgring_wakeup_nosleep[cpu]++; thread_unlock(td); + return (FILTER_HANDLED); } -u_int fmn_msgcount[32][4]; -u_int fmn_loops[32]; - static void msgring_process(void * arg) { volatile struct msgring_thread *mthd; struct thread *td; - uint32_t mflags; - int hwtid, vc, handled, nmsgs; + uint32_t mflags, msgstatus1; + int hwtid, nmsgs; hwtid = (intptr_t)arg; mthd = &msgring_threads[hwtid]; @@ -314,39 +318,47 @@ msgring_process(void * arg) thread_unlock(td); if (hwtid != nlm_cpuid()) - printf("Misscheduled hwtid %d != cpuid %d\n", hwtid, nlm_cpuid()); - mflags = nlm_save_flags_cop2(); - nlm_fmn_cpu_init(IRQ_MSGRING, 0, 0, 0, 0, 0); - nlm_restore_flags(mflags); + printf("Misscheduled hwtid %d != cpuid %d\n", hwtid, + nlm_cpuid()); - /* start processing messages */ - for( ; ; ) { - /*atomic_store_rel_int(&mthd->needed, 0);*/ + xlp_discard_msg_vc(0xf); + xlp_msgring_cpu_init(nlm_nodeid(), nlm_cpuid(), CMS_DEFAULT_CREDIT); + if (polled == 0) { + mflags = nlm_save_flags_cop2(); + nlm_fmn_cpu_init(IRQ_MSGRING, 0, 0, 0, 0, 0); + nlm_restore_flags(mflags); + xlp_cms_enable_intr(nlm_nodeid(), nlm_cpuid(), 0x2, 0); + /* clear pending interrupts. + * they will get re-raised if still valid */ + nlm_write_c0_eirr(1ULL << IRQ_MSGRING); + } - /* enable cop2 access */ - do { - handled = 0; - for (vc = 0; vc < 4; vc++) { - nmsgs = xlp_handle_msg_vc(vc, 1); - fmn_msgcount[hwtid][vc] += nmsgs; - handled += nmsgs; - } - } while (handled); + /* start processing messages */ + for (;;) { + atomic_store_rel_int(&mthd->needed, 0); + nmsgs = xlp_handle_msg_vc(0xf, 0); /* sleep */ -#if 0 - thread_lock(td); - if (mthd->needed) { + if (polled == 0) { + /* clear VC-pend bits */ + mflags = nlm_save_flags_cop2(); + msgstatus1 = nlm_read_c2_msgstatus1(); + msgstatus1 |= (0xf << 16); + nlm_write_c2_msgstatus1(msgstatus1); + nlm_restore_flags(mflags); + + thread_lock(td); + if (mthd->needed) { + thread_unlock(td); + continue; + } + sched_class(td, PRI_ITHD); + TD_SET_IWAIT(td); + mi_switch(SW_VOL, NULL); thread_unlock(td); - continue; - } - sched_class(td, PRI_ITHD); - TD_SET_IWAIT(td); - mi_switch(SW_VOL, NULL); - thread_unlock(td); -#else - pause("wmsg", 1); -#endif + } else + pause("wmsg", 1); + fmn_loops[hwtid]++; } } @@ -370,7 +382,9 @@ create_msgring_thread(int hwtid) sched_class(td, PRI_ITHD); sched_add(td, SRQ_INTR); thread_unlock(td); - CTR2(KTR_INTR, "%s: created %s", __func__, td->td_name); + if (bootverbose) + printf("Msgring handler create on cpu %d (%s)\n", + hwtid, td->td_name); } int @@ -381,7 +395,7 @@ register_msgring_handler(int startb, int printf("Register handler %d-%d %p(%p)\n", startb, endb, action, arg); KASSERT(startb >= 0 && startb <= endb && endb < MSGRNG_NSTATIONS, - ("Invalid value for for bucket range %d,%d", startb, endb)); + ("Invalid value for bucket range %d,%d", startb, endb)); mtx_lock_spin(&msgmap_lock); for (i = startb; i <= endb; i++) { @@ -395,6 +409,45 @@ register_msgring_handler(int startb, int } /* + * Initialize the messaging subsystem. + * + * Message Stations are shared among all threads in a cpu core, this + * has to be called once from every core which is online. + */ +static void +xlp_msgring_config(void *arg) +{ + void *cookie; + unsigned int thrmask, mask; + int i; + + mtx_init(&msgmap_lock, "msgring", NULL, MTX_SPIN); + if (xlp_threads_per_core < xlp_msg_threads_per_core) + xlp_msg_threads_per_core = xlp_threads_per_core; + thrmask = ((1 << xlp_msg_threads_per_core) - 1); + /*thrmask <<= xlp_threads_per_core - xlp_msg_threads_per_core;*/ + mask = 0; + for (i = 0; i < XLP_MAX_CORES; i++) { + mask <<= XLP_MAX_THREADS; + mask |= thrmask; + } + xlp_msg_thread_mask = xlp_hw_thread_mask & mask; +#if 0 + printf("CMS Message handler thread mask %#jx\n", + (uintmax_t)xlp_msg_thread_mask); +#endif + + if (nlm_is_xlp3xx()) + polled = 0; /* switch to interrupt driven driver */ + +/* nlm_cms_default_setup(0,0,0,0); */ + xlp_cms_credit_setup(CMS_DEFAULT_CREDIT); + create_msgring_thread(0); + cpu_establish_hardintr("msgring", msgring_process_fast_intr, NULL, + NULL, IRQ_MSGRING, INTR_TYPE_NET, &cookie); +} + +/* * Start message ring processing threads on other CPUs, after SMP start */ static void @@ -409,6 +462,8 @@ start_msgring_threads(void *arg) } } +SYSINIT(xlp_msgring_config, SI_SUB_DRIVERS, SI_ORDER_FIRST, + xlp_msgring_config, NULL); SYSINIT(start_msgring_threads, SI_SUB_SMP, SI_ORDER_MIDDLE, start_msgring_threads, NULL); Modified: head/sys/mips/nlm/files.xlp ============================================================================== --- head/sys/mips/nlm/files.xlp Mon Nov 21 07:55:37 2011 (r227782) +++ head/sys/mips/nlm/files.xlp Mon Nov 21 08:12:36 2011 (r227783) @@ -1,4 +1,5 @@ # $FreeBSD$ +mips/nlm/hal/nlm_hal.c standard mips/nlm/hal/fmn.c standard mips/nlm/xlp_machdep.c standard mips/nlm/intr_machdep.c standard Modified: head/sys/mips/nlm/hal/cop2.h ============================================================================== --- head/sys/mips/nlm/hal/cop2.h Mon Nov 21 07:55:37 2011 (r227782) +++ head/sys/mips/nlm/hal/cop2.h Mon Nov 21 08:12:36 2011 (r227783) @@ -38,7 +38,7 @@ #define COP2_RXMSGSTATUS 3 #define COP2_MSGSTATUS1 4 #define COP2_MSGCONFIG 5 -#define COP2_MSGCONFIG1 6 +#define COP2_MSGERROR 6 #define CROSSTHR_POPQ_EN 0x01 #define VC0_POPQ_EN 0x02 @@ -160,7 +160,10 @@ NLM_DEFINE_COP2_ACCESSORS32(txmsgstatus, NLM_DEFINE_COP2_ACCESSORS32(rxmsgstatus, COP2_RXMSGSTATUS, 0); NLM_DEFINE_COP2_ACCESSORS32(msgstatus1, COP2_MSGSTATUS1, 0); NLM_DEFINE_COP2_ACCESSORS32(msgconfig, COP2_MSGCONFIG, 0); -NLM_DEFINE_COP2_ACCESSORS32(msgconfig1, COP2_MSGCONFIG1, 0); +NLM_DEFINE_COP2_ACCESSORS32(msgerror0, COP2_MSGERROR, 0); +NLM_DEFINE_COP2_ACCESSORS32(msgerror1, COP2_MSGERROR, 1); +NLM_DEFINE_COP2_ACCESSORS32(msgerror2, COP2_MSGERROR, 2); +NLM_DEFINE_COP2_ACCESSORS32(msgerror3, COP2_MSGERROR, 3); /* successful completion returns 1, else 0 */ static inline int @@ -279,7 +282,7 @@ nlm_fmn_msgrcv(int vc, int *srcid, int * } static inline void -nlm_fmn_cpu_init(int int_vec, int ctpe, int v0pe, int v1pe, int v2pe, int v3pe) +nlm_fmn_cpu_init(int int_vec, int ecc_en, int v0pe, int v1pe, int v2pe, int v3pe) { uint32_t val = nlm_read_c2_msgconfig(); @@ -287,12 +290,12 @@ nlm_fmn_cpu_init(int int_vec, int ctpe, * in msgconfig register of cop2. * As per chip/cpu RTL, [16:20] bits consist of int_vec. */ - val |= ((int_vec & 0x1f) << 16) | + val |= (((int_vec & 0x1f) << 16) | + ((ecc_en & 0x1) << 8) | ((v3pe & 0x1) << 4) | ((v2pe & 0x1) << 3) | ((v1pe & 0x1) << 2) | - ((v0pe & 0x1) << 1) | - (ctpe & 0x1); + ((v0pe & 0x1) << 1)); nlm_write_c2_msgconfig(val); } Modified: head/sys/mips/nlm/hal/fmn.c ============================================================================== --- head/sys/mips/nlm/hal/fmn.c Mon Nov 21 07:55:37 2011 (r227782) +++ head/sys/mips/nlm/hal/fmn.c Mon Nov 21 08:12:36 2011 (r227783) @@ -67,7 +67,6 @@ uint64_t nlm_cms_spill_total_messages = * For all 4 nodes, there are 18*4 = 72 FMN stations */ uint32_t nlm_cms_total_stations = 18 * 4 /*xlp_num_nodes*/; -uint32_t cms_onchip_seg_availability[CMS_ON_CHIP_PER_QUEUE_SPACE]; /** * Takes inputs as node, queue_size and maximum number of queues. @@ -146,114 +145,6 @@ void nlm_cms_setup_credits(uint64_t base } -int nlm_cms_config_onchip_queue (uint64_t base, uint64_t spill_base, - int qid, int spill_en) -{ - - /* Configure 32 as onchip queue depth */ - nlm_cms_alloc_onchip_q(base, qid, 1); - - /* Spill configuration */ - if (spill_en) { - /* Configure 4*4KB = 16K as spill size */ - nlm_cms_alloc_spill_q(base, qid, spill_base, 4); - } - -#if 0 - /* configure credits for src cpu0, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CPU0_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src cpu1, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CPU1_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src cpu2, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CPU2_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src cpu3, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CPU3_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src cpu4, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CPU4_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src cpu5, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CPU5_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src cpu6, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CPU6_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src cpu7, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CPU7_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src pcie0, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_PCIE0_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src pcie1, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_PCIE1_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src pcie2, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_PCIE2_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src pcie3, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_PCIE3_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src dte, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_DTE_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src rsa_ecc, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_RSA_ECC_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src crypto, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CRYPTO_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src cmp, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_CMP_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src poe, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_POE_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); - - /* configure credits for src nae, on this queue */ - nlm_cms_setup_credits(base, qid, CMS_NAE_SRC_STID, - CMS_DEFAULT_CREDIT(nlm_cms_total_stations, - nlm_cms_spill_total_messages)); -#endif - - return 0; -} - /* * base - CMS module base address for this node. * qid - is the output queue id otherwise called as vc id @@ -268,7 +159,7 @@ int nlm_cms_alloc_spill_q(uint64_t base, uint64_t queue_config; uint32_t spill_start; - if(nsegs > CMS_MAX_SPILL_SEGMENTS_PER_QUEUE) { + if (nsegs > CMS_MAX_SPILL_SEGMENTS_PER_QUEUE) { return 1; } @@ -286,152 +177,6 @@ int nlm_cms_alloc_spill_q(uint64_t base, return 0; } -/* - * base - CMS module base address for this node. - * qid - is the output queue id otherwise called as vc id - * nsegs - No of segments where a "1" indicates 32 credits. On chip - * credits must be a multiple of 32. - */ -int nlm_cms_alloc_onchip_q(uint64_t base, int qid, int nsegs) -{ - static uint32_t curr_end = 0; - uint64_t queue_config; - int onchipbase, start, last; - uint8_t i; - - if( ((curr_end + nsegs) > CMS_MAX_ONCHIP_SEGMENTS) || - (nsegs > CMS_ON_CHIP_PER_QUEUE_SPACE) ) { - /* Invalid configuration */ - return 1; - } - if(((curr_end % 32) + nsegs - 1) <= 31) { - onchipbase = (curr_end / 32); - start = (curr_end % 32); - curr_end += nsegs; - } else { - onchipbase = (curr_end / 32) + 1; - start = 0; - curr_end = ((onchipbase * 32) + nsegs); - } - last = start + nsegs - 1; - - for(i = start;i <= last;i++) { - if(cms_onchip_seg_availability[onchipbase] & (1 << i)) { - /* Conflict!!! segment is already allocated */ - return 1; - } - } - /* Update the availability bitmap as consumed */ - for(i = start; i <= last; i++) { - cms_onchip_seg_availability[onchipbase] |= (1 << i); - } - - queue_config = nlm_read_cms_reg(base,(CMS_OUTPUTQ_CONFIG(qid))); - - /* On chip configuration */ - queue_config = (((uint64_t)CMS_QUEUE_ENA << 63) | - ((onchipbase & 0x1f) << 10) | - ((last & 0x1f) << 5) | - (start & 0x1f)); - - nlm_write_cms_reg(base,(CMS_OUTPUTQ_CONFIG(qid)),queue_config); - - return 0; -} - -void nlm_cms_default_setup(int node, uint64_t spill_base, int spill_en, - int popq_en) -{ - int j, k, vc; - int queue; - uint64_t base; - - base = nlm_get_cms_regbase(node); - for(j=0; j<1024; j++) { - printf("Qid:0x%04d Val:0x%016jx\n",j, - (uintmax_t)nlm_cms_get_onchip_queue (base, j)); - } - /* Enable all cpu push queues */ - for (j=0; j Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50BB71065673; Mon, 21 Nov 2011 08:28:38 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id C44EB8FC16; Mon, 21 Nov 2011 08:28:37 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id C57267E820; Mon, 21 Nov 2011 19:28:35 +1100 (EST) Message-ID: <4ECA0BB3.4000208@freebsd.org> Date: Mon, 21 Nov 2011 19:28:35 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111006 Thunderbird/7.0.1 MIME-Version: 1.0 To: Lawrence Stewart References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <4EC9E408.9000304@freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> <4EC9FD8A.5040401@freebsd.org> In-Reply-To: <4EC9FD8A.5040401@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Julien Ridoux , Ben Kaduk Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 08:28:38 -0000 On 11/21/11 18:28, Lawrence Stewart wrote: > On 11/21/11 17:18, Julien Ridoux wrote: >> >> On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: >> >>> On 11/21/11 16:12, Ben Kaduk wrote: [snip] >>>> Is it really necessary to make the ABI dependent on a kernel >>>> configuration option? This causes all sorts of headaches if >>>> loadable modules ever want to use that ABI, something that we >>>> just ran into with vm_page_t and friends and had a long thread on >>>> -current about. >>> >>> Fair question. Julien, if pcap and other consumers will happily >>> ignore the new ffcount_stamp member in the bpf header, is there any >>> reason to conditionally add the ffcounter into the header struct? >> >> It is a valid question indeed. The feedback I have received so far >> was to not have the feed-forward clock support be a default kernel >> configuration option. What follows is based on this assumption. >> >> The commit (r227747) introduces sysctl that are conditioned by the >> same "FFCLOCK" kernel configuration option. If a loadable module >> tests for the presence of this sysctl, it will know if the >> ffcount_stamp member is available. Is it too much of a hack? >> >> Alternatively, if the ffcounter is added to the bpf header >> unconditionally, the ffcount_stamp member can be set to 0. Loadable >> modules will then see a consistent ABI but will retrieve a >> meaningless value. >> >> I am not sure which option makes more sense, any preference? > > If I understand the issues correctly, I think the appropriate path > forward is to remove the conditional change to the bpf header and have > ffcount_stamp become a permanent member of the struct. We'll just leave > the member uninitialised in the !FFCLOCK case. This change will make the > patch un-MFCable, but I think that's ok. I think I might be changing my mind about the benefits of having both the timestamp and the ffcounter value in the header. Adding an extra 8 bytes to the bpf header size does give us the ability to do some neat things in a dual system clock world, but on further reflection these things may not be worth the size increase cost for the average FreeBSD user. On further reflection, I suspect the number of people likely to be interested in having the flexibility of retaining both the timestamp and ffcounter value would be less than those who don't care. We could therefore expect that anyone wanting the flexibility should patch their kernel and rebuild kernel/world in order to handle the ABI breakage and put things in sync. Given that ffcounter is currently a 64bit value, we could add a CTASSERT() safety belt somewhere to check that sizeof(ffcounter) == sizeof(struct timeval) and then retask the net.bpf.ffclock_tstamp sysctl (or perhaps better rename it to something like "net.bpf.timestamp_src") and have it take options like "fb_time", "ff_time" or "ff_counter" for feedback clock based timestamp, feed-forward based timestamp, or feed-forward counter based timestamp. We would then have the bpf code shoehorn either a regular timeval timestamp or the ffcounter value into bh_tstamp header field depending on whether "fb_time"/"ff_time" or "ff_counter" is selected. Anything consuming the BPF header would then need to know how to interpret the bh_tstamp field. Perhaps we could add a general purpose flags field to the BPF header and define a flag which indicates if the bh_tstamp field is a timestamp or counter value. Thoughts? Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 09:30: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 551591065672; Mon, 21 Nov 2011 09:30:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id D62BB8FC0A; Mon, 21 Nov 2011 09:30:01 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAL9Tvad010353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Nov 2011 20:29:59 +1100 Date: Mon, 21 Nov 2011 20:29:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: mdf@freebsd.org In-Reply-To: Message-ID: <20111121200813.E1158@besplex.bde.org> References: <201111122001.pACK1UML059238@svn.freebsd.org> <20111113220817.GC1677@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-825119736-1321867797=:1158" Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Garrett Cooper , Alexander Motin , svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r227473 - head/sbin/geom/class/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 09:30:02 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-825119736-1321867797=:1158 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 13 Nov 2011 mdf@freebsd.org wrote: > On Sun, Nov 13, 2011 at 2:46 PM, Garrett Cooper wrot= e: >> On Sun, Nov 13, 2011 at 2:08 PM, Pawel Jakub Dawidek w= rote: >>> On Sat, Nov 12, 2011 at 12:16:23PM -0800, Garrett Cooper wrote: >>>> On Sat, Nov 12, 2011 at 12:01 PM, Alexander Motin wr= ote: >>>>> Author: mav >>>>> Date: Sat Nov 12 20:01:30 2011 >>>>> New Revision: 227473 >>>>> URL: http://svn.freebsd.org/changeset/base/227473 >>>>> >>>>> Log: >>>>> =A0Fix build on some archs after r227464. >>>>> >>>>> Modified: >>>>> =A0head/sbin/geom/class/multipath/geom_multipath.c >>>>> >>>>> Modified: head/sbin/geom/class/multipath/geom_multipath.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/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 1= 2 19:55:48 2011 =A0 =A0 =A0 =A0(r227472) >>>>> +++ head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 1= 2 20:01:30 2011 =A0 =A0 =A0 =A0(r227473) >>>>> @@ -133,7 +133,8 @@ mp_label(struct gctl_req *req) >>>>> =A0 =A0 =A0 =A0uint8_t *sector, *rsector; >>>>> =A0 =A0 =A0 =A0char *ptr; >>>>> =A0 =A0 =A0 =A0uuid_t uuid; >>>>> - =A0 =A0 =A0 uint32_t secsize =3D 0, ssize, status; >>>>> + =A0 =A0 =A0 ssize_t secsize =3D 0, ssize; >>>>> + =A0 =A0 =A0 uint32_t status; >>>>> =A0 =A0 =A0 =A0const char *name, *name2, *mpname; >>>>> =A0 =A0 =A0 =A0int error, i, nargs, fd; >>>>> >>>>> @@ -161,8 +162,8 @@ mp_label(struct gctl_req *req) >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0disksize =3D msize; >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (secsize !=3D ssize= ) { >>>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_er= ror(req, "%s sector size %u different.", >>>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= name, ssize); >>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_er= ror(req, "%s sector size %ju different.", >>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= name, (intmax_t)ssize); >>>> >>>> Shouldn't that be uintmax_t, not intmax_t ? >>> >>> No, ssize_t is signed. Although the best would be to use %zd for >>> ssize_t. >> >> Thanks... Missed the leading s. > > ... except that the cast and conversion specifier aren't in sync. The > cast is signed; the conversion specifier is unsigned. %zd is still > best, since it's the conversion specifier for the variable's type. > Next best is %jd and cast to intmax_t, since the signedness is > preserved. But ssize_t is still a nonsense type for representing a sector size. ssize_t is for the return type of read(2) and write(2) and not much more. On 64-bit arches it is (bogusly) int64_t, although read() and write() are still limited to INT_MAX for historical reasons (buggy standards may require ssize_t to have this wrong type and SSIZE_MAX to have the corresponding wrong value INT64_MAX (equal to the maximum value representable by this wrong type and not equal to the maximum value that read() and write() actually support). These bugs were missing in V7 where read() and write() took and returned plain int sizes. Portable code must still call them with a size <=3D INT_MAX, else it may break, for example on FreeBSD. When ssize_t is misused for something unrelated to read() and write(), it mainly gives printf format complications since it tends to be larger than necessary. Here it gives a printf format complication of a cast to intmax_t, and a printf format error since intmax_t doesn't match the format %ju, and it gives the nonsense that sectors of size >=3D 2GB are "supported" on 64-bit systems but not on 32-bit systems. Testing this support is difficult even with virtual disks. > But in the end it doesn't matter a lot since whatever is printed in > the error message, it's likely derivable from reading the code what > the actual value used was. Even when the value is truncated, provided the behaviour is defined or benign. Bruce --0-825119736-1321867797=:1158-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 09:52: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 CEA6E1065672; Mon, 21 Nov 2011 09:52:10 +0000 (UTC) (envelope-from jrid@cubinlab.ee.unimelb.edu.au) Received: from mail-gw2.its.unimelb.edu.au (mail-gw2.its.unimelb.edu.au [128.250.5.151]) by mx1.freebsd.org (Postfix) with ESMTP id 860828FC0C; Mon, 21 Nov 2011 09:52:10 +0000 (UTC) Received: from emu.cubinlab.ee.unimelb.edu.au (cubinlab.ee.unimelb.edu.au [128.250.80.33]) by mail-gw2.its.unimelb.edu.au (Postfix) with ESMTPS id 40987EE2; Mon, 21 Nov 2011 20:52:09 +1100 (EST) Received: from jrid.cubinlab.ee.unimelb.edu.au (jrid.cubinlab.ee.unimelb.edu.au [10.0.1.128]) (authenticated bits=0) by emu.cubinlab.ee.unimelb.edu.au (8.14.4/8.14.4) with ESMTP id pAL9q7Q2055302 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 21 Nov 2011 20:52:08 +1100 (EST) (envelope-from jrid@cubinlab.ee.unimelb.edu.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Julien Ridoux In-Reply-To: <4ECA0BB3.4000208@freebsd.org> Date: Mon, 21 Nov 2011 20:52:07 +1100 Content-Transfer-Encoding: quoted-printable Message-Id: <62D53750-FB6E-4DF3-A1E2-65B22EF85EB6@cubinlab.ee.unimelb.edu.au> References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <4EC9E408.9000304@freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> <4EC9FD8A.5040401@freebsd.org> <4ECA0BB3.4000208@freebsd.org> To: Lawrence Stewart X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 09:52:10 -0000 On 21/11/2011, at 7:28 PM, Lawrence Stewart wrote: > On 11/21/11 18:28, Lawrence Stewart wrote: >> On 11/21/11 17:18, Julien Ridoux wrote: >>>=20 >>> On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: >>>=20 >>>> On 11/21/11 16:12, Ben Kaduk wrote: > [snip] >>>>> Is it really necessary to make the ABI dependent on a kernel >>>>> configuration option? This causes all sorts of headaches if >>>>> loadable modules ever want to use that ABI, something that we >>>>> just ran into with vm_page_t and friends and had a long thread on >>>>> -current about. >>>>=20 >>>> Fair question. Julien, if pcap and other consumers will happily >>>> ignore the new ffcount_stamp member in the bpf header, is there any >>>> reason to conditionally add the ffcounter into the header struct? >>>=20 >>> It is a valid question indeed. The feedback I have received so far >>> was to not have the feed-forward clock support be a default kernel >>> configuration option. What follows is based on this assumption. >>>=20 >>> The commit (r227747) introduces sysctl that are conditioned by the >>> same "FFCLOCK" kernel configuration option. If a loadable module >>> tests for the presence of this sysctl, it will know if the >>> ffcount_stamp member is available. Is it too much of a hack? >>>=20 >>> Alternatively, if the ffcounter is added to the bpf header >>> unconditionally, the ffcount_stamp member can be set to 0. Loadable >>> modules will then see a consistent ABI but will retrieve a >>> meaningless value. >>>=20 >>> I am not sure which option makes more sense, any preference? >>=20 >> If I understand the issues correctly, I think the appropriate path >> forward is to remove the conditional change to the bpf header and = have >> ffcount_stamp become a permanent member of the struct. We'll just = leave >> the member uninitialised in the !FFCLOCK case. This change will make = the >> patch un-MFCable, but I think that's ok. >=20 > I think I might be changing my mind about the benefits of having both = the timestamp and the ffcounter value in the header. Adding an extra 8 = bytes to the bpf header size does give us the ability to do some neat = things in a dual system clock world, but on further reflection these = things may not be worth the size increase cost for the average FreeBSD = user. >=20 > On further reflection, I suspect the number of people likely to be = interested in having the flexibility of retaining both the timestamp and = ffcounter value would be less than those who don't care. We could = therefore expect that anyone wanting the flexibility should patch their = kernel and rebuild kernel/world in order to handle the ABI breakage and = put things in sync. >=20 > Given that ffcounter is currently a 64bit value, we could add a = CTASSERT() safety belt somewhere to check that sizeof(ffcounter) =3D=3D = sizeof(struct timeval) and then retask the net.bpf.ffclock_tstamp sysctl = (or perhaps better rename it to something like "net.bpf.timestamp_src") = and have it take options like "fb_time", "ff_time" or "ff_counter" for = feedback clock based timestamp, feed-forward based timestamp, or = feed-forward counter based timestamp. >=20 > We would then have the bpf code shoehorn either a regular timeval = timestamp or the ffcounter value into bh_tstamp header field depending = on whether "fb_time"/"ff_time" or "ff_counter" is selected. Anything = consuming the BPF header would then need to know how to interpret the = bh_tstamp field. Perhaps we could add a general purpose flags field to = the BPF header and define a flag which indicates if the bh_tstamp field = is a timestamp or counter value. >=20 > Thoughts? In a typical scenario with a feed-forward clock, the synchronisation = daemon needs the ffcounter timestamps. Tcpdump (or any libpcap based = processed) would expects a timetamp in seconds formatted as a timeval. If the ffcounter value is stored as an extra value in the bpf header, = both processes are happy. If the current timestamp field is used, then the system wide sysctl will = not suffice. This will require to modify/add bpf ioctl to be able to = configure each open bpf independently. Also, selecting a timestamp in seconds would prevent packet traces from = being replayed and have their timestamps corrected in post-processing. = However, I agree that this feature and the capacity to compare 2 = different synchronisation algorithms running in parallel is attractive = to a small proportion of FreeBSD users. From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 10:36: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 C6B651065673; Mon, 21 Nov 2011 10:36:57 +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 B6F108FC1B; Mon, 21 Nov 2011 10:36:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALAavBu039190; Mon, 21 Nov 2011 10:36:57 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALAavS7039188; Mon, 21 Nov 2011 10:36:57 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201111211036.pALAavS7039188@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 21 Nov 2011 10:36: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: r227784 - 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: Mon, 21 Nov 2011 10:36:57 -0000 Author: pluknet Date: Mon Nov 21 10:36:57 2011 New Revision: 227784 URL: http://svn.freebsd.org/changeset/base/227784 Log: Use the acquired reference to the vmspace instead of direct dereferencing of p->p_vmspace like it is done in sysctl_kern_proc_vmmap(). Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Nov 21 08:12:36 2011 (r227783) +++ head/sys/kern/kern_proc.c Mon Nov 21 10:36:57 2011 (r227784) @@ -1528,7 +1528,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); - map = &p->p_vmspace->vm_map; /* XXXRW: More locking required? */ + map = &vm->vm_map; /* XXXRW: More locking required? */ vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 10:44:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D09431065673; Mon, 21 Nov 2011 10:44:03 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 5D28B8FC12; Mon, 21 Nov 2011 10:44:03 +0000 (UTC) Received: from lstewart1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 72A607E820; Mon, 21 Nov 2011 21:44:01 +1100 (EST) Message-ID: <4ECA2B71.1050803@freebsd.org> Date: Mon, 21 Nov 2011 21:44:01 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111016 Thunderbird/7.0.1 MIME-Version: 1.0 To: Julien Ridoux References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <4EC9E408.9000304@freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> <4EC9FD8A.5040401@freebsd.org> <4ECA0BB3.4000208@freebsd.org> <62D53750-FB6E-4DF3-A1E2-65B22EF85EB6@cubinlab.ee.unimelb.edu.au> In-Reply-To: <62D53750-FB6E-4DF3-A1E2-65B22EF85EB6@cubinlab.ee.unimelb.edu.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 10:44:03 -0000 On 11/21/11 20:52, Julien Ridoux wrote: > > On 21/11/2011, at 7:28 PM, Lawrence Stewart wrote: > >> On 11/21/11 18:28, Lawrence Stewart wrote: >>> On 11/21/11 17:18, Julien Ridoux wrote: >>>> >>>> On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: >>>> >>>>> On 11/21/11 16:12, Ben Kaduk wrote: >> [snip] >>>>>> Is it really necessary to make the ABI dependent on a >>>>>> kernel configuration option? This causes all sorts of >>>>>> headaches if loadable modules ever want to use that ABI, >>>>>> something that we just ran into with vm_page_t and friends >>>>>> and had a long thread on -current about. >>>>> >>>>> Fair question. Julien, if pcap and other consumers will >>>>> happily ignore the new ffcount_stamp member in the bpf >>>>> header, is there any reason to conditionally add the >>>>> ffcounter into the header struct? >>>> >>>> It is a valid question indeed. The feedback I have received so >>>> far was to not have the feed-forward clock support be a default >>>> kernel configuration option. What follows is based on this >>>> assumption. >>>> >>>> The commit (r227747) introduces sysctl that are conditioned by >>>> the same "FFCLOCK" kernel configuration option. If a loadable >>>> module tests for the presence of this sysctl, it will know if >>>> the ffcount_stamp member is available. Is it too much of a >>>> hack? >>>> >>>> Alternatively, if the ffcounter is added to the bpf header >>>> unconditionally, the ffcount_stamp member can be set to 0. >>>> Loadable modules will then see a consistent ABI but will >>>> retrieve a meaningless value. >>>> >>>> I am not sure which option makes more sense, any preference? >>> >>> If I understand the issues correctly, I think the appropriate >>> path forward is to remove the conditional change to the bpf >>> header and have ffcount_stamp become a permanent member of the >>> struct. We'll just leave the member uninitialised in the !FFCLOCK >>> case. This change will make the patch un-MFCable, but I think >>> that's ok. >> >> I think I might be changing my mind about the benefits of having >> both the timestamp and the ffcounter value in the header. Adding an >> extra 8 bytes to the bpf header size does give us the ability to do >> some neat things in a dual system clock world, but on further >> reflection these things may not be worth the size increase cost for >> the average FreeBSD user. >> >> On further reflection, I suspect the number of people likely to be >> interested in having the flexibility of retaining both the >> timestamp and ffcounter value would be less than those who don't >> care. We could therefore expect that anyone wanting the flexibility >> should patch their kernel and rebuild kernel/world in order to >> handle the ABI breakage and put things in sync. >> >> Given that ffcounter is currently a 64bit value, we could add a >> CTASSERT() safety belt somewhere to check that sizeof(ffcounter) == >> sizeof(struct timeval) and then retask the net.bpf.ffclock_tstamp >> sysctl (or perhaps better rename it to something like >> "net.bpf.timestamp_src") and have it take options like "fb_time", >> "ff_time" or "ff_counter" for feedback clock based timestamp, >> feed-forward based timestamp, or feed-forward counter based >> timestamp. >> >> We would then have the bpf code shoehorn either a regular timeval >> timestamp or the ffcounter value into bh_tstamp header field >> depending on whether "fb_time"/"ff_time" or "ff_counter" is >> selected. Anything consuming the BPF header would then need to know >> how to interpret the bh_tstamp field. Perhaps we could add a >> general purpose flags field to the BPF header and define a flag >> which indicates if the bh_tstamp field is a timestamp or counter >> value. >> >> Thoughts? > > In a typical scenario with a feed-forward clock, the synchronisation > daemon needs the ffcounter timestamps. Tcpdump (or any libpcap based > processed) would expects a timetamp in seconds formatted as a > timeval. > > If the ffcounter value is stored as an extra value in the bpf header, > both processes are happy. Sure. I guess my thinking was that the minute someone throws the switch, they would need to know what they're getting themselves into. We consistently expect that from our users so no reason not to here ;) > If the current timestamp field is used, then the system wide sysctl > will not suffice. This will require to modify/add bpf ioctl to be > able to configure each open bpf independently. Also, selecting a I like the sound of this - I think it would be the way to go for userspace processes. You'd still need some mechanism for in-kernel consumers to know how to interpret the timestamp field. I just noticed that there is a comment about implicit padding at the end of struct bpf_hdr, so adding a flags field to fill that padding would be possible without changing the ABI - I think we could safely shoehorn a uint16_t flags field in there? > timestamp in seconds would prevent packet traces from being replayed > and have their timestamps corrected in post-processing. However, I > agree that this feature and the capacity to compare 2 different > synchronisation algorithms running in parallel is attractive to a > small proportion of FreeBSD users. Perhaps we could introduce a new option e.g. "BPF_FFCOUNTER" which is independent of FFCLOCK. Then, if BPF_FFCOUNTER is specified in the kernel conf, the ffcount_stamp member gets conditionally embedded into the BPF header to enable these more advanced use cases. Yes it would change the ABI and yes it couldn't be relied upon by modules compiled against a kernel without BPF_FFCOUNTER, but I'm not seeing a problem with that - we would only expect the option to be used in more specialised circumstances and we would be providing a standard means to get ffcounter values in the timestamp field instead of a regular timestamp if an ioctl is set on the bpf device. In this revised world order, the average user would run with FFCLOCK but without BPF_FFCOUNTER, and could use the new BPF ioctl to select feedback clock timestamp, feed-forward clock timestamp or feed-forward counter timestamp which would determine how the bpf header's bh_tstamp field is to be interpreted. In the less common case where someone wants to have both the timestamp and ffcounter value in BPF headers, they stick BPF_FFCOUNTER in the kernel config, recompile world/kernel+modules and off they go. It sounds like a reasonable middle ground to me, avoiding the 8byte-per-packet overhead in the default case, but allowing advanced use cases with a single kernel option and recompilation of world/kernel+modules. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 10:51: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 BCDE4106566C; Mon, 21 Nov 2011 10:51:12 +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 1FA438FC0A; Mon, 21 Nov 2011 10:51:11 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pALAp8VB022859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Nov 2011 12:51:08 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pALAp8AK034202; Mon, 21 Nov 2011 12:51:08 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pALAp8Km034201; Mon, 21 Nov 2011 12:51:08 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 21 Nov 2011 12:51:08 +0200 From: Kostik Belousov To: Sergey Kandaurov Message-ID: <20111121105108.GE50300@deviant.kiev.zoral.com.ua> References: <201111211036.pALAavS7039188@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sKTXwkTcrvVuA/Nz" Content-Disposition: inline In-Reply-To: <201111211036.pALAavS7039188@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227784 - 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: Mon, 21 Nov 2011 10:51:12 -0000 --sKTXwkTcrvVuA/Nz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 21, 2011 at 10:36:57AM +0000, Sergey Kandaurov wrote: > Author: pluknet > Date: Mon Nov 21 10:36:57 2011 > New Revision: 227784 > URL: http://svn.freebsd.org/changeset/base/227784 >=20 > Log: > Use the acquired reference to the vmspace instead of direct dereferenci= ng > of p->p_vmspace like it is done in sysctl_kern_proc_vmmap(). >=20 > Modified: > head/sys/kern/kern_proc.c >=20 > Modified: head/sys/kern/kern_proc.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/kern/kern_proc.c Mon Nov 21 08:12:36 2011 (r227783) > +++ head/sys/kern/kern_proc.c Mon Nov 21 10:36:57 2011 (r227784) > @@ -1528,7 +1528,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A > } > kve =3D malloc(sizeof(*kve), M_TEMP, M_WAITOK); > =20 > - map =3D &p->p_vmspace->vm_map; /* XXXRW: More locking required? */ > + map =3D &vm->vm_map; /* XXXRW: More locking required? */ It makes sense to remove the XXXRW comment, from both places. > vm_map_lock_read(map); > for (entry =3D map->header.next; entry !=3D &map->header; > entry =3D entry->next) { --sKTXwkTcrvVuA/Nz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7KLRsACgkQC3+MBN1Mb4i0HQCffjla7xswBxEIbBOfZFVGDsTX 2wwAoJj8tZl9nb6bArOGisM20bP8cfDm =UAUL -----END PGP SIGNATURE----- --sKTXwkTcrvVuA/Nz-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 12: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 EB58D1065672; Mon, 21 Nov 2011 12:07:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0AE68FC13; Mon, 21 Nov 2011 12:07:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALC7ICC041978; Mon, 21 Nov 2011 12:07:18 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALC7IQu041976; Mon, 21 Nov 2011 12:07:18 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111211207.pALC7IQu041976@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 21 Nov 2011 12:07: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: r227785 - 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: Mon, 21 Nov 2011 12:07:19 -0000 Author: glebius Date: Mon Nov 21 12:07:18 2011 New Revision: 227785 URL: http://svn.freebsd.org/changeset/base/227785 Log: - Reduce severity for all ARP events, that can be triggered from remote machine to LOG_NOTICE. Exception left to "using my IP address". - Fix multicast ARP warning: add newline and also log the bad MAC address. Tested by: Alexander Wittig Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Nov 21 10:36:57 2011 (r227784) +++ head/sys/netinet/if_ether.c Mon Nov 21 12:07:18 2011 (r227785) @@ -433,7 +433,7 @@ arpintr(struct mbuf *m) if (m->m_len < sizeof(struct arphdr) && ((m = m_pullup(m, sizeof(struct arphdr))) == NULL)) { - log(LOG_ERR, "arp: runt packet -- m_pullup failed\n"); + log(LOG_NOTICE, "arp: runt packet -- m_pullup failed\n"); return; } ar = mtod(m, struct arphdr *); @@ -443,7 +443,7 @@ arpintr(struct mbuf *m) ntohs(ar->ar_hrd) != ARPHRD_ARCNET && ntohs(ar->ar_hrd) != ARPHRD_IEEE1394 && ntohs(ar->ar_hrd) != ARPHRD_INFINIBAND) { - log(LOG_ERR, "arp: unknown hardware address format (0x%2D)\n", + log(LOG_NOTICE, "arp: unknown hardware address format (0x%2D)\n", (unsigned char *)&ar->ar_hrd, ""); m_freem(m); return; @@ -451,7 +451,7 @@ arpintr(struct mbuf *m) if (m->m_len < arphdr_len(ar)) { if ((m = m_pullup(m, arphdr_len(ar))) == NULL) { - log(LOG_ERR, "arp: runt packet\n"); + log(LOG_NOTICE, "arp: runt packet\n"); m_freem(m); return; } @@ -527,7 +527,7 @@ in_arpinput(struct mbuf *m) req_len = arphdr_len2(ifp->if_addrlen, sizeof(struct in_addr)); if (m->m_len < req_len && (m = m_pullup(m, req_len)) == NULL) { - log(LOG_ERR, "in_arp: runt packet -- m_pullup failed\n"); + log(LOG_NOTICE, "in_arp: runt packet -- m_pullup failed\n"); return; } @@ -537,13 +537,14 @@ in_arpinput(struct mbuf *m) * a protocol length not equal to an IPv4 address. */ if (ah->ar_pln != sizeof(struct in_addr)) { - log(LOG_ERR, "in_arp: requested protocol length != %zu\n", + log(LOG_NOTICE, "in_arp: requested protocol length != %zu\n", sizeof(struct in_addr)); return; } if (ETHER_IS_MULTICAST(ar_sha(ah))) { - log(LOG_ERR, "in_arp: source hardware address is multicast."); + log(LOG_NOTICE, "in_arp: %*D is multicast\n", + ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); return; } @@ -645,7 +646,7 @@ match: if (!bcmp(ar_sha(ah), enaddr, ifp->if_addrlen)) goto drop; /* it's from me, ignore it. */ if (!bcmp(ar_sha(ah), ifp->if_broadcastaddr, ifp->if_addrlen)) { - log(LOG_ERR, + log(LOG_NOTICE, "arp: link address is broadcast for IP address %s!\n", inet_ntoa(isaddr)); goto drop; @@ -681,7 +682,7 @@ match: /* the following is not an error when doing bridging */ if (!bridged && la->lle_tbl->llt_ifp != ifp && !carp_match) { if (log_arp_wrong_iface) - log(LOG_ERR, "arp: %s is on %s " + log(LOG_WARNING, "arp: %s is on %s " "but got reply from %*D on %s\n", inet_ntoa(isaddr), la->lle_tbl->llt_ifp->if_xname, @@ -716,10 +717,10 @@ match: if (ifp->if_addrlen != ah->ar_hln) { LLE_WUNLOCK(la); - log(LOG_WARNING, - "arp from %*D: addr len: new %d, i/f %d (ignored)", - ifp->if_addrlen, (u_char *) ar_sha(ah), ":", - ah->ar_hln, ifp->if_addrlen); + log(LOG_WARNING, "arp from %*D: addr len: new %d, " + "i/f %d (ignored)\n", ifp->if_addrlen, + (u_char *) ar_sha(ah), ":", ah->ar_hln, + ifp->if_addrlen); goto drop; } (void)memcpy(&la->ll_addr, ar_sha(ah), ifp->if_addrlen); From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 12:21: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 EF78C10657C0; Mon, 21 Nov 2011 12:21:00 +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 DF5C08FC15; Mon, 21 Nov 2011 12:21:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALCL0EP042441; Mon, 21 Nov 2011 12:21:00 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALCL0Fv042439; Mon, 21 Nov 2011 12:21:00 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201111211221.pALCL0Fv042439@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 21 Nov 2011 12:21: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: r227786 - 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: Mon, 21 Nov 2011 12:21:01 -0000 Author: pluknet Date: Mon Nov 21 12:21:00 2011 New Revision: 227786 URL: http://svn.freebsd.org/changeset/base/227786 Log: Remove no more relevant XXXRW comments since accessing the vmspace is now properly done with the acquired vmspace reference. Pointed out by: kib Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Nov 21 12:07:18 2011 (r227785) +++ head/sys/kern/kern_proc.c Mon Nov 21 12:21:00 2011 (r227786) @@ -1528,7 +1528,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); - map = &vm->vm_map; /* XXXRW: More locking required? */ + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -1706,7 +1706,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); - map = &vm->vm_map; /* XXXRW: More locking required? */ + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 12:23: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 729651065673; Mon, 21 Nov 2011 12:23:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 627EB8FC08; Mon, 21 Nov 2011 12:23:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALCNNU4042553; Mon, 21 Nov 2011 12:23:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALCNNmo042551; Mon, 21 Nov 2011 12:23:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111211223.pALCNNmo042551@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 21 Nov 2011 12:23: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: r227787 - 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: Mon, 21 Nov 2011 12:23:23 -0000 Author: glebius Date: Mon Nov 21 12:23:22 2011 New Revision: 227787 URL: http://svn.freebsd.org/changeset/base/227787 Log: Better use pkill(1) in last commit. Submitted by: pjd Modified: head/etc/rc.resume Modified: head/etc/rc.resume ============================================================================== --- head/etc/rc.resume Mon Nov 21 12:21:00 2011 (r227786) +++ head/etc/rc.resume Mon Nov 21 12:23:22 2011 (r227787) @@ -50,7 +50,7 @@ if [ -r /var/run/rc.suspend.tch ]; then fi if [ -r /var/run/moused.pid ]; then - kill -HUP `head -1 /var/run/moused.pid` + pkill -HUP -F /var/run/moused.pid fi # Turns on a power supply of a card in the slot inactivated. From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 12: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 5B7C9106566C; Mon, 21 Nov 2011 12:23:27 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id E9B828FC12; Mon, 21 Nov 2011 12:23:26 +0000 (UTC) Received: by yenq9 with SMTP id q9so275953yen.13 for ; Mon, 21 Nov 2011 04:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=8KGHQ1S62r/cnMJUi3ky7km0QF+HCWp0h6CCWQn2f4Q=; b=IBHGAiYPgu1qeiDCnt7LAzMcwAQkRj4ll8Dl01V/gA3JUMVnioiHVGCBfnWZcdm3p5 HMoV4AMgfvtEQV5awNU8+w9y6yhKn+THO6AJirjVowQJNhGqYENs3vQ9lksSM161SIjw 8xRN3JFGZGeOHHDzDhfivKsw3//U9Ue6XJfis= MIME-Version: 1.0 Received: by 10.182.36.36 with SMTP id n4mr2936263obj.16.1321878206179; Mon, 21 Nov 2011 04:23:26 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.142.101 with HTTP; Mon, 21 Nov 2011 04:23:26 -0800 (PST) In-Reply-To: <20111121105108.GE50300@deviant.kiev.zoral.com.ua> References: <201111211036.pALAavS7039188@svn.freebsd.org> <20111121105108.GE50300@deviant.kiev.zoral.com.ua> Date: Mon, 21 Nov 2011 15:23:26 +0300 X-Google-Sender-Auth: dRtvsxlXXovZTw3RAN_lgCNvgHc Message-ID: From: Sergey Kandaurov To: Kostik Belousov 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: r227784 - 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: Mon, 21 Nov 2011 12:23:27 -0000 On 21 November 2011 14:51, Kostik Belousov wrote: > On Mon, Nov 21, 2011 at 10:36:57AM +0000, Sergey Kandaurov wrote: >> Author: pluknet >> Date: Mon Nov 21 10:36:57 2011 >> New Revision: 227784 >> URL: http://svn.freebsd.org/changeset/base/227784 >> >> Log: >> =A0 Use the acquired reference to the vmspace instead of direct derefere= ncing >> =A0 of p->p_vmspace like it is done in sysctl_kern_proc_vmmap(). >> >> Modified: >> =A0 head/sys/kern/kern_proc.c >> >> Modified: head/sys/kern/kern_proc.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/kern/kern_proc.c Mon Nov 21 08:12:36 2011 =A0 =A0 =A0 =A0(r= 227783) >> +++ head/sys/kern/kern_proc.c Mon Nov 21 10:36:57 2011 =A0 =A0 =A0 =A0(r= 227784) >> @@ -1528,7 +1528,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A >> =A0 =A0 =A0 } >> =A0 =A0 =A0 kve =3D malloc(sizeof(*kve), M_TEMP, M_WAITOK); >> >> - =A0 =A0 map =3D &p->p_vmspace->vm_map; =A0 =A0/* XXXRW: More locking r= equired? */ >> + =A0 =A0 map =3D &vm->vm_map; =A0 =A0 =A0/* XXXRW: More locking require= d? */ > It makes sense to remove the XXXRW comment, from both places. Thanks for your comment, committed. [Just though, why it was not done so far and if that comment may relate to something else.. ] > >> =A0 =A0 =A0 vm_map_lock_read(map); >> =A0 =A0 =A0 for (entry =3D map->header.next; entry !=3D &map->header; >> =A0 =A0 =A0 =A0 =A0 entry =3D entry->next) { > --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 12:59:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915861065673; Mon, 21 Nov 2011 12:59:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F3F38FC0C; Mon, 21 Nov 2011 12:59:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALCxrN0043781; Mon, 21 Nov 2011 12:59:53 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALCxr1U043777; Mon, 21 Nov 2011 12:59:53 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111211259.pALCxr1U043777@svn.freebsd.org> From: Attilio Rao Date: Mon, 21 Nov 2011 12:59: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: r227788 - in head/sys: kern 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: Mon, 21 Nov 2011 12:59:53 -0000 Author: attilio Date: Mon Nov 21 12:59:52 2011 New Revision: 227788 URL: http://svn.freebsd.org/changeset/base/227788 Log: Introduce the same mutex-wise fix in r227758 for sx locks. The functions that offer file and line specifications are: - sx_assert_ - sx_downgrade_ - sx_slock_ - sx_slock_sig_ - sx_sunlock_ - sx_try_slock_ - sx_try_xlock_ - sx_try_upgrade_ - sx_unlock_ - sx_xlock_ - sx_xlock_sig_ - sx_xunlock_ Now vm_map locking is fully converted and can avoid to know specifics about locking procedures. Reviewed by: kib MFC after: 1 month Modified: head/sys/kern/kern_sx.c head/sys/sys/sx.h head/sys/vm/vm_map.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Mon Nov 21 12:23:22 2011 (r227787) +++ head/sys/kern/kern_sx.c Mon Nov 21 12:59:52 2011 (r227788) @@ -256,7 +256,7 @@ _sx_slock(struct sx *sx, int opts, const } int -_sx_try_slock(struct sx *sx, const char *file, int line) +sx_try_slock_(struct sx *sx, const char *file, int line) { uintptr_t x; @@ -300,7 +300,7 @@ _sx_xlock(struct sx *sx, int opts, const } int -_sx_try_xlock(struct sx *sx, const char *file, int line) +sx_try_xlock_(struct sx *sx, const char *file, int line) { int rval; @@ -364,7 +364,7 @@ _sx_xunlock(struct sx *sx, const char *f * Return 1 if if the upgrade succeed, 0 otherwise. */ int -_sx_try_upgrade(struct sx *sx, const char *file, int line) +sx_try_upgrade_(struct sx *sx, const char *file, int line) { uintptr_t x; int success; @@ -394,7 +394,7 @@ _sx_try_upgrade(struct sx *sx, const cha * Downgrade an unrecursed exclusive lock into a single shared lock. */ void -_sx_downgrade(struct sx *sx, const char *file, int line) +sx_downgrade_(struct sx *sx, const char *file, int line) { uintptr_t x; int wakeup_swapper; Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Mon Nov 21 12:23:22 2011 (r227787) +++ head/sys/sys/sx.h Mon Nov 21 12:59:52 2011 (r227788) @@ -94,14 +94,14 @@ void sx_sysinit(void *arg); #define sx_init(sx, desc) sx_init_flags((sx), (desc), 0) void sx_init_flags(struct sx *sx, const char *description, int opts); void sx_destroy(struct sx *sx); +int sx_try_slock_(struct sx *sx, const char *file, int line); +int sx_try_xlock_(struct sx *sx, const char *file, int line); +int sx_try_upgrade_(struct sx *sx, const char *file, int line); +void sx_downgrade_(struct sx *sx, const char *file, int line); int _sx_slock(struct sx *sx, int opts, const char *file, int line); int _sx_xlock(struct sx *sx, int opts, const char *file, int line); -int _sx_try_slock(struct sx *sx, const char *file, int line); -int _sx_try_xlock(struct sx *sx, const char *file, int line); void _sx_sunlock(struct sx *sx, const char *file, int line); void _sx_xunlock(struct sx *sx, const char *file, int line); -int _sx_try_upgrade(struct sx *sx, const char *file, int line); -void _sx_downgrade(struct sx *sx, const char *file, int line); int _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file, int line); int _sx_slock_hard(struct sx *sx, int opts, const char *file, int line); @@ -208,30 +208,50 @@ __sx_sunlock(struct sx *sx, const char * #error "LOCK_DEBUG not defined, include before " #endif #if (LOCK_DEBUG > 0) || defined(SX_NOINLINE) -#define sx_xlock(sx) (void)_sx_xlock((sx), 0, LOCK_FILE, LOCK_LINE) -#define sx_xlock_sig(sx) \ - _sx_xlock((sx), SX_INTERRUPTIBLE, LOCK_FILE, LOCK_LINE) -#define sx_xunlock(sx) _sx_xunlock((sx), LOCK_FILE, LOCK_LINE) -#define sx_slock(sx) (void)_sx_slock((sx), 0, LOCK_FILE, LOCK_LINE) -#define sx_slock_sig(sx) \ - _sx_slock((sx), SX_INTERRUPTIBLE, LOCK_FILE, LOCK_LINE) -#define sx_sunlock(sx) _sx_sunlock((sx), LOCK_FILE, LOCK_LINE) +#define sx_xlock_(sx, file, line) \ + (void)_sx_xlock((sx), 0, (file), (line)) +#define sx_xlock_sig_(sx, file, line) \ + _sx_xlock((sx), SX_INTERRUPTIBLE, (file), (line)) +#define sx_xunlock_(sx, file, line) \ + _sx_xunlock((sx), (file), (line)) +#define sx_slock_(sx, file, line) \ + (void)_sx_slock((sx), 0, (file), (line)) +#define sx_slock_sig_(sx, file, line) \ + _sx_slock((sx), SX_INTERRUPTIBLE, (file) , (line)) +#define sx_sunlock_(sx, file, line) \ + _sx_sunlock((sx), (file), (line)) #else -#define sx_xlock(sx) \ - (void)__sx_xlock((sx), curthread, 0, LOCK_FILE, LOCK_LINE) -#define sx_xlock_sig(sx) \ - __sx_xlock((sx), curthread, SX_INTERRUPTIBLE, LOCK_FILE, LOCK_LINE) -#define sx_xunlock(sx) \ - __sx_xunlock((sx), curthread, LOCK_FILE, LOCK_LINE) -#define sx_slock(sx) (void)__sx_slock((sx), 0, LOCK_FILE, LOCK_LINE) -#define sx_slock_sig(sx) \ - __sx_slock((sx), SX_INTERRUPTIBLE, LOCK_FILE, LOCK_LINE) -#define sx_sunlock(sx) __sx_sunlock((sx), LOCK_FILE, LOCK_LINE) +#define sx_xlock_(sx, file, line) \ + (void)__sx_xlock((sx), curthread, 0, (file), (line)) +#define sx_xlock_sig_(sx, file, line) \ + __sx_xlock((sx), curthread, SX_INTERRUPTIBLE, (file), (line)) +#define sx_xunlock_(sx, file, line) \ + __sx_xunlock((sx), curthread, (file), (line)) +#define sx_slock_(sx, file, line) \ + (void)__sx_slock((sx), 0, (file), (line)) +#define sx_slock_sig_(sx, file, line) \ + __sx_slock((sx), SX_INTERRUPTIBLE, (file), (line)) +#define sx_sunlock_(sx, file, line) \ + __sx_sunlock((sx), (file), (line)) #endif /* LOCK_DEBUG > 0 || SX_NOINLINE */ -#define sx_try_slock(sx) _sx_try_slock((sx), LOCK_FILE, LOCK_LINE) -#define sx_try_xlock(sx) _sx_try_xlock((sx), LOCK_FILE, LOCK_LINE) -#define sx_try_upgrade(sx) _sx_try_upgrade((sx), LOCK_FILE, LOCK_LINE) -#define sx_downgrade(sx) _sx_downgrade((sx), LOCK_FILE, LOCK_LINE) +#define sx_try_slock(sx) sx_try_slock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_try_xlock(sx) sx_try_xlock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_try_upgrade(sx) sx_try_upgrade_((sx), LOCK_FILE, LOCK_LINE) +#define sx_downgrade(sx) sx_downgrade_((sx), LOCK_FILE, LOCK_LINE) +#ifdef INVARIANTS +#define sx_assert_(sx, what, file, line) \ + _sx_assert((sx), (what), (file), (line)) +#else +#define sx_assert_(sx, what, file, line) (void)0 +#endif + +#define sx_xlock(sx) sx_xlock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_xlock_sig(sx) sx_xlock_sig_((sx), LOCK_FILE, LOCK_LINE) +#define sx_xunlock(sx) sx_xunlock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_slock(sx) sx_slock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_slock_sig(sx) sx_slock_sig_((sx), LOCK_FILE, LOCK_LINE) +#define sx_sunlock(sx) sx_sunlock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_assert(sx, what) sx_assert_((sx), (what), __FILE__, __LINE__) /* * Return a pointer to the owning thread if the lock is exclusively @@ -245,13 +265,15 @@ __sx_sunlock(struct sx *sx, const char * (((sx)->sx_lock & ~(SX_LOCK_FLAGMASK & ~SX_LOCK_SHARED)) == \ (uintptr_t)curthread) -#define sx_unlock(sx) do { \ +#define sx_unlock_(sx, file, line) do { \ if (sx_xlocked(sx)) \ - sx_xunlock(sx); \ + sx_xunlock_(sx, file, line); \ else \ - sx_sunlock(sx); \ + sx_sunlock_(sx, file, line); \ } while (0) +#define sx_unlock(sx) sx_unlock_((sx), LOCK_FILE, LOCK_LINE) + #define sx_sleep(chan, sx, pri, wmesg, timo) \ _sleep((chan), &(sx)->lock_object, (pri), (wmesg), (timo)) @@ -287,12 +309,6 @@ __sx_sunlock(struct sx *sx, const char * #define SX_NOTRECURSED LA_NOTRECURSED #endif -#ifdef INVARIANTS -#define sx_assert(sx, what) _sx_assert((sx), (what), LOCK_FILE, LOCK_LINE) -#else -#define sx_assert(sx, what) (void)0 -#endif - #endif /* _KERNEL */ #endif /* !_SYS_SX_H_ */ Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Nov 21 12:23:22 2011 (r227787) +++ head/sys/vm/vm_map.c Mon Nov 21 12:59:52 2011 (r227788) @@ -466,7 +466,7 @@ _vm_map_lock(vm_map_t map, const char *f if (map->system_map) mtx_lock_flags_(&map->system_mtx, 0, file, line); else - (void)_sx_xlock(&map->lock, 0, file, line); + sx_xlock_(&map->lock, file, line); map->timestamp++; } @@ -491,7 +491,7 @@ _vm_map_unlock(vm_map_t map, const char if (map->system_map) mtx_unlock_flags_(&map->system_mtx, 0, file, line); else { - _sx_xunlock(&map->lock, file, line); + sx_xunlock_(&map->lock, file, line); vm_map_process_deferred(); } } @@ -503,7 +503,7 @@ _vm_map_lock_read(vm_map_t map, const ch if (map->system_map) mtx_lock_flags_(&map->system_mtx, 0, file, line); else - (void)_sx_slock(&map->lock, 0, file, line); + sx_slock_(&map->lock, file, line); } void @@ -513,7 +513,7 @@ _vm_map_unlock_read(vm_map_t map, const if (map->system_map) mtx_unlock_flags_(&map->system_mtx, 0, file, line); else { - _sx_sunlock(&map->lock, file, line); + sx_sunlock_(&map->lock, file, line); vm_map_process_deferred(); } } @@ -525,7 +525,7 @@ _vm_map_trylock(vm_map_t map, const char error = map->system_map ? !mtx_trylock_flags_(&map->system_mtx, 0, file, line) : - !_sx_try_xlock(&map->lock, file, line); + !sx_try_xlock_(&map->lock, file, line); if (error == 0) map->timestamp++; return (error == 0); @@ -538,7 +538,7 @@ _vm_map_trylock_read(vm_map_t map, const error = map->system_map ? !mtx_trylock_flags_(&map->system_mtx, 0, file, line) : - !_sx_try_slock(&map->lock, file, line); + !sx_try_slock_(&map->lock, file, line); return (error == 0); } @@ -560,17 +560,17 @@ _vm_map_lock_upgrade(vm_map_t map, const if (map->system_map) { mtx_assert_(&map->system_mtx, MA_OWNED, file, line); } else { - if (!_sx_try_upgrade(&map->lock, file, line)) { + if (!sx_try_upgrade_(&map->lock, file, line)) { last_timestamp = map->timestamp; - _sx_sunlock(&map->lock, file, line); + sx_sunlock_(&map->lock, file, line); vm_map_process_deferred(); /* * If the map's timestamp does not change while the * map is unlocked, then the upgrade succeeds. */ - (void)_sx_xlock(&map->lock, 0, file, line); + sx_xlock_(&map->lock, file, line); if (last_timestamp != map->timestamp) { - _sx_xunlock(&map->lock, file, line); + sx_xunlock_(&map->lock, file, line); return (1); } } @@ -586,7 +586,7 @@ _vm_map_lock_downgrade(vm_map_t map, con if (map->system_map) { mtx_assert_(&map->system_mtx, MA_OWNED, file, line); } else - _sx_downgrade(&map->lock, file, line); + sx_downgrade_(&map->lock, file, line); } /* @@ -605,7 +605,6 @@ vm_map_locked(vm_map_t map) return (sx_xlocked(&map->lock)); } -/* XXX: INVARIANTS here is still necessary because of sx support. */ #ifdef INVARIANTS static void _vm_map_assert_locked(vm_map_t map, const char *file, int line) @@ -614,28 +613,13 @@ _vm_map_assert_locked(vm_map_t map, cons if (map->system_map) mtx_assert_(&map->system_mtx, MA_OWNED, file, line); else - _sx_assert(&map->lock, SA_XLOCKED, file, line); + sx_assert_(&map->lock, SA_XLOCKED, file, line); } -#if 0 -static void -_vm_map_assert_locked_read(vm_map_t map, const char *file, int line) -{ - - if (map->system_map) - mtx_assert_(&map->system_mtx, MA_OWNED, file, line); - else - _sx_assert(&map->lock, SA_SLOCKED, file, line); -} -#endif - #define VM_MAP_ASSERT_LOCKED(map) \ _vm_map_assert_locked(map, LOCK_FILE, LOCK_LINE) -#define VM_MAP_ASSERT_LOCKED_READ(map) \ - _vm_map_assert_locked_read(map, LOCK_FILE, LOCK_LINE) #else #define VM_MAP_ASSERT_LOCKED(map) -#define VM_MAP_ASSERT_LOCKED_READ(map) #endif /* @@ -660,7 +644,7 @@ _vm_map_unlock_and_wait(vm_map_t map, in if (map->system_map) mtx_unlock_flags_(&map->system_mtx, 0, file, line); else - _sx_xunlock(&map->lock, file, line); + sx_xunlock_(&map->lock, file, line); return (msleep(&map->root, &map_sleep_mtx, PDROP | PVM, "vmmaps", timo)); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 13:34: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 AB708106564A; Mon, 21 Nov 2011 13:34:30 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A25F8FC19; Mon, 21 Nov 2011 13:34:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALDYUDe044884; Mon, 21 Nov 2011 13:34:30 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALDYUXu044881; Mon, 21 Nov 2011 13:34:30 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111211334.pALDYUXu044881@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 21 Nov 2011 13:34: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: r227789 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 13:34:30 -0000 Author: lstewart Date: Mon Nov 21 13:34:29 2011 New Revision: 227789 URL: http://svn.freebsd.org/changeset/base/227789 Log: - Add Pulse-Per-Second timestamping using raw ffcounter and corresponding ffclock time in seconds. - Add IOCTL to retrieve ffclock timestamps from userland. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au) Modified: head/sys/kern/kern_tc.c head/sys/sys/timepps.h Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon Nov 21 12:59:52 2011 (r227788) +++ head/sys/kern/kern_tc.c Mon Nov 21 13:34:29 2011 (r227789) @@ -1365,6 +1365,9 @@ pps_ioctl(u_long cmd, caddr_t data, stru { pps_params_t *app; struct pps_fetch_args *fapi; +#ifdef FFCLOCK + struct pps_fetch_ffc_args *fapi_ffc; +#endif #ifdef PPS_SYNC struct pps_kcbind_args *kapi; #endif @@ -1379,6 +1382,11 @@ pps_ioctl(u_long cmd, caddr_t data, stru app = (pps_params_t *)data; if (app->mode & ~pps->ppscap) return (EINVAL); +#ifdef FFCLOCK + /* Ensure only a single clock is selected for ffc timestamp. */ + if ((app->mode & PPS_TSCLK_MASK) == PPS_TSCLK_MASK) + return (EINVAL); +#endif pps->ppsparam = *app; return (0); case PPS_IOC_GETPARAMS: @@ -1398,6 +1406,31 @@ pps_ioctl(u_long cmd, caddr_t data, stru pps->ppsinfo.current_mode = pps->ppsparam.mode; fapi->pps_info_buf = pps->ppsinfo; return (0); +#ifdef FFCLOCK + case PPS_IOC_FETCH_FFCOUNTER: + fapi_ffc = (struct pps_fetch_ffc_args *)data; + if (fapi_ffc->tsformat && fapi_ffc->tsformat != + PPS_TSFMT_TSPEC) + return (EINVAL); + if (fapi_ffc->timeout.tv_sec || fapi_ffc->timeout.tv_nsec) + return (EOPNOTSUPP); + pps->ppsinfo_ffc.current_mode = pps->ppsparam.mode; + fapi_ffc->pps_info_buf_ffc = pps->ppsinfo_ffc; + /* Overwrite timestamps if feedback clock selected. */ + switch (pps->ppsparam.mode & PPS_TSCLK_MASK) { + case PPS_TSCLK_FBCK: + fapi_ffc->pps_info_buf_ffc.assert_timestamp = + pps->ppsinfo.assert_timestamp; + fapi_ffc->pps_info_buf_ffc.clear_timestamp = + pps->ppsinfo.clear_timestamp; + break; + case PPS_TSCLK_FFWD: + break; + default: + break; + } + return (0); +#endif /* FFCLOCK */ case PPS_IOC_KCBIND: #ifdef PPS_SYNC kapi = (struct pps_kcbind_args *)data; @@ -1426,6 +1459,9 @@ pps_init(struct pps_state *pps) pps->ppscap |= PPS_OFFSETASSERT; if (pps->ppscap & PPS_CAPTURECLEAR) pps->ppscap |= PPS_OFFSETCLEAR; +#ifdef FFCLOCK + pps->ppscap |= PPS_TSCLK_MASK; +#endif } void @@ -1437,6 +1473,9 @@ pps_capture(struct pps_state *pps) th = timehands; pps->capgen = th->th_generation; pps->capth = th; +#ifdef FFCLOCK + pps->capffth = fftimehands; +#endif pps->capcount = th->th_counter->tc_get_timecount(th->th_counter); if (pps->capgen != th->th_generation) pps->capgen = 0; @@ -1450,6 +1489,11 @@ pps_event(struct pps_state *pps, int eve u_int tcount, *pcount; int foff, fhard; pps_seq_t *pseq; +#ifdef FFCLOCK + struct timespec *tsp_ffc; + pps_seq_t *pseq_ffc; + ffcounter *ffcount; +#endif KASSERT(pps != NULL, ("NULL pps pointer in pps_event")); /* If the timecounter was wound up underneath us, bail out. */ @@ -1464,6 +1508,11 @@ pps_event(struct pps_state *pps, int eve fhard = pps->kcmode & PPS_CAPTUREASSERT; pcount = &pps->ppscount[0]; pseq = &pps->ppsinfo.assert_sequence; +#ifdef FFCLOCK + ffcount = &pps->ppsinfo_ffc.assert_ffcount; + tsp_ffc = &pps->ppsinfo_ffc.assert_timestamp; + pseq_ffc = &pps->ppsinfo_ffc.assert_sequence; +#endif } else { tsp = &pps->ppsinfo.clear_timestamp; osp = &pps->ppsparam.clear_offset; @@ -1471,6 +1520,11 @@ pps_event(struct pps_state *pps, int eve fhard = pps->kcmode & PPS_CAPTURECLEAR; pcount = &pps->ppscount[1]; pseq = &pps->ppsinfo.clear_sequence; +#ifdef FFCLOCK + ffcount = &pps->ppsinfo_ffc.clear_ffcount; + tsp_ffc = &pps->ppsinfo_ffc.clear_timestamp; + pseq_ffc = &pps->ppsinfo_ffc.clear_sequence; +#endif } /* @@ -1507,6 +1561,17 @@ pps_event(struct pps_state *pps, int eve tsp->tv_sec -= 1; } } + +#ifdef FFCLOCK + *ffcount = pps->capffth->tick_ffcount + tcount; + bt = pps->capffth->tick_time; + ffclock_convert_delta(tcount, pps->capffth->cest.period, &bt); + bintime_add(&bt, &pps->capffth->tick_time); + bintime2timespec(&bt, &ts); + (*pseq_ffc)++; + *tsp_ffc = ts; +#endif + #ifdef PPS_SYNC if (fhard) { uint64_t scale; Modified: head/sys/sys/timepps.h ============================================================================== --- head/sys/sys/timepps.h Mon Nov 21 12:59:52 2011 (r227788) +++ head/sys/sys/timepps.h Mon Nov 21 13:34:29 2011 (r227789) @@ -6,6 +6,12 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Julien Ridoux at the University + * of Melbourne under sponsorship from the FreeBSD Foundation. + * * $FreeBSD$ * * The is a FreeBSD version of the RFC 2783 API for Pulse Per Second @@ -15,6 +21,7 @@ #ifndef _SYS_TIMEPPS_H_ #define _SYS_TIMEPPS_H_ +#include #include #include @@ -43,6 +50,16 @@ typedef struct { int current_mode; /* current mode bits */ } pps_info_t; +typedef struct { + pps_seq_t assert_sequence; /* assert event seq # */ + pps_seq_t clear_sequence; /* clear event seq # */ + pps_timeu_t assert_tu; + pps_timeu_t clear_tu; + ffcounter assert_ffcount; /* ffcounter on assert event */ + ffcounter clear_ffcount; /* ffcounter on clear event */ + int current_mode; /* current mode bits */ +} pps_info_ffc_t; + #define assert_timestamp assert_tu.tspec #define clear_timestamp clear_tu.tspec @@ -79,6 +96,10 @@ typedef struct { #define PPS_TSFMT_TSPEC 0x1000 #define PPS_TSFMT_NTPFP 0x2000 +#define PPS_TSCLK_FBCK 0x10000 +#define PPS_TSCLK_FFWD 0x20000 +#define PPS_TSCLK_MASK 0x30000 + #define PPS_KC_HARDPPS 0 #define PPS_KC_HARDPPS_PLL 1 #define PPS_KC_HARDPPS_FLL 2 @@ -89,6 +110,12 @@ struct pps_fetch_args { struct timespec timeout; }; +struct pps_fetch_ffc_args { + int tsformat; + pps_info_ffc_t pps_info_buf_ffc; + struct timespec timeout; +}; + struct pps_kcbind_args { int kernel_consumer; int edge; @@ -102,18 +129,21 @@ struct pps_kcbind_args { #define PPS_IOC_GETCAP _IOR('1', 5, int) #define PPS_IOC_FETCH _IOWR('1', 6, struct pps_fetch_args) #define PPS_IOC_KCBIND _IOW('1', 7, struct pps_kcbind_args) +#define PPS_IOC_FETCH_FFCOUNTER _IOWR('1', 8, struct pps_fetch_ffc_args) #ifdef _KERNEL struct pps_state { /* Capture information. */ struct timehands *capth; + struct fftimehands *capffth; unsigned capgen; unsigned capcount; /* State information. */ pps_params_t ppsparam; pps_info_t ppsinfo; + pps_info_ffc_t ppsinfo_ffc; int kcmode; int ppscap; struct timecounter *ppstc; @@ -184,6 +214,25 @@ time_pps_fetch(pps_handle_t handle, cons } static __inline int +time_pps_fetch_ffc(pps_handle_t handle, const int tsformat, + pps_info_ffc_t *ppsinfobuf, const struct timespec *timeout) +{ + struct pps_fetch_ffc_args arg; + int error; + + arg.tsformat = tsformat; + if (timeout == NULL) { + arg.timeout.tv_sec = -1; + arg.timeout.tv_nsec = -1; + } else { + arg.timeout = *timeout; + } + error = ioctl(handle, PPS_IOC_FETCH_FFCOUNTER, &arg); + *ppsinfobuf = arg.pps_info_buf_ffc; + return (error); +} + +static __inline int time_pps_kcbind(pps_handle_t handle, const int kernel_consumer, const int edge, const int tsformat) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 13:40: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 00350106564A; Mon, 21 Nov 2011 13:40:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44888FC15; Mon, 21 Nov 2011 13:40:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALDeZGE045095; Mon, 21 Nov 2011 13:40:35 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALDeZIn045093; Mon, 21 Nov 2011 13:40:35 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111211340.pALDeZIn045093@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 21 Nov 2011 13:40: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: r227790 - 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: Mon, 21 Nov 2011 13:40:36 -0000 Author: glebius Date: Mon Nov 21 13:40:35 2011 New Revision: 227790 URL: http://svn.freebsd.org/changeset/base/227790 Log: Be more informative for "unknown hardware address format" message. Submitted by: Andrzej Tobola Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Nov 21 13:34:29 2011 (r227789) +++ head/sys/netinet/if_ether.c Mon Nov 21 13:40:35 2011 (r227790) @@ -443,8 +443,10 @@ arpintr(struct mbuf *m) ntohs(ar->ar_hrd) != ARPHRD_ARCNET && ntohs(ar->ar_hrd) != ARPHRD_IEEE1394 && ntohs(ar->ar_hrd) != ARPHRD_INFINIBAND) { - log(LOG_NOTICE, "arp: unknown hardware address format (0x%2D)\n", - (unsigned char *)&ar->ar_hrd, ""); + log(LOG_NOTICE, "arp: unknown hardware address format (0x%2D)" + " (from %*D to %*D)\n", (unsigned char *)&ar->ar_hrd, "", + ETHER_ADDR_LEN, (u_char *)ar_sha(ar), ":", + ETHER_ADDR_LEN, (u_char *)ar_tha(ar), ":"); m_freem(m); return; } From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 14:10: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 A77BE1065670; Mon, 21 Nov 2011 14:10:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9659B8FC15; Mon, 21 Nov 2011 14:10:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALEAD0T046141; Mon, 21 Nov 2011 14:10:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALEAD9B046139; Mon, 21 Nov 2011 14:10:13 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111211410.pALEAD9B046139@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 21 Nov 2011 14:10: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: r227791 - 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: Mon, 21 Nov 2011 14:10:13 -0000 Author: glebius Date: Mon Nov 21 14:10:13 2011 New Revision: 227791 URL: http://svn.freebsd.org/changeset/base/227791 Log: Historically in_control() did not check sockaddrs supplied with structs ifreq/in_aliasreq and there've been several panics due to that problem. All these panics were fixed just a couple of lines above the panicing code. Take a more general approach: sanity check sockaddrs supplied with SIOCAIFADDR and SIOCSIF*ADDR at the beggining of the function and drop all checks below. One check is now disabled due to strange code in ifconfig(8) that I've removed recently. I'm going to enable it with next __FreeBSD_version bump. Historically in_ifinit() was able to recover from an error and restore old address. Nowadays this feature isn't working for all error cases, but for some of them. I suppose no software relies on this behavior, so I'd like to remove it, since this simplifies code a lot. Also, move if_scrub() earlier in the in_ifinit(). It is more correct to wipe routes before removing address from local address list, and interface address list. Silence from: bz, brooks, andre, rwatson, 3 weeks Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Nov 21 13:40:35 2011 (r227790) +++ head/sys/netinet/in.c Mon Nov 21 14:10:13 2011 (r227791) @@ -234,16 +234,42 @@ in_control(struct socket *so, u_long cmd * in_lifaddr_ioctl() and ifp->if_ioctl(). */ switch (cmd) { - case SIOCAIFADDR: - case SIOCDIFADDR: case SIOCGIFADDR: case SIOCGIFBRDADDR: case SIOCGIFDSTADDR: case SIOCGIFNETMASK: + case SIOCDIFADDR: + break; + case SIOCAIFADDR: + /* + * ifra_addr must be present and be of INET family. + * ifra_broadaddr and ifra_mask are optional. + */ + if (ifra->ifra_addr.sin_len != sizeof(struct sockaddr_in) || + ifra->ifra_addr.sin_family != AF_INET) + return (EINVAL); + if (ifra->ifra_broadaddr.sin_len != 0 && + (ifra->ifra_broadaddr.sin_len != sizeof(struct sockaddr_in) || + ifra->ifra_broadaddr.sin_family != AF_INET)) + return (EINVAL); +#if 0 + /* + * ifconfig(8) historically doesn't set af_family for mask + * for unknown reason. + */ + if (ifra->ifra_mask.sin_len != 0 && + (ifra->ifra_mask.sin_len != sizeof(struct sockaddr_in) || + ifra->ifra_mask.sin_family != AF_INET)) + return (EINVAL); +#endif + break; case SIOCSIFADDR: case SIOCSIFBRDADDR: case SIOCSIFDSTADDR: case SIOCSIFNETMASK: + if (ifr->ifr_addr.sa_family != AF_INET || + ifr->ifr_addr.sa_len != sizeof(struct sockaddr_in)) + return (EINVAL); break; case SIOCALIFADDR: @@ -349,7 +375,7 @@ in_control(struct socket *so, u_long cmd switch (cmd) { case SIOCAIFADDR: case SIOCDIFADDR: - if (ifra->ifra_addr.sin_family == AF_INET) { + { struct in_ifaddr *oia; IN_IFADDR_RLOCK(); @@ -506,7 +532,7 @@ in_control(struct socket *so, u_long cmd goto out; case SIOCSIFNETMASK: - ia->ia_sockmask.sin_addr = ifra->ifra_addr.sin_addr; + ia->ia_sockmask = *(struct sockaddr_in *)&ifr->ifr_addr; ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr); goto out; @@ -514,14 +540,12 @@ in_control(struct socket *so, u_long cmd maskIsNew = 0; hostIsNew = 1; error = 0; - if (ia->ia_addr.sin_family == AF_INET) { - if (ifra->ifra_addr.sin_len == 0) { - ifra->ifra_addr = ia->ia_addr; - hostIsNew = 0; - } else if (ifra->ifra_addr.sin_addr.s_addr == - ia->ia_addr.sin_addr.s_addr) - hostIsNew = 0; - } + if (ifra->ifra_addr.sin_len == 0) { + ifra->ifra_addr = ia->ia_addr; + hostIsNew = 0; + } else if (ifra->ifra_addr.sin_addr.s_addr == + ia->ia_addr.sin_addr.s_addr) + hostIsNew = 0; if (ifra->ifra_mask.sin_len) { /* * QL: XXX @@ -552,7 +576,7 @@ in_control(struct socket *so, u_long cmd break; if ((ifp->if_flags & IFF_BROADCAST) && - (ifra->ifra_broadaddr.sin_family == AF_INET)) + ifra->ifra_broadaddr.sin_len) ia->ia_broadaddr = ifra->ifra_broadaddr; if (error == 0) { ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); @@ -608,31 +632,26 @@ in_control(struct socket *so, u_long cmd IN_IFADDR_WLOCK(); TAILQ_REMOVE(&V_in_ifaddrhead, ia, ia_link); - if (ia->ia_addr.sin_family == AF_INET) { - struct in_ifaddr *if_ia; - LIST_REMOVE(ia, ia_hash); - IN_IFADDR_WUNLOCK(); - /* - * If this is the last IPv4 address configured on this - * interface, leave the all-hosts group. - * No state-change report need be transmitted. - */ - if_ia = NULL; - IFP_TO_IA(ifp, if_ia); - if (if_ia == NULL) { - ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); - IN_MULTI_LOCK(); - if (ii->ii_allhosts) { - (void)in_leavegroup_locked(ii->ii_allhosts, - NULL); - ii->ii_allhosts = NULL; - } - IN_MULTI_UNLOCK(); - } else - ifa_free(&if_ia->ia_ifa); + LIST_REMOVE(ia, ia_hash); + IN_IFADDR_WUNLOCK(); + /* + * If this is the last IPv4 address configured on this + * interface, leave the all-hosts group. + * No state-change report need be transmitted. + */ + IFP_TO_IA(ifp, iap); + if (iap == NULL) { + ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); + IN_MULTI_LOCK(); + if (ii->ii_allhosts) { + (void)in_leavegroup_locked(ii->ii_allhosts, NULL); + ii->ii_allhosts = NULL; + } + IN_MULTI_UNLOCK(); } else - IN_IFADDR_WUNLOCK(); + ifa_free(&iap->ia_ifa); + ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ out: if (ia != NULL) @@ -828,50 +847,29 @@ in_ifinit(struct ifnet *ifp, struct in_i int scrub) { register u_long i = ntohl(sin->sin_addr.s_addr); - struct sockaddr_in oldaddr; int flags = RTF_UP, error = 0; - oldaddr = ia->ia_addr; - if (oldaddr.sin_family == AF_INET) + if (scrub) + in_scrubprefix(ia, LLE_STATIC); + + IN_IFADDR_WLOCK(); + if (ia->ia_addr.sin_family == AF_INET) LIST_REMOVE(ia, ia_hash); ia->ia_addr = *sin; - if (ia->ia_addr.sin_family == AF_INET) { - IN_IFADDR_WLOCK(); - LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.sin_addr.s_addr), - ia, ia_hash); - IN_IFADDR_WUNLOCK(); - } + LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.sin_addr.s_addr), + ia, ia_hash); + IN_IFADDR_WUNLOCK(); + /* * Give the interface a chance to initialize * if this is its first address, * and to validate the address if necessary. */ - if (ifp->if_ioctl != NULL) { - error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); - if (error) { + if (ifp->if_ioctl != NULL && + (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia)) != 0) /* LIST_REMOVE(ia, ia_hash) is done in in_control */ - ia->ia_addr = oldaddr; - IN_IFADDR_WLOCK(); - if (ia->ia_addr.sin_family == AF_INET) - LIST_INSERT_HEAD(INADDR_HASH( - ia->ia_addr.sin_addr.s_addr), ia, ia_hash); - else - /* - * If oldaddr family is not AF_INET (e.g. - * interface has been just created) in_control - * does not call LIST_REMOVE, and we end up - * with bogus ia entries in hash - */ - LIST_REMOVE(ia, ia_hash); - IN_IFADDR_WUNLOCK(); return (error); - } - } - if (scrub) { - ia->ia_ifa.ifa_addr = (struct sockaddr *)&oldaddr; - in_ifscrub(ifp, ia, LLE_STATIC); - ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; - } + /* * Be compatible with network classes, if netmask isn't supplied, * guess it based on classes. @@ -916,11 +914,9 @@ in_ifinit(struct ifnet *ifp, struct in_i if (ia->ia_addr.sin_addr.s_addr == INADDR_ANY) return (0); - if (ifp->if_flags & IFF_POINTOPOINT) { - if (ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) + if (ifp->if_flags & IFF_POINTOPOINT && + ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) return (0); - } - /* * add a loopback route to self From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 14:36: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 A3DF9106566C; Mon, 21 Nov 2011 14:36:19 +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 93AD28FC17; Mon, 21 Nov 2011 14:36:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALEaJvd047091; Mon, 21 Nov 2011 14:36:19 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALEaJSn047089; Mon, 21 Nov 2011 14:36:19 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201111211436.pALEaJSn047089@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 21 Nov 2011 14:36: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: r227792 - 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: Mon, 21 Nov 2011 14:36:19 -0000 Author: pluknet Date: Mon Nov 21 14:36:19 2011 New Revision: 227792 URL: http://svn.freebsd.org/changeset/base/227792 Log: Add history for setsockopt(2). PR: docs/162719 Submitted by: Niclas Zeising MFC after: 1 week Modified: head/lib/libc/sys/getsockopt.2 Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Mon Nov 21 14:10:13 2011 (r227791) +++ head/lib/libc/sys/getsockopt.2 Mon Nov 21 14:36:19 2011 (r227792) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd June 13, 2008 +.Dd November 21, 2011 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -533,7 +533,9 @@ on a non-listening socket was attempted. .Sh HISTORY The .Fn getsockopt -system call appeared in +and +.Fn setsockopt +system calls appeared in .Bx 4.2 . .Sh BUGS Several of the socket options should be handled at lower levels of the system. From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 14:50: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 1A6BC10656FB; Mon, 21 Nov 2011 14:50:18 +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 E410A8FC0A; Mon, 21 Nov 2011 14:50:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALEoHfr047549; Mon, 21 Nov 2011 14:50:17 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALEoHUK047544; Mon, 21 Nov 2011 14:50:17 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111211450.pALEoHUK047544@svn.freebsd.org> From: Martin Matuska Date: Mon, 21 Nov 2011 14:50: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: r227793 - in head/cddl: sbin/zfs sbin/zpool usr.bin/zstreamdump usr.sbin/zdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 14:50:18 -0000 Author: mm Date: Mon Nov 21 14:50:17 2011 New Revision: 227793 URL: http://svn.freebsd.org/changeset/base/227793 Log: For now, remove MANFILTER from ZFS manpages (bad effect on html output). MFC after: 4 days Modified: head/cddl/sbin/zfs/Makefile head/cddl/sbin/zpool/Makefile head/cddl/usr.bin/zstreamdump/Makefile head/cddl/usr.sbin/zdb/Makefile Modified: head/cddl/sbin/zfs/Makefile ============================================================================== --- head/cddl/sbin/zfs/Makefile Mon Nov 21 14:36:19 2011 (r227792) +++ head/cddl/sbin/zfs/Makefile Mon Nov 21 14:50:17 2011 (r227793) @@ -25,6 +25,4 @@ DPADD= ${LIBGEOM} ${LIBNVPAIR} ${LIBUMEM ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} LDADD= -lgeom -lnvpair -lumem -lutil -luutil -lzfs -MANFILTER= sed -e '/^$$/d' - .include Modified: head/cddl/sbin/zpool/Makefile ============================================================================== --- head/cddl/sbin/zpool/Makefile Mon Nov 21 14:36:19 2011 (r227792) +++ head/cddl/sbin/zpool/Makefile Mon Nov 21 14:50:17 2011 (r227793) @@ -30,6 +30,4 @@ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} LDADD= -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs -MANFILTER= sed -e '/^$$/d' - .include Modified: head/cddl/usr.bin/zstreamdump/Makefile ============================================================================== --- head/cddl/usr.bin/zstreamdump/Makefile Mon Nov 21 14:36:19 2011 (r227792) +++ head/cddl/usr.bin/zstreamdump/Makefile Mon Nov 21 14:50:17 2011 (r227793) @@ -24,6 +24,4 @@ LDADD= -lm -lnvpair -lumem -lzpool -lpth CSTD= c99 -MANFILTER= sed -e '/^$$/d' - .include Modified: head/cddl/usr.sbin/zdb/Makefile ============================================================================== --- head/cddl/usr.sbin/zdb/Makefile Mon Nov 21 14:36:19 2011 (r227792) +++ head/cddl/usr.sbin/zdb/Makefile Mon Nov 21 14:50:17 2011 (r227793) @@ -27,6 +27,4 @@ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} $ ${LIBUUTIL} ${LIBZFS} ${LIBZPOOL} LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool -MANFILTER= sed -e '/^$$/d' - .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 15:26: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 1CCD8106566B; Mon, 21 Nov 2011 15:26:21 +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 0A7248FC14; Mon, 21 Nov 2011 15:26:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALFQLHl048728; Mon, 21 Nov 2011 15:26:21 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALFQKVJ048725; Mon, 21 Nov 2011 15:26:20 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111211526.pALFQKVJ048725@svn.freebsd.org> From: Martin Matuska Date: Mon, 21 Nov 2011 15:26: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: r227794 - in head/cddl/contrib/opensolaris/cmd: zfs zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 15:26:21 -0000 Author: mm Date: Mon Nov 21 15:26:20 2011 New Revision: 227794 URL: http://svn.freebsd.org/changeset/base/227794 Log: Update zfs(8) and zpool(8) manpages from CDDL-licensed sources [1]. Improved alignment for a maximum width of 80 characters. Mark unsupported parts as such. Reported to vendor: Illumos issue #1801 References: https://www.illumos.org/issues/1801 Obtained from: OpenSolaris CDDL manual pages (snv_134, s11express) [1] MFC after: 4 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 21 14:50:17 2011 (r227793) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 21 15:26:20 2011 (r227794) @@ -1,8 +1,5 @@ '\" te -.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. -.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with -.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.\" Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] @@ -10,7 +7,7 @@ .\" Copyright 2011 by Delphix. All rights reserved. .\" Portions Copyright 2011 Pawel Jakub Dawidek .\" Portions Copyright 2011 Martin Matuska -.TH ZFS 8 "September 24, 2009" FreeBSD +.TH ZFS 8 "November 21, 2011" FreeBSD .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS @@ -94,13 +91,13 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIsource\fR[,...]] - "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ... +\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR all | \fIfield\fR[,...]] [\fB-s\fR \fIsource\fR[,...]] + all | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ... .fi .LP .nf -\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ... +\fBzfs\fR \fBinherit\fR [\fB-rS\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ... .fi .LP @@ -152,7 +149,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBsend\fR [\fB-vR\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR +\fBzfs\fR \fBsend\fR [\fB-DvRp\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR .fi .LP @@ -162,7 +159,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] \fB-d\fR \fIfilesystem\fR +\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] [\fB-d\fR | \fB-e\fR] \fIfilesystem\fR .fi .LP @@ -172,7 +169,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] +\fBzfs\fR \fBallow\fR [\fB-ldug\fR] \fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] \fIfilesystem\fR|\fIvolume\fR .fi @@ -193,7 +190,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] +\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] \fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR .fi @@ -237,6 +234,11 @@ zfs \- configures ZFS file systems \fBzfs\fR \fBunjail\fR \fIjailid\fR \fIfilesystem\fR .fi +.LP +.nf +\fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot\fR|\fIfilesystem\fR +.fi + .SH DESCRIPTION .sp .LP @@ -396,6 +398,16 @@ A \fBZFS\fR dataset can be detached from After a dataset is attached to a jail and the \fBjailed\fR property is set, a jailed file system cannot be mounted outside the jail, since the jail administrator might have set the mount point to an unacceptable value. +.SS "Deduplication" +.sp +.LP +Deduplication is the process of removing redundant data at the block-level, +reducing the total amount of data stored. Deduplication is pool-wide; each +dataset can opt in or out using its own \fBdedup\fR property. If a file system +has the \fBdedup\fR property enabled, duplicate data blocks are removed +synchronously on write. The result is that only unique data are stored and +common components are shared among files in all datasets in the pool that have +\fBdedup\fR enabled. .SS "Native Properties" .sp .LP @@ -559,10 +571,11 @@ The type of dataset: \fBfilesystem\fR, \ The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into -account the reservations of any descendent datasets. The amount of space that a -dataset consumes from its parent, as well as the amount of space that are freed -if this dataset is recursively destroyed, is the greater of its space used and -its reservation. +account \fBrefreservation\fR (through \fBusedbyrefreservation\fR) and the +reservations of any descendent datasets (through \fBusedbychildren\fR). The +amount of space that a dataset consumes from its parent, as well as the amount +of space that are freed if this dataset is recursively destroyed, is the +greater of its space used and its reservation. .sp When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with @@ -624,6 +637,14 @@ destroying any necessary snapshots or de .RS 4n The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed. +.sp +Space accounted for by this property represents potential consumption by future +writes, reserved in advance to prevent write allocation failures in this +dataset. This can include unwritten data, space currently shared with +snapshots, and compression savings for volumes (which may be lost when +replaced with less compressible data). When allocations for later writes +increase \fBusedbydataset\fR or \fBusedbysnapshots\fR, +\fBusedbyrefreservation\fR will decrease accordingly. .RE .sp @@ -874,6 +895,25 @@ property at file system creation time by .sp .ne 2 .na +\fB\fBdedup\fR=\fBon\fR | \fBoff\fR | \fBverify\fR | +\fBsha256\fR[,\fBverify\fR]\fR +.ad +.sp .6 +.RS 4n +Controls whether deduplication is in effect for a dataset. The default value +is \fBoff\fR. The default checksum used for deduplication is \fBsha256\fR +(subject to change). When \fBdedup\fR is enabled, the \fBdedup\fR checksum +algorithm overrides the \fBchecksum\fR property. Setting the value to +\fBverify\fR is equivalent to specifying \fBsha256,verify\fR. +.sp +If the property is set to \fBverify\fR, then, whenever two blocks have the +same signature, ZFS will do a byte-for-byte comparison with the existing block +to ensure that the contents are identical. +.RE + +.sp +.ne 2 +.na \fB\fBdevices\fR=\fBon\fR | \fBoff\fR\fR .ad .sp .6 @@ -907,6 +947,16 @@ section for more information. The defaul .sp .ne 2 .na +\fB\fBmlslabel\fR=\fIlabel\fR | \fBnone\fR\fR +.ad +.sp .6 +.RS 4n +The \fBmlslabel\fR property is not supported on FreeBSD. +.RE + +.sp +.ne 2 +.na \fB\fBmountpoint\fR=\fIpath\fR | \fBnone\fR | \fBlegacy\fR\fR .ad .sp .6 @@ -931,7 +981,7 @@ new location. .sp .6 .RS 4n Controls whether the file system should be mounted with \fBnbmand\fR (Non -Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this +Blocking mandatory locks). This is used for \fBSMB\fR clients. Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(8) for more information on \fBnbmand\fR mounts. .RE @@ -970,17 +1020,96 @@ implicit quota. .sp .ne 2 .na +\fB\fBsync=standard\fR | \fBalways\fR | \fBdisabled\fR\fR +.ad +.sp .6 +.RS 4n +Determines the degree to which file system transactions are synchronized. This +property can be set when a dataset is created, or dynamically, and will take +effect immediately. \fBsync\fR can have one of the following settings: +.sp +.ne 2 +.na +\fB\fBstandard\fR\fR +.ad +.sp .6 +.RS 4n +The default option. Synchronous file system transactions are written to the +intent log and then all devices written are flushed to ensure the data is +stable (that is, not cached by device controllers). +.RE + +.sp +.ne 2 +.na +\fB\fBalways\fR\fR +.ad +.sp .6 +.RS 4n +Every file system transaction would be written and flushed to stable storage. +This setting should be used only where extreme caution is required, as there +is a significant performance penalty. +.RE + +.sp +.ne 2 +.na +\fB\fBdisabled\fR\fR +.ad +.sp .6 +.RS 4n +Synchronous requests are disabled. File system transactions commit to stable +storage only on the next DMU transaction group commit, which might be after +many seconds. This setting gives the highest performance. However, it is very +dangerous as ZFS would be ignoring the synchronous transaction demands of +applications such as databases or NFS. Furthermore, when this setting is in +effect for the currently active root or \fB/var\fR filesystem, out-of-spec +behavior, application data loss, and increased vulnerability to replay attacks +can result. Administrators should only use this option only when these risks +are understood. +.RE + +To change the property, use a command such as either of the following: +.sp +.in +2 +.nf +# \fBzfs create -o sync=disabled whirlpool/milek\fR +# \fBzfs set sync=always whirlpool/perrin\fR +.fi +.in -2 +.sp + +Retrieve the value of sync as you would other properties. For example: +.sp +.in +2 +.nf +% \fBzfs get sync\fR +% \fBzfs list -o sync\fR +.fi +.in -2 +.sp + +The \fBsync\fR property is not inherited from parent datasets. +.RE + +.sp +.ne 2 +.na \fB\fBuserquota@\fR\fIuser\fR=\fIsize\fR | \fBnone\fR\fR .ad .sp .6 .RS 4n -Limits the amount of space consumed by the specified user. User space -consumption is identified by the \fBuserspace@\fR\fIuser\fR property. +Limits the amount of space consumed by the specified user. Similar to the +\fBrefquota\fR property, the \fBuserquota\fR space calculation does not inc +lude space that is used by descendent datasets, such as snapshots and clones. +User space consumption is identified by the \fBuserspace@\fR\fIuser\fR p +roperty. .sp Enforcement of user quotas may be delayed by several seconds. This delay means -that a user might exceed their quota before the system notices that they are -over quota and begins to refuse additional writes with the \fBEDQUOT\fR error -message . See the \fBzfs userspace\fR subcommand for more information. +that a user might exceed her quota before the system notices that she is over +quota. The system would then begin to refuse additional writes with the +\fBEDQUOT\fR error message . See the \fBzfs userspace\fR subcommand for more +information. .sp Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBuserquota\fR privilege with \fBzfs @@ -1184,12 +1313,12 @@ daemon is reloaded. .ad .sp .6 .RS 4n -Provide a hint to ZFS about handling of synchronous requests in this dataset. -If \fBlogbias\fR is set to \fBlatency\fR (the default), ZFS will use pool log -devices (if configured) to handle the requests at low latency. If \fBlogbias\fR -is set to \fBthroughput\fR, ZFS will not use configured pool log devices. ZFS -will instead optimize synchronous operations for global pool throughput and -efficient use of resources. +Provides a hint to ZFS about handling of synchronous requests in this dataset. +If \fBlogbias\fR is set to \fBlatency\fR (the default), ZFS uses the pool's +log devices (if configured) to handle the requests at low latency. If +\fBlogbias\fR is set to \fBthroughput\fR, ZFS does not use the configured pool +log devices. Instead, ZFS optimizes synchronous operations for global pool +throughput and efficient use of resources. .RE .sp @@ -1231,11 +1360,13 @@ reservation (or \fBrefreservation\fR). T multiple of \fBvolblocksize\fR, and cannot be zero. .sp The reservation is kept equal to the volume's logical size to prevent -unexpected behavior for consumers. Without the reservation, the volume could -run out of space, resulting in undefined behavior or data corruption, depending -on how the volume is used. These effects can also occur when the volume size is -changed while it is in use (particularly when shrinking the size). Extreme care -should be used when adjusting the volume size. +unexpected behavior for consumers. The reservation size corresponds to the +volume's logical size, increased by ZFS implementation overhead. Without the +reservation, the volume could run out of space, resulting in undefined behavior +or data corruption, depending on how the volume is used. These effects can also +occur when the volume size is changed while it is in use (particularly when +shrinking the size). Extreme care should be used when adjusting the volume +size. .sp Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the \fBzfs create -V\fR @@ -1286,7 +1417,7 @@ these properties. .ad .sp .6 .RS 4n -The \fB\fBcasesensitivity\fR property is currently not supported on FreeBSD. +The \fBcasesensitivity\fR property is not supported on FreeBSD. .RE .sp @@ -1989,7 +2120,7 @@ Properties" section. .ne 2 .na \fB\fBzfs get\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR -\fIfield\fR[,...] [\fB-s\fR \fIsource\fR[,...] "\fIall\fR" | +\fBall\fR | \fIfield\fR[,...] [\fB-s\fR \fIsource\fR[,...]] \fBall\fR | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR .ad .sp .6 @@ -2000,7 +2131,7 @@ property, the following columns are disp .sp .in +2 .nf - name Dataset name + name Dataset name property Property name value Property value source Property source. Can either be local, default, @@ -2009,9 +2140,10 @@ property, the following columns are disp .in -2 .sp -All columns are displayed by default, though this can be controlled by using -the \fB-o\fR option. This command takes a comma-separated list of properties as -described in the "Native Properties" and "User Properties" sections. +All columns except the \fBRECEIVED\fR column are displayed by default; specify +particular or all columns, using the \fB-o\fR option. This command takes a +comma-separated list of properties as described in the "Native Properties" and +"User Properties" sections. .sp The special value \fBall\fR can be used to display all properties that apply to the given dataset's type (filesystem, volume, or snapshot). @@ -2056,8 +2188,25 @@ arbitrary amount of space. .ad .sp .6 .RS 4n -A comma-separated list of columns to display. \fBname,property,value,source\fR -is the default value. +Set of fields to display. One or more of: +.sp +.in +2 +.nf +name,property,value,received,source +.fi +.in -2 +.sp + +Present multiple fields as a comma-separated list. The default value is: +.sp +.in +2 +.nf +name,property,value,source +.fi +.in -2 +.sp + +The keyword \fBall\fR specifies all sources. .RE .sp @@ -2069,8 +2218,16 @@ is the default value. .RS 4n A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of -the following: \fBlocal,default,inherited,temporary,none\fR. The default value -is all sources. +the following: +.sp +.in +2 +.nf +local,default,inherited,temporary,received,none +.fi +.in -2 +.sp + +The default value is all sources. .RE .sp @@ -2088,7 +2245,7 @@ Display numbers in parseable (exact) val .sp .ne 2 .na -\fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR +\fB\fBzfs inherit\fR [\fB-rS\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR .ad .sp .6 @@ -2107,6 +2264,20 @@ properties can be inherited. Recursively inherit the given property for all children. .RE +.sp +.ne 2 +.na +\fB\fB-S\fR\fR +.ad +.sp .6 +.RS 4n +Revert to the received property value, if any. If the property does not have a +received value, the behavior of \fBzfs inherit\fR \fB-S\fR is the same as +\fBzfs inherit\fR without \fB-S\fR. If the property does have a received +value, \fBzfs inherit\fR masks the received value with the inherited value +until \fBzfs inherit\fR \fB-S\fR reverts to the received value. +.RE + .RE .sp @@ -2127,10 +2298,10 @@ Displays a list of file systems that are .ad .sp .6 .RS 4n -Upgrades file systems to a new on-disk version. Once this is done, the file -systems will no longer be accessible on systems running older versions of the -software. \fBzfs send\fR streams generated from new snapshots of these file -systems cannot be accessed on systems running older versions of the software. +Upgrades file systems to a new, on-disk version. Upgrading a file system means +that it will no longer be accessible on a system running an older software +version. A \fBzfs send\fR stream that is generated from a new file system +snapshot cannot be accessed on a system that runs an older software version. .sp In general, the file system version is independent of the pool version. See \fBzpool\fR(8) for information on the \fBzpool upgrade\fR command. @@ -2439,7 +2610,11 @@ Unmount the specified filesystem. The co .ad .sp .6 .RS 4n -Shares available \fBZFS\fR file systems. +Shares ZFS file systems that have the \fBsharenfs\fR or \fBsharesmb\fR +property set. Sharing a file system with the NFS or SMB protocol means that +the file system data is available over the network. ZFS file systems that have +the \fBsharenfs\fR or \fBsharesmb\fR property set are automatically shared +when a system is booted. .sp .ne 2 .na @@ -2447,8 +2622,8 @@ Shares available \fBZFS\fR file systems. .ad .sp .6 .RS 4n -Share all available \fBZFS\fR file systems. Invoked automatically as part of -the boot process. +Shares all ZFS file systems that have the \fBsharenfs\fR or \fBsharesmb\fR +property set and according to the share property values. .RE .sp @@ -2458,9 +2633,8 @@ the boot process. .ad .sp .6 .RS 4n -Share the specified filesystem according to the \fBsharenfs\fR and -\fBsharesmb\fR properties. File systems are shared when the \fBsharenfs\fR or -\fBsharesmb\fR property is set. +Shares the specified file system that has the \fBsharenfs\fR or \fBsharesmb\fR +property set and according to the share property values. .RE .RE @@ -2472,8 +2646,8 @@ Share the specified filesystem according .ad .sp .6 .RS 4n -Unshares currently shared \fBZFS\fR file systems. This is invoked automatically -as part of the shutdown process. +Unshares all ZFS file systems that have the \fBsharenfs\fR or \fBsharesmb\fR +property set. .sp .ne 2 .na @@ -2501,8 +2675,8 @@ Unshare the specified filesystem. The co .sp .ne 2 .na -\fB\fBzfs send\fR [\fB-vR\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] -\fIsnapshot\fR\fR +\fBzfs send\fR [\fB-DvRp\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] +\fIsnapshot\fR .ad .sp .6 .RS 4n @@ -2510,6 +2684,18 @@ Creates a stream representation of the s to standard output. The output can be redirected to a file or to a different system (for example, using \fBssh\fR(1). By default, a full stream is generated. + +.sp +.ne 2 +.na +\fB\fB-D\fR\fR +.ad +.sp .6 +.RS 4n +Perform \fBdedup\fR processing on the stream. Deduplicated streams cannot be +received on systems that do not support the stream deduplication feature. +.RE + .sp .ne 2 .na @@ -2582,7 +2768,7 @@ on future versions of \fBZFS\fR. .ad .br .na -\fB\fBzfs receive\fR [\fB-vnFu\fR] \fB-d\fR \fIfilesystem\fR\fR +\fB\fBzfs receive\fR [\fB-vnFu\fR] [\fB-d\fR | \fB-e\fR] \fIfilesystem\fR\fR .ad .sp .6 .RS 4n @@ -2604,15 +2790,21 @@ on the sending location are destroyed by command. .sp The name of the snapshot (and file system, if a full stream is received) that -this subcommand creates depends on the argument type and the \fB-d\fR option. +this subcommand creates depends on the argument type and the \fB-d\fR or +\fB-e\fR option. .sp If the argument is a snapshot name, the specified \fIsnapshot\fR is created. If the argument is a file system or volume name, a snapshot with the same name as the sent snapshot is created within the specified \fIfilesystem\fR or -\fIvolume\fR. If the \fB-d\fR option is specified, the snapshot name is -determined by appending the sent snapshot's name to the specified -\fIfilesystem\fR. If the \fB-d\fR option is specified, any required file -systems within the specified one are created. +\fIvolume\fR. If the \fB-d\fR or \fB-e\fR option is specified, the snapshot +name is determined by appending the sent snapshot's name to the specified +filesystem. If the \fB-d\fR option is specified, all but the pool name of the +sent snapshot path is appended (for example, \fBb/c@1\fR appended from sent +snapshot \fBa/b/c@1\fR), and if the \fB-e\fR option is specified, only the tail +of the sent snapshot path is appended (for example, \fBc@1\fR appended from +sent snapshot \fBa/b/c@1\fR). In the case of \fB-d\fR, any file systems needed +to replicate the path of the sent snapshot are created within the specified +file system. .sp .ne 2 .na @@ -2620,8 +2812,20 @@ systems within the specified one are cre .ad .sp .6 .RS 4n -Use the name of the sent snapshot to determine the name of the new snapshot as -described in the paragraph above. +Use all but the first element of the sent snapshot path (all but the pool name) +to determine the name of the new snapshot as described in the paragraph above. +.RE + +.sp +.ne 2 +.mk +.na +\fB\fB-e\fR\fR +.ad +.sp .6 +.RS 4n +Use the last element of the sent snapshot path to determine the name of the new +snapshot as described in the paragraph above. .RE .sp @@ -2637,6 +2841,16 @@ File system that is associated with the .sp .ne 2 .na +\fB\fB-p\fR\fR +.ad +.sp .6 +.RS 4n +Send properties. +.RE + +.sp +.ne 2 +.na \fB\fB-v\fR\fR .ad .sp .6 @@ -2685,7 +2899,7 @@ volume. See the other forms of \fBzfs al .sp .ne 2 .na -\fB\fBzfs allow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] +\fB\fBzfs allow\fR [\fB-ldug\fR] \fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR| \fIvolume\fR\fR .ad .br @@ -2700,14 +2914,14 @@ non-privileged users. .sp .ne 2 .na -\fB[\fB-ug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...]\fR +\fB[\fB-ug\fR] \fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...]\fR .ad .sp .6 .RS 4n Specifies to whom the permissions are delegated. Multiple entities can be specified as a comma-separated list. If neither of the \fB-ug\fR options are specified, then the argument is interpreted preferentially as the keyword -"everyone", then as a user name, and lastly as a group name. To specify a user +\fBeveryone\fR, then as a user name, and lastly as a group name. To specify a user or group named "everyone", use the \fB-u\fR or \fB-g\fR options. To specify a group with the same name as a user, use the \fB-g\fR options. .RE @@ -2719,7 +2933,7 @@ group with the same name as a user, use .ad .sp .6 .RS 4n -Specifies that the permissions be delegated to "everyone." Multiple permissions +Specifies that the permissions be delegated to \fBeveryone\fR. Multiple permissions may be specified as a comma-separated list. Permission names are the same as \fBZFS\fR subcommand and property names. See the property list below. Property set names, which begin with an at sign (\fB@\fR) , may be specified. See the @@ -2751,16 +2965,21 @@ Permissions are generally the ability to .in +2 .nf NAME TYPE NOTES -allow subcommand Must also have the permission that is being - allowed -clone subcommand Must also have the 'create' ability and 'mount' - ability in the origin file system +allow subcommand Must also have the permission that is + being allowed +clone subcommand Must also have the 'create' ability and + 'mount' ability in the origin file system create subcommand Must also have the 'mount' ability destroy subcommand Must also have the 'mount' ability +diff subcommand Allows user to compare differences between + snapshots of a ZFS dataset +hold subcommand Allows adding a user hold to a snapshot mount subcommand Allows mount/umount of ZFS datasets -promote subcommand Must also have the 'mount' - and 'promote' ability in the origin file system +promote subcommand Must also have the 'mount' and 'promote' + ability in the origin file system receive subcommand Must also have the 'mount' and 'create' ability +release subcommand Allows releasing a user hold which + might destroy the snapshot rename subcommand Must also have the 'mount' and 'create' ability in the new parent rollback subcommand Must also have the 'mount' ability @@ -2782,9 +3001,12 @@ casesensitivity property checksum property compression property copies property +dedup property devices property exec property jailed property +logbias property +mlslabel property mountpoint property nbmand property normalization property @@ -2800,6 +3022,7 @@ setuid property sharenfs property sharesmb property snapdir property +sync property utf8only property version property volblocksize property @@ -2842,7 +3065,7 @@ characters long. .ne 2 .na \fB\fBzfs unallow\fR [\fB-rldug\fR] -"\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] +\fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[, ...]] \fIfilesystem\fR|\fIvolume\fR\fR .ad .br @@ -2864,10 +3087,10 @@ Removes permissions that were granted wi permissions are explicitly denied, so other permissions granted are still in effect. For example, if the permission is granted by an ancestor. If no permissions are specified, then all permissions for the specified \fIuser\fR, -\fIgroup\fR, or \fIeveryone\fR are removed. Specifying "everyone" (or using the -\fB-e\fR option) only removes the permissions that were granted to "everyone", -not all permissions for every user and group. See the \fBzfs allow\fR command -for a description of the \fB-ldugec\fR options. +\fIgroup\fR, or \fIeveryone\fR are removed. Specifying \fBeveryone\fR (or +using the \fB-e\fR option) only removes the permissions that were granted to +\fReveryone\fB, not all permissions for every user and group. See the +\fBzfs allow\fR command for a description of the \fB-ldugec\fR options. .sp .ne 2 .na @@ -2995,6 +3218,170 @@ Detaches the given file system from the .RE +.sp +.ne 2 +.na +\fB\fBzfs diff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot\fR | +\fIfilesystem\fR\fR +.ad +.sp .6 +.RS 4n +Gives a high-level description of the differences between a snapshot and a +descendent dataset. The descendent can be either a snapshot of the dataset or +the current dataset. +.sp +For each file that has undergone a change between the original snapshot and +the descendent, the type of change is described along with the name of the +file. In the case of a rename, both the old and new names are shown. Whitespace +characters, backslash characters, and other non-printable or non-7-bit ASCII +characters found in file names are displayed as a backslash character followed +by the three-digit octal representation of the byte value. +.sp +If the \fB-t\fR option is specified, the first column of output from the +command is the file's \fBst_ctim\fR value. For deleted files, this is the final +\fBst_ctim\fR in the earlier snapshot. +.sp +The type of change follows any timestamp displayed, and is described with a +single character: +.sp +.ne 2 +.na +\fB\fB+\fR\fR +.ad +.RS 5n +Indicates the file was added in the later dataset. +.RE + +.sp +.ne 2 +.na +\fB\fB-\fR\fR +.ad +.RS 5n +Indicates the file was removed in the later dataset. +.RE + +.sp +.ne 2 +.na +\fB\fBM\fR\fR +.ad +.RS 5n +Indicates the file was modified in the later dataset. +.RE + +.sp +.ne 2 +.na +\fB\fBR\fR\fR +.ad +.RS 5n +Indicates the file was renamed in the later dataset. +.RE + +If the \fB-F\fR option is specified, the next column of output will be a single +character describing the type of the file. The mappings are: +.sp +.ne 2 +.na +\fB\fBF\fR\fR +.ad +.RS 5n +regular file +.RE + +.sp +.ne 2 +.na +\fB\fB/\fR\fR +.ad +.RS 5n +directory +.RE + +.sp +.ne 2 +.na +\fB\fBB\fR\fR +.ad +.RS 5n +block device +.RE + +.sp +.ne 2 +.na +\fB\fB>\fR\fR +.ad +.RS 5n +door +.RE + +.sp +.ne 2 +.na +\fB\fB|\fR\fR +.ad +.RS 5n +FIFO +.RE + +.sp +.ne 2 +.na +\fB\fB@\fR\fR +.ad +.RS 5n +symbolic link +.RE + +.sp +.ne 2 +.na +\fB\fBP\fR\fR +.ad +.RS 5n +event portal +.RE + +.sp +.ne 2 +.na +\fB\fB=\fR\fR +.ad +.RS 5n +socket +.RE + +If the modification involved a change in the link count of a non-directory +file, the change will be expressed as a delta within parentheses on the +modification line. If the file was renamed, the old name will be separated from +the new with the string "\fB->\fR". +.sp +The following is example output with both the \fB-F\fR and \fB-t\fR options +specified: +.sp +.in +2 +.nf +1269962501.206726811 M / /myfiles/ +1269962444.207369955 M F /myfiles/link_to_me (+1) +1269962499.207519034 R /myfiles/rename_me -> /myfiles/renamed +1269962431.813566720 - F /myfiles/delete_me +1269962518.666905544 + F /myfiles/new_file +1269962501.393099817 + | /myfiles/new_pipe +.fi +.in -2 +.sp +If the \fB-H\fR option is selected, easier-to-parse output is produced. Fields +are separated by a single tab, and no arrow string (\fB->\fR) is placed between +the old and new names of a rename. No guarantees are made on the spacing +between fields of non \fB-H\fR output. +.sp +Unless they already have the \fB{PRIV_SYS_CONFIG}\fR or \fB{PRIV_SYS_MOUNT}\fR +privilege, users must be granted the \fBdiff\fR permission with \fBzfs allow\fR +to use this subcommand. +.RE + .SH EXAMPLES .LP \fBExample 1 \fRCreating a ZFS File System Hierarchy @@ -3114,19 +3501,19 @@ The following command lists all properti # \fBzfs get all pool/home/bob\fR NAME PROPERTY VALUE SOURCE pool/home/bob type filesystem - -pool/home/bob creation Tue Jul 21 15:53 2009 - +pool/home/bob creation Wed May 5 6:13 2010 - pool/home/bob used 21K - -pool/home/bob available 20.0G - +pool/home/bob available 50.0G - pool/home/bob referenced 21K - pool/home/bob compressratio 1.00x - pool/home/bob mounted yes - -pool/home/bob quota 20G local +pool/home/bob quota 50G local pool/home/bob reservation none default pool/home/bob recordsize 128K default pool/home/bob mountpoint /pool/home/bob default pool/home/bob sharenfs off default pool/home/bob checksum on default -pool/home/bob compression on local +pool/home/bob compression off local pool/home/bob atime on default pool/home/bob devices on default pool/home/bob exec on default @@ -3154,6 +3541,8 @@ pool/home/bob usedbysnapshots 0 pool/home/bob usedbydataset 21K - pool/home/bob usedbychildren 0 - pool/home/bob usedbyrefreservation 0 - +pool/home/bob logbias latency default +pool/home/bob mlslabel none default .fi .in -2 .sp @@ -3314,7 +3703,7 @@ property for a dataset. .sp .LP -\fBExample 16 \fRPerforming a Rolling Snapshot +\fBExample 15 \fRPerforming a Rolling Snapshot .sp .LP The following example shows how to maintain a history of snapshots with a @@ -3339,7 +3728,7 @@ a new snapshot, as follows: .sp .LP -\fBExample 17 \fRSetting \fBsharenfs\fR Property Options on a ZFS File System +\fBExample 16 \fRSetting \fBsharenfs\fR Property Options on a ZFS File System .sp .LP The following commands show how to set \fBsharenfs\fR property options to @@ -3360,7 +3749,7 @@ If you are using \fBDNS\fR for host name qualified hostname. .LP -\fBExample 18 \fRDelegating ZFS Administration Permissions on a ZFS Dataset +\fBExample 17 \fRDelegating ZFS Administration Permissions on a ZFS Dataset .sp .LP The following example shows how to set permissions so that user \fBcindys\fR @@ -3394,7 +3783,7 @@ Set an \fBACL\fR similar to the followin .sp .LP -\fBExample 19 \fRDelegating Create Time Permissions on a ZFS Dataset +\fBExample 18 \fRDelegating Create Time Permissions on a ZFS Dataset .sp .LP The following example shows how to grant anyone in the group \fBstaff\fR to @@ -3419,7 +3808,7 @@ Local+Descendent permissions on (tank/us .sp .LP -\fBExample 20 \fRDefining and Granting a Permission Set on a ZFS Dataset +\fBExample 19 \fRDefining and Granting a Permission Set on a ZFS Dataset .sp .LP The following example shows how to define and grant a permission set on the @@ -3445,7 +3834,7 @@ Local+Descendent permissions on (tank/us .sp .LP -\fBExample 21 \fRDelegating Property Permissions on a ZFS Dataset +\fBExample 20 \fRDelegating Property Permissions on a ZFS Dataset .sp .LP The following example shows to grant the ability to set quotas and reservations @@ -3470,7 +3859,7 @@ users/home/marks quota 10G .sp .LP -\fBExample 22 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset +\fBExample 21 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset .sp .LP The following example shows how to remove the snapshot permission from the Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Nov 21 14:50:17 2011 (r227793) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Nov 21 15:26:20 2011 (r227794) @@ -1,11 +1,18 @@ '\" te -.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. -.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the -.\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.\" Portions Copyright 2011 Justin T. Gibbs -.\" Portions Copyright 2011 Martin Matuska -.TH ZPOOL 8 "September 21, 2009" FreeBSD +.\" Copyright (c) 2004, 2010, Oracle and/or its +.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 15:33: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 2120A1065672; Mon, 21 Nov 2011 15:33:38 +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 10BAE8FC15; Mon, 21 Nov 2011 15:33:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALFXbVA048998; Mon, 21 Nov 2011 15:33:37 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALFXbAV048995; Mon, 21 Nov 2011 15:33:37 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111211533.pALFXbAV048995@svn.freebsd.org> From: Martin Matuska Date: Mon, 21 Nov 2011 15:33: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: r227795 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 15:33:38 -0000 Author: mm Date: Mon Nov 21 15:33:37 2011 New Revision: 227795 URL: http://svn.freebsd.org/changeset/base/227795 Log: Fix mismerge in copyright of zpool(8). MFC after: 4 days Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Nov 21 15:26:20 2011 (r227794) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Nov 21 15:33:37 2011 (r227795) @@ -1,6 +1,5 @@ '\" te .\" Copyright (c) 2004, 2010, Oracle and/or its -.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. .\" affiliates. All rights reserved. .\" The contents of this file are subject to the .\" terms of the Common Development and Distribution License (the "License"). @@ -12,6 +11,9 @@ .\" If applicable, add the following below this CDDL HEADER, with the fields enclosed .\" by brackets "[]" replaced with your own identifying information: Portions .\" Copyright [yyyy] [name of copyright owner] +.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. +.\" Portions Copyright 2011 Justin T. Gibbs +.\" Portions Copyright 2011 Martin Matuska .TH ZPOOL 8 "November 21, 2011" FreeBSD .SH NAME zpool \- configures ZFS storage pools From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 16:06: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 6E01A1065672; Mon, 21 Nov 2011 16:06:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DBD98FC1A; Mon, 21 Nov 2011 16:06:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALG6Nev050061; Mon, 21 Nov 2011 16:06:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALG6NRt050059; Mon, 21 Nov 2011 16:06:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111211606.pALG6NRt050059@svn.freebsd.org> From: Rick Macklem Date: Mon, 21 Nov 2011 16:06: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: r227796 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 16:06:23 -0000 Author: rmacklem Date: Mon Nov 21 16:06:23 2011 New Revision: 227796 URL: http://svn.freebsd.org/changeset/base/227796 Log: Clean up some cruft in the NFSv4 client left over from the OpenBSD port, so that it is more readable. No logic change is made by this commit. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Mon Nov 21 15:33:37 2011 (r227795) +++ head/sys/fs/nfsclient/nfs_clstate.c Mon Nov 21 16:06:23 2011 (r227796) @@ -1681,7 +1681,6 @@ nfscl_cleanup_common(struct nfsclclient } } -#if defined(APPLEKEXT) || defined(__FreeBSD__) /* * Find open/lock owners for processes that have exited. */ @@ -1699,7 +1698,6 @@ nfscl_cleanupkext(struct nfsclclient *cl NFSUNLOCKCLSTATE(); NFSPROCLISTUNLOCK(); } -#endif /* APPLEKEXT || __FreeBSD__ */ static int fake_global; /* Used to force visibility of MNTK_UNMOUNTF */ /* @@ -2341,6 +2339,8 @@ nfscl_renewthread(struct nfsclclient *cl u_int32_t clidrev; int error, cbpathdown, islept, igotlock, ret, clearok; uint32_t recover_done_time = 0; + struct timespec mytime; + static time_t prevsec = 0; cred = newnfs_getcred(); NFSLOCKCLSTATE(); @@ -2528,22 +2528,15 @@ tryagain: FREE((caddr_t)dp, M_NFSCLDELEG); } -#if defined(APPLEKEXT) || defined(__FreeBSD__) /* * Call nfscl_cleanupkext() once per second to check for * open/lock owners where the process has exited. */ - { - struct timespec mytime; - static time_t prevsec = 0; - - NFSGETNANOTIME(&mytime); - if (prevsec != mytime.tv_sec) { - prevsec = mytime.tv_sec; - nfscl_cleanupkext(clp); - } + NFSGETNANOTIME(&mytime); + if (prevsec != mytime.tv_sec) { + prevsec = mytime.tv_sec; + nfscl_cleanupkext(clp); } -#endif /* APPLEKEXT || __FreeBSD__ */ NFSLOCKCLSTATE(); if ((clp->nfsc_flags & NFSCLFLAGS_RECOVER) == 0) From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 16:16: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 223661065673; Mon, 21 Nov 2011 16:16: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 EC50F8FC1D; Mon, 21 Nov 2011 16:16:48 +0000 (UTC) Received: from bigwig.baldwin.cx (96.47.65.170.static.nyinternet.net [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id A164146B06; Mon, 21 Nov 2011 11:16:48 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 94C04B94B; Mon, 21 Nov 2011 11:16:45 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Date: Mon, 21 Nov 2011 11:16:47 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111191011.pAJABp0N034812@svn.freebsd.org> In-Reply-To: <201111191011.pAJABp0N034812@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201111211116.47529.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 Nov 2011 11:16:45 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227701 - in head/sys: arm/xscale/ixp425 dev/ahci dev/ata dev/gpio dev/mvs dev/ppbus dev/ppc dev/siba dev/siis dev/usb kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 16:16:49 -0000 On Saturday, November 19, 2011 5:11:51 am Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Nov 19 10:11:50 2011 > New Revision: 227701 > URL: http://svn.freebsd.org/changeset/base/227701 > > Log: > Move the device_delete_all_children() function from usb_util.c > to kern/subr_bus.c. Simplify this function so that it no longer > depends on malloc() to execute. Identify a few other places where > it makes sense to use device_delete_all_children(). > > MFC after: 1 week Sorry I didn't review this earlier when you sent it to me. In general I think this is a good idea, and reducing the duplicated code is great. One style nit below: > Modified: head/sys/kern/subr_bus.c > ============================================================================== > --- head/sys/kern/subr_bus.c Sat Nov 19 09:16:52 2011 (r227700) > +++ head/sys/kern/subr_bus.c Sat Nov 19 10:11:50 2011 (r227701) > @@ -1881,6 +1881,39 @@ device_delete_child(device_t dev, device > } > > /** > + * @brief Delete all children devices of the given device, if any. > + * > + * This function deletes all children devices of the given device, if > + * any, using the device_delete_child() function for each device it > + * finds. If a child device cannot be deleted, this function will > + * return an error code. > + * > + * @param dev the parent device > + * > + * @retval 0 success > + * @retval non-zero a device would not detach > + */ > +int > +device_delete_all_children(device_t dev) > +{ > + device_t child; > + int error; > + > + PDEBUG(("Deleting all children of %s", DEVICENAME(dev))); > + > + error = 0; > + > + while ( (child = TAILQ_FIRST(&dev->children)) ) { Can you fix the extra whitespace here and explicitly test against NULL? > + error = device_delete_child(dev, child); > + if (error) { > + PDEBUG(("Failed deleting %s", DEVICENAME(child))); > + break; > + } > + } > + return (error); > +} > + > +/** > * @brief Find a device given a unit number > * > * This is similar to devclass_get_devices() but only searches for > -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 16:35: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 CDAD21065672; Mon, 21 Nov 2011 16:35:57 +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 BD7CB8FC13; Mon, 21 Nov 2011 16:35:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALGZvcZ051069; Mon, 21 Nov 2011 16:35:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALGZvSS051067; Mon, 21 Nov 2011 16:35:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201111211635.pALGZvSS051067@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 21 Nov 2011 16:35: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: r227797 - 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, 21 Nov 2011 16:35:57 -0000 Author: des Date: Mon Nov 21 16:35:57 2011 New Revision: 227797 URL: http://svn.freebsd.org/changeset/base/227797 Log: As threatened on -arch, add {SHARED,STATIC}_{C,CXX}FLAGS, which allow a Makefile to specify different CFLAGS for shared and static libraries. MFC after: 3 weeks Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon Nov 21 16:06:23 2011 (r227796) +++ head/share/mk/bsd.lib.mk Mon Nov 21 16:35:57 2011 (r227797) @@ -67,23 +67,29 @@ PICFLAG=-fpic PO_FLAG=-pg +.c.o: + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + .c.po: - ${CC} ${PO_FLAG} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) .c.So: - ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.cc.o: + ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + .cc.po .C.po .cpp.po .cxx.po: - ${CXX} ${PO_FLAG} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.So .C.So .cpp.So .cxx.So: - ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 16:40: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 A7203106564A; Mon, 21 Nov 2011 16:40:39 +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 968058FC08; Mon, 21 Nov 2011 16:40:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALGedPw051274; Mon, 21 Nov 2011 16:40:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALGedXg051270; Mon, 21 Nov 2011 16:40:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201111211640.pALGedXg051270@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 21 Nov 2011 16:40: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: r227798 - in head: . lib/libpam lib/libpam/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 16:40:39 -0000 Author: des Date: Mon Nov 21 16:40:39 2011 New Revision: 227798 URL: http://svn.freebsd.org/changeset/base/227798 Log: Simplify the libpam build by removing the shared modules' dependency on the shared library. The modules are loaded by the library, so we know it'll be there when we need it. MFC after: 3 weeks Modified: head/Makefile.inc1 head/lib/libpam/Makefile.inc head/lib/libpam/modules/Makefile.inc Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Nov 21 16:35:57 2011 (r227797) +++ head/Makefile.inc1 Mon Nov 21 16:40:39 2011 (r227798) @@ -1230,12 +1230,13 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ - lib/libopie lib/libpam ${_lib_libthr} \ + lib/libopie ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ - ${_secure_lib_libssl} + ${_secure_lib_libssl} \ + lib/libpam .if ${MK_LIBTHR} != "no" _lib_libthr= lib/libthr @@ -1323,7 +1324,7 @@ ${_lib}__PL: .PHONY .endif .endfor -.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} +.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs} ${_lib}__L: .PHONY .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ @@ -1335,17 +1336,6 @@ ${_lib}__L: .PHONY .endif .endfor -# libpam is special: we need to build static PAM modules before -# static PAM library, and dynamic PAM library before dynamic PAM -# modules. -lib/libpam__L: .PHONY - ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ - cd ${.CURDIR}/lib/libpam; \ - ${MAKE} DIRPRFX=lib/libpam/ obj; \ - ${MAKE} DIRPRFX=lib/libpam/ depend; \ - ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ - ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install - _prereq_libs: ${_prereq_libs:S/$/__PL/} _startup_libs: ${_startup_libs:S/$/__L/} _prebuild_libs: ${_prebuild_libs:S/$/__L/} Modified: head/lib/libpam/Makefile.inc ============================================================================== --- head/lib/libpam/Makefile.inc Mon Nov 21 16:35:57 2011 (r227797) +++ head/lib/libpam/Makefile.inc Mon Nov 21 16:40:39 2011 (r227798) @@ -31,4 +31,6 @@ DEBUG_FLAGS+= -DDEBUG SHLIB_MAJOR= 5 PAM_MOD_DIR= ${LIBDIR} +STATIC_CFLAGS+= -DOPENPAM_STATIC_MODULES + .include "../Makefile.inc" Modified: head/lib/libpam/modules/Makefile.inc ============================================================================== --- head/lib/libpam/modules/Makefile.inc Mon Nov 21 16:35:57 2011 (r227797) +++ head/lib/libpam/modules/Makefile.inc Mon Nov 21 16:40:39 2011 (r227798) @@ -5,20 +5,8 @@ PAMDIR= ${.CURDIR}/../../../../contrib/ NO_INSTALLLIB= NO_PROFILE= -CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam +CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam -# This is nasty. -# For the static case, libpam.a depends on the modules. -# For the dynamic case, the modules depend on libpam.so.N -.if defined(_NO_LIBPAM_SO_YET) -NO_PIC= -.else SHLIB_NAME?= ${LIB}.so.${SHLIB_MAJOR} -DPADD+= ${LIBPAM} -LDADD+= -lpam -.endif - -.c.o: - ${CC} ${CFLAGS} -DOPENPAM_STATIC_MODULES -c ${.IMPSRC} .include "../Makefile.inc" From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 16:43: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 33D16106566B; Mon, 21 Nov 2011 16:43:25 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09EAB8FC0A; Mon, 21 Nov 2011 16:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALGhOmp051403; Mon, 21 Nov 2011 16:43:24 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALGhODM051401; Mon, 21 Nov 2011 16:43:24 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111211643.pALGhODM051401@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 21 Nov 2011 16:43: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: r227799 - head/sys/mips/nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 16:43:25 -0000 Author: jchandra Date: Mon Nov 21 16:43:24 2011 New Revision: 227799 URL: http://svn.freebsd.org/changeset/base/227799 Log: Do dcache flush on CPU core before enabling threads. The dcache flush has to be done using the core control registers before splitting the L1D cache by enabling the hardware threads. Also replace .word calls for mfcr/mtcr with a C macro. In collaboration with: prabhath at netlogicmicro com Modified: head/sys/mips/nlm/mpreset.S Modified: head/sys/mips/nlm/mpreset.S ============================================================================== --- head/sys/mips/nlm/mpreset.S Mon Nov 21 16:40:39 2011 (r227798) +++ head/sys/mips/nlm/mpreset.S Mon Nov 21 16:43:24 2011 (r227799) @@ -45,6 +45,42 @@ .set noreorder .set mips64 +#define MFCR(rt,rs) .word ((0x1c<<26)|((rs)<<21)|((rt)<<16)|(0x18)) +#define MTCR(rt,rs) .word ((0x1c<<26)|((rs)<<21)|((rt)<<16)|(0x19)) +/* + * We need to do this to really flush the dcache before splitting it + */ +.macro flush_l1_dcache + .set push + .set noreorder + li $8, LSU_DEBUG_DATA0 /* use register number to handle */ + li $9, LSU_DEBUG_ADDR /* different ABIs */ + li t2, 0 + li t3, 0x200 +1: + sll v0, t2, 5 + MTCR(0, 8) + ori v1, v0, 0x3 + MTCR(3, 9) +2: + MFCR(3, 9) + andi v1, 0x1 + bnez v1, 2b + nop + MTCR(0, 8) + ori v1, v0, 0x7 + MTCR(3, 9) +3: + MFCR(3, 9) + andi v1, 0x1 + bnez v1, 3b + nop + addi t2, 1 + bne t3, t2, 1b + nop + .set pop +.endm + VECTOR(XLPResetEntry, unknown) mfc0 t0, MIPS_COP_0_STATUS li t1, 0x80000 @@ -111,11 +147,14 @@ LEAF(xlp_enable_threads) sd t1, 72(sp) sd gp, 80(sp) sd ra, 88(sp) + + flush_l1_dcache + /* Use register number to work in o32 and n32 */ li $9, ((CPU_BLOCKID_MAP << 8) | MAP_THREADMODE) move $8, a0 sync - .word 0x71280019 /* mtcr t0, t1*/ + MTCR(8, 9) mfc0 t0, MIPS_COP_0_PRID, 1 andi t0, 0x3 beqz t0, 2f @@ -134,8 +173,8 @@ LEAF(xlp_enable_threads) */ li $9, 0x400 li $8, 0 - .word 0x71280019 /* mtcr $8, $9*/ - .word 0x000000c0 /* ehb */ + MTCR(8, 9) + sll zero,3 /* ehb */ #endif dmfc0 t0, $4, 2 /* SP saved in UserLocal */ ori sp, t0, 0x7 From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 16:48: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 7303B1065672; Mon, 21 Nov 2011 16:48:33 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-dy0-f54.google.com (mail-dy0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id A148E8FC0C; Mon, 21 Nov 2011 16:48:32 +0000 (UTC) Received: by dyk29 with SMTP id 29so474082dyk.13 for ; Mon, 21 Nov 2011 08:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=ijDg6CLYNRq5SkNk7g9nn+t1LirMKepLl7AmeJnZpk4=; b=NRAUcki5h55LFl/JYfX/41zgiC4fbwSKBoLnoS5h4K72wSjsgNYXqC4iui3KxrcLpW H6kWpSvmxfHxp3k2xjIpzH4jz55L4kGOJ9Q+PgUREwpkA5QuRSk++VkQBpDp2OTaJnr3 sQQHQ7oef29Ic6ua5/VM7XFVwAZRI/QDAVM4o= MIME-Version: 1.0 Received: by 10.204.155.141 with SMTP id s13mr15338832bkw.40.1321892611898; Mon, 21 Nov 2011 08:23:31 -0800 (PST) Sender: tomelite82@gmail.com Received: by 10.223.93.132 with HTTP; Mon, 21 Nov 2011 08:23:31 -0800 (PST) In-Reply-To: <201111211410.pALEAD9B046139@svn.freebsd.org> References: <201111211410.pALEAD9B046139@svn.freebsd.org> Date: Mon, 21 Nov 2011 08:23:31 -0800 X-Google-Sender-Auth: TPSLmk_kyHypOWHVPZX4bHFqS2A Message-ID: From: Qing Li To: Gleb Smirnoff 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: r227791 - 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: Mon, 21 Nov 2011 16:48:33 -0000 Logically speaking the prefix route should not be removed until all of the address related housing keeping tasks have been completed successfully. Putting "in_scrubprefix()" at the top does not gain you anything at all, but can potentially be problematic if additional tasks are in fact performed in "if_ioctl()" that may in fact affect the logic in "in_ifinit()". Case in point, I had to perform additional routing related tasks so I re-introduced "nd6_rtrequest()" in r227460. You are not simplifying much logic by removing the error recovery code from the return of "if_ioctl()". So why removing the flexibility of what "if_ioctl()" is intended for as part of the address configuration logic ? --Qing On Mon, Nov 21, 2011 at 6:10 AM, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Nov 21 14:10:13 2011 > New Revision: 227791 > URL: http://svn.freebsd.org/changeset/base/227791 > > Log: > =A0Historically in_control() did not check sockaddrs supplied with > =A0structs ifreq/in_aliasreq and there've been several panics due > =A0to that problem. All these panics were fixed just a couple of > =A0lines above the panicing code. > > =A0Take a more general approach: sanity check sockaddrs supplied > =A0with SIOCAIFADDR and SIOCSIF*ADDR at the beggining of the > =A0function and drop all checks below. > > =A0One check is now disabled due to strange code in ifconfig(8) > =A0that I've removed recently. I'm going to enable it with next > =A0__FreeBSD_version bump. > > =A0Historically in_ifinit() was able to recover from an error > =A0and restore old address. Nowadays this feature isn't working > =A0for all error cases, but for some of them. I suppose no software > =A0relies on this behavior, so I'd like to remove it, since this > =A0simplifies code a lot. > > =A0Also, move if_scrub() earlier in the in_ifinit(). It is more > =A0correct to wipe routes before removing address from local > =A0address list, and interface address list. > > =A0Silence from: bz, brooks, andre, rwatson, 3 weeks > > Modified: > =A0head/sys/netinet/in.c > > Modified: head/sys/netinet/in.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/netinet/in.c =A0 =A0 =A0 Mon Nov 21 13:40:35 2011 =A0 =A0 = =A0 =A0(r227790) > +++ head/sys/netinet/in.c =A0 =A0 =A0 Mon Nov 21 14:10:13 2011 =A0 =A0 = =A0 =A0(r227791) > @@ -234,16 +234,42 @@ in_control(struct socket *so, u_long cmd > =A0 =A0 =A0 =A0 * in_lifaddr_ioctl() and ifp->if_ioctl(). > =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0switch (cmd) { > - =A0 =A0 =A0 case SIOCAIFADDR: > - =A0 =A0 =A0 case SIOCDIFADDR: > =A0 =A0 =A0 =A0case SIOCGIFADDR: > =A0 =A0 =A0 =A0case SIOCGIFBRDADDR: > =A0 =A0 =A0 =A0case SIOCGIFDSTADDR: > =A0 =A0 =A0 =A0case SIOCGIFNETMASK: > + =A0 =A0 =A0 case SIOCDIFADDR: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case SIOCAIFADDR: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* ifra_addr must be present and be of IN= ET family. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* ifra_broadaddr and ifra_mask are optio= nal. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ifra->ifra_addr.sin_len !=3D sizeof(str= uct sockaddr_in) || > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifra->ifra_addr.sin_family !=3D AF_= INET) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EINVAL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ifra->ifra_broadaddr.sin_len !=3D 0 && > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (ifra->ifra_broadaddr.sin_len !=3D = sizeof(struct sockaddr_in) || > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifra->ifra_broadaddr.sin_family != =3D AF_INET)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EINVAL); > +#if 0 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* ifconfig(8) historically doesn't set a= f_family for mask > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* for unknown reason. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ifra->ifra_mask.sin_len !=3D 0 && > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (ifra->ifra_mask.sin_len !=3D sizeo= f(struct sockaddr_in) || > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifra->ifra_mask.sin_family !=3D AF_= INET)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EINVAL); > +#endif > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > =A0 =A0 =A0 =A0case SIOCSIFADDR: > =A0 =A0 =A0 =A0case SIOCSIFBRDADDR: > =A0 =A0 =A0 =A0case SIOCSIFDSTADDR: > =A0 =A0 =A0 =A0case SIOCSIFNETMASK: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ifr->ifr_addr.sa_family !=3D AF_INET || > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifr->ifr_addr.sa_len !=3D sizeof(st= ruct sockaddr_in)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EINVAL); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > > =A0 =A0 =A0 =A0case SIOCALIFADDR: > @@ -349,7 +375,7 @@ in_control(struct socket *so, u_long cmd > =A0 =A0 =A0 =A0switch (cmd) { > =A0 =A0 =A0 =A0case SIOCAIFADDR: > =A0 =A0 =A0 =A0case SIOCDIFADDR: > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ifra->ifra_addr.sin_family =3D=3D AF_IN= ET) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct in_ifaddr *oia; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0IN_IFADDR_RLOCK(); > @@ -506,7 +532,7 @@ in_control(struct socket *so, u_long cmd > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out; > > =A0 =A0 =A0 =A0case SIOCSIFNETMASK: > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 ia->ia_sockmask.sin_addr =3D ifra->ifra_add= r.sin_addr; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ia->ia_sockmask =3D *(struct sockaddr_in *)= &ifr->ifr_addr; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ia->ia_subnetmask =3D ntohl(ia->ia_sockmas= k.sin_addr.s_addr); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out; > > @@ -514,14 +540,12 @@ in_control(struct socket *so, u_long cmd > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0maskIsNew =3D 0; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0hostIsNew =3D 1; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D 0; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ia->ia_addr.sin_family =3D=3D AF_INET) = { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ifra->ifra_addr.sin_len= =3D=3D 0) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifra->ifra_= addr =3D ia->ia_addr; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hostIsNew = =3D 0; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (ifra->ifra_addr.= sin_addr.s_addr =3D=3D > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0ia->ia_addr.sin_addr.s_addr) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hostIsNew = =3D 0; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ifra->ifra_addr.sin_len =3D=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifra->ifra_addr =3D ia->ia_= addr; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hostIsNew =3D 0; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (ifra->ifra_addr.sin_addr.s_addr = =3D=3D > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ia->ia_addr.sin_add= r.s_addr) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hostIsNew =3D 0; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (ifra->ifra_mask.sin_len) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * QL: XXX > @@ -552,7 +576,7 @@ in_control(struct socket *so, u_long cmd > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((ifp->if_flags & IFF_BROADCAST) && > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (ifra->ifra_broadaddr.sin_family = =3D=3D AF_INET)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifra->ifra_broadaddr.sin_len) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ia->ia_broadaddr =3D ifra-= >ifra_broadaddr; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (error =3D=3D 0) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ii =3D ((struct in_ifinfo = *)ifp->if_afdata[AF_INET]); > @@ -608,31 +632,26 @@ in_control(struct socket *so, u_long cmd > > =A0 =A0 =A0 =A0IN_IFADDR_WLOCK(); > =A0 =A0 =A0 =A0TAILQ_REMOVE(&V_in_ifaddrhead, ia, ia_link); > - =A0 =A0 =A0 if (ia->ia_addr.sin_family =3D=3D AF_INET) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct in_ifaddr *if_ia; > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIST_REMOVE(ia, ia_hash); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_IFADDR_WUNLOCK(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If this is the last IPv4 address confi= gured on this > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* interface, leave the all-hosts group. > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* No state-change report need be transmi= tted. > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if_ia =3D NULL; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 IFP_TO_IA(ifp, if_ia); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (if_ia =3D=3D NULL) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ii =3D ((struct in_ifinfo *= )ifp->if_afdata[AF_INET]); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_MULTI_LOCK(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ii->ii_allhosts) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (void)in_le= avegroup_locked(ii->ii_allhosts, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NUL= L); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ii->ii_allh= osts =3D NULL; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_MULTI_UNLOCK(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifa_free(&if_ia->ia_ifa); > + =A0 =A0 =A0 LIST_REMOVE(ia, ia_hash); > + =A0 =A0 =A0 IN_IFADDR_WUNLOCK(); > + =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0* If this is the last IPv4 address configured on this > + =A0 =A0 =A0 =A0* interface, leave the all-hosts group. > + =A0 =A0 =A0 =A0* No state-change report need be transmitted. > + =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 IFP_TO_IA(ifp, iap); > + =A0 =A0 =A0 if (iap =3D=3D NULL) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ii =3D ((struct in_ifinfo *)ifp->if_afdata[= AF_INET]); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_MULTI_LOCK(); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ii->ii_allhosts) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (void)in_leavegroup_locked(= ii->ii_allhosts, NULL); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ii->ii_allhosts =3D NULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_MULTI_UNLOCK(); > =A0 =A0 =A0 =A0} else > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_IFADDR_WUNLOCK(); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ifa_free(&iap->ia_ifa); > + > =A0 =A0 =A0 =A0ifa_free(&ia->ia_ifa); =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0/* in_ifaddrhead */ > =A0out: > =A0 =A0 =A0 =A0if (ia !=3D NULL) > @@ -828,50 +847,29 @@ in_ifinit(struct ifnet *ifp, struct in_i > =A0 =A0 int scrub) > =A0{ > =A0 =A0 =A0 =A0register u_long i =3D ntohl(sin->sin_addr.s_addr); > - =A0 =A0 =A0 struct sockaddr_in oldaddr; > =A0 =A0 =A0 =A0int flags =3D RTF_UP, error =3D 0; > > - =A0 =A0 =A0 oldaddr =3D ia->ia_addr; > - =A0 =A0 =A0 if (oldaddr.sin_family =3D=3D AF_INET) > + =A0 =A0 =A0 if (scrub) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 in_scrubprefix(ia, LLE_STATIC); > + > + =A0 =A0 =A0 IN_IFADDR_WLOCK(); > + =A0 =A0 =A0 if (ia->ia_addr.sin_family =3D=3D AF_INET) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LIST_REMOVE(ia, ia_hash); > =A0 =A0 =A0 =A0ia->ia_addr =3D *sin; > - =A0 =A0 =A0 if (ia->ia_addr.sin_family =3D=3D AF_INET) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_IFADDR_WLOCK(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.si= n_addr.s_addr), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ia, ia_hash); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_IFADDR_WUNLOCK(); > - =A0 =A0 =A0 } > + =A0 =A0 =A0 LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.sin_addr.s_addr), > + =A0 =A0 =A0 =A0 =A0 ia, ia_hash); > + =A0 =A0 =A0 IN_IFADDR_WUNLOCK(); > + > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Give the interface a chance to initialize > =A0 =A0 =A0 =A0 * if this is its first address, > =A0 =A0 =A0 =A0 * and to validate the address if necessary. > =A0 =A0 =A0 =A0 */ > - =A0 =A0 =A0 if (ifp->if_ioctl !=3D NULL) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D (*ifp->if_ioctl)(ifp, SIOCSIFADDR= , (caddr_t)ia); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (error) { > + =A0 =A0 =A0 if (ifp->if_ioctl !=3D NULL && > + =A0 =A0 =A0 =A0 =A0 (error =3D (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (cadd= r_t)ia)) !=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* LIST_REMOVE(ia, ia_hash= ) is done in in_control */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ia->ia_addr =3D oldaddr; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_IFADDR_WLOCK(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ia->ia_addr.sin_family = =3D=3D AF_INET) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIST_INSERT= _HEAD(INADDR_HASH( > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ia-= >ia_addr.sin_addr.s_addr), ia, ia_hash); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If old= addr family is not AF_INET (e.g. > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* interf= ace has been just created) in_control > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* does n= ot call LIST_REMOVE, and we end up > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* with b= ogus ia entries in hash > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LIST_REMOVE= (ia, ia_hash); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IN_IFADDR_WUNLOCK(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (error); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > - =A0 =A0 =A0 } > - =A0 =A0 =A0 if (scrub) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 ia->ia_ifa.ifa_addr =3D (struct sockaddr *)= &oldaddr; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 in_ifscrub(ifp, ia, LLE_STATIC); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 ia->ia_ifa.ifa_addr =3D (struct sockaddr *)= &ia->ia_addr; > - =A0 =A0 =A0 } > + > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Be compatible with network classes, if netmask isn't su= pplied, > =A0 =A0 =A0 =A0 * guess it based on classes. > @@ -916,11 +914,9 @@ in_ifinit(struct ifnet *ifp, struct in_i > =A0 =A0 =A0 =A0if (ia->ia_addr.sin_addr.s_addr =3D=3D INADDR_ANY) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (0); > > - =A0 =A0 =A0 if (ifp->if_flags & IFF_POINTOPOINT) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ia->ia_dstaddr.sin_addr.s_addr =3D=3D i= a->ia_addr.sin_addr.s_addr) > + =A0 =A0 =A0 if (ifp->if_flags & IFF_POINTOPOINT && > + =A0 =A0 =A0 =A0 =A0 ia->ia_dstaddr.sin_addr.s_addr =3D=3D ia->ia_addr.s= in_addr.s_addr) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (0); > - =A0 =A0 =A0 } > - > > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * add a loopback route to self > From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 18:04: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 848C3106566B; Mon, 21 Nov 2011 18:04:37 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7407D8FC0C; Mon, 21 Nov 2011 18:04:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALI4bYi053930; Mon, 21 Nov 2011 18:04:37 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALI4bdC053928; Mon, 21 Nov 2011 18:04:37 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201111211804.pALI4bdC053928@svn.freebsd.org> From: Warren Block Date: Mon, 21 Nov 2011 18:04: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: r227800 - 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: Mon, 21 Nov 2011 18:04:37 -0000 Author: wblock (doc committer) Date: Mon Nov 21 18:04:37 2011 New Revision: 227800 URL: http://svn.freebsd.org/changeset/base/227800 Log: Correct and expand BSD partitioning scheme description. Correct GUID to GPT in RECOVERING section. Reviewed by: ae Approved by: gjb (mentor) MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Nov 21 16:43:24 2011 (r227799) +++ head/sbin/geom/class/part/gpart.8 Mon Nov 21 18:04:37 2011 (r227800) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2011 +.Dd November 21, 2011 .Dt GPART 8 .Os .Sh NAME @@ -498,12 +498,14 @@ Requires the .Cd GEOM_PART_APM kernel option. .It Cm BSD -BSD disklabel without an MBR. -Sometimes called -.Dq dangerously dedicated mode . +Traditional BSD disklabel, usually used to subdivide MBR partitions. .Po -See -.Xr bsdlabel 8 for more information. +This scheme can also be used as the sole partitioning method, without +an MBR. +Partition editing tools from other operating systems often do not +understand the bare disklabel partition layout, so this is sometimes +called +.Dq dangerously dedicated . .Pc Requires the .Cm GEOM_PART_BSD @@ -854,7 +856,7 @@ action or reverted with the action. .Sh RECOVERING The GEOM PART class supports recovering of partition tables only for GPT. -The GUID primary metadata is stored at the beginning of the device. +The GPT primary metadata is stored at the beginning of the device. For redundancy, a secondary .Pq backup copy of the metadata is stored at the end of the device. From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 18:39: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 25EDA1065742; Mon, 21 Nov 2011 18:39:35 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id AEBF68FC15; Mon, 21 Nov 2011 18:39:34 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id pALIdX0F059412; Mon, 21 Nov 2011 19:39:33 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id pALIdXZK059411; Mon, 21 Nov 2011 19:39:33 +0100 (CET) (envelope-from marius) Date: Mon, 21 Nov 2011 19:39:33 +0100 From: Marius Strobl To: John Baldwin Message-ID: <20111121183933.GK56603@alchemy.franken.de> References: <201111191011.pAJABp0N034812@svn.freebsd.org> <201111211116.47529.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111211116.47529.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky Subject: Re: svn commit: r227701 - in head/sys: arm/xscale/ixp425 dev/ahci dev/ata dev/gpio dev/mvs dev/ppbus dev/ppc dev/siba dev/siis dev/usb kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 18:39:35 -0000 On Mon, Nov 21, 2011 at 11:16:47AM -0500, John Baldwin wrote: > On Saturday, November 19, 2011 5:11:51 am Hans Petter Selasky wrote: > > Author: hselasky > > Date: Sat Nov 19 10:11:50 2011 > > New Revision: 227701 > > URL: http://svn.freebsd.org/changeset/base/227701 > > > > Log: > > Move the device_delete_all_children() function from usb_util.c > > to kern/subr_bus.c. Simplify this function so that it no longer > > depends on malloc() to execute. Identify a few other places where > > it makes sense to use device_delete_all_children(). > > > > MFC after: 1 week > > Sorry I didn't review this earlier when you sent it to me. In general I > think this is a good idea, and reducing the duplicated code is great. Could we rename it to just device_delete_children(9)? Using both "all" and the plural seems redundant and doesn't match device_get_children(9) which also operates on all children. Marius From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 19:54: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 5D99F1065673; Mon, 21 Nov 2011 19:54:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 52FB28FC18; Mon, 21 Nov 2011 19:54:41 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id pALJseCf000315; Mon, 21 Nov 2011 23:54:40 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id pALJsdHd000314; Mon, 21 Nov 2011 23:54:39 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 21 Nov 2011 23:54:39 +0400 From: Gleb Smirnoff To: Qing Li Message-ID: <20111121195439.GE96616@FreeBSD.org> References: <201111211410.pALEAD9B046139@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: r227791 - 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: Mon, 21 Nov 2011 19:54:42 -0000 Qing, On Mon, Nov 21, 2011 at 08:23:31AM -0800, Qing Li wrote: Q> Logically speaking the prefix route should not be removed until all of the Q> address related housing keeping tasks have been completed successfully. >From my point of view logically speaking, we should first remove route, then remove address. Otherwise, for a short time we've got an invalid route in table. Q> Putting "in_scrubprefix()" at the top does not gain you anything at Q> all, but can Q> potentially be problematic if additional tasks are in fact performed Q> in "if_ioctl()" Q> that may in fact affect the logic in "in_ifinit()". Q> Q> Case in point, I had to perform additional routing related tasks so I Q> re-introduced "nd6_rtrequest()" in r227460. Pardon, can you please elaborate on this? I don't see any problems that I intoroduced, but if ther are any, we can either push in_scrubprefix() down the function as it was before, of fix them some other way. Q> You are not simplifying much logic by removing the error recovery code from Q> the return of "if_ioctl()". So why removing the flexibility of what Q> "if_ioctl()" is Q> intended for as part of the address configuration logic ? Because in_ifinit() was inconsistent. It tried to recover in case of (*ifp->if_ioctl) failure, but did not try to recover in case of failure of: in_addprefix() ifa_add_loopback_route() Q> --Qing Q> Q> On Mon, Nov 21, 2011 at 6:10 AM, Gleb Smirnoff wrote: Q> > Author: glebius Q> > Date: Mon Nov 21 14:10:13 2011 Q> > New Revision: 227791 Q> > URL: http://svn.freebsd.org/changeset/base/227791 Q> > Q> > Log: Q> > šHistorically in_control() did not check sockaddrs supplied with Q> > šstructs ifreq/in_aliasreq and there've been several panics due Q> > što that problem. All these panics were fixed just a couple of Q> > šlines above the panicing code. Q> > Q> > šTake a more general approach: sanity check sockaddrs supplied Q> > šwith SIOCAIFADDR and SIOCSIF*ADDR at the beggining of the Q> > šfunction and drop all checks below. Q> > Q> > šOne check is now disabled due to strange code in ifconfig(8) Q> > šthat I've removed recently. I'm going to enable it with next Q> > š__FreeBSD_version bump. Q> > Q> > šHistorically in_ifinit() was able to recover from an error Q> > šand restore old address. Nowadays this feature isn't working Q> > šfor all error cases, but for some of them. I suppose no software Q> > šrelies on this behavior, so I'd like to remove it, since this Q> > šsimplifies code a lot. Q> > Q> > šAlso, move if_scrub() earlier in the in_ifinit(). It is more Q> > šcorrect to wipe routes before removing address from local Q> > šaddress list, and interface address list. Q> > Q> > šSilence from: bz, brooks, andre, rwatson, 3 weeks Q> > Q> > Modified: Q> > šhead/sys/netinet/in.c Q> > Q> > Modified: head/sys/netinet/in.c Q> > ============================================================================== Q> > --- head/sys/netinet/in.c š š š Mon Nov 21 13:40:35 2011 š š š š(r227790) Q> > +++ head/sys/netinet/in.c š š š Mon Nov 21 14:10:13 2011 š š š š(r227791) Q> > @@ -234,16 +234,42 @@ in_control(struct socket *so, u_long cmd Q> > š š š š * in_lifaddr_ioctl() and ifp->if_ioctl(). Q> > š š š š */ Q> > š š š šswitch (cmd) { Q> > - š š š case SIOCAIFADDR: Q> > - š š š case SIOCDIFADDR: Q> > š š š šcase SIOCGIFADDR: Q> > š š š šcase SIOCGIFBRDADDR: Q> > š š š šcase SIOCGIFDSTADDR: Q> > š š š šcase SIOCGIFNETMASK: Q> > + š š š case SIOCDIFADDR: Q> > + š š š š š š š break; Q> > + š š š case SIOCAIFADDR: Q> > + š š š š š š š /* Q> > + š š š š š š š š* ifra_addr must be present and be of INET family. Q> > + š š š š š š š š* ifra_broadaddr and ifra_mask are optional. Q> > + š š š š š š š š*/ Q> > + š š š š š š š if (ifra->ifra_addr.sin_len != sizeof(struct sockaddr_in) || Q> > + š š š š š š š š š ifra->ifra_addr.sin_family != AF_INET) Q> > + š š š š š š š š š š š return (EINVAL); Q> > + š š š š š š š if (ifra->ifra_broadaddr.sin_len != 0 && Q> > + š š š š š š š š š (ifra->ifra_broadaddr.sin_len != sizeof(struct sockaddr_in) || Q> > + š š š š š š š š š ifra->ifra_broadaddr.sin_family != AF_INET)) Q> > + š š š š š š š š š š š return (EINVAL); Q> > +#if 0 Q> > + š š š š š š š /* Q> > + š š š š š š š š* ifconfig(8) historically doesn't set af_family for mask Q> > + š š š š š š š š* for unknown reason. Q> > + š š š š š š š š*/ Q> > + š š š š š š š if (ifra->ifra_mask.sin_len != 0 && Q> > + š š š š š š š š š (ifra->ifra_mask.sin_len != sizeof(struct sockaddr_in) || Q> > + š š š š š š š š š ifra->ifra_mask.sin_family != AF_INET)) Q> > + š š š š š š š š š š š return (EINVAL); Q> > +#endif Q> > + š š š š š š š break; Q> > š š š šcase SIOCSIFADDR: Q> > š š š šcase SIOCSIFBRDADDR: Q> > š š š šcase SIOCSIFDSTADDR: Q> > š š š šcase SIOCSIFNETMASK: Q> > + š š š š š š š if (ifr->ifr_addr.sa_family != AF_INET || Q> > + š š š š š š š š š ifr->ifr_addr.sa_len != sizeof(struct sockaddr_in)) Q> > + š š š š š š š š š š š return (EINVAL); Q> > š š š š š š š šbreak; Q> > Q> > š š š šcase SIOCALIFADDR: Q> > @@ -349,7 +375,7 @@ in_control(struct socket *so, u_long cmd Q> > š š š šswitch (cmd) { Q> > š š š šcase SIOCAIFADDR: Q> > š š š šcase SIOCDIFADDR: Q> > - š š š š š š š if (ifra->ifra_addr.sin_family == AF_INET) { Q> > + š š š š š š š { Q> > š š š š š š š š š š š šstruct in_ifaddr *oia; Q> > Q> > š š š š š š š š š š š šIN_IFADDR_RLOCK(); Q> > @@ -506,7 +532,7 @@ in_control(struct socket *so, u_long cmd Q> > š š š š š š š šgoto out; Q> > Q> > š š š šcase SIOCSIFNETMASK: Q> > - š š š š š š š ia->ia_sockmask.sin_addr = ifra->ifra_addr.sin_addr; Q> > + š š š š š š š ia->ia_sockmask = *(struct sockaddr_in *)&ifr->ifr_addr; Q> > š š š š š š š šia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr); Q> > š š š š š š š šgoto out; Q> > Q> > @@ -514,14 +540,12 @@ in_control(struct socket *so, u_long cmd Q> > š š š š š š š šmaskIsNew = 0; Q> > š š š š š š š šhostIsNew = 1; Q> > š š š š š š š šerror = 0; Q> > - š š š š š š š if (ia->ia_addr.sin_family == AF_INET) { Q> > - š š š š š š š š š š š if (ifra->ifra_addr.sin_len == 0) { Q> > - š š š š š š š š š š š š š š š ifra->ifra_addr = ia->ia_addr; Q> > - š š š š š š š š š š š š š š š hostIsNew = 0; Q> > - š š š š š š š š š š š } else if (ifra->ifra_addr.sin_addr.s_addr == Q> > - š š š š š š š š š š š š š š š š š š š š š š šia->ia_addr.sin_addr.s_addr) Q> > - š š š š š š š š š š š š š š š hostIsNew = 0; Q> > - š š š š š š š } Q> > + š š š š š š š if (ifra->ifra_addr.sin_len == 0) { Q> > + š š š š š š š š š š š ifra->ifra_addr = ia->ia_addr; Q> > + š š š š š š š š š š š hostIsNew = 0; Q> > + š š š š š š š } else if (ifra->ifra_addr.sin_addr.s_addr == Q> > + š š š š š š š š š š š š š ia->ia_addr.sin_addr.s_addr) Q> > + š š š š š š š š š š š hostIsNew = 0; Q> > š š š š š š š šif (ifra->ifra_mask.sin_len) { Q> > š š š š š š š š š š š š/* Q> > š š š š š š š š š š š š * QL: XXX Q> > @@ -552,7 +576,7 @@ in_control(struct socket *so, u_long cmd Q> > š š š š š š š š š š š šbreak; Q> > Q> > š š š š š š š šif ((ifp->if_flags & IFF_BROADCAST) && Q> > - š š š š š š š š š (ifra->ifra_broadaddr.sin_family == AF_INET)) Q> > + š š š š š š š š š ifra->ifra_broadaddr.sin_len) Q> > š š š š š š š š š š š šia->ia_broadaddr = ifra->ifra_broadaddr; Q> > š š š š š š š šif (error == 0) { Q> > š š š š š š š š š š š šii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); Q> > @@ -608,31 +632,26 @@ in_control(struct socket *so, u_long cmd Q> > Q> > š š š šIN_IFADDR_WLOCK(); Q> > š š š šTAILQ_REMOVE(&V_in_ifaddrhead, ia, ia_link); Q> > - š š š if (ia->ia_addr.sin_family == AF_INET) { Q> > - š š š š š š š struct in_ifaddr *if_ia; Q> > Q> > - š š š š š š š LIST_REMOVE(ia, ia_hash); Q> > - š š š š š š š IN_IFADDR_WUNLOCK(); Q> > - š š š š š š š /* Q> > - š š š š š š š š* If this is the last IPv4 address configured on this Q> > - š š š š š š š š* interface, leave the all-hosts group. Q> > - š š š š š š š š* No state-change report need be transmitted. Q> > - š š š š š š š š*/ Q> > - š š š š š š š if_ia = NULL; Q> > - š š š š š š š IFP_TO_IA(ifp, if_ia); Q> > - š š š š š š š if (if_ia == NULL) { Q> > - š š š š š š š š š š š ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); Q> > - š š š š š š š š š š š IN_MULTI_LOCK(); Q> > - š š š š š š š š š š š if (ii->ii_allhosts) { Q> > - š š š š š š š š š š š š š š š (void)in_leavegroup_locked(ii->ii_allhosts, Q> > - š š š š š š š š š š š š š š š š š NULL); Q> > - š š š š š š š š š š š š š š š ii->ii_allhosts = NULL; Q> > - š š š š š š š š š š š } Q> > - š š š š š š š š š š š IN_MULTI_UNLOCK(); Q> > - š š š š š š š } else Q> > - š š š š š š š š š š š ifa_free(&if_ia->ia_ifa); Q> > + š š š LIST_REMOVE(ia, ia_hash); Q> > + š š š IN_IFADDR_WUNLOCK(); Q> > + š š š /* Q> > + š š š š* If this is the last IPv4 address configured on this Q> > + š š š š* interface, leave the all-hosts group. Q> > + š š š š* No state-change report need be transmitted. Q> > + š š š š*/ Q> > + š š š IFP_TO_IA(ifp, iap); Q> > + š š š if (iap == NULL) { Q> > + š š š š š š š ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); Q> > + š š š š š š š IN_MULTI_LOCK(); Q> > + š š š š š š š if (ii->ii_allhosts) { Q> > + š š š š š š š š š š š (void)in_leavegroup_locked(ii->ii_allhosts, NULL); Q> > + š š š š š š š š š š š ii->ii_allhosts = NULL; Q> > + š š š š š š š } Q> > + š š š š š š š IN_MULTI_UNLOCK(); Q> > š š š š} else Q> > - š š š š š š š IN_IFADDR_WUNLOCK(); Q> > + š š š š š š š ifa_free(&iap->ia_ifa); Q> > + Q> > š š š šifa_free(&ia->ia_ifa); š š š š š š š š š š š š š/* in_ifaddrhead */ Q> > šout: Q> > š š š šif (ia != NULL) Q> > @@ -828,50 +847,29 @@ in_ifinit(struct ifnet *ifp, struct in_i Q> > š š int scrub) Q> > š{ Q> > š š š šregister u_long i = ntohl(sin->sin_addr.s_addr); Q> > - š š š struct sockaddr_in oldaddr; Q> > š š š šint flags = RTF_UP, error = 0; Q> > Q> > - š š š oldaddr = ia->ia_addr; Q> > - š š š if (oldaddr.sin_family == AF_INET) Q> > + š š š if (scrub) Q> > + š š š š š š š in_scrubprefix(ia, LLE_STATIC); Q> > + Q> > + š š š IN_IFADDR_WLOCK(); Q> > + š š š if (ia->ia_addr.sin_family == AF_INET) Q> > š š š š š š š šLIST_REMOVE(ia, ia_hash); Q> > š š š šia->ia_addr = *sin; Q> > - š š š if (ia->ia_addr.sin_family == AF_INET) { Q> > - š š š š š š š IN_IFADDR_WLOCK(); Q> > - š š š š š š š LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.sin_addr.s_addr), Q> > - š š š š š š š š š ia, ia_hash); Q> > - š š š š š š š IN_IFADDR_WUNLOCK(); Q> > - š š š } Q> > + š š š LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.sin_addr.s_addr), Q> > + š š š š š ia, ia_hash); Q> > + š š š IN_IFADDR_WUNLOCK(); Q> > + Q> > š š š š/* Q> > š š š š * Give the interface a chance to initialize Q> > š š š š * if this is its first address, Q> > š š š š * and to validate the address if necessary. Q> > š š š š */ Q> > - š š š if (ifp->if_ioctl != NULL) { Q> > - š š š š š š š error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); Q> > - š š š š š š š if (error) { Q> > + š š š if (ifp->if_ioctl != NULL && Q> > + š š š š š (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia)) != 0) Q> > š š š š š š š š š š š š/* LIST_REMOVE(ia, ia_hash) is done in in_control */ Q> > - š š š š š š š š š š š ia->ia_addr = oldaddr; Q> > - š š š š š š š š š š š IN_IFADDR_WLOCK(); Q> > - š š š š š š š š š š š if (ia->ia_addr.sin_family == AF_INET) Q> > - š š š š š š š š š š š š š š š LIST_INSERT_HEAD(INADDR_HASH( Q> > - š š š š š š š š š š š š š š š š š ia->ia_addr.sin_addr.s_addr), ia, ia_hash); Q> > - š š š š š š š š š š š else Q> > - š š š š š š š š š š š š š š š /* Q> > - š š š š š š š š š š š š š š š š* If oldaddr family is not AF_INET (e.g. Q> > - š š š š š š š š š š š š š š š š* interface has been just created) in_control Q> > - š š š š š š š š š š š š š š š š* does not call LIST_REMOVE, and we end up Q> > - š š š š š š š š š š š š š š š š* with bogus ia entries in hash Q> > - š š š š š š š š š š š š š š š š*/ Q> > - š š š š š š š š š š š š š š š LIST_REMOVE(ia, ia_hash); Q> > - š š š š š š š š š š š IN_IFADDR_WUNLOCK(); Q> > š š š š š š š š š š š šreturn (error); Q> > - š š š š š š š } Q> > - š š š } Q> > - š š š if (scrub) { Q> > - š š š š š š š ia->ia_ifa.ifa_addr = (struct sockaddr *)&oldaddr; Q> > - š š š š š š š in_ifscrub(ifp, ia, LLE_STATIC); Q> > - š š š š š š š ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; Q> > - š š š } Q> > + Q> > š š š š/* Q> > š š š š * Be compatible with network classes, if netmask isn't supplied, Q> > š š š š * guess it based on classes. Q> > @@ -916,11 +914,9 @@ in_ifinit(struct ifnet *ifp, struct in_i Q> > š š š šif (ia->ia_addr.sin_addr.s_addr == INADDR_ANY) Q> > š š š š š š š šreturn (0); Q> > Q> > - š š š if (ifp->if_flags & IFF_POINTOPOINT) { Q> > - š š š š š š š if (ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) Q> > + š š š if (ifp->if_flags & IFF_POINTOPOINT && Q> > + š š š š š ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) Q> > š š š š š š š š š š š šreturn (0); Q> > - š š š } Q> > - Q> > Q> > š š š š/* Q> > š š š š * add a loopback route to self Q> > -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 20:07: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 46B8F1065674; Mon, 21 Nov 2011 20:07:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 369D28FC17; Mon, 21 Nov 2011 20:07:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALK7DP4057804; Mon, 21 Nov 2011 20:07:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALK7D9s057802; Mon, 21 Nov 2011 20:07:13 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111212007.pALK7D9s057802@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 21 Nov 2011 20:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227801 - 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: Mon, 21 Nov 2011 20:07:13 -0000 Author: glebius Date: Mon Nov 21 20:07:12 2011 New Revision: 227801 URL: http://svn.freebsd.org/changeset/base/227801 Log: This check isn't needed now, sanity checking done in the beginning. Missed it in last commit. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Nov 21 18:04:37 2011 (r227800) +++ head/sys/netinet/in.c Mon Nov 21 20:07:12 2011 (r227801) @@ -569,8 +569,7 @@ in_control(struct socket *so, u_long cmd ia->ia_dstaddr = ifra->ifra_dstaddr; maskIsNew = 1; /* We lie; but the effect's the same */ } - if (ifra->ifra_addr.sin_family == AF_INET && - (hostIsNew || maskIsNew)) + if (hostIsNew || maskIsNew) error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0); if (error != 0 && iaIsNew) break; From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 20:26: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 C9123106564A; Mon, 21 Nov 2011 20:26:22 +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 B92618FC0C; Mon, 21 Nov 2011 20:26:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALKQM3E058444; Mon, 21 Nov 2011 20:26:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALKQMPI058442; Mon, 21 Nov 2011 20:26:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111212026.pALKQMPI058442@svn.freebsd.org> From: Xin LI Date: Mon, 21 Nov 2011 20:26: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: r227802 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2011 20:26:22 -0000 Author: delphij Date: Mon Nov 21 20:26:22 2011 New Revision: 227802 URL: http://svn.freebsd.org/changeset/base/227802 Log: Improve the way to calculate available pages in tmpfs: - Don't deduct wired pages from total usable counts because it does not make any sense. To make things worse, on systems where swap size is smaller than physical memory and use a lot of wired pages (e.g. ZFS), tmpfs can suddenly have free space of 0 because of this; - Count cached pages as available; [1] - Don't count inactive pages as available, technically we could but that might be too aggressive; [1] [1] Suggested by kib@ MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Mon Nov 21 20:07:12 2011 (r227801) +++ head/sys/fs/tmpfs/tmpfs.h Mon Nov 21 20:26:22 2011 (r227802) @@ -502,11 +502,8 @@ int tmpfs_truncate(struct vnode *, off_t static __inline size_t tmpfs_mem_info(void) { - size_t size; - size = swap_pager_avail + cnt.v_free_count + cnt.v_inactive_count; - size -= size > cnt.v_wire_count ? cnt.v_wire_count : size; - return size; + return (swap_pager_avail + cnt.v_free_count + cnt.v_cache_count); } /* Returns the maximum size allowed for a tmpfs file system. This macro From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 20:29: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 3C745106566B; Mon, 21 Nov 2011 20:29:40 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 2189A8FC14; Mon, 21 Nov 2011 20:29:40 +0000 (UTC) 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 anubis.delphij.net (Postfix) with ESMTPSA id C3DDF38A2; Mon, 21 Nov 2011 12:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1321907379; bh=RQUuW4CzKXQLmigfjrvkkDJbElOqAO7Ppkvp2zD1/Aw=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=3cSkmqPZiFhUtNCGsE+wWc9b0GtLiRCQiXq+ZN/OICIVwmIvF7PbRAR7ux4uwLUlr Kp4GERSXR3FFcSeIVotupkLcCJEGajq3hiPWAag0C3GH0xMIcwpzdJFF46KlZCZtbB bUgl7r9xiGDRPddlR5/v5L17Vj1CNZpjUypgvXXk= Message-ID: <4ECAB4B2.5050106@delphij.net> Date: Mon, 21 Nov 2011 12:29:38 -0800 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: Xin LI References: <201111212026.pALKQMPI058442@svn.freebsd.org> In-Reply-To: <201111212026.pALKQMPI058442@svn.freebsd.org> OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227802 - head/sys/fs/tmpfs 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: Mon, 21 Nov 2011 20:29:40 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 For the record, in our talk kib@ also suggested that it would be worthwhile to add "reserved" swap pages for tmpfs so that administrators can have guaranteed space for tmpfs as well. This is not implemented in this changeset. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJOyrSyAAoJEATO+BI/yjfB+JcIAJ/LpqOlZa05CRzCFuZouBPZ K+DyxALxOEwOxkC4iVrAuhUCSAXew8RcpMl52UjbPiMh4tFLs4cqyrIQ0GXvRO9L lOGVaM+YxRQBjnU7Xh2FgQV75C5yVmWwey2FAVWfcv9545If8fqH8t5u5IlaL46z jePIfLr5681xuZetWC7vlU63ZR6khOTIB+vVnekI0frPiNVgLKmeKIQIkjM/NNQt x81ssKxBxM10BHG9dh54s8YLYCEM2AGPhuAv0TIFXVlq5/W2Vk6cMwettDJ9+WBG GeJm2H2I+dlR8Hn7r0c2/QEt+XeKTOcz8CF+CznWfz1JnbsMM+NJqdI6gW0eH34= =rsl4 -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 20:33: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 E45D21065670; Mon, 21 Nov 2011 20:33:18 +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 D210F8FC08; Mon, 21 Nov 2011 20:33:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALKXI1l058752; Mon, 21 Nov 2011 20:33:18 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALKXIYE058749; Mon, 21 Nov 2011 20:33:18 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111212033.pALKXIYE058749@svn.freebsd.org> From: Martin Matuska Date: Mon, 21 Nov 2011 20:33: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: r227803 - in head/cddl/contrib/opensolaris/cmd: zfs zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 20:33:19 -0000 Author: mm Date: Mon Nov 21 20:33:18 2011 New Revision: 227803 URL: http://svn.freebsd.org/changeset/base/227803 Log: Revert back to revision 227649 because of license uncertainity. Manual pages from OpenSolaris svn_134 are still properly CDDL licensed but I have been informed that the parts from s11ex are uncertain even if they contain a CDDL header. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 21 20:26:22 2011 (r227802) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Nov 21 20:33:18 2011 (r227803) @@ -1,5 +1,8 @@ '\" te -.\" Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. +.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. +.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with +.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] @@ -7,7 +10,7 @@ .\" Copyright 2011 by Delphix. All rights reserved. .\" Portions Copyright 2011 Pawel Jakub Dawidek .\" Portions Copyright 2011 Martin Matuska -.TH ZFS 8 "November 21, 2011" FreeBSD +.TH ZFS 8 "September 24, 2009" FreeBSD .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS @@ -91,13 +94,13 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR all | \fIfield\fR[,...]] [\fB-s\fR \fIsource\fR[,...]] - all | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ... +\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIsource\fR[,...]] + "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ... .fi .LP .nf -\fBzfs\fR \fBinherit\fR [\fB-rS\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ... +\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ... .fi .LP @@ -149,7 +152,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBsend\fR [\fB-DvRp\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR +\fBzfs\fR \fBsend\fR [\fB-vR\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR .fi .LP @@ -159,7 +162,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] [\fB-d\fR | \fB-e\fR] \fIfilesystem\fR +\fBzfs\fR \fBreceive\fR [\fB-vnFu\fR] \fB-d\fR \fIfilesystem\fR .fi .LP @@ -169,7 +172,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBallow\fR [\fB-ldug\fR] \fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] +\fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] \fIfilesystem\fR|\fIvolume\fR .fi @@ -190,7 +193,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] \fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] +\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR .fi @@ -234,11 +237,6 @@ zfs \- configures ZFS file systems \fBzfs\fR \fBunjail\fR \fIjailid\fR \fIfilesystem\fR .fi -.LP -.nf -\fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot\fR|\fIfilesystem\fR -.fi - .SH DESCRIPTION .sp .LP @@ -398,16 +396,6 @@ A \fBZFS\fR dataset can be detached from After a dataset is attached to a jail and the \fBjailed\fR property is set, a jailed file system cannot be mounted outside the jail, since the jail administrator might have set the mount point to an unacceptable value. -.SS "Deduplication" -.sp -.LP -Deduplication is the process of removing redundant data at the block-level, -reducing the total amount of data stored. Deduplication is pool-wide; each -dataset can opt in or out using its own \fBdedup\fR property. If a file system -has the \fBdedup\fR property enabled, duplicate data blocks are removed -synchronously on write. The result is that only unique data are stored and -common components are shared among files in all datasets in the pool that have -\fBdedup\fR enabled. .SS "Native Properties" .sp .LP @@ -571,11 +559,10 @@ The type of dataset: \fBfilesystem\fR, \ The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into -account \fBrefreservation\fR (through \fBusedbyrefreservation\fR) and the -reservations of any descendent datasets (through \fBusedbychildren\fR). The -amount of space that a dataset consumes from its parent, as well as the amount -of space that are freed if this dataset is recursively destroyed, is the -greater of its space used and its reservation. +account the reservations of any descendent datasets. The amount of space that a +dataset consumes from its parent, as well as the amount of space that are freed +if this dataset is recursively destroyed, is the greater of its space used and +its reservation. .sp When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with @@ -637,14 +624,6 @@ destroying any necessary snapshots or de .RS 4n The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed. -.sp -Space accounted for by this property represents potential consumption by future -writes, reserved in advance to prevent write allocation failures in this -dataset. This can include unwritten data, space currently shared with -snapshots, and compression savings for volumes (which may be lost when -replaced with less compressible data). When allocations for later writes -increase \fBusedbydataset\fR or \fBusedbysnapshots\fR, -\fBusedbyrefreservation\fR will decrease accordingly. .RE .sp @@ -895,25 +874,6 @@ property at file system creation time by .sp .ne 2 .na -\fB\fBdedup\fR=\fBon\fR | \fBoff\fR | \fBverify\fR | -\fBsha256\fR[,\fBverify\fR]\fR -.ad -.sp .6 -.RS 4n -Controls whether deduplication is in effect for a dataset. The default value -is \fBoff\fR. The default checksum used for deduplication is \fBsha256\fR -(subject to change). When \fBdedup\fR is enabled, the \fBdedup\fR checksum -algorithm overrides the \fBchecksum\fR property. Setting the value to -\fBverify\fR is equivalent to specifying \fBsha256,verify\fR. -.sp -If the property is set to \fBverify\fR, then, whenever two blocks have the -same signature, ZFS will do a byte-for-byte comparison with the existing block -to ensure that the contents are identical. -.RE - -.sp -.ne 2 -.na \fB\fBdevices\fR=\fBon\fR | \fBoff\fR\fR .ad .sp .6 @@ -947,16 +907,6 @@ section for more information. The defaul .sp .ne 2 .na -\fB\fBmlslabel\fR=\fIlabel\fR | \fBnone\fR\fR -.ad -.sp .6 -.RS 4n -The \fBmlslabel\fR property is not supported on FreeBSD. -.RE - -.sp -.ne 2 -.na \fB\fBmountpoint\fR=\fIpath\fR | \fBnone\fR | \fBlegacy\fR\fR .ad .sp .6 @@ -981,7 +931,7 @@ new location. .sp .6 .RS 4n Controls whether the file system should be mounted with \fBnbmand\fR (Non -Blocking mandatory locks). This is used for \fBSMB\fR clients. Changes to this +Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(8) for more information on \fBnbmand\fR mounts. .RE @@ -1020,96 +970,17 @@ implicit quota. .sp .ne 2 .na -\fB\fBsync=standard\fR | \fBalways\fR | \fBdisabled\fR\fR -.ad -.sp .6 -.RS 4n -Determines the degree to which file system transactions are synchronized. This -property can be set when a dataset is created, or dynamically, and will take -effect immediately. \fBsync\fR can have one of the following settings: -.sp -.ne 2 -.na -\fB\fBstandard\fR\fR -.ad -.sp .6 -.RS 4n -The default option. Synchronous file system transactions are written to the -intent log and then all devices written are flushed to ensure the data is -stable (that is, not cached by device controllers). -.RE - -.sp -.ne 2 -.na -\fB\fBalways\fR\fR -.ad -.sp .6 -.RS 4n -Every file system transaction would be written and flushed to stable storage. -This setting should be used only where extreme caution is required, as there -is a significant performance penalty. -.RE - -.sp -.ne 2 -.na -\fB\fBdisabled\fR\fR -.ad -.sp .6 -.RS 4n -Synchronous requests are disabled. File system transactions commit to stable -storage only on the next DMU transaction group commit, which might be after -many seconds. This setting gives the highest performance. However, it is very -dangerous as ZFS would be ignoring the synchronous transaction demands of -applications such as databases or NFS. Furthermore, when this setting is in -effect for the currently active root or \fB/var\fR filesystem, out-of-spec -behavior, application data loss, and increased vulnerability to replay attacks -can result. Administrators should only use this option only when these risks -are understood. -.RE - -To change the property, use a command such as either of the following: -.sp -.in +2 -.nf -# \fBzfs create -o sync=disabled whirlpool/milek\fR -# \fBzfs set sync=always whirlpool/perrin\fR -.fi -.in -2 -.sp - -Retrieve the value of sync as you would other properties. For example: -.sp -.in +2 -.nf -% \fBzfs get sync\fR -% \fBzfs list -o sync\fR -.fi -.in -2 -.sp - -The \fBsync\fR property is not inherited from parent datasets. -.RE - -.sp -.ne 2 -.na \fB\fBuserquota@\fR\fIuser\fR=\fIsize\fR | \fBnone\fR\fR .ad .sp .6 .RS 4n -Limits the amount of space consumed by the specified user. Similar to the -\fBrefquota\fR property, the \fBuserquota\fR space calculation does not inc -lude space that is used by descendent datasets, such as snapshots and clones. -User space consumption is identified by the \fBuserspace@\fR\fIuser\fR p -roperty. +Limits the amount of space consumed by the specified user. User space +consumption is identified by the \fBuserspace@\fR\fIuser\fR property. .sp Enforcement of user quotas may be delayed by several seconds. This delay means -that a user might exceed her quota before the system notices that she is over -quota. The system would then begin to refuse additional writes with the -\fBEDQUOT\fR error message . See the \fBzfs userspace\fR subcommand for more -information. +that a user might exceed their quota before the system notices that they are +over quota and begins to refuse additional writes with the \fBEDQUOT\fR error +message . See the \fBzfs userspace\fR subcommand for more information. .sp Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBuserquota\fR privilege with \fBzfs @@ -1313,12 +1184,12 @@ daemon is reloaded. .ad .sp .6 .RS 4n -Provides a hint to ZFS about handling of synchronous requests in this dataset. -If \fBlogbias\fR is set to \fBlatency\fR (the default), ZFS uses the pool's -log devices (if configured) to handle the requests at low latency. If -\fBlogbias\fR is set to \fBthroughput\fR, ZFS does not use the configured pool -log devices. Instead, ZFS optimizes synchronous operations for global pool -throughput and efficient use of resources. +Provide a hint to ZFS about handling of synchronous requests in this dataset. +If \fBlogbias\fR is set to \fBlatency\fR (the default), ZFS will use pool log +devices (if configured) to handle the requests at low latency. If \fBlogbias\fR +is set to \fBthroughput\fR, ZFS will not use configured pool log devices. ZFS +will instead optimize synchronous operations for global pool throughput and +efficient use of resources. .RE .sp @@ -1360,13 +1231,11 @@ reservation (or \fBrefreservation\fR). T multiple of \fBvolblocksize\fR, and cannot be zero. .sp The reservation is kept equal to the volume's logical size to prevent -unexpected behavior for consumers. The reservation size corresponds to the -volume's logical size, increased by ZFS implementation overhead. Without the -reservation, the volume could run out of space, resulting in undefined behavior -or data corruption, depending on how the volume is used. These effects can also -occur when the volume size is changed while it is in use (particularly when -shrinking the size). Extreme care should be used when adjusting the volume -size. +unexpected behavior for consumers. Without the reservation, the volume could +run out of space, resulting in undefined behavior or data corruption, depending +on how the volume is used. These effects can also occur when the volume size is +changed while it is in use (particularly when shrinking the size). Extreme care +should be used when adjusting the volume size. .sp Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the \fBzfs create -V\fR @@ -1417,7 +1286,7 @@ these properties. .ad .sp .6 .RS 4n -The \fBcasesensitivity\fR property is not supported on FreeBSD. +The \fB\fBcasesensitivity\fR property is currently not supported on FreeBSD. .RE .sp @@ -2120,7 +1989,7 @@ Properties" section. .ne 2 .na \fB\fBzfs get\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR -\fBall\fR | \fIfield\fR[,...] [\fB-s\fR \fIsource\fR[,...]] \fBall\fR | +\fIfield\fR[,...] [\fB-s\fR \fIsource\fR[,...] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR .ad .sp .6 @@ -2131,7 +2000,7 @@ property, the following columns are disp .sp .in +2 .nf - name Dataset name + name Dataset name property Property name value Property value source Property source. Can either be local, default, @@ -2140,10 +2009,9 @@ property, the following columns are disp .in -2 .sp -All columns except the \fBRECEIVED\fR column are displayed by default; specify -particular or all columns, using the \fB-o\fR option. This command takes a -comma-separated list of properties as described in the "Native Properties" and -"User Properties" sections. +All columns are displayed by default, though this can be controlled by using +the \fB-o\fR option. This command takes a comma-separated list of properties as +described in the "Native Properties" and "User Properties" sections. .sp The special value \fBall\fR can be used to display all properties that apply to the given dataset's type (filesystem, volume, or snapshot). @@ -2188,25 +2056,8 @@ arbitrary amount of space. .ad .sp .6 .RS 4n -Set of fields to display. One or more of: -.sp -.in +2 -.nf -name,property,value,received,source -.fi -.in -2 -.sp - -Present multiple fields as a comma-separated list. The default value is: -.sp -.in +2 -.nf -name,property,value,source -.fi -.in -2 -.sp - -The keyword \fBall\fR specifies all sources. +A comma-separated list of columns to display. \fBname,property,value,source\fR +is the default value. .RE .sp @@ -2218,16 +2069,8 @@ The keyword \fBall\fR specifies all sour .RS 4n A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of -the following: -.sp -.in +2 -.nf -local,default,inherited,temporary,received,none -.fi -.in -2 -.sp - -The default value is all sources. +the following: \fBlocal,default,inherited,temporary,none\fR. The default value +is all sources. .RE .sp @@ -2245,7 +2088,7 @@ Display numbers in parseable (exact) val .sp .ne 2 .na -\fB\fBzfs inherit\fR [\fB-rS\fR] \fIproperty\fR +\fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR .ad .sp .6 @@ -2264,20 +2107,6 @@ properties can be inherited. Recursively inherit the given property for all children. .RE -.sp -.ne 2 -.na -\fB\fB-S\fR\fR -.ad -.sp .6 -.RS 4n -Revert to the received property value, if any. If the property does not have a -received value, the behavior of \fBzfs inherit\fR \fB-S\fR is the same as -\fBzfs inherit\fR without \fB-S\fR. If the property does have a received -value, \fBzfs inherit\fR masks the received value with the inherited value -until \fBzfs inherit\fR \fB-S\fR reverts to the received value. -.RE - .RE .sp @@ -2298,10 +2127,10 @@ Displays a list of file systems that are .ad .sp .6 .RS 4n -Upgrades file systems to a new, on-disk version. Upgrading a file system means -that it will no longer be accessible on a system running an older software -version. A \fBzfs send\fR stream that is generated from a new file system -snapshot cannot be accessed on a system that runs an older software version. +Upgrades file systems to a new on-disk version. Once this is done, the file +systems will no longer be accessible on systems running older versions of the +software. \fBzfs send\fR streams generated from new snapshots of these file +systems cannot be accessed on systems running older versions of the software. .sp In general, the file system version is independent of the pool version. See \fBzpool\fR(8) for information on the \fBzpool upgrade\fR command. @@ -2610,11 +2439,7 @@ Unmount the specified filesystem. The co .ad .sp .6 .RS 4n -Shares ZFS file systems that have the \fBsharenfs\fR or \fBsharesmb\fR -property set. Sharing a file system with the NFS or SMB protocol means that -the file system data is available over the network. ZFS file systems that have -the \fBsharenfs\fR or \fBsharesmb\fR property set are automatically shared -when a system is booted. +Shares available \fBZFS\fR file systems. .sp .ne 2 .na @@ -2622,8 +2447,8 @@ when a system is booted. .ad .sp .6 .RS 4n -Shares all ZFS file systems that have the \fBsharenfs\fR or \fBsharesmb\fR -property set and according to the share property values. +Share all available \fBZFS\fR file systems. Invoked automatically as part of +the boot process. .RE .sp @@ -2633,8 +2458,9 @@ property set and according to the share .ad .sp .6 .RS 4n -Shares the specified file system that has the \fBsharenfs\fR or \fBsharesmb\fR -property set and according to the share property values. +Share the specified filesystem according to the \fBsharenfs\fR and +\fBsharesmb\fR properties. File systems are shared when the \fBsharenfs\fR or +\fBsharesmb\fR property is set. .RE .RE @@ -2646,8 +2472,8 @@ property set and according to the share .ad .sp .6 .RS 4n -Unshares all ZFS file systems that have the \fBsharenfs\fR or \fBsharesmb\fR -property set. +Unshares currently shared \fBZFS\fR file systems. This is invoked automatically +as part of the shutdown process. .sp .ne 2 .na @@ -2675,8 +2501,8 @@ Unshare the specified filesystem. The co .sp .ne 2 .na -\fBzfs send\fR [\fB-DvRp\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] -\fIsnapshot\fR +\fB\fBzfs send\fR [\fB-vR\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] +\fIsnapshot\fR\fR .ad .sp .6 .RS 4n @@ -2684,18 +2510,6 @@ Creates a stream representation of the s to standard output. The output can be redirected to a file or to a different system (for example, using \fBssh\fR(1). By default, a full stream is generated. - -.sp -.ne 2 -.na -\fB\fB-D\fR\fR -.ad -.sp .6 -.RS 4n -Perform \fBdedup\fR processing on the stream. Deduplicated streams cannot be -received on systems that do not support the stream deduplication feature. -.RE - .sp .ne 2 .na @@ -2768,7 +2582,7 @@ on future versions of \fBZFS\fR. .ad .br .na -\fB\fBzfs receive\fR [\fB-vnFu\fR] [\fB-d\fR | \fB-e\fR] \fIfilesystem\fR\fR +\fB\fBzfs receive\fR [\fB-vnFu\fR] \fB-d\fR \fIfilesystem\fR\fR .ad .sp .6 .RS 4n @@ -2790,21 +2604,15 @@ on the sending location are destroyed by command. .sp The name of the snapshot (and file system, if a full stream is received) that -this subcommand creates depends on the argument type and the \fB-d\fR or -\fB-e\fR option. +this subcommand creates depends on the argument type and the \fB-d\fR option. .sp If the argument is a snapshot name, the specified \fIsnapshot\fR is created. If the argument is a file system or volume name, a snapshot with the same name as the sent snapshot is created within the specified \fIfilesystem\fR or -\fIvolume\fR. If the \fB-d\fR or \fB-e\fR option is specified, the snapshot -name is determined by appending the sent snapshot's name to the specified -filesystem. If the \fB-d\fR option is specified, all but the pool name of the -sent snapshot path is appended (for example, \fBb/c@1\fR appended from sent -snapshot \fBa/b/c@1\fR), and if the \fB-e\fR option is specified, only the tail -of the sent snapshot path is appended (for example, \fBc@1\fR appended from -sent snapshot \fBa/b/c@1\fR). In the case of \fB-d\fR, any file systems needed -to replicate the path of the sent snapshot are created within the specified -file system. +\fIvolume\fR. If the \fB-d\fR option is specified, the snapshot name is +determined by appending the sent snapshot's name to the specified +\fIfilesystem\fR. If the \fB-d\fR option is specified, any required file +systems within the specified one are created. .sp .ne 2 .na @@ -2812,20 +2620,8 @@ file system. .ad .sp .6 .RS 4n -Use all but the first element of the sent snapshot path (all but the pool name) -to determine the name of the new snapshot as described in the paragraph above. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-e\fR\fR -.ad -.sp .6 -.RS 4n -Use the last element of the sent snapshot path to determine the name of the new -snapshot as described in the paragraph above. +Use the name of the sent snapshot to determine the name of the new snapshot as +described in the paragraph above. .RE .sp @@ -2841,16 +2637,6 @@ File system that is associated with the .sp .ne 2 .na -\fB\fB-p\fR\fR -.ad -.sp .6 -.RS 4n -Send properties. -.RE - -.sp -.ne 2 -.na \fB\fB-v\fR\fR .ad .sp .6 @@ -2899,7 +2685,7 @@ volume. See the other forms of \fBzfs al .sp .ne 2 .na -\fB\fBzfs allow\fR [\fB-ldug\fR] \fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...] +\fB\fBzfs allow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR| \fIvolume\fR\fR .ad .br @@ -2914,14 +2700,14 @@ non-privileged users. .sp .ne 2 .na -\fB[\fB-ug\fR] \fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...]\fR +\fB[\fB-ug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...]\fR .ad .sp .6 .RS 4n Specifies to whom the permissions are delegated. Multiple entities can be specified as a comma-separated list. If neither of the \fB-ug\fR options are specified, then the argument is interpreted preferentially as the keyword -\fBeveryone\fR, then as a user name, and lastly as a group name. To specify a user +"everyone", then as a user name, and lastly as a group name. To specify a user or group named "everyone", use the \fB-u\fR or \fB-g\fR options. To specify a group with the same name as a user, use the \fB-g\fR options. .RE @@ -2933,7 +2719,7 @@ group with the same name as a user, use .ad .sp .6 .RS 4n -Specifies that the permissions be delegated to \fBeveryone\fR. Multiple permissions +Specifies that the permissions be delegated to "everyone." Multiple permissions may be specified as a comma-separated list. Permission names are the same as \fBZFS\fR subcommand and property names. See the property list below. Property set names, which begin with an at sign (\fB@\fR) , may be specified. See the @@ -2965,21 +2751,16 @@ Permissions are generally the ability to .in +2 .nf NAME TYPE NOTES -allow subcommand Must also have the permission that is - being allowed -clone subcommand Must also have the 'create' ability and - 'mount' ability in the origin file system +allow subcommand Must also have the permission that is being + allowed +clone subcommand Must also have the 'create' ability and 'mount' + ability in the origin file system create subcommand Must also have the 'mount' ability destroy subcommand Must also have the 'mount' ability -diff subcommand Allows user to compare differences between - snapshots of a ZFS dataset -hold subcommand Allows adding a user hold to a snapshot mount subcommand Allows mount/umount of ZFS datasets -promote subcommand Must also have the 'mount' and 'promote' - ability in the origin file system +promote subcommand Must also have the 'mount' + and 'promote' ability in the origin file system receive subcommand Must also have the 'mount' and 'create' ability -release subcommand Allows releasing a user hold which - might destroy the snapshot rename subcommand Must also have the 'mount' and 'create' ability in the new parent rollback subcommand Must also have the 'mount' ability @@ -3001,12 +2782,9 @@ casesensitivity property checksum property compression property copies property -dedup property devices property exec property jailed property -logbias property -mlslabel property mountpoint property nbmand property normalization property @@ -3022,7 +2800,6 @@ setuid property sharenfs property sharesmb property snapdir property -sync property utf8only property version property volblocksize property @@ -3065,7 +2842,7 @@ characters long. .ne 2 .na \fB\fBzfs unallow\fR [\fB-rldug\fR] -\fBeveryone\fR|\fIuser\fR|\fIgroup\fR[,...] +"\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[, ...]] \fIfilesystem\fR|\fIvolume\fR\fR .ad .br @@ -3087,10 +2864,10 @@ Removes permissions that were granted wi permissions are explicitly denied, so other permissions granted are still in effect. For example, if the permission is granted by an ancestor. If no permissions are specified, then all permissions for the specified \fIuser\fR, -\fIgroup\fR, or \fIeveryone\fR are removed. Specifying \fBeveryone\fR (or -using the \fB-e\fR option) only removes the permissions that were granted to -\fReveryone\fB, not all permissions for every user and group. See the -\fBzfs allow\fR command for a description of the \fB-ldugec\fR options. +\fIgroup\fR, or \fIeveryone\fR are removed. Specifying "everyone" (or using the +\fB-e\fR option) only removes the permissions that were granted to "everyone", +not all permissions for every user and group. See the \fBzfs allow\fR command +for a description of the \fB-ldugec\fR options. .sp .ne 2 .na @@ -3218,170 +2995,6 @@ Detaches the given file system from the .RE -.sp -.ne 2 -.na -\fB\fBzfs diff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot\fR | -\fIfilesystem\fR\fR -.ad -.sp .6 -.RS 4n -Gives a high-level description of the differences between a snapshot and a -descendent dataset. The descendent can be either a snapshot of the dataset or -the current dataset. -.sp -For each file that has undergone a change between the original snapshot and -the descendent, the type of change is described along with the name of the -file. In the case of a rename, both the old and new names are shown. Whitespace -characters, backslash characters, and other non-printable or non-7-bit ASCII -characters found in file names are displayed as a backslash character followed -by the three-digit octal representation of the byte value. -.sp -If the \fB-t\fR option is specified, the first column of output from the -command is the file's \fBst_ctim\fR value. For deleted files, this is the final -\fBst_ctim\fR in the earlier snapshot. -.sp -The type of change follows any timestamp displayed, and is described with a -single character: -.sp -.ne 2 -.na -\fB\fB+\fR\fR -.ad -.RS 5n -Indicates the file was added in the later dataset. -.RE - -.sp -.ne 2 -.na -\fB\fB-\fR\fR -.ad -.RS 5n -Indicates the file was removed in the later dataset. -.RE - -.sp -.ne 2 -.na -\fB\fBM\fR\fR -.ad -.RS 5n -Indicates the file was modified in the later dataset. -.RE - -.sp -.ne 2 -.na -\fB\fBR\fR\fR -.ad -.RS 5n -Indicates the file was renamed in the later dataset. -.RE - -If the \fB-F\fR option is specified, the next column of output will be a single -character describing the type of the file. The mappings are: -.sp -.ne 2 -.na -\fB\fBF\fR\fR -.ad -.RS 5n -regular file -.RE - -.sp -.ne 2 -.na -\fB\fB/\fR\fR -.ad -.RS 5n -directory -.RE - -.sp -.ne 2 -.na -\fB\fBB\fR\fR -.ad -.RS 5n -block device -.RE - -.sp -.ne 2 -.na -\fB\fB>\fR\fR -.ad -.RS 5n -door -.RE - -.sp -.ne 2 -.na -\fB\fB|\fR\fR -.ad -.RS 5n -FIFO -.RE - -.sp -.ne 2 -.na -\fB\fB@\fR\fR -.ad -.RS 5n -symbolic link -.RE - -.sp -.ne 2 -.na -\fB\fBP\fR\fR -.ad -.RS 5n -event portal -.RE - -.sp -.ne 2 -.na -\fB\fB=\fR\fR -.ad -.RS 5n -socket -.RE - -If the modification involved a change in the link count of a non-directory -file, the change will be expressed as a delta within parentheses on the -modification line. If the file was renamed, the old name will be separated from -the new with the string "\fB->\fR". -.sp -The following is example output with both the \fB-F\fR and \fB-t\fR options -specified: -.sp -.in +2 -.nf -1269962501.206726811 M / /myfiles/ -1269962444.207369955 M F /myfiles/link_to_me (+1) -1269962499.207519034 R /myfiles/rename_me -> /myfiles/renamed -1269962431.813566720 - F /myfiles/delete_me -1269962518.666905544 + F /myfiles/new_file -1269962501.393099817 + | /myfiles/new_pipe -.fi -.in -2 -.sp -If the \fB-H\fR option is selected, easier-to-parse output is produced. Fields -are separated by a single tab, and no arrow string (\fB->\fR) is placed between -the old and new names of a rename. No guarantees are made on the spacing -between fields of non \fB-H\fR output. -.sp -Unless they already have the \fB{PRIV_SYS_CONFIG}\fR or \fB{PRIV_SYS_MOUNT}\fR -privilege, users must be granted the \fBdiff\fR permission with \fBzfs allow\fR -to use this subcommand. -.RE - .SH EXAMPLES .LP \fBExample 1 \fRCreating a ZFS File System Hierarchy @@ -3501,19 +3114,19 @@ The following command lists all properti # \fBzfs get all pool/home/bob\fR NAME PROPERTY VALUE SOURCE pool/home/bob type filesystem - -pool/home/bob creation Wed May 5 6:13 2010 - +pool/home/bob creation Tue Jul 21 15:53 2009 - pool/home/bob used 21K - -pool/home/bob available 50.0G - +pool/home/bob available 20.0G - pool/home/bob referenced 21K - pool/home/bob compressratio 1.00x - pool/home/bob mounted yes - -pool/home/bob quota 50G local +pool/home/bob quota 20G local pool/home/bob reservation none default pool/home/bob recordsize 128K default pool/home/bob mountpoint /pool/home/bob default pool/home/bob sharenfs off default pool/home/bob checksum on default -pool/home/bob compression off local +pool/home/bob compression on local pool/home/bob atime on default pool/home/bob devices on default pool/home/bob exec on default @@ -3541,8 +3154,6 @@ pool/home/bob usedbysnapshots 0 pool/home/bob usedbydataset 21K - pool/home/bob usedbychildren 0 - pool/home/bob usedbyrefreservation 0 - -pool/home/bob logbias latency default -pool/home/bob mlslabel none default .fi .in -2 .sp @@ -3703,7 +3314,7 @@ property for a dataset. .sp .LP -\fBExample 15 \fRPerforming a Rolling Snapshot +\fBExample 16 \fRPerforming a Rolling Snapshot .sp .LP The following example shows how to maintain a history of snapshots with a @@ -3728,7 +3339,7 @@ a new snapshot, as follows: .sp .LP -\fBExample 16 \fRSetting \fBsharenfs\fR Property Options on a ZFS File System +\fBExample 17 \fRSetting \fBsharenfs\fR Property Options on a ZFS File System .sp .LP The following commands show how to set \fBsharenfs\fR property options to @@ -3749,7 +3360,7 @@ If you are using \fBDNS\fR for host name qualified hostname. .LP -\fBExample 17 \fRDelegating ZFS Administration Permissions on a ZFS Dataset +\fBExample 18 \fRDelegating ZFS Administration Permissions on a ZFS Dataset .sp .LP The following example shows how to set permissions so that user \fBcindys\fR @@ -3783,7 +3394,7 @@ Set an \fBACL\fR similar to the followin .sp .LP -\fBExample 18 \fRDelegating Create Time Permissions on a ZFS Dataset +\fBExample 19 \fRDelegating Create Time Permissions on a ZFS Dataset .sp .LP The following example shows how to grant anyone in the group \fBstaff\fR to @@ -3808,7 +3419,7 @@ Local+Descendent permissions on (tank/us .sp .LP -\fBExample 19 \fRDefining and Granting a Permission Set on a ZFS Dataset +\fBExample 20 \fRDefining and Granting a Permission Set on a ZFS Dataset .sp .LP The following example shows how to define and grant a permission set on the @@ -3834,7 +3445,7 @@ Local+Descendent permissions on (tank/us .sp .LP -\fBExample 20 \fRDelegating Property Permissions on a ZFS Dataset +\fBExample 21 \fRDelegating Property Permissions on a ZFS Dataset .sp .LP The following example shows to grant the ability to set quotas and reservations @@ -3859,7 +3470,7 @@ users/home/marks quota 10G .sp .LP -\fBExample 21 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset +\fBExample 22 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset .sp .LP The following example shows how to remove the snapshot permission from the Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Nov 21 20:26:22 2011 (r227802) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Nov 21 20:33:18 2011 (r227803) @@ -1,20 +1,11 @@ '\" te -.\" Copyright (c) 2004, 2010, Oracle and/or its -.\" affiliates. All rights reserved. -.\" The contents of this file are subject to the -.\" terms of the Common Development and Distribution License (the "License"). -.\" You may not use this file except in compliance with the License. You can obtain -.\" a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. -.\" See the License for the specific language governing permissions and limitations -.\" under the License. When distributing Covered Code, include this CDDL HEADER -.\" in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 20:47: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 B130F106566C; Mon, 21 Nov 2011 20:47:51 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id D38198FC15; Mon, 21 Nov 2011 20:47:50 +0000 (UTC) X-T2-Spam-Status: No, hits=2.5 required=5.0 tests=ALL_TRUSTED, BAYES_99 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 39041959; Mon, 21 Nov 2011 21:47:48 +0100 From: Hans Petter Selasky To: Bruce Evans Date: Mon, 21 Nov 2011 21:45:08 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <229B993A-8F52-42B3-AE87-7DB4451AA9D0@bsdimp.com> <20111121134538.R1108@besplex.bde.org> In-Reply-To: <20111121134538.R1108@besplex.bde.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201111212145.08537.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Warner Losh Subject: Re: svn commit: r227749 - 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: Mon, 21 Nov 2011 20:47:51 -0000 On Monday 21 November 2011 04:37:02 Bruce Evans wrote: > pause() grew some additional complications that I don't like. Hans > noticed that DELAY(n) overflows for large n on arm. So pause() now > avoids passing large n to DELAY(). Probably no other callers of > DELAY() do this, and no callers of pause() need large n for DELAY(). > I'll see what I can do later this week. Right now I'm very busy. --HPS From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 21:36: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 1F8A6106564A; Mon, 21 Nov 2011 21:36:16 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id F25038FC12; Mon, 21 Nov 2011 21:36:14 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so9461277bkb.13 for ; Mon, 21 Nov 2011 13:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=cn0Lz1+cHFLu45xSp3vV81rtCqy8YN/ooEXCw2Ojk7I=; b=C1SiN0PXo2YQ5yURbQprvCEXvvoFvZ6/VC8LpwTrzNMDG4gW7eYxZXTaPpNeQbFzPR 42w2g2lTslPm17GpIPKfiAkaU7sl5vR1j1pa0HdfPF/R3q40FuoOggnkyWevOfoQTHHL x+DlMqpj7413L+0oQwS5k7Rs2FNt9MrbFG79Y= MIME-Version: 1.0 Received: by 10.204.155.141 with SMTP id s13mr16379431bkw.40.1321911373598; Mon, 21 Nov 2011 13:36:13 -0800 (PST) Sender: tomelite82@gmail.com Received: by 10.223.93.132 with HTTP; Mon, 21 Nov 2011 13:36:13 -0800 (PST) In-Reply-To: <20111121195439.GE96616@FreeBSD.org> References: <201111211410.pALEAD9B046139@svn.freebsd.org> <20111121195439.GE96616@FreeBSD.org> Date: Mon, 21 Nov 2011 13:36:13 -0800 X-Google-Sender-Auth: 7uhkSPtcyyxf005NUZRvgeDEMyo Message-ID: From: Qing Li To: Gleb Smirnoff , Qing Li Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227791 - 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: Mon, 21 Nov 2011 21:36:16 -0000 > > From my point of view logically speaking, we should first remove route, > then remove address. Otherwise, for a short time we've got an invalid > route in table. > For a short time you have an invalid address, it is faster to remove the address from the list to prevent usage, then to flush the route, which would also trigger L2 table flushes as well. > > Q> Putting "in_scrubprefix()" at the top does not gain you anything at > Q> all, but can > Q> potentially be problematic if additional tasks are in fact performed > Q> in "if_ioctl()" > Q> that may in fact affect the logic in "in_ifinit()". > Q> > Q> Case in point, I had to perform additional routing related tasks so I > Q> re-introduced "nd6_rtrequest()" in r227460. > > Pardon, can you please elaborate on this? I don't see any problems that > I intoroduced, but if ther are any, we can either push in_scrubprefix() > down the function as it was before, of fix them some other way. > The point being, perhaps the address related tasks to be performed in "if_ioctl()" today is limited, however, we may need to perform additional housekeeping tasks in "if_ioctl()", and if there is error, we would want to revert the process. There are so many different L2 and pseudo interface functions that map to "if_ioctl()", it is Not safe to ignore its error and not reflect that error back to the consistency of the routing table and the interface address list. Again, removing the associated route at the beginning of in_ifinit() does not gain much in terms of performance or code cleanness, nor does it improve the logic, so why limit what we could do in the future in "if_ioctl()" by making such a change ?? > > Q> You are not simplifying much logic by removing the error recovery code from > Q> the return of "if_ioctl()". So why removing the flexibility of what > Q> "if_ioctl()" is > Q> intended for as part of the address configuration logic ? > > Because in_ifinit() was inconsistent. It tried to recover in case > of (*ifp->if_ioctl) failure, but did not try to recover in case > of failure of: > > in_addprefix() > ifa_add_loopback_route() > The "inconsistency" is due to the fact failures from these two functions are not fatal, and does not necessarily affect the actual operations. In function "in_addprefix()", there are 2 main possible errors. EEXIST is non fatal, it just means the same prefix route is already covered by another address, and what is being inserted is just an alias. The other error is due to RTM_ADD failure, however, since IFA_ROUTE is not set on the address when failure occurs, no route will ever be directed to either the interface or that address. Therefore no harm is done. In the case of function "ifa_add_loopback_route()", again, a failure is just an indication of an EEXIST. You may ask why not check for EEXIST before calling these functions, and I can tell you having worked those code regions for quite some time, the actual work amounts to the same efforts, but complicates the logic WRT the callers. It's actually better just let the failure occur. Unless you have strong reasons otherwise, I'd appreciate you put back the original logic in function "in_ifinit()". --Qing From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 21:59: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 DF7391065672; Mon, 21 Nov 2011 21:59: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 CF9018FC12; Mon, 21 Nov 2011 21:59:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALLx1nA061396; Mon, 21 Nov 2011 21:59:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALLx1K9061394; Mon, 21 Nov 2011 21:59:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111212159.pALLx1K9061394@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Nov 2011 21:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227804 - head/sys/dev/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: Mon, 21 Nov 2011 21:59:02 -0000 Author: adrian Date: Mon Nov 21 21:59:01 2011 New Revision: 227804 URL: http://svn.freebsd.org/changeset/base/227804 Log: Fix some whitespace pollution. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Nov 21 20:33:18 2011 (r227803) +++ head/sys/dev/ath/if_ath.c Mon Nov 21 21:59:01 2011 (r227804) @@ -1864,12 +1864,10 @@ ath_txrx_stop(struct ath_softc *sc) int i = MAX_TXRX_ITERATIONS; ATH_UNLOCK_ASSERT(sc); - /* Stop any new TX/RX from occuring */ taskqueue_block(sc->sc_tq); ATH_PCU_LOCK(sc); - /* * Sleep until all the pending operations have completed. * @@ -1878,7 +1876,7 @@ ath_txrx_stop(struct ath_softc *sc) */ while (sc->sc_rxproc_cnt || sc->sc_txproc_cnt || sc->sc_txstart_cnt || sc->sc_intr_cnt) { - if (i <= 0) + if (i <= 0) break; msleep(sc, &sc->sc_mtx, 0, "ath_txrx_stop", 1); i--; From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 22:19: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 05405106566C; Mon, 21 Nov 2011 22:19:13 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF1418FC14; Mon, 21 Nov 2011 22:19:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALMJCHo062106; Mon, 21 Nov 2011 22:19:12 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALMJCYa062103; Mon, 21 Nov 2011 22:19:12 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201111212219.pALMJCYa062103@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 21 Nov 2011 22:19: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: r227805 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 22:19:13 -0000 Author: bschmidt Date: Mon Nov 21 22:19:12 2011 New Revision: 227805 URL: http://svn.freebsd.org/changeset/base/227805 Log: The DC calibration result obtained during initialization can't be passed over to the runtime firmware on 6050 devices. Instead let the runtime firmware do the calibration itself. This fixes support for the 6050 series devices. Obtained from: OpenBSD Submitted by: kevlo Tested by: lx, Tz-Huan Huang(earlier version) Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Nov 21 21:59:01 2011 (r227804) +++ head/sys/dev/iwn/if_iwn.c Mon Nov 21 22:19:12 2011 (r227805) @@ -246,6 +246,7 @@ static int iwn_send_sensitivity(struct i static int iwn_set_pslevel(struct iwn_softc *, int, int, int); static int iwn_send_btcoex(struct iwn_softc *); static int iwn_send_advanced_btcoex(struct iwn_softc *); +static int iwn5000_runtime_calib(struct iwn_softc *); static int iwn_config(struct iwn_softc *); static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); static int iwn_scan(struct iwn_softc *); @@ -2505,7 +2506,8 @@ iwn5000_rx_calib_results(struct iwn_soft case IWN5000_PHY_CALIB_DC: if ((sc->sc_flags & IWN_FLAG_INTERNAL_PA) == 0 && (sc->hw_type == IWN_HW_REV_TYPE_5150 || - sc->hw_type >= IWN_HW_REV_TYPE_6000)) + sc->hw_type >= IWN_HW_REV_TYPE_6000) && + sc->hw_type != IWN_HW_REV_TYPE_6050) idx = 0; break; case IWN5000_PHY_CALIB_LO: @@ -4996,6 +4998,19 @@ iwn_send_advanced_btcoex(struct iwn_soft } static int +iwn5000_runtime_calib(struct iwn_softc *sc) +{ + struct iwn5000_calib_config cmd; + + memset(&cmd, 0, sizeof cmd); + cmd.ucode.once.enable = 0xffffffff; + cmd.ucode.once.start = IWN5000_CALIB_DC; + DPRINTF(sc, IWN_DEBUG_CALIBRATE, + "%s: configuring runtime calibration\n", __func__); + return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0); +} + +static int iwn_config(struct iwn_softc *sc) { struct iwn_ops *ops = &sc->ops; @@ -5015,6 +5030,17 @@ iwn_config(struct iwn_softc *sc) } } + if (sc->hw_type == IWN_HW_REV_TYPE_6050) { + /* Configure runtime DC calibration. */ + error = iwn5000_runtime_calib(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not configure runtime calibration\n", + __func__); + return error; + } + } + /* Configure valid TX chains for >=5000 Series. */ if (sc->hw_type != IWN_HW_REV_TYPE_4965) { txmask = htole32(sc->txchainmask); Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Mon Nov 21 21:59:01 2011 (r227804) +++ head/sys/dev/iwn/if_iwnreg.h Mon Nov 21 22:19:12 2011 (r227805) @@ -739,6 +739,8 @@ struct iwn5000_wimax_coex { struct iwn5000_calib_elem { uint32_t enable; uint32_t start; +#define IWN5000_CALIB_DC (1 << 1) + uint32_t send; uint32_t apply; uint32_t reserved; From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 22:57: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 D85E3106564A; Mon, 21 Nov 2011 22:57:29 +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 5B5528FC1A; Mon, 21 Nov 2011 22:57:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALMvTTI063354; Mon, 21 Nov 2011 22:57:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALMvTZd063352; Mon, 21 Nov 2011 22:57:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111212257.pALMvTZd063352@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Nov 2011 22:57: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: r227806 - head/sys/dev/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: Mon, 21 Nov 2011 22:57:29 -0000 Author: adrian Date: Mon Nov 21 22:57:28 2011 New Revision: 227806 URL: http://svn.freebsd.org/changeset/base/227806 Log: Use the correct lock when calling msleep(). This fixes panics that users have been seeing when operating in station mode, where the interface undergoes a lot more resets then in hostap mode (ie whilst doing channel scanning.) Reported by: arundel, wblock@wonkity.com Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Nov 21 22:19:12 2011 (r227805) +++ head/sys/dev/ath/if_ath.c Mon Nov 21 22:57:28 2011 (r227806) @@ -1878,7 +1878,7 @@ ath_txrx_stop(struct ath_softc *sc) sc->sc_txstart_cnt || sc->sc_intr_cnt) { if (i <= 0) break; - msleep(sc, &sc->sc_mtx, 0, "ath_txrx_stop", 1); + msleep(sc, &sc->sc_pcu_mtx, 0, "ath_txrx_stop", 1); i--; } ATH_PCU_UNLOCK(sc); From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 23:32: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 11563106564A; Mon, 21 Nov 2011 23:32:15 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 016AC8FC0A; Mon, 21 Nov 2011 23:32:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pALNWEFJ064462; Mon, 21 Nov 2011 23:32:14 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pALNWERk064460; Mon, 21 Nov 2011 23:32:14 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111212332.pALNWERk064460@svn.freebsd.org> From: David Chisnall Date: Mon, 21 Nov 2011 23:32: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: r227807 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Nov 2011 23:32:15 -0000 Author: theraven Date: Mon Nov 21 23:32:14 2011 New Revision: 227807 URL: http://svn.freebsd.org/changeset/base/227807 Log: (Hopefully) Fix the build with clang by removing a typedef that's no longer needed. Approved by: brooks (mentor) Modified: head/lib/libc/string/strcasecmp.c Modified: head/lib/libc/string/strcasecmp.c ============================================================================== --- head/lib/libc/string/strcasecmp.c Mon Nov 21 22:57:28 2011 (r227806) +++ head/lib/libc/string/strcasecmp.c Mon Nov 21 23:32:14 2011 (r227807) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include "xlocale_private.h" -typedef unsigned char u_char; - int strcasecmp_l(const char *s1, const char *s2, locale_t locale) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 21 23:51: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 360EE10657C8; Mon, 21 Nov 2011 23:51:05 +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 C62768FC0A; Mon, 21 Nov 2011 23:51:04 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 255EE1DD633; Tue, 22 Nov 2011 00:51:02 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id F267F28468; Tue, 22 Nov 2011 00:51:01 +0100 (CET) Date: Tue, 22 Nov 2011 00:51:01 +0100 From: Jilles Tjoelker To: Bruce Evans Message-ID: <20111121235101.GA8012@stack.nl> References: <201111082354.pA8NsdhP055080@svn.freebsd.org> <20111109083545.GC1598@mole.fafoe.narf.at> <20111109203528.GA29992@stack.nl> <20111121181134.A882@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111121181134.A882@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder , src-committers@freebsd.org Subject: Re: svn commit: r227369 - 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, 21 Nov 2011 23:51:05 -0000 On Mon, Nov 21, 2011 at 06:29:06PM +1100, Bruce Evans wrote: > On Wed, 9 Nov 2011, Jilles Tjoelker wrote: > > On Wed, Nov 09, 2011 at 09:35:51AM +0100, Stefan Farfeleder wrote: > >> Isn't the behaviour undefined too when you convert an out-of-range > >> uintmax_t value back into an intmax_t value? > > The result is implementation-defined or an implementation-defined signal > > is raised. > C doesn't allow any signal, at least in C90 and n869.txt draft C99: > % 6.3.1.3 Signed and unsigned integers > % ... > % [#3] Otherwise, the new type is signed and the value cannot > % be represented in it; the result is implementation-defined. > % J.3 Implementation-defined behavior > % ... > % J.3.5 Integers > % > % [#1] > % ... > % -- The result of converting an integer to a signed integer > % type when the value cannot be represented in an object > % of that type (6.3.1.3). > > n869.txt barely mentions signals, especially here. Its only literal > match for "signal raised" is in Annex H for LIA, which says that if > an arithmetic exception raises a signal, then the signal shall be > SIGFPE, and this is mainly for floating point. It has many more literal > matches for "exception raised", since Annex F for IEEE754 requires > exceptions to be raised a lot; these exceptions normally don't generate > signals. > > GCC documentation (gcc.info 4.5 Integers implementation) says this > > ] * `The result of, or the signal raised by, converting an integer to a > > ] signed integer type when the value cannot be represented in an > > ] object of that type (C90 6.2.1.2, C99 6.3.1.3).' > ", or the signal raised by, " in this seems to be a bug in gcc > documentation. The documentation of implementation-defined behaviour > shouldn't mention that specifed behaviour is implemented, at least > without distinguishing the part that is as specified. The possibility of a signal is mentioned in C99TC2 draft n1124 and remains in C1x draft n1548. The documentation in 'info gcc' is consistent with that. > > ] For conversion to a type of width N, the value is reduced modulo > > ] 2^N to be within range of the type; no signal is raised. > > which is exactly what we need. > Of course, a correct implementation would give a random result, so that > no one depends on implementation-defined behaviour. That would be a non-practical implementation, as it would be both slower and run fewer existing applications. I think there should be some "loopholes" to do signed integer arithmetic with wraparound, not allowing the compiler to assume there is no overflow. While POSIX leaves the behaviour on overflow and division by zero in shell arithmetic undefined as with C arithmetic (although it mentions the possibility of converting to floating point in case of overflow), I prefer that sh(1) not crash. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 00:07:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE73F1065673; Tue, 22 Nov 2011 00:07:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4CE38FC0C; Tue, 22 Nov 2011 00:07:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAM07rMw065613; Tue, 22 Nov 2011 00:07:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAM07rjP065608; Tue, 22 Nov 2011 00:07:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111220007.pAM07rjP065608@svn.freebsd.org> From: Eitan Adler Date: Tue, 22 Nov 2011 00:07: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: r227808 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 00:07:53 -0000 Author: eadler (ports committer) Date: Tue Nov 22 00:07:53 2011 New Revision: 227808 URL: http://svn.freebsd.org/changeset/base/227808 Log: - add check for pointer equality prior to performing the O(n) pass - while here change 's' to 's1' in strcoll Submitted by: eadler@ Reviewed by: theraven@ Approved by: brooks@ MFC after: 2 weeks Modified: head/lib/libc/string/strcasecmp.c head/lib/libc/string/strcmp.c head/lib/libc/string/strcoll.c head/lib/libc/string/strncmp.c Modified: head/lib/libc/string/strcasecmp.c ============================================================================== --- head/lib/libc/string/strcasecmp.c Mon Nov 21 23:32:14 2011 (r227807) +++ head/lib/libc/string/strcasecmp.c Tue Nov 22 00:07:53 2011 (r227808) @@ -48,6 +48,9 @@ strcasecmp_l(const char *s1, const char const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2; + if (s1 == s2) + return (0); + FIX_LOCALE(locale); while (tolower_l(*us1, locale) == tolower_l(*us2++, locale)) @@ -65,18 +68,21 @@ int strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale) { FIX_LOCALE(locale); - if (n != 0) { - const u_char - *us1 = (const u_char *)s1, - *us2 = (const u_char *)s2; - - do { - if (tolower_l(*us1, locale) != tolower_l(*us2++, locale)) - return (tolower_l(*us1, locale) - tolower_l(*--us2, locale)); - if (*us1++ == '\0') - break; - } while (--n != 0); - } + + const u_char + *us1 = (const u_char *)s1, + *us2 = (const u_char *)s2; + + if (( s1 == s2) | (n == 0)) + return (0); + + + do { + if (tolower_l(*us1, locale) != tolower_l(*us2++, locale)) + return (tolower_l(*us1, locale) - tolower_l(*--us2, locale)); + if (*us1++ == '\0') + break; + } while (--n != 0); return (0); } Modified: head/lib/libc/string/strcmp.c ============================================================================== --- head/lib/libc/string/strcmp.c Mon Nov 21 23:32:14 2011 (r227807) +++ head/lib/libc/string/strcmp.c Tue Nov 22 00:07:53 2011 (r227808) @@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$"); int strcmp(const char *s1, const char *s2) { + if (s1 == s2) + return (0); + while (*s1 == *s2++) if (*s1++ == '\0') return (0); Modified: head/lib/libc/string/strcoll.c ============================================================================== --- head/lib/libc/string/strcoll.c Mon Nov 21 23:32:14 2011 (r227807) +++ head/lib/libc/string/strcoll.c Tue Nov 22 00:07:53 2011 (r227808) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include int -strcoll_l(const char *s, const char *s2, locale_t locale) +strcoll_l(const char *s1, const char *s2, locale_t locale) { int len, len2, prim, prim2, sec, sec2, ret, ret2; const char *t, *t2; @@ -50,16 +50,16 @@ strcoll_l(const char *s, const char *s2, (struct xlocale_collate*)locale->components[XLC_COLLATE]; if (table->__collate_load_error) - return strcmp(s, s2); + return strcmp(s1, s2); len = len2 = 1; ret = ret2 = 0; if (table->__collate_substitute_nontrivial) { - t = tt = __collate_substitute(table, s); + t = tt = __collate_substitute(table, s1); t2 = tt2 = __collate_substitute(table, s2); } else { tt = tt2 = NULL; - t = s; + t = s1; t2 = s2; } while(*t && *t2) { @@ -95,8 +95,8 @@ strcoll_l(const char *s, const char *s2, } int -strcoll(const char *s, const char *s2) +strcoll(const char *s1, const char *s2) { - return strcoll_l(s, s2, __get_locale()); + return strcoll_l(s1, s2, __get_locale()); } Modified: head/lib/libc/string/strncmp.c ============================================================================== --- head/lib/libc/string/strncmp.c Mon Nov 21 23:32:14 2011 (r227807) +++ head/lib/libc/string/strncmp.c Tue Nov 22 00:07:53 2011 (r227808) @@ -39,8 +39,9 @@ int strncmp(const char *s1, const char *s2, size_t n) { - if (n == 0) + if ((n == 0) | (s1 == s2)) return (0); + do { if (*s1 != *s2++) return (*(const unsigned char *)s1 - From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 00:35: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 B8AEB106566C; Tue, 22 Nov 2011 00:35:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A87178FC13; Tue, 22 Nov 2011 00:35:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAM0ZUJW066507; Tue, 22 Nov 2011 00:35:30 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAM0ZUNX066505; Tue, 22 Nov 2011 00:35:30 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111220035.pAM0ZUNX066505@svn.freebsd.org> From: Rick Macklem Date: Tue, 22 Nov 2011 00:35: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: r227809 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 00:35:30 -0000 Author: rmacklem Date: Tue Nov 22 00:35:30 2011 New Revision: 227809 URL: http://svn.freebsd.org/changeset/base/227809 Log: This patch enables the new/default NFS server's use of shared vnode locking for read, readdir, readlink, getattr and access. It is hoped that this will improve server performance for these operations, since they will no longer be serialized for a given file/vnode. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Tue Nov 22 00:07:53 2011 (r227808) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Tue Nov 22 00:35:30 2011 (r227809) @@ -2624,7 +2624,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_ if (VFS_NEEDSGIANT(mp)) error = ESTALE; else - error = VFS_FHTOVP(mp, &fhp->fh_fid, LK_EXCLUSIVE, vpp); + error = VFS_FHTOVP(mp, &fhp->fh_fid, lktype, vpp); if (error != 0) /* Make sure the server replies ESTALE to the client. */ error = ESTALE; @@ -2645,14 +2645,6 @@ nfsvno_fhtovp(struct mount *mp, fhandle_ exp->nes_secflavors[i] = secflavors[i]; } } - if (error == 0 && lktype == LK_SHARED) - /* - * It would be much better to pass lktype to VFS_FHTOVP(), - * but this will have to do until VFS_FHTOVP() has a lock - * type argument like VFS_VGET(). - */ - NFSVOPLOCK(*vpp, LK_DOWNGRADE | LK_RETRY); - NFSEXITCODE(error); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 01: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 5A4FB1065672; Tue, 22 Nov 2011 01:32:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 301198FC13; Tue, 22 Nov 2011 01:32:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAM1Ww5G068375; Tue, 22 Nov 2011 01:32:58 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAM1Ww05068373; Tue, 22 Nov 2011 01:32:58 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111220132.pAM1Ww05068373@svn.freebsd.org> From: Rick Macklem Date: Tue, 22 Nov 2011 01:32: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: r227810 - stable/7/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 01:32:58 -0000 Author: rmacklem Date: Tue Nov 22 01:32:57 2011 New Revision: 227810 URL: http://svn.freebsd.org/changeset/base/227810 Log: MFC: r227059 Both a crash reported on freebsd-current on Oct. 18 under the subject heading "mtx_lock() of destroyed mutex on NFS" and PR# 156168 appear to be caused by clnt_dg_destroy() closing down the socket prematurely. When to close down the socket is controlled by a reference count (cs_refs), but clnt_dg_create() checks for sb_upcall being non-NULL to decide if a new socket is needed. I believe the crashes were caused by the following race: clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket clnt_dg_destroy() then loses race with clnt_dg_create() for acquisition of the SOCKBUF_LOCK() clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1 clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to NULL and destroys socket This patch fixes the above race by changing clnt_dg_destroy() so that it acquires SOCKBUF_LOCK() before testing cs_refs. This is a slightly modified patch for stable/7. It fixes the above race, although others still exist, since some patches such as r193272 cannot be MFC'd. Tested by: nonesuch at longcount.org (Mark Saad) PR: kern/156168 Modified: stable/7/sys/rpc/clnt_dg.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/rpc/clnt_dg.c ============================================================================== --- stable/7/sys/rpc/clnt_dg.c Tue Nov 22 00:35:30 2011 (r227809) +++ stable/7/sys/rpc/clnt_dg.c Tue Nov 22 01:32:57 2011 (r227810) @@ -811,18 +811,22 @@ clnt_dg_destroy(CLIENT *cl) while (cu->cu_threads) msleep(cu, &cs->cs_lock, 0, "rpcclose", 0); + mtx_unlock(&cs->cs_lock); + SOCKBUF_LOCK(&cu->cu_socket->so_rcv); + mtx_lock(&cs->cs_lock); cs->cs_refs--; if (cs->cs_refs == 0) { - mtx_destroy(&cs->cs_lock); - SOCKBUF_LOCK(&cu->cu_socket->so_rcv); + mtx_unlock(&cs->cs_lock); cu->cu_socket->so_upcallarg = NULL; cu->cu_socket->so_upcall = NULL; cu->cu_socket->so_rcv.sb_flags &= ~SB_UPCALL; SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); + mtx_destroy(&cs->cs_lock); mem_free(cs, sizeof(*cs)); lastsocketref = TRUE; } else { mtx_unlock(&cs->cs_lock); + SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); lastsocketref = FALSE; } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 02:50: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 528CC1065676; Tue, 22 Nov 2011 02:50:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4286D8FC18; Tue, 22 Nov 2011 02:50:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAM2oPbd070859; Tue, 22 Nov 2011 02:50:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAM2oPWC070856; Tue, 22 Nov 2011 02:50:25 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111220250.pAM2oPWC070856@svn.freebsd.org> From: Eitan Adler Date: Tue, 22 Nov 2011 02:50: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: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 02:50:25 -0000 Author: eadler (ports committer) Date: Tue Nov 22 02:50:24 2011 New Revision: 227812 URL: http://svn.freebsd.org/changeset/base/227812 Log: - fix some style(9) nits with my last commit - add a comment explaining why I used '|' instead of '||' Submitted by: danfe@ Approved by: emaste@ Modified: head/lib/libc/string/strcasecmp.c head/lib/libc/string/strncmp.c Modified: head/lib/libc/string/strcasecmp.c ============================================================================== --- head/lib/libc/string/strcasecmp.c Tue Nov 22 02:27:59 2011 (r227811) +++ head/lib/libc/string/strcasecmp.c Tue Nov 22 02:50:24 2011 (r227812) @@ -49,7 +49,7 @@ strcasecmp_l(const char *s1, const char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2; if (s1 == s2) - return (0); + return (0); FIX_LOCALE(locale); @@ -73,8 +73,9 @@ strncasecmp_l(const char *s1, const char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2; - if (( s1 == s2) | (n == 0)) - return (0); + /* use a bitwise or to avoid an additional branch instruction */ + if ((s1 == s2) | (n == 0)) + return (0); do { Modified: head/lib/libc/string/strncmp.c ============================================================================== --- head/lib/libc/string/strncmp.c Tue Nov 22 02:27:59 2011 (r227811) +++ head/lib/libc/string/strncmp.c Tue Nov 22 02:50:24 2011 (r227812) @@ -39,6 +39,7 @@ int strncmp(const char *s1, const char *s2, size_t n) { + /* use a bitwise or to avoid an additional branch instruction */ if ((n == 0) | (s1 == s2)) return (0); From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 03:12: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 3B3A1106566C; Tue, 22 Nov 2011 03:12:58 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 6E83B8FC12; Tue, 22 Nov 2011 03:12:57 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id pAM2dbKS092298; Mon, 21 Nov 2011 20:39:37 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id pAM2db3o092297; Mon, 21 Nov 2011 20:39:37 -0600 (CST) (envelope-from brooks) Date: Mon, 21 Nov 2011 20:39:37 -0600 From: Brooks Davis To: Nathan Whitehorn Message-ID: <20111122023936.GB92186@lor.one-eyed-alien.net> References: <201111210049.pAL0nkW9016705@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mxv5cy4qt+RJ9ypb" Content-Disposition: inline In-Reply-To: <201111210049.pAL0nkW9016705@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: r227775 - in head: lib/clang 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: Tue, 22 Nov 2011 03:12:58 -0000 --mxv5cy4qt+RJ9ypb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 21, 2011 at 12:49:46AM +0000, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Mon Nov 21 00:49:46 2011 > New Revision: 227775 > URL: http://svn.freebsd.org/changeset/base/227775 >=20 > Log: > Connect LLVM/clang to the build on powerpc64. After the binutils 2.17.50 > import, it works without issue. Great news! -- Brooks --mxv5cy4qt+RJ9ypb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFOywtoXY6L6fI4GtQRApxgAKCd3zZ0xLk5s2yqgYuVt6dbEWEElwCfSO7m 4zzDyNP2Z/A/StKK62nXEKo= =7oSl -----END PGP SIGNATURE----- --mxv5cy4qt+RJ9ypb-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 06: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 47C69106566C; Tue, 22 Nov 2011 06:45:37 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id EB0758FC0C; Tue, 22 Nov 2011 06:45:36 +0000 (UTC) Received: by pzk33 with SMTP id 33so32055131pzk.3 for ; Mon, 21 Nov 2011 22:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=RZc40lI4rakDFtxVD7ul69sAeEzRAn5izbdeHw+pi1c=; b=PMlplKSp3zyXmJBaFUFSo2k+VCanWX3G2o6A26XoH2880t31ON4bv6WT4J7irLjSIc tBUQjNDJzyLiKXihd5+KFB3WP07hW3/djjU2AR+N67H1ASWHTB9oC2v/xGS8WCQt1FLO PICPijWtaUK8RDJ32ACpezJsVbofuArkdaFIQ= MIME-Version: 1.0 Received: by 10.68.30.193 with SMTP id u1mr13914282pbh.93.1321944336299; Mon, 21 Nov 2011 22:45:36 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Mon, 21 Nov 2011 22:45:36 -0800 (PST) In-Reply-To: <201111220250.pAM2oPWC070856@svn.freebsd.org> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> Date: Mon, 21 Nov 2011 22:45:36 -0800 X-Google-Sender-Auth: An2Os5eUWFzunOQVDjOdV_cRZgg Message-ID: From: mdf@FreeBSD.org To: Eitan Adler 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: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 06:45:37 -0000 On Mon, Nov 21, 2011 at 6:50 PM, Eitan Adler wrote: > Author: eadler (ports committer) > Date: Tue Nov 22 02:50:24 2011 > New Revision: 227812 > URL: http://svn.freebsd.org/changeset/base/227812 > > Log: > =A0- fix some style(9) nits with my last commit > =A0- add a comment explaining why I used '|' instead of '||' > > =A0Submitted by: danfe@ > =A0Approved by: =A0emaste@ > > Modified: > =A0head/lib/libc/string/strcasecmp.c > =A0head/lib/libc/string/strncmp.c > > Modified: head/lib/libc/string/strcasecmp.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/lib/libc/string/strcasecmp.c =A0 Tue Nov 22 02:27:59 2011 =A0 = =A0 =A0 =A0(r227811) > +++ head/lib/libc/string/strcasecmp.c =A0 Tue Nov 22 02:50:24 2011 =A0 = =A0 =A0 =A0(r227812) > @@ -49,7 +49,7 @@ strcasecmp_l(const char *s1, const char > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*us1 =3D (const u_char *)s= 1, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*us2 =3D (const u_char *)s= 2; > =A0 =A0 =A0 =A0if (s1 =3D=3D s2) > - =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > > =A0 =A0 =A0 =A0FIX_LOCALE(locale); > > @@ -73,8 +73,9 @@ strncasecmp_l(const char *s1, const char > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*us1 =3D (const u_char *)s= 1, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*us2 =3D (const u_char *)s= 2; > > - =A0 =A0 =A0 if (( s1 =3D=3D s2) | (n =3D=3D 0)) > - =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 /* use a bitwise or to avoid an additional branch instructi= on */ > + =A0 =A0 =A0 if ((s1 =3D=3D s2) | (n =3D=3D 0)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); I guess I'm a little confused. Do we really have profiling information at this level that suggests the overhead of the branch is significant? I thought most hardware had pretty good branch-prediction, particularly with speculative execution. Wouldn't something like __predict_false() have more value for performance, or is all this just guess-work? I would much rather have the code say what it means unless there's real, measurable performance differences from doing otherwise. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 09:53: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 E2E04106566B; Tue, 22 Nov 2011 09:53:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail15.syd.optusnet.com.au (mail15.syd.optusnet.com.au [211.29.132.196]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6208FC08; Tue, 22 Nov 2011 09:53:55 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail15.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAM9rpHj027768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Nov 2011 20:53:53 +1100 Date: Tue, 22 Nov 2011 20:53:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler In-Reply-To: <201111220007.pAM07rjP065608@svn.freebsd.org> Message-ID: <20111122195444.N8431@besplex.bde.org> References: <201111220007.pAM07rjP065608@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: r227808 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 09:53:57 -0000 On Tue, 22 Nov 2011, Eitan Adler wrote: > Log: > - add check for pointer equality prior to performing the O(n) pass This seems like a negative optimization. The pointers are unequal in the usual case. More seriously, it gives worse undefined behaviour when the pointers are invalid. E.g., strcmp(NULL, NULL) now returns 0 where it used to trap for the null pointer access. This has many style bugs. > - while here change 's' to 's1' in strcoll > > Submitted by: eadler@ > Reviewed by: theraven@ > Approved by: brooks@ > MFC after: 2 weeks > Modified: head/lib/libc/string/strcasecmp.c > ============================================================================== > --- head/lib/libc/string/strcasecmp.c Mon Nov 21 23:32:14 2011 (r227807) > +++ head/lib/libc/string/strcasecmp.c Tue Nov 22 00:07:53 2011 (r227808) > @@ -48,6 +48,9 @@ strcasecmp_l(const char *s1, const char > const u_char > *us1 = (const u_char *)s1, > *us2 = (const u_char *)s2; > + if (s1 == s2) > + return (0); > + This adds non-KNF indentation (3 spaces instead of 1 tab) and an extra blank line. Previous locale changes have already mangled this file, with additions of extra blank lines and worse. > FIX_LOCALE(locale); > > while (tolower_l(*us1, locale) == tolower_l(*us2++, locale)) > @@ -65,18 +68,21 @@ int > strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale) > { > FIX_LOCALE(locale); > - if (n != 0) { > - const u_char > - *us1 = (const u_char *)s1, > - *us2 = (const u_char *)s2; > - > - do { > - if (tolower_l(*us1, locale) != tolower_l(*us2++, locale)) > - return (tolower_l(*us1, locale) - tolower_l(*--us2, locale)); > - if (*us1++ == '\0') > - break; > - } while (--n != 0); > - } > + > + const u_char > + *us1 = (const u_char *)s1, > + *us2 = (const u_char *)s2; > + This adds a dependency on C99 by placing the declarations after a statement. Moving the declarations out of an inner block is otherwise good. > + if (( s1 == s2) | (n == 0)) This adds an extra space, a weird operator (arithmetic OR instead of logical OR), and extra parentheses. The extra parentheses are more needed with the weird operator (arithmetic OR has a weird precedence that happens to make the parentheses unnecessary here, but compilers should warn about the relative precedences being surprising and force you to add the parentheses). > + return (0); This adds the usual non-KNF indentation. > + > + This adds 2 extra blank lines instead of only 1. > + do { > + if (tolower_l(*us1, locale) != tolower_l(*us2++, locale)) > + return (tolower_l(*us1, locale) - tolower_l(*--us2, locale)); > + if (*us1++ == '\0') > + break; > + } while (--n != 0); > return (0); > } > > > Modified: head/lib/libc/string/strcmp.c > ============================================================================== > --- head/lib/libc/string/strcmp.c Mon Nov 21 23:32:14 2011 (r227807) > +++ head/lib/libc/string/strcmp.c Tue Nov 22 00:07:53 2011 (r227808) > @@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$"); > int > strcmp(const char *s1, const char *s2) > { > + if (s1 == s2) > + return (0); > + This adds non-KNF indentation and an extra blank line, and removes the strange KNF blank line before the (null) declarations. > while (*s1 == *s2++) > if (*s1++ == '\0') > return (0); > > Modified: head/lib/libc/string/strcoll.c OK. > Modified: head/lib/libc/string/strncmp.c > ============================================================================== > --- head/lib/libc/string/strncmp.c Mon Nov 21 23:32:14 2011 (r227807) > +++ head/lib/libc/string/strncmp.c Tue Nov 22 00:07:53 2011 (r227808) > @@ -39,8 +39,9 @@ int > strncmp(const char *s1, const char *s2, size_t n) > { > > - if (n == 0) > + if ((n == 0) | (s1 == s2)) > return (0); > + As above, but without removing the blank line before the null declarations, without the extra space before s1, with only 1 extra blank line, and with the equality tests reversed relative to the above. > do { > if (*s1 != *s2++) > return (*(const unsigned char *)s1 - > Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 11:21: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 628CA106564A; Tue, 22 Nov 2011 11:21:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id BC7E28FC15; Tue, 22 Nov 2011 11:21:13 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAMBL93X021955 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Nov 2011 22:21:10 +1100 Date: Tue, 22 Nov 2011 22:21:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: mdf@FreeBSD.org In-Reply-To: Message-ID: <20111122210422.E8674@besplex.bde.org> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-925363442-1321960868=:8674" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 11:21:14 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-925363442-1321960868=:8674 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 21 Nov 2011 mdf@FreeBSD.org wrote: > On Mon, Nov 21, 2011 at 6:50 PM, Eitan Adler wrote: >> Author: eadler (ports committer) >> Date: Tue Nov 22 02:50:24 2011 >> New Revision: 227812 >> URL: http://svn.freebsd.org/changeset/base/227812 >> >> Log: >> =A0- fix some style(9) nits with my last commit >> =A0- add a comment explaining why I used '|' instead of '||' >> >> =A0Submitted by: danfe@ >> =A0Approved by: =A0emaste@ >> >> Modified: >> =A0head/lib/libc/string/strcasecmp.c >> =A0head/lib/libc/string/strncmp.c Hard 0xa0's make the quotes almost unreadable :-(. >> Modified: head/lib/libc/string/strcasecmp.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/lib/libc/string/strcasecmp.c =A0 Tue Nov 22 02:27:59 2011 =A0 = =A0 =A0 =A0(r227811) >> +++ head/lib/libc/string/strcasecmp.c =A0 Tue Nov 22 02:50:24 2011 =A0 = =A0 =A0 =A0(r227812) >> @@ -49,7 +49,7 @@ strcasecmp_l(const char *s1, const char >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*us1 =3D (const u_char *)= s1, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*us2 =3D (const u_char *)= s2; >> =A0 =A0 =A0 =A0if (s1 =3D=3D s2) >> - =A0 =A0 =A0 =A0 =A0 return (0); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); >> >> =A0 =A0 =A0 =A0FIX_LOCALE(locale); >> >> @@ -73,8 +73,9 @@ strncasecmp_l(const char *s1, const char >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*us1 =3D (const u_char *)= s1, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*us2 =3D (const u_char *)= s2; >> >> - =A0 =A0 =A0 if (( s1 =3D=3D s2) | (n =3D=3D 0)) >> - =A0 =A0 =A0 =A0 =A0 return (0); >> + =A0 =A0 =A0 /* use a bitwise or to avoid an additional branch instruct= ion */ >> + =A0 =A0 =A0 if ((s1 =3D=3D s2) | (n =3D=3D 0)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > > I guess I'm a little confused. Do we really have profiling > information at this level that suggests the overhead of the branch is > significant? I thought most hardware had pretty good > branch-prediction, particularly with speculative execution. Every time I have profiled the string functions, changes like this always have an insignificant effect, even in benchmarks. Normal code spends perhaps 0.01% of its time calling string functions, so the improvements from optimizing string functions are 0.01% of an insignificant amount. If this optimization were any good, then the compiler would already do it. In fact, gcc-4.2.1 already does it -- the reverse of it -- it rewrites= : =09"if ((i =3D=3D 0) | (j =3D=3D 0)) return; test();" into: =09"if (i =3D=3D 0 || j =3D=3D 0) return; test();" with most optimization flags that I tried. This happens even at -O with -march=3Di386, although since a plain i386 doesn't have branch target prediction and has slow branches, the first version is probably actually faster for a plain i386. But gcc-3.3.3 doesn't do this rewrite, even with -O3 -march=3Dathlon-xp, For i386, the generated code is quite slow: gcc-3.3.3 -O -march=3Di386: % =09cmpl=09$0, i % =09sete=09%dl % =09cmpl=09$0, j % =09sete=09%al % =09orl=09%edx, %eax % =09testb=09$1, %al % =09jne=09.L3 % =09...=09=09=09# call to test() not shown here or below % .L3: % =09leave % =09ret `sete' is quite slow on plain i386 too. For athlon-xp: gcc-3.3.3 -O3 -march=3Dathlon-xp: % =09movl=09j, %edx % =09movl=09i, %eax % =09testl=09%eax, %eax % =09sete=09%cl % =09testl=09%edx, %edx % =09sete=09%al % =09orl=09%ecx, %eax % =09testb=09$1, %al % =09je=09.L4 % .L3: % =09leave % =09ret This is essentially the same, except it uses load-test instead of cmp-mem, and the branch is taken in the opposite case. Weirdly, gcc42 does almost exactly the opposite with i386 and athlon-xp: gcc-4.2.1 -O -march=3Di386: % =09cmpl=09$0, i % =09je=09.L5 % =09cmpl=09$0, j % =09je=09.L5 % =09... % .L5: % =09leave % =09ret gcc-4.2.1 -O3 -march=3Dathlon-xp: % =09movl=09i, %edx % =09movl=09j, %eax % =09movl=09%esp, %ebp % =09testl=09%edx, %edx % =09sete=09%dl % =09testl=09%eax, %eax % =09sete=09%al % =09orb=09%al, %dl % =09je=09.L7 % =09leave % =09ret I guess this is because it knows that 'sete' is slow on i386. But for nocona, it goes back to rewriting the expression to use || so that there are 2 branches: gcc-4.2.1 -O3 -march=3Dnocona: % =09movl=09i, %edx % =09testl=09%edx, %edx % =09je=09.L5 % =09movl=09j, %eax % =09testl=09%eax, %eax % =09jne=09.L7 % .L5: % =09popl=09%ebp % =09ret This is the same as for plain i386 and plain -O, except it use load-test instead of cmp-mem the same as gcc-3.3.3 does for athlon-xp. It doesn't take the branch in the opposite case like gcc-3.3.3 does for athlon-xp. > Wouldn't something like __predict_false() have more value for > performance, Unlikely. Both writing | vs ||, and writing __predict_foo(), are only hints to the compiler, since the compiler knows how to rewrite the former but probably shouldn't unless it is sure, and it can ignore __predict_foo() but probably shouldn't unless it is sure. Or perhaps it trusts the programmer's directives for branches as much as ones for `register'. Similarly for `if (foo) ...; else ...;' vs `if (!foo) etc' - the programmer may have chosen the order carefully, but who knows? gcc-3-3.3 and gcc-4.2.1 -O3 should know about the behaviour of branches on athlon-xp, but the above shows that they disagree about whether the branch should be taken. IIRC, with a cold branch target cache on athlon-xp, forward branches are predicted as not taken and backwards branches are predictied as taken (so that loops work right). Since returning is the unusual case, we want to branch to it. This is what happens on i386 and nocona, but not on athlon-xp (with both compilers). Perhaps I remember the rule backwards but gcc knows it. On plain i386, taken branches are slower, so branching to the return is best, and is done. OTOH, if forward branches are predicted as being not taken, and the programmer tries to for optimize this without using __predict_foo(), then the program order should probably be: =09if (foo) =09=09usual_case(); =09else =09=09unusual_case(); This conflicts with early returns probably being the unusual case, since =09if (foo) =09=09return; =09otherstuff(); =09if (bar) =09=09return; =09morestuff(); doesn't require excessive nesting like: =09if (!foo) { =09=09otherstuff(); =09=09if (!bar) =09=09=09morestuff(); =09} =09return; so hopefully the compiler generates branches to returns. But why does gcc do the opposite on athlon-xp? I think using __predict_foo() is only useful in much larger functions than the ones here. Most modern CPUs have very good branch predictors so an extra branch or two doesn't matter (each predicted branch takes ~1 cycle, the same as an arithmetic OR operator). I believe the wins from using __predict_foo() are mainly when it allows moving large code for the unusual case far away, leaving only small code for the usual case nearby; the code for the unusual case then doesn't usually interfere with caches. > or is all this just guess-work? I would much rather have > the code say what it means unless there's real, measurable performance > differences from doing otherwise. The best optimization is extremely machine-dependent. I usually hope the compiler knows how to do it and don't try to optimize stuff like this. I usually find that the compiler barely knows what to do, but it can do better than me across a range of CPUs. Bruce --0-925363442-1321960868=:8674-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 11:35: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 6A0071065672; Tue, 22 Nov 2011 11:35:25 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5970B8FC0C; Tue, 22 Nov 2011 11:35:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMBZPbB089578; Tue, 22 Nov 2011 11:35:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMBZP6E089573; Tue, 22 Nov 2011 11:35:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111221135.pAMBZP6E089573@svn.freebsd.org> From: Attilio Rao Date: Tue, 22 Nov 2011 11:35: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: r227814 - head/sys/dev/ppbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 11:35:25 -0000 Author: attilio Date: Tue Nov 22 11:35:24 2011 New Revision: 227814 URL: http://svn.freebsd.org/changeset/base/227814 Log: - Use ppb_assert_locked() rather than using explicit mtx_assert call - Make ppbus code agnostic in regard of INVARIANTS option MFC after: 2 weeks Modified: head/sys/dev/ppbus/lpt.c head/sys/dev/ppbus/ppb_base.c head/sys/dev/ppbus/ppb_msq.c head/sys/dev/ppbus/vpo.c Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Tue Nov 22 06:56:45 2011 (r227813) +++ head/sys/dev/ppbus/lpt.c Tue Nov 22 11:35:24 2011 (r227814) @@ -447,10 +447,9 @@ lptout(void *arg) { struct lpt_data *sc = arg; device_t dev = sc->sc_dev; -#if defined(INVARIANTS) || defined(LPT_DEBUG) - device_t ppbus = device_get_parent(dev); -#endif + device_t ppbus; + ppbus = device_get_parent(dev); ppb_assert_locked(ppbus); lprintf(("T %x ", ppb_rstr(ppbus))); if (sc->sc_state & OPEN) { Modified: head/sys/dev/ppbus/ppb_base.c ============================================================================== --- head/sys/dev/ppbus/ppb_base.c Tue Nov 22 06:56:45 2011 (r227813) +++ head/sys/dev/ppbus/ppb_base.c Tue Nov 22 11:35:24 2011 (r227814) @@ -60,7 +60,7 @@ ppb_poll_bus(device_t bus, int max, int i, j, error; char r; - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); /* try at least up to 10ms */ for (j = 0; j < ((how & PPB_POLL) ? max : 1); j++) { @@ -96,12 +96,9 @@ ppb_poll_bus(device_t bus, int max, int ppb_get_epp_protocol(device_t bus) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif uintptr_t protocol; - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); BUS_READ_IVAR(device_get_parent(bus), bus, PPC_IVAR_EPP_PROTO, &protocol); return (protocol); @@ -117,7 +114,7 @@ ppb_get_mode(device_t bus) struct ppb_data *ppb = DEVTOSOFTC(bus); /* XXX yet device mode = ppbus mode = chipset mode */ - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); return (ppb->mode); } @@ -132,7 +129,7 @@ ppb_set_mode(device_t bus, int mode) struct ppb_data *ppb = DEVTOSOFTC(bus); int old_mode = ppb_get_mode(bus); - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); if (PPBUS_SETMODE(device_get_parent(bus), mode)) return (-1); @@ -150,11 +147,8 @@ ppb_set_mode(device_t bus, int mode) int ppb_write(device_t bus, char *buf, int len, int how) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); return (PPBUS_WRITE(device_get_parent(bus), buf, len, how)); } @@ -166,11 +160,8 @@ ppb_write(device_t bus, char *buf, int l int ppb_reset_epp_timeout(device_t bus) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); return(PPBUS_RESET_EPP(device_get_parent(bus))); } @@ -182,11 +173,8 @@ ppb_reset_epp_timeout(device_t bus) int ppb_ecp_sync(device_t bus) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); return (PPBUS_ECP_SYNC(device_get_parent(bus))); } @@ -198,12 +186,9 @@ ppb_ecp_sync(device_t bus) int ppb_get_status(device_t bus, struct ppb_status *status) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif register char r; - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); r = status->status = ppb_rstr(bus); Modified: head/sys/dev/ppbus/ppb_msq.c ============================================================================== --- head/sys/dev/ppbus/ppb_msq.c Tue Nov 22 06:56:45 2011 (r227813) +++ head/sys/dev/ppbus/ppb_msq.c Tue Nov 22 11:35:24 2011 (r227814) @@ -117,13 +117,10 @@ mode2xfer(device_t bus, struct ppb_devic int ppb_MS_init(device_t bus, device_t dev, struct ppb_microseq *loop, int opcode) { -#ifdef INVARIANTS - struct ppb_data *ppb = device_get_softc(bus); -#endif struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); struct ppb_xfer *xfer = mode2xfer(bus, ppbdev, opcode); - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); xfer->loop = loop; return (0); Modified: head/sys/dev/ppbus/vpo.c ============================================================================== --- head/sys/dev/ppbus/vpo.c Tue Nov 22 06:56:45 2011 (r227813) +++ head/sys/dev/ppbus/vpo.c Tue Nov 22 11:35:24 2011 (r227814) @@ -298,11 +298,8 @@ static void vpo_action(struct cam_sim *sim, union ccb *ccb) { struct vpo_data *vpo = (struct vpo_data *)sim->softc; -#ifdef INVARIANTS - device_t ppbus = device_get_parent(vpo->vpo_dev); - ppb_assert_locked(ppbus); -#endif + ppb_assert_locked(device_get_parent(vpo->vpo_dev)); switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 13:11: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 652B9106564A; Tue, 22 Nov 2011 13:11:17 +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 398558FC19; Tue, 22 Nov 2011 13:11:17 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id C996646B06; Tue, 22 Nov 2011 08:11:16 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5C868B921; Tue, 22 Nov 2011 08:11:16 -0500 (EST) From: John Baldwin To: Marius Strobl Date: Mon, 21 Nov 2011 16:38:54 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111191011.pAJABp0N034812@svn.freebsd.org> <201111211116.47529.jhb@freebsd.org> <20111121183933.GK56603@alchemy.franken.de> In-Reply-To: <20111121183933.GK56603@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111211638.54748.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Nov 2011 08:11:16 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky Subject: Re: svn commit: r227701 - in head/sys: arm/xscale/ixp425 dev/ahci dev/ata dev/gpio dev/mvs dev/ppbus dev/ppc dev/siba dev/siis dev/usb kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 13:11:17 -0000 On Monday, November 21, 2011 1:39:33 pm Marius Strobl wrote: > On Mon, Nov 21, 2011 at 11:16:47AM -0500, John Baldwin wrote: > > On Saturday, November 19, 2011 5:11:51 am Hans Petter Selasky wrote: > > > Author: hselasky > > > Date: Sat Nov 19 10:11:50 2011 > > > New Revision: 227701 > > > URL: http://svn.freebsd.org/changeset/base/227701 > > > > > > Log: > > > Move the device_delete_all_children() function from usb_util.c > > > to kern/subr_bus.c. Simplify this function so that it no longer > > > depends on malloc() to execute. Identify a few other places where > > > it makes sense to use device_delete_all_children(). > > > > > > MFC after: 1 week > > > > Sorry I didn't review this earlier when you sent it to me. In general I > > think this is a good idea, and reducing the duplicated code is great. > > Could we rename it to just device_delete_children(9)? Using both "all" and > the plural seems redundant and doesn't match device_get_children(9) which > also operates on all children. That sounds like a good idea. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 13:27:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D0A1065672; Tue, 22 Nov 2011 13:27:53 +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 B4D298FC16; Tue, 22 Nov 2011 13:27:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMDRrrE093060; Tue, 22 Nov 2011 13:27:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMDRrMp093058; Tue, 22 Nov 2011 13:27:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111221327.pAMDRrMp093058@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Nov 2011 13:27: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: r227816 - 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: Tue, 22 Nov 2011 13:27:53 -0000 Author: kib Date: Tue Nov 22 13:27:53 2011 New Revision: 227816 URL: http://svn.freebsd.org/changeset/base/227816 Log: Remove the wrong comment about ufs not being loadable. Note that only root filesystem module needs to be available before root is mounted. MFC after: 1 week Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Nov 22 12:12:01 2011 (r227815) +++ head/sys/conf/NOTES Tue Nov 22 13:27:53 2011 (r227816) @@ -965,11 +965,10 @@ options ZERO_COPY_SOCKETS # FILESYSTEM OPTIONS # -# Only the root, /usr, and /tmp filesystems need be statically -# compiled; everything else will be automatically loaded at mount -# time. (Exception: the UFS family--- FFS --- cannot -# currently be demand-loaded.) Some people still prefer to statically -# compile other filesystems as well. +# Only the root filesystem needs to be statically compiled or preloaded +# as module; everything else will be automatically loaded at mount +# time. Some people still prefer to statically compile other +# filesystems as well. # # NB: The PORTAL filesystem is known to be buggy, and WILL panic your # system if you attempt to do anything with it. It is included here From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 13:30: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 F1E57106566C; Tue, 22 Nov 2011 13:30:07 +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 AC8BB8FC1B; Tue, 22 Nov 2011 13:30:07 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 46F2C46B0A; Tue, 22 Nov 2011 08:30:07 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9EABDB94C; Tue, 22 Nov 2011 08:30:06 -0500 (EST) From: John Baldwin To: Lawrence Stewart Date: Tue, 22 Nov 2011 08:30:04 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> <4EC9FD8A.5040401@freebsd.org> In-Reply-To: <4EC9FD8A.5040401@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111220830.05029.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Nov 2011 08:30:06 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Julien Ridoux , Ben Kaduk Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 13:30:08 -0000 On Monday, November 21, 2011 2:28:10 am Lawrence Stewart wrote: > On 11/21/11 17:18, Julien Ridoux wrote: > > > > On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: > > > >> On 11/21/11 16:12, Ben Kaduk wrote: > >>> On Sun, Nov 20, 2011 at 11:17 PM, Lawrence > >>> Stewart wrote: > >>>> Author: lstewart Date: Mon Nov 21 04:17:24 2011 New Revision: > >>>> 227778 URL: http://svn.freebsd.org/changeset/base/227778 > >>>> > >>>> Log: - When feed-forward clock support is compiled in, change > >>>> the BPF header to contain both a regular timestamp obtained > >>>> from the system clock and the current feed-forward ffcounter > >>>> value. This enables new possibilities including > >>> > >>> Is it really necessary to make the ABI dependent on a kernel > >>> configuration option? This causes all sorts of headaches if > >>> loadable modules ever want to use that ABI, something that we > >>> just ran into with vm_page_t and friends and had a long thread on > >>> -current about. > >> > >> Fair question. Julien, if pcap and other consumers will happily > >> ignore the new ffcount_stamp member in the bpf header, is there any > >> reason to conditionally add the ffcounter into the header struct? > > > > It is a valid question indeed. The feedback I have received so far > > was to not have the feed-forward clock support be a default kernel > > configuration option. What follows is based on this assumption. > > > > The commit (r227747) introduces sysctl that are conditioned by the > > same "FFCLOCK" kernel configuration option. If a loadable module > > tests for the presence of this sysctl, it will know if the > > ffcount_stamp member is available. Is it too much of a hack? > > > > Alternatively, if the ffcounter is added to the bpf header > > unconditionally, the ffcount_stamp member can be set to 0. Loadable > > modules will then see a consistent ABI but will retrieve a > > meaningless value. > > > > I am not sure which option makes more sense, any preference? > > If I understand the issues correctly, I think the appropriate path > forward is to remove the conditional change to the bpf header and have > ffcount_stamp become a permanent member of the struct. We'll just leave > the member uninitialised in the !FFCLOCK case. This change will make the > patch un-MFCable, but I think that's ok. > > As to the issue of how a kernel module would detect if it's being loaded > into a FFCLOCK enabled kernel, why wouldn't we expect modules to > "#include opt_ffclock.h" and conditionally compile code based on FFCLOCK > being defined? Is there a use case for run-time (as opposed to > compile-time) module detection of feed-forward clock capabilities? Think of standalone modules that are not built as part of a kernel (e.g. 3rd party device drivers). In general we should avoid having structures change size for kernel options, especially common structures. It just adds lots of pain and suffering and complexity. We are stuck with it for PAE on i386 (which causes pain), and for LOCK_PROFILING (but that is sufficiently rare and expensive it seems to be ok). I think 8 bytes for bpf packet is not sufficiently expensive to justify the extra headache. Just always leave the new field in. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 13:30: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 88A161065672; Tue, 22 Nov 2011 13:30:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 781CC8FC1C; Tue, 22 Nov 2011 13:30:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMDUbah093175; Tue, 22 Nov 2011 13:30:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMDUbYY093169; Tue, 22 Nov 2011 13:30:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111221330.pAMDUbYY093169@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Nov 2011 13:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227817 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 13:30:37 -0000 Author: kib Date: Tue Nov 22 13:30:36 2011 New Revision: 227817 URL: http://svn.freebsd.org/changeset/base/227817 Log: Put all the messages from msdosfs under the MSDOSFS_DEBUG ifdef. They are confusing to user, and not informative for general consumption. MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_conv.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/msdosfs/msdosfs_fat.c head/sys/fs/msdosfs/msdosfs_lookup.c head/sys/fs/msdosfs/msdosfs_vfsops.c Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Tue Nov 22 13:27:53 2011 (r227816) +++ head/sys/fs/msdosfs/msdosfs_conv.c Tue Nov 22 13:30:36 2011 (r227817) @@ -1036,8 +1036,10 @@ mbnambuf_write(struct mbnambuf *nbp, cha size_t count, newlen; if (nbp->nb_len != 0 && id != nbp->nb_last_id - 1) { +#ifdef MSDOSFS_DEBUG printf("msdosfs: non-decreasing id: id %d, last id %d\n", id, nbp->nb_last_id); +#endif return; } @@ -1046,7 +1048,9 @@ mbnambuf_write(struct mbnambuf *nbp, cha count = strlen(name); newlen = nbp->nb_len + count; if (newlen > WIN_MAXLEN || newlen > MAXNAMLEN) { +#ifdef MSDOSFS_DEBUG printf("msdosfs: file name length %zu too large\n", newlen); +#endif return; } Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Tue Nov 22 13:27:53 2011 (r227816) +++ head/sys/fs/msdosfs/msdosfs_denode.c Tue Nov 22 13:30:36 2011 (r227817) @@ -263,8 +263,10 @@ deget(pmp, dirclust, diroffset, depp) * instead of what is written in directory entry. */ if (diroffset == 0 && ldep->de_StartCluster != dirclust) { +#ifdef MSDOSFS_DEBUG printf("deget(): \".\" entry at clust %lu != %lu\n", dirclust, ldep->de_StartCluster); +#endif ldep->de_StartCluster = dirclust; } @@ -274,8 +276,11 @@ deget(pmp, dirclust, diroffset, depp) if (error == E2BIG) { ldep->de_FileSize = de_cn2off(pmp, size); error = 0; - } else + } else { +#ifdef MSDOSFS_DEBUG printf("deget(): pcbmap returned %d\n", error); +#endif + } } } else nvp->v_type = VREG; @@ -351,8 +356,10 @@ detrunc(dep, length, flags, cred, td) * directory's life. */ if ((DETOV(dep)->v_vflag & VV_ROOT) && !FAT32(pmp)) { +#ifdef MSDOSFS_DEBUG printf("detrunc(): can't truncate root directory, clust %ld, offset %ld\n", dep->de_dirclust, dep->de_diroffset); +#endif return (EINVAL); } Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Tue Nov 22 13:27:53 2011 (r227816) +++ head/sys/fs/msdosfs/msdosfs_fat.c Tue Nov 22 13:30:36 2011 (r227817) @@ -503,7 +503,9 @@ fatentry(function, pmp, cn, oldcontents, * Be sure they asked us to do something. */ if ((function & (FAT_SET | FAT_GET)) == 0) { +#ifdef MSDOSFS_DEBUG printf("fatentry(): function code doesn't specify get or set\n"); +#endif return (EINVAL); } @@ -512,7 +514,9 @@ fatentry(function, pmp, cn, oldcontents, * where to put it, give them an error. */ if ((function & FAT_GET) && oldcontents == NULL) { +#ifdef MSDOSFS_DEBUG printf("fatentry(): get function with no place to put result\n"); +#endif return (EINVAL); } #endif @@ -997,7 +1001,9 @@ extendfile(dep, count, bpp, ncp, flags) */ if (dep->de_StartCluster == MSDOSFSROOT && (dep->de_Attributes & ATTR_DIRECTORY)) { +#ifdef MSDOSFS_DEBUG printf("extendfile(): attempt to extend root directory\n"); +#endif return (ENOSPC); } Modified: head/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_lookup.c Tue Nov 22 13:27:53 2011 (r227816) +++ head/sys/fs/msdosfs/msdosfs_lookup.c Tue Nov 22 13:30:36 2011 (r227817) @@ -902,8 +902,10 @@ doscheckpath(source, target) out:; if (bp) brelse(bp); +#ifdef MSDOSFS_DEBUG if (error == ENOTDIR) printf("doscheckpath(): .. not a directory?\n"); +#endif if (dep != NULL) vput(DETOV(dep)); return (error); Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Tue Nov 22 13:27:53 2011 (r227816) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Tue Nov 22 13:30:36 2011 (r227817) @@ -555,7 +555,9 @@ mountmsdosfs(struct vnode *devvp, struct || pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL; +#ifdef MSDOSFS_DEBUG printf("mountmsdosfs(): bad FAT32 filesystem\n"); +#endif goto error_exit; } pmp->pm_fatmask = FAT32_MASK; @@ -633,8 +635,10 @@ mountmsdosfs(struct vnode *devvp, struct clusters = (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv; if (pmp->pm_maxcluster >= clusters) { +#ifdef MSDOSFS_DEBUG printf("Warning: number of clusters (%ld) exceeds FAT " "capacity (%ld)\n", pmp->pm_maxcluster + 1, clusters); +#endif pmp->pm_maxcluster = clusters - 1; } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 14:01: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 0E5341065670; Tue, 22 Nov 2011 14:01:00 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5098FC12; Tue, 22 Nov 2011 14:00:59 +0000 (UTC) Received: from lstewart1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 69E917E880; Wed, 23 Nov 2011 01:00:57 +1100 (EST) Message-ID: <4ECBAB19.4010907@freebsd.org> Date: Wed, 23 Nov 2011 01:00:57 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111016 Thunderbird/7.0.1 MIME-Version: 1.0 To: John Baldwin References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> <4EC9FD8A.5040401@freebsd.org> <201111220830.05029.jhb@freebsd.org> In-Reply-To: <201111220830.05029.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Julien Ridoux , Ben Kaduk Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 14:01:00 -0000 On 11/23/11 00:30, John Baldwin wrote: > On Monday, November 21, 2011 2:28:10 am Lawrence Stewart wrote: >> On 11/21/11 17:18, Julien Ridoux wrote: >>> >>> On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: >>> >>>> On 11/21/11 16:12, Ben Kaduk wrote: >>>>> On Sun, Nov 20, 2011 at 11:17 PM, Lawrence >>>>> Stewart wrote: >>>>>> Author: lstewart Date: Mon Nov 21 04:17:24 2011 New Revision: >>>>>> 227778 URL: http://svn.freebsd.org/changeset/base/227778 >>>>>> >>>>>> Log: - When feed-forward clock support is compiled in, change >>>>>> the BPF header to contain both a regular timestamp obtained >>>>>> from the system clock and the current feed-forward ffcounter >>>>>> value. This enables new possibilities including >>>>> >>>>> Is it really necessary to make the ABI dependent on a kernel >>>>> configuration option? This causes all sorts of headaches if >>>>> loadable modules ever want to use that ABI, something that we >>>>> just ran into with vm_page_t and friends and had a long thread on >>>>> -current about. >>>> >>>> Fair question. Julien, if pcap and other consumers will happily >>>> ignore the new ffcount_stamp member in the bpf header, is there any >>>> reason to conditionally add the ffcounter into the header struct? >>> >>> It is a valid question indeed. The feedback I have received so far >>> was to not have the feed-forward clock support be a default kernel >>> configuration option. What follows is based on this assumption. >>> >>> The commit (r227747) introduces sysctl that are conditioned by the >>> same "FFCLOCK" kernel configuration option. If a loadable module >>> tests for the presence of this sysctl, it will know if the >>> ffcount_stamp member is available. Is it too much of a hack? >>> >>> Alternatively, if the ffcounter is added to the bpf header >>> unconditionally, the ffcount_stamp member can be set to 0. Loadable >>> modules will then see a consistent ABI but will retrieve a >>> meaningless value. >>> >>> I am not sure which option makes more sense, any preference? >> >> If I understand the issues correctly, I think the appropriate path >> forward is to remove the conditional change to the bpf header and have >> ffcount_stamp become a permanent member of the struct. We'll just leave >> the member uninitialised in the !FFCLOCK case. This change will make the >> patch un-MFCable, but I think that's ok. >> >> As to the issue of how a kernel module would detect if it's being loaded >> into a FFCLOCK enabled kernel, why wouldn't we expect modules to >> "#include opt_ffclock.h" and conditionally compile code based on FFCLOCK >> being defined? Is there a use case for run-time (as opposed to >> compile-time) module detection of feed-forward clock capabilities? > > Think of standalone modules that are not built as part of a kernel (e.g. > 3rd party device drivers). In general we should avoid having structures > change size for kernel options, especially common structures. It just adds > lots of pain and suffering and complexity. We are stuck with it for PAE on > i386 (which causes pain), and for LOCK_PROFILING (but that is sufficiently > rare and expensive it seems to be ok). I think 8 bytes for bpf packet is > not sufficiently expensive to justify the extra headache. Just always leave > the new field in. hmm... Julien almost has a patch finished which accomplishes what my most recent email in this thread describes. Julien, I suggest we get it finished and follow up to this thread with a pointer to the patch for people to look at. If there's still a strong feeling that what it does is going to bring pain we can do away with the new BPF_FFCOUNTER config option and have the bpf header struct just grow by 8 bytes. Stay tuned... Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 14: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 80C451065670; Tue, 22 Nov 2011 14:11:42 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7051E8FC08; Tue, 22 Nov 2011 14:11:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMEBg7c094249; Tue, 22 Nov 2011 14:11:42 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMEBg4d094247; Tue, 22 Nov 2011 14:11:42 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111221411.pAMEBg4d094247@svn.freebsd.org> From: David Chisnall Date: Tue, 22 Nov 2011 14:11: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: r227818 - head/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 14:11:42 -0000 Author: theraven Date: Tue Nov 22 14:11:42 2011 New Revision: 227818 URL: http://svn.freebsd.org/changeset/base/227818 Log: Fix a crash when trying to duplicate a locale that contains some implicit C locale components. Reported by: Michael Butler Approved by: dim (mentor) Modified: head/lib/libc/locale/xlocale.c Modified: head/lib/libc/locale/xlocale.c ============================================================================== --- head/lib/libc/locale/xlocale.c Tue Nov 22 13:30:36 2011 (r227817) +++ head/lib/libc/locale/xlocale.c Tue Nov 22 14:11:42 2011 (r227818) @@ -200,8 +200,13 @@ static int dupcomponent(int type, locale if (new->components[type]) { strncpy(new->components[type]->locale, src->locale, ENCODING_LEN); } - } else { + } else if (base->components[type]) { new->components[type] = xlocale_retain(base->components[type]); + } else { + /* If the component was NULL, return success - if base is a valid + * locale then the flag indicating that this isn't present should be + * set. If it isn't a valid locale, then we're stuck anyway. */ + return 1; } return (0 != new->components[type]); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 14:20: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 643D5106564A; Tue, 22 Nov 2011 14:20:22 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 016918FC0A; Tue, 22 Nov 2011 14:20:21 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cwma5-0-0-cust875.7-3.cable.virginmedia.com [86.11.39.108]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id pAMEKKsT025300 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 22 Nov 2011 14:20:20 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: David Chisnall In-Reply-To: <20111122210422.E8674@besplex.bde.org> Date: Tue, 22 Nov 2011 14:20:15 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <8B1C6EE4-A351-44A6-AC8A-DC53779CD380@FreeBSD.org> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122210422.E8674@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, mdf@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 14:20:22 -0000 On 22 Nov 2011, at 11:21, Bruce Evans wrote: > If this optimization were any good, then the compiler would already do > it. In fact, gcc-4.2.1 already does it -- the reverse of it -- it = rewrites: >=20 > "if ((i =3D=3D 0) | (j =3D=3D 0)) return; test();" >=20 > into: >=20 > "if (i =3D=3D 0 || j =3D=3D 0) return; test();" In general, I prefer | in cases where execution order does not matter = because it frees the compiler up to insert branches or not, depending on = which is more efficient for the target. =20 In this case, either | or || is fine, because neither reads any memory = or has side effects so | and || are equivalent to the compiler, but the = use of | tells a human reading the code that the order is unimportant. =20= David= From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 14:53: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 E57D41065670 for ; Tue, 22 Nov 2011 14:53:06 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob6.rzone.de (mo-p00-ob6.rzone.de [IPv6:2a01:238:20a:202:53f0::1]) by mx1.freebsd.org (Postfix) with ESMTP id 7F65B8FC0A for ; Tue, 22 Nov 2011 14:53:06 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/avgusCdvwXOZ/NA7x/bslx4UOSLYuW7Bwv8PtjkoBcppeXE= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de ([2001:6f8:13f0:0:224:d7ff:fe63:d530]) by post.strato.de (mrclete mo62) (RZmta 26.10 AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id v03597nAMEa46v for ; Tue, 22 Nov 2011 15:52:46 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Tue, 22 Nov 2011 15:52:39 +0100 Date: Tue, 22 Nov 2011 15:52:39 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20111122145239.GB19875@britannica.bec.de> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122210422.E8674@besplex.bde.org> <8B1C6EE4-A351-44A6-AC8A-DC53779CD380@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8B1C6EE4-A351-44A6-AC8A-DC53779CD380@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 14:53:07 -0000 On Tue, Nov 22, 2011 at 02:20:15PM +0000, David Chisnall wrote: > In this case, either | or || is fine, because neither reads any memory > or has side effects so | and || are equivalent to the compiler, but > the use of | tells a human reading the code that the order is unimportant. The use of | is just more obscure. The compiler can easily interfere here that the execution order is irrelevant as the statements are side effect free. Joerg From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 15:33: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 11886106566B; Tue, 22 Nov 2011 15:33:34 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 8DF238FC14; Tue, 22 Nov 2011 15:33:33 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAMFXW2Z020261; Tue, 22 Nov 2011 10:33:32 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAMFXWsi020260; Tue, 22 Nov 2011 10:33:32 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Tue, 22 Nov 2011 10:33:32 -0500 From: David Schultz To: Eitan Adler Message-ID: <20111122153332.GA20145@zim.MIT.EDU> Mail-Followup-To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111220250.pAM2oPWC070856@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111220250.pAM2oPWC070856@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 15:33:34 -0000 On Tue, Nov 22, 2011, Eitan Adler wrote: > + /* use a bitwise or to avoid an additional branch instruction */ > + if ((s1 == s2) | (n == 0)) > + return (0); I think there are three issues with this. First, the comment suggesting that using '|' instead of '||' isn't correct; any reasonable compiler knows how to optimize side-effect-free expressions like these. (The reverse transformation, from the arithmetic expression to the boolean one, is actually harder for the compiler in general.) Second, the overwhelming precedent in FreeBSD is to use boolean operators to combine boolean expressions, so you might try to get some consensus on the issue before you go around replacing them with bitwise operators. I for one don't find the bitwise operators clearer, but I don't speak for everyone else. Third, it's not clear that checking whether s1 == s2 is even an optimization. Most programs simply aren't going to pass identical pointers as arguments to strcmp(), so for the overwhelming majority of cases, this is just a wasted test and a wasted slot in a branch predict table. (FWIW, I doubt that a realistic benchmark would demonstrate any measurable difference.) From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 15:43: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 BF78F106566C; Tue, 22 Nov 2011 15:43:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 098588FC12; Tue, 22 Nov 2011 15:43:13 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id pAMFhC38009597; Tue, 22 Nov 2011 19:43:12 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id pAMFhCCu009596; Tue, 22 Nov 2011 19:43:12 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 22 Nov 2011 19:43:12 +0400 From: Gleb Smirnoff To: Qing Li Message-ID: <20111122154312.GL96616@FreeBSD.org> References: <201111211410.pALEAD9B046139@svn.freebsd.org> <20111121195439.GE96616@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: 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: r227791 - 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, 22 Nov 2011 15:43:14 -0000 Qing, first I'd like to notice that we are speaking about obsoleted interfaces. This should be taken into account during all the discussion. We shouldn't make code more complex in favor to make obsoleted interfaces more smart. 1) Scrubbing in in_ifinit() is done only in case of SIOCSIFADDR. The latter isn't ever used in our userland code. And I suppose isn't used by any software in ports. Because you can't set a CIDR prefix with SIOCSIFADDR, which makes it useless in 2011. Actually I'd be glad to cut that SIOCSIFADDR/SIOCSIFNETMASK at all. 2) The code that restores the oldaddr is activated only in two cases: 2.1) SIOCSIFADDR 2.2) SIOCAIFADDR with an address in the in_aliasreq that already exists on the interface. If it doesn't exist, address is _added_, not changed! I'll skip on SIOCSIFADDR, said enough on it. To trigger 2.2 we need something like this: # ifconfig igb1 10.0.0.1/24 # ifconfig igb1 10.0.0.1/24 alias I don't see any idea in smart error recovering for this strange case and even can't imagine error. Back to your comments: On Mon, Nov 21, 2011 at 01:36:13PM -0800, Qing Li wrote: Q> > From my point of view logically speaking, we should first remove route, Q> > then remove address. Otherwise, for a short time we've got an invalid Q> > route in table. Q> Q> For a short time you have an invalid address, it is faster to remove the Q> address from the list to prevent usage, then to flush the route, which would Q> also trigger L2 table flushes as well. I have made a test case that proves, that usage of deleted address isn't prevented when it is removed, but loopback route still exists. The test is the following run a race between this program: struct ifreq ifr; int s; bzero(&ifr, sizeof(struct ifreq)); strncpy(ifr.ifr_name, "igb1", sizeof ifr.ifr_name); ifr.ifr_addr.sa_family = AF_INET; ifr.ifr_addr.sa_len = sizeof(struct sockaddr_in); ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = inet_addr("10.0.0.1"); s = socket(AF_INET, SOCK_DGRAM, 0); for (;;) ioctl(s, SIOCSIFADDR, &ifr); And this script: while (true); do nc -z 10.0.0.1 22 || echo Fail; done The script would never fail, that proves that traffic flows even when address is temporarily wiped. With new code script may fail. One note: your system will panic w/o fix that I've mailed you before, but this is a separate issue that should be discussed separately. Q> > Q> Putting "in_scrubprefix()" at the top does not gain you anything at Q> > Q> all, but can Q> > Q> potentially be problematic if additional tasks are in fact performed Q> > Q> in "if_ioctl()" Q> > Q> that may in fact affect the logic in "in_ifinit()". Q> > Q> Q> > Q> Case in point, I had to perform additional routing related tasks so I Q> > Q> re-introduced "nd6_rtrequest()" in r227460. Q> > Q> > Pardon, can you please elaborate on this? I don't see any problems that Q> > I intoroduced, but if ther are any, we can either push in_scrubprefix() Q> > down the function as it was before, of fix them some other way. Q> > Q> Q> The point being, perhaps the address related tasks to be performed in Q> "if_ioctl()" today is limited, however, we may need to perform additional Q> housekeeping tasks in "if_ioctl()", and if there is error, we would want to Q> revert the process. Q> Q> There are so many different L2 and pseudo interface functions that map Q> to "if_ioctl()", it is Not safe to ignore its error and not reflect that error Q> back to the consistency of the routing table and the interface address Q> list. Yep, most of modern if_ioctl's do not fail at all. But my code checks for error, so that isn't a problem. Q> Again, removing the associated route at the beginning of in_ifinit() does Q> not gain much in terms of performance or code cleanness, nor does it Q> improve the logic, so why limit what we could do in the future in "if_ioctl()" Q> by making such a change ?? Q> Q> > Q> > Q> You are not simplifying much logic by removing the error recovery code from Q> > Q> the return of "if_ioctl()". So why removing the flexibility of what Q> > Q> "if_ioctl()" is Q> > Q> intended for as part of the address configuration logic ? Q> > Q> > Because in_ifinit() was inconsistent. It tried to recover in case Q> > of (*ifp->if_ioctl) failure, but did not try to recover in case Q> > of failure of: Q> > Q> > in_addprefix() Q> > ifa_add_loopback_route() Q> > Q> Q> The "inconsistency" is due to the fact failures from these two functions Q> are not fatal, and does not necessarily affect the actual operations. Q> Q> In function "in_addprefix()", there are 2 main possible errors. EEXIST is Q> non fatal, it just means the same prefix route is already covered by Q> another address, and what is being inserted is just an alias. Q> Q> The other error is due to RTM_ADD failure, however, since IFA_ROUTE is Q> not set on the address when failure occurs, no route will ever be directed Q> to either the interface or that address. Therefore no harm is done. Q> Q> In the case of function "ifa_add_loopback_route()", again, a failure is just Q> an indication of an EEXIST. Q> Q> You may ask why not check for EEXIST before calling these functions, and Q> I can tell you having worked those code regions for quite some time, the Q> actual work amounts to the same efforts, but complicates the logic WRT Q> the callers. It's actually better just let the failure occur. Application writers don't know this in-kernel things. They usually write code this way: if (ioctl(foo) < 0) { /* fatal error: can't configure address! */ } And this is correct way. Look into this from viewpoint of say quagga developer. One doesn't need to know about this tricks in FreeBSD kernel. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 15: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 8A587106564A; Tue, 22 Nov 2011 15:51:44 +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 063AB8FC18; Tue, 22 Nov 2011 15:51:41 +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 RAA18922; Tue, 22 Nov 2011 17:51:39 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <4ECBC50B.2020705@FreeBSD.org> Date: Tue, 22 Nov 2011 17:51:39 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111109 Thunderbird/8.0 MIME-Version: 1.0 To: David Chisnall References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122210422.E8674@besplex.bde.org> <8B1C6EE4-A351-44A6-AC8A-DC53779CD380@FreeBSD.org> In-Reply-To: <8B1C6EE4-A351-44A6-AC8A-DC53779CD380@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 15:51:44 -0000 on 22/11/2011 16:20 David Chisnall said the following: > the use of | tells a human reading the code that the order is unimportant I think that it tells that we are dealing with bit flags, not with logical operations. Which would be a lie^W^W an incorrect hint in this case (both to humans and compilers). -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 16:00: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 801211065675; Tue, 22 Nov 2011 16:00:56 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2798FC08; Tue, 22 Nov 2011 16:00:55 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAMG0tlg020470; Tue, 22 Nov 2011 11:00:55 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAMG0ttn020469; Tue, 22 Nov 2011 11:00:55 -0500 (EST) (envelope-from das@freebsd.org) Date: Tue, 22 Nov 2011 11:00:55 -0500 From: David Schultz To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20111122160055.GA20431@zim.MIT.EDU> Mail-Followup-To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111122153332.GA20145@zim.MIT.EDU> Cc: Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 16:00:56 -0000 On Tue, Nov 22, 2011, David Schultz wrote: > First, the comment suggesting that using '|' instead of '||' isn't > correct; any reasonable compiler knows how to optimize > side-effect-free expressions like these. (The reverse > transformation, from the arithmetic expression to the boolean one, > is actually harder for the compiler in general.) That should read "the comment suggesting that using '|' instead of '||' <> isn't correct". From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 16:18: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 6D8F21065670; Tue, 22 Nov 2011 16:18:12 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6B78FC13; Tue, 22 Nov 2011 16:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMGICBU099678; Tue, 22 Nov 2011 16:18:12 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMGICac099676; Tue, 22 Nov 2011 16:18:12 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201111221618.pAMGICac099676@svn.freebsd.org> From: Ivan Voras Date: Tue, 22 Nov 2011 16:18: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: r227822 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 16:18:12 -0000 Author: ivoras Date: Tue Nov 22 16:18:12 2011 New Revision: 227822 URL: http://svn.freebsd.org/changeset/base/227822 Log: Avoid panics from recursive rename operations. Not a perfect patch but good enough for now. PR: kern/159418 Submitted by: Gleb Kurtsou Reviewed by: kib MFC after: 1 month Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Nov 22 16:08:12 2011 (r227821) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Nov 22 16:18:12 2011 (r227822) @@ -965,11 +965,8 @@ tmpfs_rename(struct vop_rename_args *v) /* If we need to move the directory between entries, lock the * source so that we can safely operate on it. */ - if (tdvp != fdvp) { - error = vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY); - if (error != 0) - goto out; - } + if (fdvp != tdvp && fdvp != tvp) + vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY); fdnode = VP_TO_TMPFS_DIR(fdvp); fnode = VP_TO_TMPFS_NODE(fvp); de = tmpfs_dir_lookup(fdnode, fnode, fcnp); @@ -1143,7 +1140,7 @@ tmpfs_rename(struct vop_rename_args *v) error = 0; out_locked: - if (fdnode != tdnode) + if (fdvp != tdvp && fdvp != tvp) VOP_UNLOCK(fdvp, 0); out: From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 16:44: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 CBC7D106564A; Tue, 22 Nov 2011 16:44:50 +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 A21E98FC16; Tue, 22 Nov 2011 16:44:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMGiobH000648; Tue, 22 Nov 2011 16:44:50 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMGiorG000645; Tue, 22 Nov 2011 16:44:50 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201111221644.pAMGiorG000645@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 22 Nov 2011 16:44: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: r227823 - in head: share/man/man4 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: Tue, 22 Nov 2011 16:44:50 -0000 Author: jh Date: Tue Nov 22 16:44:50 2011 New Revision: 227823 URL: http://svn.freebsd.org/changeset/base/227823 Log: Append unit number to the WMI status device name to allow attaching multiple acpi_wmi(4) instances. PR: kern/162491 Reviewed by: avg Modified: head/share/man/man4/acpi_wmi.4 head/sys/dev/acpi_support/acpi_wmi.c Modified: head/share/man/man4/acpi_wmi.4 ============================================================================== --- head/share/man/man4/acpi_wmi.4 Tue Nov 22 16:18:12 2011 (r227822) +++ head/share/man/man4/acpi_wmi.4 Tue Nov 22 16:44:50 2011 (r227823) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2010 +.Dd November 22, 2011 .Dt ACPI_WMI 4 .Os .Sh NAME @@ -49,16 +49,16 @@ The .Nm driver provides an interface for vendor specific WMI implementations (e.g. HP and Acer laptops). -It creates /dev/wmistat, which can be read to get +It creates /dev/wmistat%d, which can be read to get information about GUIDs found in the system. .Sh FILES -.Bl -tag -width /dev/wmistat -compact -.It Pa /dev/wmistat +.Bl -tag -width /dev/wmistat%d -compact +.It Pa /dev/wmistat%d WMI status device. .El .Sh EXAMPLES .Bd -literal -# cat /dev/wmistat +# cat /dev/wmistat0 GUID INST EXPE METH STR EVENT OID {5FB7F034-2C63-45E9-BE91-3D44E2C707E4} 1 NO WMAA NO NO AA {95F24279-4D7B-4334-9387-ACCDC67EF61C} 1 NO NO NO 0x80+ - Modified: head/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- head/sys/dev/acpi_support/acpi_wmi.c Tue Nov 22 16:18:12 2011 (r227822) +++ head/sys/dev/acpi_support/acpi_wmi.c Tue Nov 22 16:44:50 2011 (r227823) @@ -265,7 +265,7 @@ acpi_wmi_attach(device_t dev) acpi_wmi_ec_handler); } else { sc->wmistat_dev_t = make_dev(&wmistat_cdevsw, 0, UID_ROOT, - GID_WHEEL, 0644, "wmistat"); + GID_WHEEL, 0644, "wmistat%d", device_get_unit(dev)); sc->wmistat_dev_t->si_drv1 = sc; sc->wmistat_open_pid = 0; sc->wmistat_bufptr = -1; From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 17:30: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 9C9341065670; Tue, 22 Nov 2011 17:30:41 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 884D18FC1C; Tue, 22 Nov 2011 17:30:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMHUfZw002171; Tue, 22 Nov 2011 17:30:41 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMHUfDc002168; Tue, 22 Nov 2011 17:30:41 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111221730.pAMHUfDc002168@svn.freebsd.org> From: David Chisnall Date: Tue, 22 Nov 2011 17:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227825 - in vendor: libc++ libc++/dist libc++/dist/include libc++/dist/include/ext libc++/dist/include/support libc++/dist/include/support/win32 libc++/dist/src libc++/dist/src/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: Tue, 22 Nov 2011 17:30:41 -0000 Author: theraven Date: Tue Nov 22 17:30:41 2011 New Revision: 227825 URL: http://svn.freebsd.org/changeset/base/227825 Log: Import libcxxrt / libc++ into a vendor branch. Approved by: dim (mentor) Added: vendor/libc++/ vendor/libc++/dist/ vendor/libc++/dist/include/ vendor/libc++/dist/include/__bit_reference vendor/libc++/dist/include/__config vendor/libc++/dist/include/__debug vendor/libc++/dist/include/__functional_03 vendor/libc++/dist/include/__functional_base vendor/libc++/dist/include/__functional_base_03 vendor/libc++/dist/include/__hash_table vendor/libc++/dist/include/__locale vendor/libc++/dist/include/__mutex_base vendor/libc++/dist/include/__split_buffer vendor/libc++/dist/include/__sso_allocator vendor/libc++/dist/include/__std_stream vendor/libc++/dist/include/__tree vendor/libc++/dist/include/__tuple vendor/libc++/dist/include/__tuple_03 vendor/libc++/dist/include/algorithm vendor/libc++/dist/include/array vendor/libc++/dist/include/atomic vendor/libc++/dist/include/bitset vendor/libc++/dist/include/cassert vendor/libc++/dist/include/ccomplex vendor/libc++/dist/include/cctype vendor/libc++/dist/include/cerrno vendor/libc++/dist/include/cfenv vendor/libc++/dist/include/cfloat vendor/libc++/dist/include/chrono vendor/libc++/dist/include/cinttypes vendor/libc++/dist/include/ciso646 vendor/libc++/dist/include/climits vendor/libc++/dist/include/clocale vendor/libc++/dist/include/cmath vendor/libc++/dist/include/codecvt vendor/libc++/dist/include/complex vendor/libc++/dist/include/complex.h (contents, props changed) vendor/libc++/dist/include/condition_variable vendor/libc++/dist/include/csetjmp vendor/libc++/dist/include/csignal vendor/libc++/dist/include/cstdarg vendor/libc++/dist/include/cstdbool vendor/libc++/dist/include/cstddef vendor/libc++/dist/include/cstdint vendor/libc++/dist/include/cstdio vendor/libc++/dist/include/cstdlib vendor/libc++/dist/include/cstring vendor/libc++/dist/include/ctgmath vendor/libc++/dist/include/ctime vendor/libc++/dist/include/cwchar vendor/libc++/dist/include/cwctype vendor/libc++/dist/include/deque vendor/libc++/dist/include/exception vendor/libc++/dist/include/ext/ vendor/libc++/dist/include/ext/__hash vendor/libc++/dist/include/ext/hash_map vendor/libc++/dist/include/ext/hash_set vendor/libc++/dist/include/forward_list vendor/libc++/dist/include/fstream vendor/libc++/dist/include/functional vendor/libc++/dist/include/future vendor/libc++/dist/include/initializer_list vendor/libc++/dist/include/iomanip vendor/libc++/dist/include/ios vendor/libc++/dist/include/iosfwd vendor/libc++/dist/include/iostream vendor/libc++/dist/include/istream vendor/libc++/dist/include/iterator vendor/libc++/dist/include/limits vendor/libc++/dist/include/list vendor/libc++/dist/include/locale vendor/libc++/dist/include/map vendor/libc++/dist/include/memory vendor/libc++/dist/include/mutex vendor/libc++/dist/include/new vendor/libc++/dist/include/numeric vendor/libc++/dist/include/ostream vendor/libc++/dist/include/queue vendor/libc++/dist/include/random vendor/libc++/dist/include/ratio vendor/libc++/dist/include/regex vendor/libc++/dist/include/scoped_allocator vendor/libc++/dist/include/set vendor/libc++/dist/include/sstream vendor/libc++/dist/include/stack vendor/libc++/dist/include/stdexcept vendor/libc++/dist/include/streambuf vendor/libc++/dist/include/string vendor/libc++/dist/include/strstream vendor/libc++/dist/include/support/ vendor/libc++/dist/include/support/win32/ vendor/libc++/dist/include/support/win32/limits_win32.h (contents, props changed) vendor/libc++/dist/include/support/win32/locale_win32.h (contents, props changed) vendor/libc++/dist/include/support/win32/math_win32.h (contents, props changed) vendor/libc++/dist/include/support/win32/support.h (contents, props changed) vendor/libc++/dist/include/system_error vendor/libc++/dist/include/tgmath.h (contents, props changed) vendor/libc++/dist/include/thread vendor/libc++/dist/include/tuple vendor/libc++/dist/include/type_traits vendor/libc++/dist/include/typeindex vendor/libc++/dist/include/typeinfo vendor/libc++/dist/include/unordered_map vendor/libc++/dist/include/unordered_set vendor/libc++/dist/include/utility vendor/libc++/dist/include/valarray vendor/libc++/dist/include/vector vendor/libc++/dist/src/ vendor/libc++/dist/src/algorithm.cpp (contents, props changed) vendor/libc++/dist/src/bind.cpp (contents, props changed) vendor/libc++/dist/src/chrono.cpp (contents, props changed) vendor/libc++/dist/src/condition_variable.cpp (contents, props changed) vendor/libc++/dist/src/debug.cpp (contents, props changed) vendor/libc++/dist/src/exception.cpp (contents, props changed) vendor/libc++/dist/src/future.cpp (contents, props changed) vendor/libc++/dist/src/hash.cpp (contents, props changed) vendor/libc++/dist/src/ios.cpp (contents, props changed) vendor/libc++/dist/src/iostream.cpp (contents, props changed) vendor/libc++/dist/src/locale.cpp (contents, props changed) vendor/libc++/dist/src/memory.cpp (contents, props changed) vendor/libc++/dist/src/mutex.cpp (contents, props changed) vendor/libc++/dist/src/new.cpp (contents, props changed) vendor/libc++/dist/src/random.cpp (contents, props changed) vendor/libc++/dist/src/regex.cpp (contents, props changed) vendor/libc++/dist/src/stdexcept.cpp (contents, props changed) vendor/libc++/dist/src/string.cpp (contents, props changed) vendor/libc++/dist/src/strstream.cpp (contents, props changed) vendor/libc++/dist/src/support/ vendor/libc++/dist/src/support/win32/ vendor/libc++/dist/src/support/win32/locale_win32.cpp (contents, props changed) vendor/libc++/dist/src/support/win32/support.cpp (contents, props changed) vendor/libc++/dist/src/system_error.cpp (contents, props changed) vendor/libc++/dist/src/thread.cpp (contents, props changed) vendor/libc++/dist/src/typeinfo.cpp (contents, props changed) vendor/libc++/dist/src/utility.cpp (contents, props changed) vendor/libc++/dist/src/valarray.cpp (contents, props changed) vendor/libcxxrt/ vendor/libcxxrt/dist/ vendor/libcxxrt/dist/CMakeLists.txt (contents, props changed) vendor/libcxxrt/dist/abi_namespace.h (contents, props changed) vendor/libcxxrt/dist/auxhelper.cc (contents, props changed) vendor/libcxxrt/dist/cxxabi.h (contents, props changed) vendor/libcxxrt/dist/doxygen_config vendor/libcxxrt/dist/dwarf_eh.h (contents, props changed) vendor/libcxxrt/dist/dynamic_cast.cc (contents, props changed) vendor/libcxxrt/dist/exception.cc (contents, props changed) vendor/libcxxrt/dist/guard.cc (contents, props changed) vendor/libcxxrt/dist/libelftc_dem_gnu3.c (contents, props changed) vendor/libcxxrt/dist/memory.cc (contents, props changed) vendor/libcxxrt/dist/stdexcept.cc (contents, props changed) vendor/libcxxrt/dist/stdexcept.h (contents, props changed) vendor/libcxxrt/dist/terminate.cc (contents, props changed) vendor/libcxxrt/dist/typeinfo vendor/libcxxrt/dist/typeinfo.cc (contents, props changed) vendor/libcxxrt/dist/typeinfo.h (contents, props changed) Added: vendor/libc++/dist/include/__bit_reference ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/include/__bit_reference Tue Nov 22 17:30:41 2011 (r227825) @@ -0,0 +1,1247 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___BIT_REFERENCE +#define _LIBCPP___BIT_REFERENCE + +#include <__config> +#include + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template class __bit_iterator; +template class __bit_const_reference; + +template +struct __has_storage_type +{ + static const bool value = false; +}; + +template ::value> +class __bit_reference +{ + typedef typename _C::__storage_type __storage_type; + typedef typename _C::__storage_pointer __storage_pointer; + + __storage_pointer __seg_; + __storage_type __mask_; + +#if defined(__clang__) + friend typename _C::__self; +#else + friend class _C::__self; +#endif + friend class __bit_const_reference<_C>; + friend class __bit_iterator<_C, false>; +public: + _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT + {return static_cast(*__seg_ & __mask_);} + _LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT + {return !static_cast(*this);} + + _LIBCPP_INLINE_VISIBILITY + __bit_reference& operator=(bool __x) _NOEXCEPT + { + if (__x) + *__seg_ |= __mask_; + else + *__seg_ &= ~__mask_; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + __bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT + {return operator=(static_cast(__x));} + + _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;} + _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const _NOEXCEPT + {return __bit_iterator<_C, false>(__seg_, static_cast(__ctz(__mask_)));} +private: + _LIBCPP_INLINE_VISIBILITY + __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT + : __seg_(__s), __mask_(__m) {} +}; + +template +class __bit_reference<_C, false> +{ +}; + +template +_LIBCPP_INLINE_VISIBILITY inline +void +swap(__bit_reference<_C> __x, __bit_reference<_D> __y) _NOEXCEPT +{ + bool __t = __x; + __x = __y; + __y = __t; +} + +template +_LIBCPP_INLINE_VISIBILITY inline +void +swap(__bit_reference<_C> __x, bool& __y) _NOEXCEPT +{ + bool __t = __x; + __x = __y; + __y = __t; +} + +template +_LIBCPP_INLINE_VISIBILITY inline +void +swap(bool& __x, __bit_reference<_C> __y) _NOEXCEPT +{ + bool __t = __x; + __x = __y; + __y = __t; +} + +template +class __bit_const_reference +{ + typedef typename _C::__storage_type __storage_type; + typedef typename _C::__const_storage_pointer __storage_pointer; + + __storage_pointer __seg_; + __storage_type __mask_; + +#if defined(__clang__) + friend typename _C::__self; +#else + friend class _C::__self; +#endif + friend class __bit_iterator<_C, true>; +public: + _LIBCPP_INLINE_VISIBILITY + __bit_const_reference(const __bit_reference<_C>& __x) _NOEXCEPT + : __seg_(__x.__seg_), __mask_(__x.__mask_) {} + + _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT + {return static_cast(*__seg_ & __mask_);} + + _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const _NOEXCEPT + {return __bit_iterator<_C, true>(__seg_, static_cast(__ctz(__mask_)));} +private: + _LIBCPP_INLINE_VISIBILITY + __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT + : __seg_(__s), __mask_(__m) {} + + __bit_const_reference& operator=(const __bit_const_reference& __x); +}; + +// find + +template +__bit_iterator<_C, false> +__find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b = *__first.__seg_ & __m; + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) + if (*__first.__seg_) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(*__first.__seg_))); + // do last partial word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = *__first.__seg_ & __m; + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + } + return _It(__first.__seg_, static_cast(__n)); +} + +template +__bit_iterator<_C, false> +__find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b = ~(*__first.__seg_ & __m); + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) + { + __storage_type __b = ~*__first.__seg_; + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + } + // do last partial word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = ~(*__first.__seg_ & __m); + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + } + return _It(__first.__seg_, static_cast(__n)); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +find(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value_) +{ + if (static_cast(__value_)) + return __find_bool_true(__first, static_cast(__last - __first)); + return __find_bool_false(__first, static_cast(__last - __first)); +} + +// count + +template +typename __bit_iterator<_C, false>::difference_type +__count_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + typedef typename _It::difference_type difference_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + difference_type __r = 0; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __r = _VSTD::__pop_count(*__first.__seg_ & __m); + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) + __r += _VSTD::__pop_count(*__first.__seg_); + // do last partial word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __r += _VSTD::__pop_count(*__first.__seg_ & __m); + } + return __r; +} + +template +typename __bit_iterator<_C, false>::difference_type +__count_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + typedef typename _It::difference_type difference_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + difference_type __r = 0; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __r = _VSTD::__pop_count(~(*__first.__seg_ & __m)); + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) + __r += _VSTD::__pop_count(~*__first.__seg_); + // do last partial word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __r += _VSTD::__pop_count(~(*__first.__seg_ & __m)); + } + return __r; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +typename __bit_iterator<_C, false>::difference_type +count(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value_) +{ + if (static_cast(__value_)) + return __count_bool_true(__first, static_cast(__last - __first)); + return __count_bool_false(__first, static_cast(__last - __first)); +} + +// fill_n + +template +void +__fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + *__first.__seg_ &= ~__m; + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + __storage_type __nw = __n / __bits_per_word; + _VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type)); + __n -= __nw * __bits_per_word; + // do last partial word + if (__n > 0) + { + __first.__seg_ += __nw; + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + *__first.__seg_ &= ~__m; + } +} + +template +void +__fill_n_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + *__first.__seg_ |= __m; + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + __storage_type __nw = __n / __bits_per_word; + _VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type)); + __n -= __nw * __bits_per_word; + // do last partial word + if (__n > 0) + { + __first.__seg_ += __nw; + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + *__first.__seg_ |= __m; + } +} + +template +_LIBCPP_INLINE_VISIBILITY inline +void +fill_n(__bit_iterator<_C, false> __first, typename _C::size_type __n, bool __value_) +{ + if (__n > 0) + { + if (__value_) + __fill_n_true(__first, __n); + else + __fill_n_false(__first, __n); + } +} + +// fill + +template +inline _LIBCPP_INLINE_VISIBILITY +void +fill(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, bool __value_) +{ + _VSTD::fill_n(__first, static_cast(__last - __first), __value_); +} + +// copy + +template +__bit_iterator<_C, false> +__copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, + __bit_iterator<_C, false> __result) +{ + typedef __bit_iterator<_C, _IsConst> _In; + typedef typename _In::difference_type difference_type; + typedef typename _In::__storage_type __storage_type; + static const unsigned __bits_per_word = _In::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__first.__ctz_ != 0) + { + unsigned __clz = __bits_per_word - __first.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn)); + __storage_type __b = *__first.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b; + __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__dn + __result.__ctz_) % __bits_per_word); + ++__first.__seg_; + // __first.__ctz_ = 0; + } + // __first.__ctz_ == 0; + // do middle words + __storage_type __nw = __n / __bits_per_word; + _VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type)); + __n -= __nw * __bits_per_word; + __result.__seg_ += __nw; + // do last word + if (__n > 0) + { + __first.__seg_ += __nw; + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = *__first.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b; + __result.__ctz_ = static_cast(__n); + } + } + return __result; +} + +template +__bit_iterator<_C, false> +__copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, + __bit_iterator<_C, false> __result) +{ + typedef __bit_iterator<_C, _IsConst> _In; + typedef typename _In::difference_type difference_type; + typedef typename _In::__storage_type __storage_type; + static const unsigned __bits_per_word = _In::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__first.__ctz_ != 0) + { + unsigned __clz_f = __bits_per_word - __first.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz_f), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b = *__first.__seg_ & __m; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r); + __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn)); + *__result.__seg_ &= ~__m; + if (__result.__ctz_ > __first.__ctz_) + *__result.__seg_ |= __b << (__result.__ctz_ - __first.__ctz_); + else + *__result.__seg_ |= __b >> (__first.__ctz_ - __result.__ctz_); + __result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__ddn + __result.__ctz_) % __bits_per_word); + __dn -= __ddn; + if (__dn > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __dn); + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b >> (__first.__ctz_ + __ddn); + __result.__ctz_ = static_cast(__dn); + } + ++__first.__seg_; + // __first.__ctz_ = 0; + } + // __first.__ctz_ == 0; + // do middle words + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __m = ~__storage_type(0) << __result.__ctz_; + for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_) + { + __storage_type __b = *__first.__seg_; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b << __result.__ctz_; + ++__result.__seg_; + *__result.__seg_ &= __m; + *__result.__seg_ |= __b >> __clz_r; + } + // do last word + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = *__first.__seg_ & __m; + __storage_type __dn = _VSTD::min(__n, static_cast(__clz_r)); + __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn)); + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b << __result.__ctz_; + __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__dn + __result.__ctz_) % __bits_per_word); + __n -= __dn; + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b >> __dn; + __result.__ctz_ = static_cast(__n); + } + } + } + return __result; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +copy(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +{ + if (__first.__ctz_ == __result.__ctz_) + return __copy_aligned(__first, __last, __result); + return __copy_unaligned(__first, __last, __result); +} + +// copy_backward + +template +__bit_iterator<_C, false> +__copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, + __bit_iterator<_C, false> __result) +{ + typedef __bit_iterator<_C, _IsConst> _In; + typedef typename _In::difference_type difference_type; + typedef typename _In::__storage_type __storage_type; + static const unsigned __bits_per_word = _In::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__last.__ctz_ != 0) + { + difference_type __dn = _VSTD::min(static_cast(__last.__ctz_), __n); + __n -= __dn; + unsigned __clz = __bits_per_word - __last.__ctz_; + __storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz); + __storage_type __b = *__last.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b; + __result.__ctz_ = static_cast(((-__dn & (__bits_per_word - 1)) + + __result.__ctz_) % __bits_per_word); + // __last.__ctz_ = 0 + } + // __last.__ctz_ == 0 || __n == 0 + // __result.__ctz_ == 0 || __n == 0 + // do middle words + __storage_type __nw = __n / __bits_per_word; + __result.__seg_ -= __nw; + __last.__seg_ -= __nw; + _VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type)); + __n -= __nw * __bits_per_word; + // do last word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) << (__bits_per_word - __n); + __storage_type __b = *--__last.__seg_ & __m; + *--__result.__seg_ &= ~__m; + *__result.__seg_ |= __b; + __result.__ctz_ = static_cast(-__n & (__bits_per_word - 1)); + } + } + return __result; +} + +template +__bit_iterator<_C, false> +__copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, + __bit_iterator<_C, false> __result) +{ + typedef __bit_iterator<_C, _IsConst> _In; + typedef typename _In::difference_type difference_type; + typedef typename _In::__storage_type __storage_type; + static const unsigned __bits_per_word = _In::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__last.__ctz_ != 0) + { + difference_type __dn = _VSTD::min(static_cast(__last.__ctz_), __n); + __n -= __dn; + unsigned __clz_l = __bits_per_word - __last.__ctz_; + __storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_l); + __storage_type __b = *__last.__seg_ & __m; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __ddn = _VSTD::min(__dn, static_cast(__result.__ctz_)); + if (__ddn > 0) + { + __m = (~__storage_type(0) << (__result.__ctz_ - __ddn)) & (~__storage_type(0) >> __clz_r); + *__result.__seg_ &= ~__m; + if (__result.__ctz_ > __last.__ctz_) + *__result.__seg_ |= __b << (__result.__ctz_ - __last.__ctz_); + else + *__result.__seg_ |= __b >> (__last.__ctz_ - __result.__ctz_); + __result.__ctz_ = static_cast(((-__ddn & (__bits_per_word - 1)) + + __result.__ctz_) % __bits_per_word); + __dn -= __ddn; + } + if (__dn > 0) + { + // __result.__ctz_ == 0 + --__result.__seg_; + __result.__ctz_ = static_cast(-__dn & (__bits_per_word - 1)); + __m = ~__storage_type(0) << __result.__ctz_; + *__result.__seg_ &= ~__m; + __last.__ctz_ -= __dn + __ddn; + *__result.__seg_ |= __b << (__result.__ctz_ - __last.__ctz_); + } + // __last.__ctz_ = 0 + } + // __last.__ctz_ == 0 || __n == 0 + // __result.__ctz_ != 0 || __n == 0 + // do middle words + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __m = ~__storage_type(0) >> __clz_r; + for (; __n >= __bits_per_word; __n -= __bits_per_word) + { + __storage_type __b = *--__last.__seg_; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b >> __clz_r; + *--__result.__seg_ &= __m; + *__result.__seg_ |= __b << __result.__ctz_; + } + // do last word + if (__n > 0) + { + __m = ~__storage_type(0) << (__bits_per_word - __n); + __storage_type __b = *--__last.__seg_ & __m; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __dn = _VSTD::min(__n, static_cast(__result.__ctz_)); + __m = (~__storage_type(0) << (__result.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_r); + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b >> (__bits_per_word - __result.__ctz_); + __result.__ctz_ = static_cast(((-__dn & (__bits_per_word - 1)) + + __result.__ctz_) % __bits_per_word); + __n -= __dn; + if (__n > 0) + { + // __result.__ctz_ == 0 + --__result.__seg_; + __result.__ctz_ = static_cast(-__n & (__bits_per_word - 1)); + __m = ~__storage_type(0) << __result.__ctz_; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b << (__result.__ctz_ - (__bits_per_word - __n - __dn)); + } + } + } + return __result; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +copy_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +{ + if (__last.__ctz_ == __result.__ctz_) + return __copy_backward_aligned(__first, __last, __result); + return __copy_backward_unaligned(__first, __last, __result); +} + +// move + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +move(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +{ + return _VSTD::copy(__first, __last, __result); +} + +// move_backward + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +move_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +{ + return _VSTD::copy(__first, __last, __result); +} + +// swap_ranges + +template +__bit_iterator<__C2, false> +__swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last, + __bit_iterator<__C2, false> __result) +{ + typedef __bit_iterator<__C1, false> _I1; + typedef typename _I1::difference_type difference_type; + typedef typename _I1::__storage_type __storage_type; + static const unsigned __bits_per_word = _I1::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__first.__ctz_ != 0) + { + unsigned __clz = __bits_per_word - __first.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn)); + __storage_type __b1 = *__first.__seg_ & __m; + *__first.__seg_ &= ~__m; + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1; + *__first.__seg_ |= __b2; + __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__dn + __result.__ctz_) % __bits_per_word); + ++__first.__seg_; + // __first.__ctz_ = 0; + } + // __first.__ctz_ == 0; + // do middle words + for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_, ++__result.__seg_) + swap(*__first.__seg_, *__result.__seg_); + // do last word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b1 = *__first.__seg_ & __m; + *__first.__seg_ &= ~__m; + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1; + *__first.__seg_ |= __b2; + __result.__ctz_ = static_cast(__n); + } + } + return __result; +} + +template +__bit_iterator<__C2, false> +__swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last, + __bit_iterator<__C2, false> __result) +{ + typedef __bit_iterator<__C1, false> _I1; + typedef typename _I1::difference_type difference_type; + typedef typename _I1::__storage_type __storage_type; + static const unsigned __bits_per_word = _I1::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__first.__ctz_ != 0) + { + unsigned __clz_f = __bits_per_word - __first.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz_f), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b1 = *__first.__seg_ & __m; + *__first.__seg_ &= ~__m; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r); + __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn)); + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + if (__result.__ctz_ > __first.__ctz_) + { + unsigned __s = __result.__ctz_ - __first.__ctz_; + *__result.__seg_ |= __b1 << __s; + *__first.__seg_ |= __b2 >> __s; + } + else + { + unsigned __s = __first.__ctz_ - __result.__ctz_; + *__result.__seg_ |= __b1 >> __s; + *__first.__seg_ |= __b2 << __s; + } + __result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__ddn + __result.__ctz_) % __bits_per_word); + __dn -= __ddn; + if (__dn > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __dn); + __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + unsigned __s = __first.__ctz_ + __ddn; + *__result.__seg_ |= __b1 >> __s; + *__first.__seg_ |= __b2 << __s; + __result.__ctz_ = static_cast(__dn); + } + ++__first.__seg_; + // __first.__ctz_ = 0; + } + // __first.__ctz_ == 0; + // do middle words + __storage_type __m = ~__storage_type(0) << __result.__ctz_; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_) + { + __storage_type __b1 = *__first.__seg_; + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1 << __result.__ctz_; + *__first.__seg_ = __b2 >> __result.__ctz_; + ++__result.__seg_; + __b2 = *__result.__seg_ & ~__m; + *__result.__seg_ &= __m; + *__result.__seg_ |= __b1 >> __clz_r; + *__first.__seg_ |= __b2 << __clz_r; + } + // do last word + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b1 = *__first.__seg_ & __m; + *__first.__seg_ &= ~__m; + __storage_type __dn = _VSTD::min<__storage_type>(__n, __clz_r); + __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn)); + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1 << __result.__ctz_; + *__first.__seg_ |= __b2 >> __result.__ctz_; + __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__dn + __result.__ctz_) % __bits_per_word); + __n -= __dn; + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1 >> __dn; + *__first.__seg_ |= __b2 << __dn; + __result.__ctz_ = static_cast(__n); + } + } + } + return __result; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<__C2, false> +swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __last1, + __bit_iterator<__C2, false> __first2) +{ + if (__first1.__ctz_ == __first2.__ctz_) + return __swap_ranges_aligned(__first1, __last1, __first2); + return __swap_ranges_unaligned(__first1, __last1, __first2); +} + +// rotate + +template +struct __bit_array +{ + typedef typename _C::difference_type difference_type; + typedef typename _C::__storage_type __storage_type; + typedef typename _C::iterator iterator; + static const unsigned __bits_per_word = _C::__bits_per_word; + static const unsigned _N = 4; + + difference_type __size_; + __storage_type __word_[_N]; + + _LIBCPP_INLINE_VISIBILITY static difference_type capacity() + {return static_cast(_N * __bits_per_word);} + _LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {} + _LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);} + _LIBCPP_INLINE_VISIBILITY iterator end() {return iterator(__word_ + __size_ / __bits_per_word, + static_cast(__size_ % __bits_per_word));} +}; + +template +__bit_iterator<_C, false> +rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __bit_iterator<_C, false> __last) +{ + typedef __bit_iterator<_C, false> _I1; + typedef typename _I1::difference_type difference_type; + typedef typename _I1::__storage_type __storage_type; + static const unsigned __bits_per_word = _I1::__bits_per_word; + difference_type __d1 = __middle - __first; + difference_type __d2 = __last - __middle; + _I1 __r = __first + __d2; + while (__d1 != 0 && __d2 != 0) + { + if (__d1 <= __d2) + { + if (__d1 <= __bit_array<_C>::capacity()) + { + __bit_array<_C> __b(__d1); + _VSTD::copy(__first, __middle, __b.begin()); + _VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first)); + break; + } + else + { + __bit_iterator<_C, false> __mp = _VSTD::swap_ranges(__first, __middle, __middle); + __first = __middle; + __middle = __mp; + __d2 -= __d1; + } + } + else + { + if (__d2 <= __bit_array<_C>::capacity()) + { + __bit_array<_C> __b(__d2); + _VSTD::copy(__middle, __last, __b.begin()); + _VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last)); + break; + } + else + { + __bit_iterator<_C, false> __mp = __first + __d2; + _VSTD::swap_ranges(__first, __mp, __middle); + __first = __mp; + __d1 -= __d2; + } + } + } + return __r; +} + +// equal + +template +bool +__equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __last1, + __bit_iterator<_C, true> __first2) +{ + typedef __bit_iterator<_C, true> _It; + typedef typename _It::difference_type difference_type; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + difference_type __n = __last1 - __first1; + if (__n > 0) + { + // do first word + if (__first1.__ctz_ != 0) + { + unsigned __clz_f = __bits_per_word - __first1.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz_f), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b = *__first1.__seg_ & __m; + unsigned __clz_r = __bits_per_word - __first2.__ctz_; + __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r); + __m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn)); + if (__first2.__ctz_ > __first1.__ctz_) + if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_))) + return false; + else + if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ - __first2.__ctz_))) + return false; + __first2.__seg_ += (__ddn + __first2.__ctz_) / __bits_per_word; + __first2.__ctz_ = static_cast((__ddn + __first2.__ctz_) % __bits_per_word); + __dn -= __ddn; + if (__dn > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __dn); + if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ + __ddn))) + return false; + __first2.__ctz_ = static_cast(__dn); + } + ++__first1.__seg_; + // __first1.__ctz_ = 0; + } + // __first1.__ctz_ == 0; + // do middle words + unsigned __clz_r = __bits_per_word - __first2.__ctz_; + __storage_type __m = ~__storage_type(0) << __first2.__ctz_; + for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first1.__seg_) + { + __storage_type __b = *__first1.__seg_; + if ((*__first2.__seg_ & __m) != (__b << __first2.__ctz_)) + return false; + ++__first2.__seg_; + if ((*__first2.__seg_ & ~__m) != (__b >> __clz_r)) + return false; + } + // do last word + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = *__first1.__seg_ & __m; + __storage_type __dn = _VSTD::min(__n, static_cast(__clz_r)); + __m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn)); + if ((*__first2.__seg_ & __m) != (__b << __first2.__ctz_)) + return false; + __first2.__seg_ += (__dn + __first2.__ctz_) / __bits_per_word; + __first2.__ctz_ = static_cast((__dn + __first2.__ctz_) % __bits_per_word); + __n -= __dn; + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 17:33: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 328661065679; Tue, 22 Nov 2011 17:33:09 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 089228FC0C; Tue, 22 Nov 2011 17:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMHX83F002290; Tue, 22 Nov 2011 17:33:08 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMHX8Td002289; Tue, 22 Nov 2011 17:33:08 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111221733.pAMHX8Td002289@svn.freebsd.org> From: David Chisnall Date: Tue, 22 Nov 2011 17:33:08 +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: r227826 - in vendor: libc++/r145065 libcxxrt/9802a7e430e08b90bf0e92d24abff095fa72ec21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 17:33:09 -0000 Author: theraven Date: Tue Nov 22 17:33:08 2011 New Revision: 227826 URL: http://svn.freebsd.org/changeset/base/227826 Log: Create versioned copies of the vendor branches.. Approved by: dim (mentor) Added: vendor/libc++/r145065/ - copied from r227825, vendor/libc++/dist/ vendor/libcxxrt/9802a7e430e08b90bf0e92d24abff095fa72ec21/ - copied from r227825, vendor/libcxxrt/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 17:44: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 EE87C1065670; Tue, 22 Nov 2011 17:44:38 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU [18.9.25.15]) by mx1.freebsd.org (Postfix) with ESMTP id 64B0C8FC16; Tue, 22 Nov 2011 17:44:38 +0000 (UTC) X-AuditID: 1209190f-b7f6e6d0000008df-55-4ecbdc002827 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id 39.EA.02271.00CDBCE4; Tue, 22 Nov 2011 12:29:36 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id pAMHTZaP031434; Tue, 22 Nov 2011 12:29:35 -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 pAMHTXge022269 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 22 Nov 2011 12:29:34 -0500 (EST) Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id pAMHTWCL011894; Tue, 22 Nov 2011 12:29:32 -0500 (EST) Date: Tue, 22 Nov 2011 12:29:31 -0500 (EST) From: Benjamin Kaduk To: John Baldwin In-Reply-To: <201111220830.05029.jhb@freebsd.org> Message-ID: References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> <4EC9FD8A.5040401@freebsd.org> <201111220830.05029.jhb@freebsd.org> 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: H4sIAAAAAAAAA+NgFupkleLIzCtJLcpLzFFi42IRYrdT12W4c9rP4OZDBYu9R64zW0xbv4vR YvOtLmaLNy0/WCz+tE8BEpsWslo0fVnA5MDu0XDex2PGp/ksHjtn3WUPYI7isklJzcksSy3S t0vgyuj7+4i14Adrxay3M5kaGG+wdDFyckgImEi0Nz5lhbDFJC7cW8/WxcjFISSwj1FiWvtz sISQwAZGib3PTSDsA0wSfz7zQBQ1MEpc+TeLDSTBIqAtcWVjLzOIzSagIjHzzUagOAeHiICS xNRvaiBhZoEXjBKTjmSA2MIC+hJfV08EO4JTwFDi19JFYK28AvYSP9cuZYKYv59RYuayN2BH iAroSKzeP4UFokhQ4uTMJywQQy0lzv25zjaBUXAWktQsJKkFjEyrGGVTcqt0cxMzc4pTk3WL kxPz8lKLdE30cjNL9FJTSjcxgkKcU5J/B+O3g0qHGAU4GJV4eKNOnvYTYk0sK67MPcQoycGk JMqrfhsoxJeUn1KZkVicEV9UmpNafIhRgoNZSYQ3bw1QjjclsbIqtSgfJiXNwaIkztu4w8FP SCA9sSQ1OzW1ILUIJivDwaEkwWsHMlSwKDU9tSItM6cEIc3EwQkynAdoeBpIDW9xQWJucWY6 RP4Uo6KUOK8vSEIAJJFRmgfXC0tBrxjFgV4RhmjnAaYvuO5XQIOZgAZPW3sCZHBJIkJKqoFx pvzNhWUHrRYVaN3w0Mi6qHtV5pOt/sHcKWtfpoYILLz7b25OitxeU485b5OP3rVi3hHRGz3B n/1M1OFcxnMTGhgsT2meTdxa7GOXXfFz++r4+DfpbPee1T277Nol4rD/FG/R3IW8MU/nG6xv EZV653RdctPzxpgJG+r5TyfEiUVfnK1y8ds8JZbijERDLeai4kQAOE8MSBwDAAA= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Julien Ridoux , Ben Kaduk , svn-src-head@freebsd.org, Lawrence Stewart Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 17:44:39 -0000 On Tue, 22 Nov 2011, John Baldwin wrote: > > Think of standalone modules that are not built as part of a kernel (e.g. > 3rd party device drivers). In general we should avoid having structures > change size for kernel options, especially common structures. It just adds > lots of pain and suffering and complexity. We are stuck with it for PAE on > i386 (which causes pain), and for LOCK_PROFILING (but that is sufficiently > rare and expensive it seems to be ok). I think 8 bytes for bpf packet is > not sufficiently expensive to justify the extra headache. Just always leave > the new field in. This is exactly what I was thinking of -- thanks for making more concrete. Sorry for the radio silence yesterday; too many meetings. -Ben From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 18:02: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 19ECD106566B; Tue, 22 Nov 2011 18:02:25 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8F29E8FC16; Tue, 22 Nov 2011 18:02:23 +0000 (UTC) Received: by faap15 with SMTP id p15so999822faa.13 for ; Tue, 22 Nov 2011 10:02:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=zBBaUWeThsLI8+tJSSIImjfeqSdp8MD+YHwZHGY2sa0=; b=J3zpAJaXf5FoKxFOqJH38k/zc7a5tRx6v6Bwrbh99GyYcNbA0iN3GhBEnL/AhbNmw+ Fv+N18glw6kSrIPwa9mUmKMRRkFrvElPBd9wqB/fdYSdtS0FAOXyWqqQwyi7o1X1TP1X 6lu9KuXcJUKVZQbe92iy1PH+i0URYhIq3L5Hg= Received: by 10.180.91.137 with SMTP id ce9mr9220149wib.5.1321984942189; Tue, 22 Nov 2011 10:02:22 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.216.21.133 with HTTP; Tue, 22 Nov 2011 10:01:51 -0800 (PST) In-Reply-To: <20111122153332.GA20145@zim.MIT.EDU> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> From: Eitan Adler Date: Tue, 22 Nov 2011 13:01:51 -0500 X-Google-Sender-Auth: dsOzowFM9ntVAr0XOUapjEO6HrI Message-ID: To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dim@freebsd.org, Brooks Davis , theraven@freebsd.org, bde@freebsd.org Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 18:02:25 -0000 Meta comment: I should have sent this patch to -hackers prior to seeking approval to commit. I learned my lesson and will seek wider review before making such changes in the future. On Tue, Nov 22, 2011 at 6:21 AM, Bruce Evans wrote: I saw your email about the style changes. I'd like to flesh out what changes should be made first before making another commit>> I guess I'm a little confused. =C2=A0Do we really have profiling>> information at this level that suggests the overhead of the branch is>> significant? I thought most hardware had pretty good>> branch-prediction, particularly with speculative execution. I made this change at the direction of theraven@. I assume he knows a little bit more about compilers than I do. ;)It seems from the rest of this thread that even if this were an optimization it still shouldn't be done at source code code level. > Every time I have profiled the string functions, changes like this always= > have an insignificant effect, even in benchmarks. =C2=A0Normal code spend= s> perhaps 0.01% of its time calling string functions, so the improvements>= from optimizing string functions are 0.01% of an insignificant amount. The problem with profiling this type of change is that it is hard to find a good representative benchmark. I could easily write code that will show you that adding the equality check is a good idea or that it is a horrible idea. IMHO it saves enough time when they are equal, but loses almost no time when the strings are not equal. >> Wouldn't something like __predict_false() have more value for>> performa= nce, It seems that at most this couldn't hurt. On Tue, Nov 22, 2011 at 10:33 AM, David Schultz wrote: > Third, it's not clear that checking whether s1 =3D=3D s2 is even an > optimization. =C2=A0Most programs simply aren't going to pass identical > pointers as arguments to strcmp(), so for the overwhelming > majority of cases, this is just a wasted test and a wasted slot in > a branch predict table. =C2=A0(FWIW, I doubt that a realistic benchmark > would demonstrate any measurable difference.) It is fairly common for programs to compare a value passed to a function to a array of strings. Also note that for the strn*cmp functions we already have a branch so this isn't always a wasted slot. Here is what I'd like to do next: - fix bde@'s style nits - change the | to a || and remove the comment - but leave the equality check as is. - find a src committer to approve the patch - go back to working on ports for a while ;) Is this the right course of action? Or should I just revert both commits entirely? --=20 Eitan Adler Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 18:53: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 1CAAE1065670; Tue, 22 Nov 2011 18:53:55 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8AA68FC0C; Tue, 22 Nov 2011 18:53:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMIrs5C004878; Tue, 22 Nov 2011 18:53:54 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMIrsQ2004876; Tue, 22 Nov 2011 18:53:54 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201111221853.pAMIrsQ2004876@svn.freebsd.org> From: Robert Millan Date: Tue, 22 Nov 2011 18:53: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: r227827 - 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, 22 Nov 2011 18:53:55 -0000 Author: rmh Date: Tue Nov 22 18:53:54 2011 New Revision: 227827 URL: http://svn.freebsd.org/changeset/base/227827 Log: Define __FreeBSD_kernel__ macro in sys/param.h. __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, which by definition is always true on FreeBSD. This macro is also defined on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD. It is tempting to use this macro in userland code when we want to enable kernel-specific routines, and in fact it's fine to do this in code that is part of FreeBSD itself. However, be aware that as presence of this macro is still not widespread (e.g. older FreeBSD versions, 3rd party compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in external applications without also checking for __FreeBSD__ as an alternative. Approved by: kib (mentor) MFC after: 2 weeks Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Nov 22 17:33:08 2011 (r227826) +++ head/sys/sys/param.h Tue Nov 22 18:53:54 2011 (r227827) @@ -60,6 +60,22 @@ #undef __FreeBSD_version #define __FreeBSD_version 1000001 /* Master, propagated to newvers */ +/* + * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, + * which by definition is always true on FreeBSD. This macro is also defined + * on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD. + * + * It is tempting to use this macro in userland code when we want to enable + * kernel-specific routines, and in fact it's fine to do this in code that + * is part of FreeBSD itself. However, be aware that as presence of this + * macro is still not widespread (e.g. older FreeBSD versions, 3rd party + * compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in + * external applications without also checking for __FreeBSD__ as an + * alternative. + */ +#undef __FreeBSD_kernel__ +#define __FreeBSD_kernel__ + #ifdef _KERNEL #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 18:58: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 CB1A9106566B; Tue, 22 Nov 2011 18:58:39 +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 BB37B8FC1B; Tue, 22 Nov 2011 18:58:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMIwdAg005066; Tue, 22 Nov 2011 18:58:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMIwdI9005064; Tue, 22 Nov 2011 18:58:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111221858.pAMIwdI9005064@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 22 Nov 2011 18:58: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: r227828 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 18:58:39 -0000 Author: yongari Date: Tue Nov 22 18:58:39 2011 New Revision: 227828 URL: http://svn.freebsd.org/changeset/base/227828 Log: Always start MII auto polling before accessing any MII registers. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Tue Nov 22 18:53:54 2011 (r227827) +++ head/sys/dev/vge/if_vge.c Tue Nov 22 18:58:39 2011 (r227828) @@ -1099,6 +1099,7 @@ vge_attach(device_t dev) goto fail; } + vge_miipoll_start(sc); /* Do MII setup */ error = mii_attach(dev, &sc->vge_miibus, ifp, vge_ifmedia_upd, vge_ifmedia_sts, BMSR_DEFCAPMASK, sc->vge_phyaddr, MII_OFFSET_ANY, @@ -2028,6 +2029,7 @@ vge_init_locked(struct vge_softc *sc) */ vge_stop(sc); vge_reset(sc); + vge_miipoll_start(sc); /* * Initialize the RX and TX descriptors and mbufs. From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 19:24: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 0D254106566B; Tue, 22 Nov 2011 19:24:32 +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 D904E8FC19; Tue, 22 Nov 2011 19:24:31 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 79AA046B42; Tue, 22 Nov 2011 14:24:31 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 01EE7B914; Tue, 22 Nov 2011 14:24:31 -0500 (EST) From: John Baldwin To: David Schultz Date: Tue, 22 Nov 2011 12:09:19 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> In-Reply-To: <20111122153332.GA20145@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111221209.19728.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Nov 2011 14:24:31 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 19:24:32 -0000 On Tuesday, November 22, 2011 10:33:32 am David Schultz wrote: > On Tue, Nov 22, 2011, Eitan Adler wrote: > > + /* use a bitwise or to avoid an additional branch instruction */ > > + if ((s1 == s2) | (n == 0)) > > + return (0); > > I think there are three issues with this. > > First, the comment suggesting that using '|' instead of '||' isn't > correct; any reasonable compiler knows how to optimize > side-effect-free expressions like these. (The reverse > transformation, from the arithmetic expression to the boolean one, > is actually harder for the compiler in general.) > > Second, the overwhelming precedent in FreeBSD is to use boolean > operators to combine boolean expressions, so you might try to get > some consensus on the issue before you go around replacing them > with bitwise operators. I for one don't find the bitwise > operators clearer, but I don't speak for everyone else. I concur, it should just use boolean logic since it is doing a boolean test. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 19:31: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 7FF90106564A; Tue, 22 Nov 2011 19:31:43 +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 6FF1C8FC08; Tue, 22 Nov 2011 19:31:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMJVhSK006182; Tue, 22 Nov 2011 19:31:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMJVhoe006179; Tue, 22 Nov 2011 19:31:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111221931.pAMJVhoe006179@svn.freebsd.org> From: Marius Strobl Date: Tue, 22 Nov 2011 19:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227829 - in head: share/man/man9 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, 22 Nov 2011 19:31:43 -0000 Author: marius Date: Tue Nov 22 19:31:43 2011 New Revision: 227829 URL: http://svn.freebsd.org/changeset/base/227829 Log: - Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t' and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from device drivers. - Update the example in driver.9 to use DEVMETHOD_END. Submitted by: jhb MFC after: 3 days Modified: head/share/man/man9/driver.9 head/sys/sys/bus.h Modified: head/share/man/man9/driver.9 ============================================================================== --- head/share/man/man9/driver.9 Tue Nov 22 18:58:39 2011 (r227828) +++ head/share/man/man9/driver.9 Tue Nov 22 19:31:43 2011 (r227829) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2010 +.Dd November 22, 2011 .Dt DRIVER 9 .Os .Sh NAME @@ -58,7 +58,7 @@ static device_method_t foo_methods[] = { DEVMETHOD(bogo_twiddle, foo_twiddle), /* Terminate method list */ - { 0, 0 } + DEVMETHOD_END }; static driver_t foo_driver = { Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Tue Nov 22 18:58:39 2011 (r227828) +++ head/sys/sys/bus.h Tue Nov 22 19:31:43 2011 (r227829) @@ -571,9 +571,10 @@ extern int bus_current_pass; void bus_set_pass(int pass); /** - * Shorthand for constructing method tables. + * Shorthands for constructing method tables. */ #define DEVMETHOD KOBJMETHOD +#define DEVMETHOD_END KOBJMETHOD_END /* * Some common device interfaces. From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 19:37: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 824561065670; Tue, 22 Nov 2011 19:37:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72B948FC0C; Tue, 22 Nov 2011 19:37:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMJbv8Q006420; Tue, 22 Nov 2011 19:37:57 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMJbvHI006418; Tue, 22 Nov 2011 19:37:57 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111221937.pAMJbvHI006418@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 22 Nov 2011 19:37: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: r227830 - 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, 22 Nov 2011 19:37:57 -0000 Author: glebius Date: Tue Nov 22 19:37:57 2011 New Revision: 227830 URL: http://svn.freebsd.org/changeset/base/227830 Log: Fix SIOCDIFADDR semantics: if no address is specified, then delete first one. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Nov 22 19:31:43 2011 (r227829) +++ head/sys/netinet/in.c Tue Nov 22 19:37:57 2011 (r227830) @@ -375,7 +375,7 @@ in_control(struct socket *so, u_long cmd switch (cmd) { case SIOCAIFADDR: case SIOCDIFADDR: - { + if (ifra->ifra_addr.sin_len == AF_INET) { struct in_ifaddr *oia; IN_IFADDR_RLOCK(); From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 19:39: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 4B1FC106566C; Tue, 22 Nov 2011 19:39:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B92A8FC14; Tue, 22 Nov 2011 19:39:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMJdSwL006502; Tue, 22 Nov 2011 19:39:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMJdSZp006500; Tue, 22 Nov 2011 19:39:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111221939.pAMJdSZp006500@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 22 Nov 2011 19:39: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: r227831 - 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, 22 Nov 2011 19:39:28 -0000 Author: glebius Date: Tue Nov 22 19:39:27 2011 New Revision: 227831 URL: http://svn.freebsd.org/changeset/base/227831 Log: style(9) nit Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Nov 22 19:37:57 2011 (r227830) +++ head/sys/netinet/in.c Tue Nov 22 19:39:27 2011 (r227831) @@ -249,7 +249,8 @@ in_control(struct socket *so, u_long cmd ifra->ifra_addr.sin_family != AF_INET) return (EINVAL); if (ifra->ifra_broadaddr.sin_len != 0 && - (ifra->ifra_broadaddr.sin_len != sizeof(struct sockaddr_in) || + (ifra->ifra_broadaddr.sin_len != + sizeof(struct sockaddr_in) || ifra->ifra_broadaddr.sin_family != AF_INET)) return (EINVAL); #if 0 From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 19:42: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 27C57106566C; Tue, 22 Nov 2011 19:42:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184028FC26; Tue, 22 Nov 2011 19:42:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMJgH3M006629; Tue, 22 Nov 2011 19:42:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMJgHoK006627; Tue, 22 Nov 2011 19:42:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111221942.pAMJgHoK006627@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 22 Nov 2011 19:42: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: r227832 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 19:42:18 -0000 Author: glebius Date: Tue Nov 22 19:42:17 2011 New Revision: 227832 URL: http://svn.freebsd.org/changeset/base/227832 Log: Improve logging: - don't hardcode function name - use LOG_DEBUG for such a debug message - print error value Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Nov 22 19:39:27 2011 (r227831) +++ head/sys/net/if.c Tue Nov 22 19:42:17 2011 (r227832) @@ -1475,7 +1475,7 @@ ifa_add_loopback_route(struct ifaddr *if RT_REMREF(rt); RT_UNLOCK(rt); } else if (error != 0) - log(LOG_INFO, "ifa_add_loopback_route: insertion failed\n"); + log(LOG_DEBUG, "%s: insertion failed: %u\n", __func__, error); return (error); } @@ -1499,7 +1499,7 @@ ifa_del_loopback_route(struct ifaddr *if error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); if (error != 0) - log(LOG_INFO, "ifa_del_loopback_route: deletion failed\n"); + log(LOG_DEBUG, "%s: deletion failed: %u\n", __func__, error); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20:05: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 0C8E61065670; Tue, 22 Nov 2011 20:05:26 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from stark.strangled.net (stark.strangled.net [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id E83278FC0C; Tue, 22 Nov 2011 20:05:25 +0000 (UTC) Received: from rui-macbook-pro.lan (bl17-149-5.dsl.telepac.pt [188.82.149.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by stark.strangled.net (Postfix) with ESMTPSA id CAB423981E; Tue, 22 Nov 2011 12:05:24 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201111211635.pALGZvSS051067@svn.freebsd.org> Date: Tue, 22 Nov 2011 20:05:22 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> References: <201111211635.pALGZvSS051067@svn.freebsd.org> To: Dag-Erling Smorgrav X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227797 - 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: Tue, 22 Nov 2011 20:05:26 -0000 With this change, I can no longer update a FreeBSD 9.0-current system = from June 2010 to FreeBSD 10.0. I suspect I'm not the only one. On 2011/11/21, at 16:35, Dag-Erling Smorgrav wrote: > Author: des > Date: Mon Nov 21 16:35:57 2011 > New Revision: 227797 > URL: http://svn.freebsd.org/changeset/base/227797 >=20 > Log: > As threatened on -arch, add {SHARED,STATIC}_{C,CXX}FLAGS, which allow = a > Makefile to specify different CFLAGS for shared and static libraries. >=20 > MFC after: 3 weeks >=20 > Modified: > head/share/mk/bsd.lib.mk >=20 > Modified: head/share/mk/bsd.lib.mk > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/mk/bsd.lib.mk Mon Nov 21 16:06:23 2011 = (r227796) > +++ head/share/mk/bsd.lib.mk Mon Nov 21 16:35:57 2011 = (r227797) > @@ -67,23 +67,29 @@ PICFLAG=3D-fpic >=20 > PO_FLAG=3D-pg >=20 > +.c.o: > + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} > + > .c.po: > - ${CC} ${PO_FLAG} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} > + ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o = ${.TARGET} > @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ > (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ > ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) >=20 > .c.So: > - ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} > + ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} = -o ${.TARGET} > @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ > (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ > ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) >=20 > +.cc.o: > + ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o = ${.TARGET} > + > .cc.po .C.po .cpp.po .cxx.po: > - ${CXX} ${PO_FLAG} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} > + ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c = ${.IMPSRC} -o ${.TARGET} >=20 > .cc.So .C.So .cpp.So .cxx.So: > - ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} > + ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c = ${.IMPSRC} -o ${.TARGET} >=20 > .f.po: > ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20: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 0531A106564A; Tue, 22 Nov 2011 20:27:37 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 63F108FC13; Tue, 22 Nov 2011 20:27:36 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAMKRZvr021687; Tue, 22 Nov 2011 15:27:35 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAMKRZ6Q021686; Tue, 22 Nov 2011 15:27:35 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Tue, 22 Nov 2011 15:27:35 -0500 From: David Schultz To: Eitan Adler Message-ID: <20111122202735.GA21442@zim.MIT.EDU> Mail-Followup-To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org, theraven@freebsd.org, dim@freebsd.org, Brooks Davis References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: src-committers@FreeBSD.ORG, theraven@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, dim@FreeBSD.ORG, Brooks Davis , bde@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 20:27:37 -0000 On Tue, Nov 22, 2011, Eitan Adler wrote: > The problem with profiling this type of change is that it is hard to > find a good representative benchmark. I could easily write code that > will show you that adding the equality check is a good idea or that it > is a horrible idea. IMHO it saves enough time when they are equal, but > loses almost no time when the strings are not equal. Benchmark or not, I think you'll have a very hard time finding a single real program that routinely calls strcasecmp() with identical pointers! > Here is what I'd like to do next: > > - fix bde@'s style nits > - change the | to a || and remove the comment > - but leave the equality check as is. > - find a src committer to approve the patch > - go back to working on ports for a while ;) > > Is this the right course of action? Or should I just revert both > commits entirely? Fixing the style nits would be good, and it sounds like several people are in favor of using boolean operators to combine boolean expressions. I don't think the extra tests you added make much difference either way, but I wouldn't want to see even more special cases sprinkled throughout the source tree without some validation that shows they are helpful. You shouldn't let this discourage you from working on src in the future. Not everyone is going to agree with everything you want to change. One observation: The level of nit-picking tends to be inversely proportional to the size of the change you're making. In other words, if you put a lot of effort into a really significant improvement, then it's *your* code and people are less likely to bother you about the details. From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20:40: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 B82E6106564A; Tue, 22 Nov 2011 20:40:18 +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 9DE008FC08; Tue, 22 Nov 2011 20:40:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMKeIQG008516; Tue, 22 Nov 2011 20:40:18 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMKeIDD008512; Tue, 22 Nov 2011 20:40:18 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111222040.pAMKeIDD008512@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 22 Nov 2011 20:40: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: r227833 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 20:40:18 -0000 Author: trociny Date: Tue Nov 22 20:40:18 2011 New Revision: 227833 URL: http://svn.freebsd.org/changeset/base/227833 Log: Add new sysctls, KERN_PROC_ENV and KERN_PROC_AUXV, to return environment strings and ELF auxiliary vectors from a process stack. Make sysctl_kern_proc_args to read not cached arguments from the process stack. Export proc_getargv() and proc_getenvv() so they can be reused by procfs and linprocfs. Suggested by: kib Reviewed by: kib Discussed with: kib, rwatson, jilles Tested by: pho MFC after: 2 weeks Modified: head/sys/kern/kern_proc.c head/sys/sys/proc.h head/sys/sys/sysctl.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Nov 22 19:42:17 2011 (r227832) +++ head/sys/kern/kern_proc.c Tue Nov 22 20:40:18 2011 (r227833) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -50,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1358,6 +1361,289 @@ pargs_drop(struct pargs *pa) pargs_free(pa); } +static int +proc_read_mem(struct thread *td, struct proc *p, vm_offset_t offset, void* buf, + size_t len) +{ + struct iovec iov; + struct uio uio; + + iov.iov_base = (caddr_t)buf; + iov.iov_len = len; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = offset; + uio.uio_resid = (ssize_t)len; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + uio.uio_td = td; + + return (proc_rwmem(p, &uio)); +} + +static int +proc_read_string(struct thread *td, struct proc *p, const char *sptr, char *buf, + size_t len) +{ + size_t i; + int error; + + error = proc_read_mem(td, p, (vm_offset_t)sptr, buf, len); + /* + * Reading the chunk may validly return EFAULT if the string is shorter + * than the chunk and is aligned at the end of the page, assuming the + * next page is not mapped. So if EFAULT is returned do a fallback to + * one byte read loop. + */ + if (error == EFAULT) { + for (i = 0; i < len; i++, buf++, sptr++) { + error = proc_read_mem(td, p, (vm_offset_t)sptr, buf, 1); + if (error != 0) + return (error); + if (*buf == '\0') + break; + } + error = 0; + } + return (error); +} + +#define PROC_AUXV_MAX 256 /* Safety limit on auxv size. */ + +enum proc_vector_type { + PROC_ARG, + PROC_ENV, + PROC_AUX, +}; + +#ifdef COMPAT_FREEBSD32 +static int +get_proc_vector32(struct thread *td, struct proc *p, char ***proc_vectorp, + size_t *vsizep, enum proc_vector_type type) +{ + struct freebsd32_ps_strings pss; + Elf32_Auxinfo aux; + vm_offset_t vptr, ptr; + uint32_t *proc_vector32; + char **proc_vector; + size_t vsize, size; + int i, error; + + error = proc_read_mem(td, p, (vm_offset_t)(p->p_sysent->sv_psstrings), + &pss, sizeof(pss)); + if (error != 0) + return (error); + switch (type) { + case PROC_ARG: + vptr = (vm_offset_t)PTRIN(pss.ps_argvstr); + vsize = pss.ps_nargvstr; + if (vsize > ARG_MAX) + return (ENOEXEC); + size = vsize * sizeof(int32_t); + break; + case PROC_ENV: + vptr = (vm_offset_t)PTRIN(pss.ps_envstr); + vsize = pss.ps_nenvstr; + if (vsize > ARG_MAX) + return (ENOEXEC); + size = vsize * sizeof(int32_t); + break; + case PROC_AUX: + vptr = (vm_offset_t)PTRIN(pss.ps_envstr) + + (pss.ps_nenvstr + 1) * sizeof(int32_t); + if (vptr % 4 != 0) + return (ENOEXEC); + for (ptr = vptr, i = 0; i < PROC_AUXV_MAX; i++) { + error = proc_read_mem(td, p, ptr, &aux, sizeof(aux)); + if (error != 0) + return (error); + if (aux.a_type == AT_NULL) + break; + ptr += sizeof(aux); + } + if (aux.a_type != AT_NULL) + return (ENOEXEC); + vsize = i + 1; + size = vsize * sizeof(aux); + break; + default: + KASSERT(0, ("Wrong proc vector type: %d", type)); + } + proc_vector32 = malloc(size, M_TEMP, M_WAITOK); + error = proc_read_mem(td, p, vptr, proc_vector32, size); + if (error != 0) + goto done; + if (type == PROC_AUX) { + *proc_vectorp = (char **)proc_vector32; + *vsizep = vsize; + return (0); + } + proc_vector = malloc(vsize * sizeof(char *), M_TEMP, M_WAITOK); + for (i = 0; i < (int)vsize; i++) + proc_vector[i] = PTRIN(proc_vector32[i]); + *proc_vectorp = proc_vector; + *vsizep = vsize; +done: + free(proc_vector32, M_TEMP); + return (error); +} +#endif + +static int +get_proc_vector(struct thread *td, struct proc *p, char ***proc_vectorp, + size_t *vsizep, enum proc_vector_type type) +{ + struct ps_strings pss; + Elf_Auxinfo aux; + vm_offset_t vptr, ptr; + char **proc_vector; + size_t vsize, size; + int error, i; + +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(p, SV_ILP32) != 0) + return (get_proc_vector32(td, p, proc_vectorp, vsizep, type)); +#endif + error = proc_read_mem(td, p, (vm_offset_t)(p->p_sysent->sv_psstrings), + &pss, sizeof(pss)); + if (error != 0) + return (error); + switch (type) { + case PROC_ARG: + vptr = (vm_offset_t)pss.ps_argvstr; + vsize = pss.ps_nargvstr; + if (vsize > ARG_MAX) + return (ENOEXEC); + size = vsize * sizeof(char *); + break; + case PROC_ENV: + vptr = (vm_offset_t)pss.ps_envstr; + vsize = pss.ps_nenvstr; + if (vsize > ARG_MAX) + return (ENOEXEC); + size = vsize * sizeof(char *); + break; + case PROC_AUX: + /* + * The aux array is just above env array on the stack. Check + * that the address is naturally aligned. + */ + vptr = (vm_offset_t)pss.ps_envstr + (pss.ps_nenvstr + 1) + * sizeof(char *); +#if __ELF_WORD_SIZE == 64 + if (vptr % sizeof(uint64_t) != 0) +#else + if (vptr % sizeof(uint32_t) != 0) +#endif + return (ENOEXEC); + /* + * We count the array size reading the aux vectors from the + * stack until AT_NULL vector is returned. So (to keep the code + * simple) we read the process stack twice: the first time here + * to find the size and the second time when copying the vectors + * to the allocated proc_vector. + */ + for (ptr = vptr, i = 0; i < PROC_AUXV_MAX; i++) { + error = proc_read_mem(td, p, ptr, &aux, sizeof(aux)); + if (error != 0) + return (error); + if (aux.a_type == AT_NULL) + break; + ptr += sizeof(aux); + } + /* + * If the PROC_AUXV_MAX entries are iterated over, and we have + * not reached AT_NULL, it is most likely we are reading wrong + * data: either the process doesn't have auxv array or data has + * been modified. Return the error in this case. + */ + if (aux.a_type != AT_NULL) + return (ENOEXEC); + vsize = i + 1; + size = vsize * sizeof(aux); + break; + default: + KASSERT(0, ("Wrong proc vector type: %d", type)); + } + proc_vector = malloc(size, M_TEMP, M_WAITOK); + if (proc_vector == NULL) + return (ENOMEM); + error = proc_read_mem(td, p, vptr, proc_vector, size); + if (error != 0) { + free(proc_vector, M_TEMP); + return (error); + } + *proc_vectorp = proc_vector; + *vsizep = vsize; + + return (0); +} + +#define GET_PS_STRINGS_CHUNK_SZ 256 /* Chunk size (bytes) for ps_strings operations. */ + +static int +get_ps_strings(struct thread *td, struct proc *p, struct sbuf *sb, + enum proc_vector_type type, size_t nchr) +{ + size_t done, len, vsize; + int error, i; + char **proc_vector, *sptr; + char pss_string[GET_PS_STRINGS_CHUNK_SZ]; + + PROC_ASSERT_HELD(p); + + /* + * We are not going to read more than 2 * (PATH_MAX + ARG_MAX) bytes. + */ + if (nchr > 2 * (PATH_MAX + ARG_MAX)) + nchr = 2 * (PATH_MAX + ARG_MAX); + + error = get_proc_vector(td, p, &proc_vector, &vsize, type); + if (error != 0) + return (error); + for (done = 0, i = 0; i < (int)vsize && done < nchr; i++) { + /* + * The program may have scribbled into its argv array, e.g. to + * remove some arguments. If that has happened, break out + * before trying to read from NULL. + */ + if (proc_vector[i] == NULL) + break; + for (sptr = proc_vector[i]; ; sptr += GET_PS_STRINGS_CHUNK_SZ) { + error = proc_read_string(td, p, sptr, pss_string, + sizeof(pss_string)); + if (error != 0) + goto done; + len = strnlen(pss_string, GET_PS_STRINGS_CHUNK_SZ); + if (done + len >= nchr) + len = nchr - done - 1; + sbuf_bcat(sb, pss_string, len); + if (len != GET_PS_STRINGS_CHUNK_SZ) + break; + done += GET_PS_STRINGS_CHUNK_SZ; + } + sbuf_bcat(sb, "", 1); + done += len + 1; + } +done: + free(proc_vector, M_TEMP); + return (error); +} + +int +proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb, size_t nchr) +{ + + return (get_ps_strings(curthread, p, sb, PROC_ARG, nchr)); +} + +int +proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb, size_t nchr) +{ + + return (get_ps_strings(curthread, p, sb, PROC_ENV, nchr)); +} + /* * This sysctl allows a process to retrieve the argument list or process * title for another process without groping around in the address space @@ -1371,7 +1657,8 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARG u_int namelen = arg2; struct pargs *newpa, *pa; struct proc *p; - int error = 0; + struct sbuf sb; + int error = 0, error2; if (namelen != 1) return (EINVAL); @@ -1391,11 +1678,24 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARG } pa = p->p_args; - pargs_hold(pa); - PROC_UNLOCK(p); - if (pa != NULL) + if (pa != NULL) { + pargs_hold(pa); + PROC_UNLOCK(p); error = SYSCTL_OUT(req, pa->ar_args, pa->ar_length); - pargs_drop(pa); + pargs_drop(pa); + } else if ((p->p_flag & (P_WEXIT | P_SYSTEM)) == 0) { + _PHOLD(p); + PROC_UNLOCK(p); + sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + error = proc_getargv(curthread, p, &sb, req->oldlen); + error2 = sbuf_finish(&sb); + PRELE(p); + sbuf_delete(&sb); + if (error == 0 && error2 != 0) + error = error2; + } else { + PROC_UNLOCK(p); + } if (error != 0 || req->newptr == NULL) return (error); @@ -1416,6 +1716,95 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARG } /* + * This sysctl allows a process to retrieve environment of another process. + */ +static int +sysctl_kern_proc_env(SYSCTL_HANDLER_ARGS) +{ + int *name = (int*) arg1; + u_int namelen = arg2; + struct proc *p; + struct sbuf sb; + int error, error2; + + if (namelen != 1) + return (EINVAL); + + p = pfind((pid_t)name[0]); + if (p == NULL) + return (ESRCH); + if ((p->p_flag & P_WEXIT) != 0) { + PROC_UNLOCK(p); + return (ESRCH); + } + if ((error = p_candebug(curthread, p)) != 0) { + PROC_UNLOCK(p); + return (error); + } + if ((p->p_flag & P_SYSTEM) != 0) { + PROC_UNLOCK(p); + return (0); + } + _PHOLD(p); + PROC_UNLOCK(p); + sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + error = proc_getenvv(curthread, p, &sb, req->oldlen); + error2 = sbuf_finish(&sb); + PRELE(p); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + +/* + * This sysctl allows a process to retrieve ELF auxiliary vector of + * another process. + */ +static int +sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARGS) +{ + int *name = (int*) arg1; + u_int namelen = arg2; + struct proc *p; + size_t vsize; + char **auxv; + int error; + + if (namelen != 1) + return (EINVAL); + + p = pfind((pid_t)name[0]); + if (p == NULL) + return (ESRCH); + if (p->p_flag & P_WEXIT) { + PROC_UNLOCK(p); + return (ESRCH); + } + if ((error = p_cansee(curthread, p)) != 0) { + PROC_UNLOCK(p); + return (error); + } + if ((p->p_flag & P_SYSTEM) != 0) { + PROC_UNLOCK(p); + return (0); + } + _PHOLD(p); + PROC_UNLOCK(p); + error = get_proc_vector(curthread, p, &auxv, &vsize, PROC_AUX); + PRELE(p); + if (error == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(p, SV_ILP32) != 0) + error = SYSCTL_OUT(req, auxv, vsize * + sizeof(Elf32_Auxinfo)); + else +#endif + error = SYSCTL_OUT(req, auxv, vsize * sizeof(Elf_Auxinfo)); + free(auxv, M_TEMP); + } + return (error); +} + +/* * This sysctl allows a process to retrieve the path of the executable for * itself or another process. */ @@ -2035,6 +2424,14 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_args, "Process argument list"); +static SYSCTL_NODE(_kern_proc, KERN_PROC_ENV, env, + CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, + sysctl_kern_proc_env, "Process environment"); + +static SYSCTL_NODE(_kern_proc, KERN_PROC_AUXV, auxv, + CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, + sysctl_kern_proc_auxv, "Process ELF auxiliary vector"); + static SYSCTL_NODE(_kern_proc, KERN_PROC_PATHNAME, pathname, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc_pathname, "Process executable path"); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Nov 22 19:42:17 2011 (r227832) +++ head/sys/sys/proc.h Tue Nov 22 20:40:18 2011 (r227833) @@ -168,6 +168,7 @@ struct p_sched; struct proc; struct procdesc; struct racct; +struct sbuf; struct sleepqueue; struct td_sched; struct thread; @@ -844,6 +845,10 @@ int p_canwait(struct thread *td, struct struct pargs *pargs_alloc(int len); void pargs_drop(struct pargs *pa); void pargs_hold(struct pargs *pa); +int proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb, + size_t nchr); +int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb, + size_t nchr); void procinit(void); void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Tue Nov 22 19:42:17 2011 (r227832) +++ head/sys/sys/sysctl.h Tue Nov 22 20:40:18 2011 (r227833) @@ -559,6 +559,8 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define KERN_PROC_VMMAP 32 /* VM map entries for process */ #define KERN_PROC_FILEDESC 33 /* File descriptors for process */ #define KERN_PROC_GROUPS 34 /* process groups */ +#define KERN_PROC_ENV 35 /* get environment */ +#define KERN_PROC_AUXV 36 /* get ELF auxiliary vector */ /* * KERN_IPC identifiers From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20:41: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 77CC31065675; Tue, 22 Nov 2011 20:41:56 +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 16D838FC13; Tue, 22 Nov 2011 20:41:56 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 6CB7B1DD6DF; Tue, 22 Nov 2011 21:41:55 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 488BC28468; Tue, 22 Nov 2011 21:41:55 +0100 (CET) Date: Tue, 22 Nov 2011 21:41:55 +0100 From: Jilles Tjoelker To: Dag-Erling Smorgrav Message-ID: <20111122204154.GA14090@stack.nl> References: <201111211640.pALGedXg051270@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111211640.pALGedXg051270@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: r227798 - in head: . lib/libpam lib/libpam/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 20:41:56 -0000 On Mon, Nov 21, 2011 at 04:40:39PM +0000, Dag-Erling Smorgrav wrote: > Author: des > Date: Mon Nov 21 16:40:39 2011 > New Revision: 227798 > URL: http://svn.freebsd.org/changeset/base/227798 > Log: > Simplify the libpam build by removing the shared modules' dependency > on the shared library. The modules are loaded by the library, so we > know it'll be there when we need it. Although this will work, I think it trades the quality of the binaries for a cleaner build system. It is better to pass all libraries to ld(1) even though a .so may have unresolved references: the NEEDED entry serves as an additional protection against version mismatches and symbol versioning (if you ever add it) requires ld(1) to have access to the .so containing the definition so it knows the version name to store in the output file. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20:43: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 581721065670; Tue, 22 Nov 2011 20:43:04 +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 2EECA8FC0C; Tue, 22 Nov 2011 20:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMKh4DW008634; Tue, 22 Nov 2011 20:43:04 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMKh4Y4008632; Tue, 22 Nov 2011 20:43:04 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111222043.pAMKh4Y4008632@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 22 Nov 2011 20:43: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: r227834 - head/sys/fs/procfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 20:43:04 -0000 Author: trociny Date: Tue Nov 22 20:43:03 2011 New Revision: 227834 URL: http://svn.freebsd.org/changeset/base/227834 Log: In procfs_doproccmdline() if arguments are not cashed read them from the process stack. Suggested by: kib Reviewed by: kib Tested by: pho MFC after: 2 weeks Modified: head/sys/fs/procfs/procfs_status.c Modified: head/sys/fs/procfs/procfs_status.c ============================================================================== --- head/sys/fs/procfs/procfs_status.c Tue Nov 22 20:40:18 2011 (r227833) +++ head/sys/fs/procfs/procfs_status.c Tue Nov 22 20:43:03 2011 (r227834) @@ -170,15 +170,10 @@ procfs_doprocstatus(PFS_FILL_ARGS) int procfs_doproccmdline(PFS_FILL_ARGS) { - struct ps_strings pstr; - char **ps_argvstr; - int error, i; /* * If we are using the ps/cmdline caching, use that. Otherwise - * revert back to the old way which only implements full cmdline - * for the current process and just p->p_comm for all other - * processes. + * read argv from the process space. * Note that if the argv is no longer available, we deliberately * don't fall back on p->p_comm or return an error: the authentic * Linux behaviour is to return zero-length in this case. @@ -190,30 +185,13 @@ procfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); return (0); } - PROC_UNLOCK(p); - if (p != td->td_proc) { - sbuf_printf(sb, "%.*s", MAXCOMLEN, p->p_comm); - } else { - error = copyin((void *)p->p_sysent->sv_psstrings, &pstr, - sizeof(pstr)); - if (error) - return (error); - if (pstr.ps_nargvstr > ARG_MAX) - return (E2BIG); - ps_argvstr = malloc(pstr.ps_nargvstr * sizeof(char *), - M_TEMP, M_WAITOK); - error = copyin((void *)pstr.ps_argvstr, ps_argvstr, - pstr.ps_nargvstr * sizeof(char *)); - if (error) { - free(ps_argvstr, M_TEMP); - return (error); - } - for (i = 0; i < pstr.ps_nargvstr; i++) { - sbuf_copyin(sb, ps_argvstr[i], 0); - sbuf_printf(sb, "%c", '\0'); - } - free(ps_argvstr, M_TEMP); + + if ((p->p_flag & P_SYSTEM) != 0) { + PROC_UNLOCK(p); + return (0); } - return (0); + PROC_UNLOCK(p); + + return (proc_getargv(td, p, sb, ARG_MAX)); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20:45: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 4F95F1065680; Tue, 22 Nov 2011 20:45:10 +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 3F4968FC21; Tue, 22 Nov 2011 20:45:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMKjA4X008751; Tue, 22 Nov 2011 20:45:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMKjA2w008749; Tue, 22 Nov 2011 20:45:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111222045.pAMKjA2w008749@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 22 Nov 2011 20:45: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: r227835 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 20:45:10 -0000 Author: yongari Date: Tue Nov 22 20:45:09 2011 New Revision: 227835 URL: http://svn.freebsd.org/changeset/base/227835 Log: Rework link establishment and link state detection logic. - Remove MIIBUS statchg callback and program VGE_DIAGCTL before initiating link establishment. Previously driver used to program VGE_DIAGCTL after getting a link in statchg callback. It seems the VGE_DIAGCTL register works like a kind of MII register such that it requires setting a 'to be' mode in advance rather than relying on resolved speed/duplex of established link. This means the statchg callback is not needed in driver. In addition, if there was no link at the time of media change, this was not called at all. - Introduce vge_ifmedia_upd_locked() to change current media to configured one. Actual media change is performed only after PHY reset and VGE_DIAGCTL setup. - In WOL configuration, make sure to clear forced mode such that controller can rely on auto-negotiation. - Unlike most other drivers that use miibus(4), vge(4) used controller's auto-polling feature for link state tracking via interrupt. This came from controller's inefficient mechanism to access MII registers. On link state change interrupt, vge(4) used to get current link state with series of MII register accesses. Because vge(4) already enabled auto polling, read PHY status register to resolved speed/duplex/flow control parameters. vge(4) still does not drive MII_TICK to reduce number of MII register accesses which in turn means the driver does not know the status of auto-negotiation. This was a one of long standing issue of vge(4). Probably driver may be able to implement a timer that keeps track of auto-negotiation state and restart auto-negotiation when driver couldn't establish a link within a specified period. However the controller does not provide a reliable way to detect auto-negotiation failure so I'm not sure whether it's worth to implement it in driver. Alternatively driver can completely disable MII auto-polling and let miibus(4) poll link state by driving MII_TICK. This may reduce unnecessary overhead of stopping/restarting MII auto-polling of controller. Unfortunately it was known that some variants of controller does not work correctly if MII auto-polling is disabled. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Tue Nov 22 20:43:03 2011 (r227834) +++ head/sys/dev/vge/if_vge.c Tue Nov 22 20:45:09 2011 (r227835) @@ -173,6 +173,7 @@ static __inline void static void vge_freebufs(struct vge_softc *); static void vge_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int vge_ifmedia_upd(struct ifnet *); +static int vge_ifmedia_upd_locked(struct vge_softc *); static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); @@ -180,7 +181,6 @@ static void vge_intr_holdoff(struct vge_ static int vge_ioctl(struct ifnet *, u_long, caddr_t); static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); -static void vge_miibus_statchg(device_t); static int vge_miibus_writereg(device_t, int, int, int); static void vge_miipoll_start(struct vge_softc *); static void vge_miipoll_stop(struct vge_softc *); @@ -190,6 +190,7 @@ static void vge_reset(struct vge_softc * static int vge_rx_list_init(struct vge_softc *); static int vge_rxeof(struct vge_softc *, int); static void vge_rxfilter(struct vge_softc *); +static void vge_setmedia(struct vge_softc *); static void vge_setvlan(struct vge_softc *); static void vge_setwol(struct vge_softc *); static void vge_start(struct ifnet *); @@ -218,7 +219,6 @@ static device_method_t vge_methods[] = { /* MII interface */ DEVMETHOD(miibus_readreg, vge_miibus_readreg), DEVMETHOD(miibus_writereg, vge_miibus_writereg), - DEVMETHOD(miibus_statchg, vge_miibus_statchg), { 0, 0 } }; @@ -1661,30 +1661,41 @@ vge_link_statchg(void *xsc) { struct vge_softc *sc; struct ifnet *ifp; - struct mii_data *mii; + uint8_t physts; sc = xsc; ifp = sc->vge_ifp; VGE_LOCK_ASSERT(sc); - mii = device_get_softc(sc->vge_miibus); - mii_pollstat(mii); - if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { - if (!(mii->mii_media_status & IFM_ACTIVE)) { + physts = CSR_READ_1(sc, VGE_PHYSTS0); + if ((physts & VGE_PHYSTS_RESETSTS) == 0) { + if ((physts & VGE_PHYSTS_LINK) == 0) { sc->vge_flags &= ~VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_DOWN); - } - } else { - if (mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { + } else { sc->vge_flags |= VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_UP); + CSR_WRITE_1(sc, VGE_CRC2, VGE_CR2_FDX_TXFLOWCTL_ENABLE | + VGE_CR2_FDX_RXFLOWCTL_ENABLE); + if ((physts & VGE_PHYSTS_FDX) != 0) { + if ((physts & VGE_PHYSTS_TXFLOWCAP) != 0) + CSR_WRITE_1(sc, VGE_CRS2, + VGE_CR2_FDX_TXFLOWCTL_ENABLE); + if ((physts & VGE_PHYSTS_RXFLOWCAP) != 0) + CSR_WRITE_1(sc, VGE_CRS2, + VGE_CR2_FDX_RXFLOWCTL_ENABLE); + } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) vge_start_locked(ifp); } } + /* + * Restart MII auto-polling because link state change interrupt + * will disable it. + */ + vge_miipoll_start(sc); } #ifdef DEVICE_POLLING @@ -2131,7 +2142,7 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); sc->vge_flags &= ~VGE_FLAG_LINK; - mii_mediachg(mii); + vge_ifmedia_upd_locked(sc); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -2145,14 +2156,28 @@ static int vge_ifmedia_upd(struct ifnet *ifp) { struct vge_softc *sc; - struct mii_data *mii; int error; sc = ifp->if_softc; VGE_LOCK(sc); + error = vge_ifmedia_upd_locked(sc); + VGE_UNLOCK(sc); + + return (error); +} + +static int +vge_ifmedia_upd_locked(struct vge_softc *sc) +{ + struct mii_data *mii; + struct mii_softc *miisc; + int error; + mii = device_get_softc(sc->vge_miibus); + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + vge_setmedia(sc); error = mii_mediachg(mii); - VGE_UNLOCK(sc); return (error); } @@ -2181,13 +2206,11 @@ vge_ifmedia_sts(struct ifnet *ifp, struc } static void -vge_miibus_statchg(device_t dev) +vge_setmedia(struct vge_softc *sc) { - struct vge_softc *sc; struct mii_data *mii; struct ifmedia_entry *ife; - sc = device_get_softc(dev); mii = device_get_softc(sc->vge_miibus); ife = mii->mii_media.ifm_cur; @@ -2221,7 +2244,7 @@ vge_miibus_statchg(device_t dev) } break; default: - device_printf(dev, "unknown media type: %x\n", + device_printf(sc->vge_dev, "unknown media type: %x\n", IFM_SUBTYPE(ife->ifm_media)); break; } @@ -2774,6 +2797,9 @@ vge_setlinkspeed(struct vge_softc *sc) break; } } + /* Clear forced MAC speed/duplex configuration. */ + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_FDXFORCE); vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_100T2CR, 0); vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_ANAR, ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA); From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20:45: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 1C5BD1065674; Tue, 22 Nov 2011 20:45:12 +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 02B968FC24; Tue, 22 Nov 2011 20:45:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMKjBnE008785; Tue, 22 Nov 2011 20:45:11 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMKjBon008783; Tue, 22 Nov 2011 20:45:11 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111222045.pAMKjBon008783@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 22 Nov 2011 20:45: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: r227836 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 20:45:12 -0000 Author: trociny Date: Tue Nov 22 20:45:11 2011 New Revision: 227836 URL: http://svn.freebsd.org/changeset/base/227836 Log: Retire linprocfs_doargv(). Instead use new functions, proc_getargv() and proc_getenvv(), which were implemented using linprocfs_doargv() as a reference. Suggested by: kib Reviewed by: kib Approved by: des (linprocfs maintainer) MFC after: 2 weeks Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Nov 22 20:45:09 2011 (r227835) +++ head/sys/compat/linprocfs/linprocfs.c Tue Nov 22 20:45:11 2011 (r227836) @@ -919,150 +919,6 @@ linprocfs_doprocroot(PFS_FILL_ARGS) return (0); } -#define MAX_ARGV_STR 512 /* Max number of argv-like strings */ -#define UIO_CHUNK_SZ 256 /* Max chunk size (bytes) for uiomove */ - -static int -linprocfs_doargv(struct thread *td, struct proc *p, struct sbuf *sb, - void (*resolver)(const struct ps_strings, u_long *, int *)) -{ - struct iovec iov; - struct uio tmp_uio; - struct ps_strings pss; - int ret, i, n_elements, elm_len; - u_long addr, pbegin; - char **env_vector, *envp; - char env_string[UIO_CHUNK_SZ]; -#ifdef COMPAT_FREEBSD32 - struct freebsd32_ps_strings pss32; - uint32_t *env_vector32; -#endif - -#define UIO_HELPER(uio, iov, base, len, cnt, offset, sz, flg, rw, td) \ -do { \ - iov.iov_base = (caddr_t)(base); \ - iov.iov_len = (len); \ - uio.uio_iov = &(iov); \ - uio.uio_iovcnt = (cnt); \ - uio.uio_offset = (off_t)(offset); \ - uio.uio_resid = (sz); \ - uio.uio_segflg = (flg); \ - uio.uio_rw = (rw); \ - uio.uio_td = (td); \ -} while (0) - - env_vector = malloc(sizeof(char *) * MAX_ARGV_STR, M_TEMP, M_WAITOK); - -#ifdef COMPAT_FREEBSD32 - env_vector32 = NULL; - if (SV_PROC_FLAG(p, SV_ILP32) != 0) { - env_vector32 = malloc(sizeof(*env_vector32) * MAX_ARGV_STR, - M_TEMP, M_WAITOK); - elm_len = sizeof(int32_t); - envp = (char *)env_vector32; - - UIO_HELPER(tmp_uio, iov, &pss32, sizeof(pss32), 1, - (off_t)(p->p_sysent->sv_psstrings), - sizeof(pss32), UIO_SYSSPACE, UIO_READ, td); - ret = proc_rwmem(p, &tmp_uio); - if (ret != 0) - goto done; - pss.ps_argvstr = PTRIN(pss32.ps_argvstr); - pss.ps_nargvstr = pss32.ps_nargvstr; - pss.ps_envstr = PTRIN(pss32.ps_envstr); - pss.ps_nenvstr = pss32.ps_nenvstr; - } else { -#endif - elm_len = sizeof(char *); - envp = (char *)env_vector; - - UIO_HELPER(tmp_uio, iov, &pss, sizeof(pss), 1, - (off_t)(p->p_sysent->sv_psstrings), - sizeof(pss), UIO_SYSSPACE, UIO_READ, td); - ret = proc_rwmem(p, &tmp_uio); - if (ret != 0) - goto done; -#ifdef COMPAT_FREEBSD32 - } -#endif - - /* Get the array address and the number of elements */ - resolver(pss, &addr, &n_elements); - - /* Consistent with lib/libkvm/kvm_proc.c */ - if (n_elements > MAX_ARGV_STR) { - ret = E2BIG; - goto done; - } - - UIO_HELPER(tmp_uio, iov, envp, n_elements * elm_len, 1, - (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, td); - ret = proc_rwmem(p, &tmp_uio); - if (ret != 0) - goto done; -#ifdef COMPAT_FREEBSD32 - if (env_vector32 != NULL) { - for (i = 0; i < n_elements; i++) - env_vector[i] = PTRIN(env_vector32[i]); - } -#endif - - /* Now we can iterate through the list of strings */ - for (i = 0; i < n_elements; i++) { - pbegin = (vm_offset_t)env_vector[i]; - for (;;) { - UIO_HELPER(tmp_uio, iov, env_string, sizeof(env_string), - 1, pbegin, iov.iov_len, UIO_SYSSPACE, UIO_READ, td); - ret = proc_rwmem(p, &tmp_uio); - if (ret != 0) - goto done; - - if (!strvalid(env_string, UIO_CHUNK_SZ)) { - /* - * We didn't find the end of the string. - * Add the string to the buffer and move - * the pointer. But do not allow strings - * of unlimited length. - */ - sbuf_bcat(sb, env_string, UIO_CHUNK_SZ); - if (sbuf_len(sb) >= ARG_MAX) { - ret = E2BIG; - goto done; - } - pbegin += UIO_CHUNK_SZ; - } else { - sbuf_cat(sb, env_string); - break; - } - } - sbuf_bcat(sb, "", 1); - } -#undef UIO_HELPER - -done: - free(env_vector, M_TEMP); -#ifdef COMPAT_FREEBSD32 - free(env_vector32, M_TEMP); -#endif - return (ret); -} - -static void -ps_string_argv(const struct ps_strings ps, u_long *addr, int *n) -{ - - *addr = (u_long) ps.ps_argvstr; - *n = ps.ps_nargvstr; -} - -static void -ps_string_env(const struct ps_strings ps, u_long *addr, int *n) -{ - - *addr = (u_long) ps.ps_envstr; - *n = ps.ps_nenvstr; -} - /* * Filler function for proc/pid/cmdline */ @@ -1090,9 +946,15 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); return (0); } + + if ((p->p_flag & P_SYSTEM) != 0) { + PROC_UNLOCK(p); + return (0); + } + PROC_UNLOCK(p); - ret = linprocfs_doargv(td, p, sb, ps_string_argv); + ret = proc_getargv(td, p, sb, ARG_MAX); return (ret); } @@ -1118,9 +980,15 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) PROC_UNLOCK(p); return (0); } + + if ((p->p_flag & P_SYSTEM) != 0) { + PROC_UNLOCK(p); + return (0); + } + PROC_UNLOCK(p); - ret = linprocfs_doargv(td, p, sb, ps_string_env); + ret = proc_getenvv(td, p, sb, ARG_MAX); return (ret); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20:57: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 6DA6B1065674; Tue, 22 Nov 2011 20:57:06 +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 5E1968FC1E; Tue, 22 Nov 2011 20:57:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMKv6X4009304; Tue, 22 Nov 2011 20:57:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMKv6VC009302; Tue, 22 Nov 2011 20:57:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111222057.pAMKv6VC009302@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 22 Nov 2011 20:57: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: r227837 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 20:57:06 -0000 Author: yongari Date: Tue Nov 22 20:57:06 2011 New Revision: 227837 URL: http://svn.freebsd.org/changeset/base/227837 Log: Announce flow control capability to underlying PHY driver. Pause timer value is initialized to 0xFFFF. Controller allows just 4 different TX pause thresholds. The lowest possible threshold value looks too aggressive so use next available threshold value. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Tue Nov 22 20:45:11 2011 (r227836) +++ head/sys/dev/vge/if_vge.c Tue Nov 22 20:57:06 2011 (r227837) @@ -1103,7 +1103,7 @@ vge_attach(device_t dev) /* Do MII setup */ error = mii_attach(dev, &sc->vge_miibus, ifp, vge_ifmedia_upd, vge_ifmedia_sts, BMSR_DEFCAPMASK, sc->vge_phyaddr, MII_OFFSET_ANY, - 0); + MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -2112,9 +2112,16 @@ vge_init_locked(struct vge_softc *sc) vge_rxfilter(sc); vge_setvlan(sc); - /* Enable flow control */ - - CSR_WRITE_1(sc, VGE_CRS2, 0x8B); + /* Initialize pause timer. */ + CSR_WRITE_2(sc, VGE_TX_PAUSE_TIMER, 0xFFFF); + /* + * Initialize flow control parameters. + * TX XON high threshold : 48 + * TX pause low threshold : 24 + * Disable hald-duplex flow control + */ + CSR_WRITE_1(sc, VGE_CRC2, 0xFF); + CSR_WRITE_1(sc, VGE_CRS2, VGE_CR2_XON_ENABLE | 0x0B); /* Enable jumbo frame reception (if desired) */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 20:59:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2F401065670; Tue, 22 Nov 2011 20:59:52 +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 E1E518FC0A; Tue, 22 Nov 2011 20:59:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMKxqtg009449; Tue, 22 Nov 2011 20:59:52 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMKxqhW009442; Tue, 22 Nov 2011 20:59:52 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111222059.pAMKxqhW009442@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 22 Nov 2011 20:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227838 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 20:59:53 -0000 Author: trociny Date: Tue Nov 22 20:59:52 2011 New Revision: 227838 URL: http://svn.freebsd.org/changeset/base/227838 Log: Add new options, -e and -x, to display process environment variables and ELF auxiliary vectors. MFC after: 2 weeks Added: head/usr.bin/procstat/procstat_auxv.c (contents, props changed) Modified: head/usr.bin/procstat/Makefile head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_args.c Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Tue Nov 22 20:57:06 2011 (r227837) +++ head/usr.bin/procstat/Makefile Tue Nov 22 20:59:52 2011 (r227838) @@ -4,6 +4,7 @@ PROG= procstat MAN= procstat.1 SRCS= procstat.c \ procstat_args.c \ + procstat_auxv.c \ procstat_basic.c \ procstat_bin.c \ procstat_cred.c \ Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Tue Nov 22 20:57:06 2011 (r227837) +++ head/usr.bin/procstat/procstat.1 Tue Nov 22 20:59:52 2011 (r227838) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2011 +.Dd November 22, 2011 .Dt PROCSTAT 1 .Os .Sh NAME @@ -56,6 +56,8 @@ for printing: Display binary information for the process. .It Fl c Display command line arguments for the process. +.It Fl e +Display environment variables for the process. .It Fl f Display file descriptor information for the process. .It Fl i @@ -73,6 +75,8 @@ Display security credential information Display thread information for the process. .It Fl v Display virtual memory mappings for the process. +.It Fl x +Display ELF auxiliary vector for the process. .El .Pp All options generate output in the format of a table, the first field of Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Tue Nov 22 20:57:06 2011 (r227837) +++ head/usr.bin/procstat/procstat.c Tue Nov 22 20:59:52 2011 (r227838) @@ -39,7 +39,8 @@ #include "procstat.h" -static int aflag, bflag, cflag, fflag, iflag, jflag, kflag, sflag, tflag, vflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, sflag, tflag; +static int vflag, xflag; int hflag, nflag, Cflag; static void @@ -47,8 +48,9 @@ usage(void) { fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " - "[-w interval] [-b | -c | -f | -i | -j | -k | -s | -t | -v]\n"); - fprintf(stderr, " [-a | pid ...]\n"); + "[-w interval] \n"); + fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " + "-s | -t | -v | -x] [-a | pid ...]\n"); exit(EX_USAGE); } @@ -60,6 +62,8 @@ procstat(struct procstat *prstat, struct procstat_bin(kipp); else if (cflag) procstat_args(kipp); + else if (eflag) + procstat_env(kipp); else if (fflag) procstat_files(prstat, kipp); else if (iflag) @@ -74,6 +78,8 @@ procstat(struct procstat *prstat, struct procstat_threads(kipp); else if (vflag) procstat_vm(kipp); + else if (xflag) + procstat_auxv(kipp); else procstat_basic(kipp); } @@ -117,7 +123,7 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CN:M:abcfijkhstvw:")) != -1) { + while ((ch = getopt(argc, argv, "CN:M:abcefijkhstvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -141,6 +147,10 @@ main(int argc, char *argv[]) cflag++; break; + case 'e': + eflag++; + break; + case 'f': fflag++; break; @@ -186,6 +196,10 @@ main(int argc, char *argv[]) interval = l; break; + case 'x': + xflag++; + break; + case '?': default: usage(); @@ -196,7 +210,8 @@ main(int argc, char *argv[]) argv += optind; /* We require that either 0 or 1 mode flags be set. */ - tmp = bflag + cflag + fflag + (kflag ? 1 : 0) + sflag + tflag + vflag; + tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + sflag + tflag + + vflag + xflag; if (!(tmp == 0 || tmp == 1)) usage(); Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Tue Nov 22 20:57:06 2011 (r227837) +++ head/usr.bin/procstat/procstat.h Tue Nov 22 20:59:52 2011 (r227838) @@ -35,9 +35,11 @@ struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); void procstat_args(struct kinfo_proc *kipp); +void procstat_auxv(struct kinfo_proc *kipp); void procstat_basic(struct kinfo_proc *kipp); void procstat_bin(struct kinfo_proc *kipp); void procstat_cred(struct kinfo_proc *kipp); +void procstat_env(struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct kinfo_proc *kipp, int kflag); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Tue Nov 22 20:57:06 2011 (r227837) +++ head/usr.bin/procstat/procstat_args.c Tue Nov 22 20:59:52 2011 (r227838) @@ -42,24 +42,26 @@ static char args[ARG_MAX]; -void -procstat_args(struct kinfo_proc *kipp) +static void +do_args(struct kinfo_proc *kipp, int env) { int error, name[4]; size_t len; char *cp; if (!hflag) - printf("%5s %-16s %-53s\n", "PID", "COMM", "ARGS"); + printf("%5s %-16s %-53s\n", "PID", "COMM", + env ? "ENVIRONMENT" : "ARGS"); name[0] = CTL_KERN; name[1] = KERN_PROC; - name[2] = KERN_PROC_ARGS; + name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; name[3] = kipp->ki_pid; len = sizeof(args); error = sysctl(name, 4, args, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.args: %d", kipp->ki_pid); + if (error < 0 && errno != ESRCH && errno != EPERM) { + warn("sysctl: kern.proc.%s: %d: %d", env ? "env" : "args", + kipp->ki_pid, errno); return; } if (error < 0) @@ -75,3 +77,15 @@ procstat_args(struct kinfo_proc *kipp) printf("%s%s", cp != args ? " " : "", cp); printf("\n"); } + +void +procstat_args(struct kinfo_proc *kipp) +{ + do_args(kipp, 0); +} + +void +procstat_env(struct kinfo_proc *kipp) +{ + do_args(kipp, 1); +} Added: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/procstat_auxv.c Tue Nov 22 20:59:52 2011 (r227838) @@ -0,0 +1,180 @@ +/*- + * Copyright (c) 2011 Mikolaj Golub + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "procstat.h" + +static char auxv[sizeof(Elf_Auxinfo) * 256]; + +void +procstat_auxv(struct kinfo_proc *kipp) +{ + Elf_Auxinfo *aux; + int i, error, name[4]; + size_t len; + + if (!hflag) + printf("%5s %-16s %-53s\n", "PID", "COMM", "AUXV"); + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_AUXV; + name[3] = kipp->ki_pid; + len = sizeof(auxv); + error = sysctl(name, 4, auxv, &len, NULL, 0); + if (error < 0 && errno != ESRCH) { + warn("sysctl: kern.proc.auxv: %d: %d", kipp->ki_pid, errno); + return; + } + if (error < 0) + return; + printf("%5d ", kipp->ki_pid); + printf("%-16s", kipp->ki_comm); + if (len == 0) { + printf(" -\n"); + return; + } + for (aux = (Elf_Auxinfo *)auxv, i = 0; i < 256; i++, aux++) { + switch(aux->a_type) { + case AT_NULL: + printf(" (%d)\n", i + 1); + return; + case AT_IGNORE: + printf(" AT_IGNORE=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_EXECFD: + printf(" AT_EXECFD=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_PHDR: + printf(" AT_PHDR=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_PHENT: + printf(" AT_PHENT=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_PHNUM: + printf(" AT_PHNUM=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_PAGESZ: + printf(" AT_PAGESZ=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_BASE: + printf(" AT_BASE=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_FLAGS: + printf(" AT_FLAGS=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_ENTRY: + printf(" AT_ENTRY=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_NOTELF: + printf(" AT_NOTELF=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_UID: + printf(" AT_UID=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_EUID: + printf(" AT_EUID=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_GID: + printf(" AT_GID=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_EGID: + printf(" AT_EGID=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_EXECPATH: + printf(" AT_EXECPATH=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_CANARY: + printf(" AT_CANARY=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_CANARYLEN: + printf(" AT_CANARYLEN=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_OSRELDATE: + printf(" AT_OSRELDATE=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_NCPUS: + printf(" AT_NCPUS=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_PAGESIZES: + printf(" AT_PAGESIZES=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_PAGESIZESLEN: + printf(" AT_PAGESIZESLEN=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_STACKPROT: + printf(" AT_STACKPROT=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + case AT_COUNT: + printf(" AT_COUNT=0x%lu", + (unsigned long)aux->a_un.a_val); + break; + default: + printf(" %ld=0x%lu", (long)aux->a_type, + (unsigned long)aux->a_un.a_val); + break; + } + } + printf("\n"); +} + From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:12: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 F20821065670; Tue, 22 Nov 2011 21:12:28 +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 E13518FC14; Tue, 22 Nov 2011 21:12:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLCSe8009914; Tue, 22 Nov 2011 21:12:28 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLCSr8009911; Tue, 22 Nov 2011 21:12:28 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111222112.pAMLCSr8009911@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 22 Nov 2011 21:12: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: r227839 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:12:29 -0000 Author: trociny Date: Tue Nov 22 21:12:28 2011 New Revision: 227839 URL: http://svn.freebsd.org/changeset/base/227839 Log: Now kvm_getenvv() and kvm_getargv() don't need procfs(5). MFC after: 2 weeks Modified: head/lib/libkvm/kvm_getprocs.3 head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/kvm_getprocs.3 ============================================================================== --- head/lib/libkvm/kvm_getprocs.3 Tue Nov 22 20:59:52 2011 (r227838) +++ head/lib/libkvm/kvm_getprocs.3 Tue Nov 22 21:12:28 2011 (r227839) @@ -32,7 +32,7 @@ .\" @(#)kvm_getprocs.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 27, 2003 +.Dd November 22, 2011 .Dt KVM_GETPROCS 3 .Os .Sh NAME @@ -172,10 +172,3 @@ on failure. .Xr kvm_write 3 .Sh BUGS These routines do not belong in the kvm interface. -.Pp -In order for -.Xr kvm_getenvv 3 -to function correctly, -.Xr procfs 5 -must be mounted on -.Pa /proc . Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Tue Nov 22 20:59:52 2011 (r227838) +++ head/lib/libkvm/kvm_proc.c Tue Nov 22 21:12:28 2011 (r227839) @@ -72,9 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include #include @@ -623,276 +620,16 @@ _kvm_realloc(kvm_t *kd, void *p, size_t return (np); } -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /* - * Read in an argument vector from the user address space of process kp. - * addr if the user-space base address of narg null-terminated contiguous - * strings. This is used to read in both the command arguments and - * environment strings. Read at most maxcnt characters of strings. + * Get the command args or environment. */ static char ** -kvm_argv(kvm_t *kd, const struct kinfo_proc *kp, u_long addr, int narg, - int maxcnt) -{ - char *np, *cp, *ep, *ap; - u_long oaddr = -1; - int len, cc; - char **argv; - - /* - * Check that there aren't an unreasonable number of arguments, - * and that the address is in user space. Special test for - * VM_MIN_ADDRESS as it evaluates to zero, but is not a simple zero - * constant for some archs. We cannot use the pre-processor here and - * for some archs the compiler would trigger a signedness warning. - */ - if (narg > 512 || addr + 1 < VM_MIN_ADDRESS + 1 || addr >= VM_MAXUSER_ADDRESS) - return (0); - - /* - * kd->argv : work space for fetching the strings from the target - * process's space, and is converted for returning to caller - */ - if (kd->argv == 0) { - /* - * Try to avoid reallocs. - */ - kd->argc = MAX(narg + 1, 32); - kd->argv = (char **)_kvm_malloc(kd, kd->argc * - sizeof(*kd->argv)); - if (kd->argv == 0) - return (0); - } else if (narg + 1 > kd->argc) { - kd->argc = MAX(2 * kd->argc, narg + 1); - kd->argv = (char **)_kvm_realloc(kd, kd->argv, kd->argc * - sizeof(*kd->argv)); - if (kd->argv == 0) - return (0); - } - /* - * kd->argspc : returned to user, this is where the kd->argv - * arrays are left pointing to the collected strings. - */ - if (kd->argspc == 0) { - kd->argspc = (char *)_kvm_malloc(kd, PAGE_SIZE); - if (kd->argspc == 0) - return (0); - kd->arglen = PAGE_SIZE; - } - /* - * kd->argbuf : used to pull in pages from the target process. - * the strings are copied out of here. - */ - if (kd->argbuf == 0) { - kd->argbuf = (char *)_kvm_malloc(kd, PAGE_SIZE); - if (kd->argbuf == 0) - return (0); - } - - /* Pull in the target process'es argv vector */ - cc = sizeof(char *) * narg; - if (kvm_uread(kd, kp, addr, (char *)kd->argv, cc) != cc) - return (0); - /* - * ap : saved start address of string we're working on in kd->argspc - * np : pointer to next place to write in kd->argspc - * len: length of data in kd->argspc - * argv: pointer to the argv vector that we are hunting around the - * target process space for, and converting to addresses in - * our address space (kd->argspc). - */ - ap = np = kd->argspc; - argv = kd->argv; - len = 0; - /* - * Loop over pages, filling in the argument vector. - * Note that the argv strings could be pointing *anywhere* in - * the user address space and are no longer contiguous. - * Note that *argv is modified when we are going to fetch a string - * that crosses a page boundary. We copy the next part of the string - * into to "np" and eventually convert the pointer. - */ - while (argv < kd->argv + narg && *argv != 0) { - - /* get the address that the current argv string is on */ - addr = (u_long)*argv & ~(PAGE_SIZE - 1); - - /* is it the same page as the last one? */ - if (addr != oaddr) { - if (kvm_uread(kd, kp, addr, kd->argbuf, PAGE_SIZE) != - PAGE_SIZE) - return (0); - oaddr = addr; - } - - /* offset within the page... kd->argbuf */ - addr = (u_long)*argv & (PAGE_SIZE - 1); - - /* cp = start of string, cc = count of chars in this chunk */ - cp = kd->argbuf + addr; - cc = PAGE_SIZE - addr; - - /* dont get more than asked for by user process */ - if (maxcnt > 0 && cc > maxcnt - len) - cc = maxcnt - len; - - /* pointer to end of string if we found it in this page */ - ep = memchr(cp, '\0', cc); - if (ep != 0) - cc = ep - cp + 1; - /* - * at this point, cc is the count of the chars that we are - * going to retrieve this time. we may or may not have found - * the end of it. (ep points to the null if the end is known) - */ - - /* will we exceed the malloc/realloced buffer? */ - if (len + cc > kd->arglen) { - int off; - char **pp; - char *op = kd->argspc; - - kd->arglen *= 2; - kd->argspc = (char *)_kvm_realloc(kd, kd->argspc, - kd->arglen); - if (kd->argspc == 0) - return (0); - /* - * Adjust argv pointers in case realloc moved - * the string space. - */ - off = kd->argspc - op; - for (pp = kd->argv; pp < argv; pp++) - *pp += off; - ap += off; - np += off; - } - /* np = where to put the next part of the string in kd->argspc*/ - /* np is kinda redundant.. could use "kd->argspc + len" */ - memcpy(np, cp, cc); - np += cc; /* inc counters */ - len += cc; - - /* - * if end of string found, set the *argv pointer to the - * saved beginning of string, and advance. argv points to - * somewhere in kd->argv.. This is initially relative - * to the target process, but when we close it off, we set - * it to point in our address space. - */ - if (ep != 0) { - *argv++ = ap; - ap = np; - } else { - /* update the address relative to the target process */ - *argv += cc; - } - - if (maxcnt > 0 && len >= maxcnt) { - /* - * We're stopping prematurely. Terminate the - * current string. - */ - if (ep == 0) { - *np = '\0'; - *argv++ = ap; - } - break; - } - } - /* Make sure argv is terminated. */ - *argv = 0; - return (kd->argv); -} - -static void -ps_str_a(struct ps_strings *p, u_long *addr, int *n) -{ - *addr = (u_long)p->ps_argvstr; - *n = p->ps_nargvstr; -} - -static void -ps_str_e (struct ps_strings *p, u_long *addr, int *n) -{ - *addr = (u_long)p->ps_envstr; - *n = p->ps_nenvstr; -} - -/* - * Determine if the proc indicated by p is still active. - * This test is not 100% foolproof in theory, but chances of - * being wrong are very low. - */ -static int -proc_verify(const struct kinfo_proc *curkp) -{ - struct kinfo_proc newkp; - int mib[4]; - size_t len; - - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PID; - mib[3] = curkp->ki_pid; - len = sizeof(newkp); - if (sysctl(mib, 4, &newkp, &len, NULL, 0) == -1) - return (0); - return (curkp->ki_pid == newkp.ki_pid && - (newkp.ki_stat != SZOMB || curkp->ki_stat == SZOMB)); -} - -static char ** -kvm_doargv(kvm_t *kd, const struct kinfo_proc *kp, int nchr, - void (*info)(struct ps_strings *, u_long *, int *)) -{ - char **ap; - u_long addr; - int cnt; - static struct ps_strings arginfo; - static u_long ps_strings; - size_t len; - - if (ps_strings == 0) { - len = sizeof(ps_strings); - if (sysctlbyname("kern.ps_strings", &ps_strings, &len, NULL, - 0) == -1) - ps_strings = PS_STRINGS; - } - - /* - * Pointers are stored at the top of the user stack. - */ - if (kp->ki_stat == SZOMB || - kvm_uread(kd, kp, ps_strings, (char *)&arginfo, - sizeof(arginfo)) != sizeof(arginfo)) - return (0); - - (*info)(&arginfo, &addr, &cnt); - if (cnt == 0) - return (0); - ap = kvm_argv(kd, kp, addr, cnt, nchr); - /* - * For live kernels, make sure this process didn't go away. - */ - if (ap != 0 && ISALIVE(kd) && !proc_verify(kp)) - ap = 0; - return (ap); -} - -/* - * Get the command args. This code is now machine independent. - */ -char ** -kvm_getargv(kvm_t *kd, const struct kinfo_proc *kp, int nchr) +kvm_argv(kvm_t *kd, const struct kinfo_proc *kp, int env, int nchr) { int oid[4]; int i; size_t bufsz; - static unsigned long buflen; + static int buflen; static char *buf, *p; static char **bufp; static int argc; @@ -903,24 +640,28 @@ kvm_getargv(kvm_t *kd, const struct kinf return (0); } - if (!buflen) { - bufsz = sizeof(buflen); - i = sysctlbyname("kern.ps_arg_cache_limit", - &buflen, &bufsz, NULL, 0); - if (i == -1) { - buflen = 0; - } else { - buf = malloc(buflen); - if (buf == NULL) - buflen = 0; - argc = 32; - bufp = malloc(sizeof(char *) * argc); + if (nchr == 0 || nchr > ARG_MAX) + nchr = ARG_MAX; + if (buflen == 0) { + buf = malloc(nchr); + if (buf == NULL) { + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (0); + } + buflen = nchr; + argc = 32; + bufp = malloc(sizeof(char *) * argc); + } else if (nchr > buflen) { + p = realloc(buf, nchr); + if (p != NULL) { + buf = p; + buflen = nchr; } } if (buf != NULL) { oid[0] = CTL_KERN; oid[1] = KERN_PROC; - oid[2] = KERN_PROC_ARGS; + oid[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; oid[3] = kp->ki_pid; bufsz = buflen; i = sysctl(oid, 4, buf, &bufsz, 0, 0); @@ -940,65 +681,17 @@ kvm_getargv(kvm_t *kd, const struct kinf return (bufp); } } - if (kp->ki_flag & P_SYSTEM) - return (NULL); - return (kvm_doargv(kd, kp, nchr, ps_str_a)); + return (NULL); } char ** -kvm_getenvv(kvm_t *kd, const struct kinfo_proc *kp, int nchr) +kvm_getargv(kvm_t *kd, const struct kinfo_proc *kp, int nchr) { - return (kvm_doargv(kd, kp, nchr, ps_str_e)); + return (kvm_argv(kd, kp, 0, nchr)); } -/* - * Read from user space. The user context is given by p. - */ -ssize_t -kvm_uread(kvm_t *kd, const struct kinfo_proc *kp, u_long uva, char *buf, - size_t len) +char ** +kvm_getenvv(kvm_t *kd, const struct kinfo_proc *kp, int nchr) { - char *cp; - char procfile[MAXPATHLEN]; - ssize_t amount; - int fd; - - if (!ISALIVE(kd)) { - _kvm_err(kd, kd->program, - "cannot read user space from dead kernel"); - return (0); - } - - sprintf(procfile, "/proc/%d/mem", kp->ki_pid); - fd = open(procfile, O_RDONLY, 0); - if (fd < 0) { - _kvm_err(kd, kd->program, "cannot open %s", procfile); - return (0); - } - - cp = buf; - while (len > 0) { - errno = 0; - if (lseek(fd, (off_t)uva, 0) == -1 && errno != 0) { - _kvm_err(kd, kd->program, "invalid address (%lx) in %s", - uva, procfile); - break; - } - amount = read(fd, cp, len); - if (amount < 0) { - _kvm_syserr(kd, kd->program, "error reading %s", - procfile); - break; - } - if (amount == 0) { - _kvm_err(kd, kd->program, "EOF reading %s", procfile); - break; - } - cp += amount; - uva += amount; - len -= amount; - } - - close(fd); - return ((ssize_t)(cp - buf)); + return (kvm_argv(kd, kp, 1, nchr)); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:14: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 AA376106564A; Tue, 22 Nov 2011 21:14:46 +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 815598FC12; Tue, 22 Nov 2011 21:14:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLEkua010014; Tue, 22 Nov 2011 21:14:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLEkuU010011; Tue, 22 Nov 2011 21:14:46 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111222114.pAMLEkuU010011@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 22 Nov 2011 21:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227840 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:14:46 -0000 Author: trociny Date: Tue Nov 22 21:14:46 2011 New Revision: 227840 URL: http://svn.freebsd.org/changeset/base/227840 Log: No need in procfs(5). MFC after: 2 weeks Modified: head/bin/ps/ps.1 head/bin/ps/ps.c Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Nov 22 21:12:28 2011 (r227839) +++ head/bin/ps/ps.1 Tue Nov 22 21:14:46 2011 (r227840) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 30, 2011 +.Dd November 22, 2011 .Dt PS 1 .Os .Sh NAME @@ -686,9 +686,6 @@ attempts to automatically determine the .Bl -tag -width ".Pa /boot/kernel/kernel" -compact .It Pa /boot/kernel/kernel default system namelist -.It Pa /proc -the mount point of -.Xr procfs 5 .El .Sh SEE ALSO .Xr kill 1 , Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Tue Nov 22 21:12:28 2011 (r227839) +++ head/bin/ps/ps.c Tue Nov 22 21:14:46 2011 (r227840) @@ -130,7 +130,6 @@ struct listinfo { } l; }; -static int check_procfs(void); static int addelem_gid(struct listinfo *, const char *); static int addelem_pid(struct listinfo *, const char *); static int addelem_tty(struct listinfo *, const char *); @@ -411,14 +410,6 @@ main(int argc, char *argv[]) argv += optind; /* - * If the user specified ps -e then they want a copy of the process - * environment kvm_getenvv(3) attempts to open /proc//mem. - * Check to make sure that procfs is mounted on /proc, otherwise - * print a warning informing the user that output will be incomplete. - */ - if (needenv == 1 && check_procfs() == 0) - warnx("Process environment requires procfs(5)"); - /* * If there arguments after processing all the options, attempt * to treat them as a list of process ids. */ @@ -1360,18 +1351,6 @@ kludge_oldps_options(const char *optlist return (newopts); } -static int -check_procfs(void) -{ - struct statfs mnt; - - if (statfs("/proc", &mnt) < 0) - return (0); - if (strcmp(mnt.f_fstypename, "procfs") != 0) - return (0); - return (1); -} - static void usage(void) { From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:18: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 B797B106566C; Tue, 22 Nov 2011 21:18:14 +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 A6C3C8FC0A; Tue, 22 Nov 2011 21:18:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLIERp010166; Tue, 22 Nov 2011 21:18:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLIETt010164; Tue, 22 Nov 2011 21:18:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201111222118.pAMLIETt010164@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 22 Nov 2011 21:18: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: r227841 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 21:18:14 -0000 Author: des Date: Tue Nov 22 21:18:14 2011 New Revision: 227841 URL: http://svn.freebsd.org/changeset/base/227841 Log: Remove libpam from _prebuild_libs. This should unbreak the -jX build. MFC after: 3 weeks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Nov 22 21:14:46 2011 (r227840) +++ head/Makefile.inc1 Tue Nov 22 21:18:14 2011 (r227841) @@ -1235,8 +1235,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_cddl_lib_libumem} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ - ${_secure_lib_libssl} \ - lib/libpam + ${_secure_lib_libssl} .if ${MK_LIBTHR} != "no" _lib_libthr= lib/libthr From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:22: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 EC266106566B; Tue, 22 Nov 2011 21:22:06 +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 DC7508FC0A; Tue, 22 Nov 2011 21:22:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLM6mk010348; Tue, 22 Nov 2011 21:22:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLM66p010346; Tue, 22 Nov 2011 21:22:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111222122.pAMLM66p010346@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 22 Nov 2011 21:22: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: r227842 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 21:22:07 -0000 Author: yongari Date: Tue Nov 22 21:22:06 2011 New Revision: 227842 URL: http://svn.freebsd.org/changeset/base/227842 Log: For IP1001 PHY, do not set multi-port device(MASTER). Ideally this bit should not affect link establishment process of auto-negotiation if manual configuration is not used, which is true in auto-negotiation. However it seems setting this bit interfere with IP1001 PHY's down-shifting feature such that establishing a 10/100Mbps link failed when 1000baseT link is not available during auto-negotiation process. Tested by: Andrey Smagin mail dot ru > Modified: head/sys/dev/mii/ip1000phy.c Modified: head/sys/dev/mii/ip1000phy.c ============================================================================== --- head/sys/dev/mii/ip1000phy.c Tue Nov 22 21:18:14 2011 (r227841) +++ head/sys/dev/mii/ip1000phy.c Tue Nov 22 21:22:06 2011 (r227842) @@ -324,7 +324,8 @@ ip1000phy_mii_phy_auto(struct mii_softc PHY_WRITE(sc, IP1000PHY_MII_ANAR, reg | IP1000PHY_ANAR_CSMA); reg = IP1000PHY_1000CR_1000T | IP1000PHY_1000CR_1000T_FDX; - reg |= IP1000PHY_1000CR_MASTER; + if (sc->mii_mpd_model != MII_MODEL_xxICPLUS_IP1001) + reg |= IP1000PHY_1000CR_MASTER; PHY_WRITE(sc, IP1000PHY_MII_1000CR, reg); PHY_WRITE(sc, IP1000PHY_MII_BMCR, (IP1000PHY_BMCR_FDX | IP1000PHY_BMCR_AUTOEN | IP1000PHY_BMCR_STARTNEG)); From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:24:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 650BB10656A6; Tue, 22 Nov 2011 21:24:13 +0000 (UTC) Date: Tue, 22 Nov 2011 21:24:13 +0000 From: Alexander Best To: Mikolaj Golub Message-ID: <20111122212413.GA44084@freebsd.org> References: <201111222114.pAMLEkuU010011@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111222114.pAMLEkuU010011@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227840 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:24:13 -0000 On Tue Nov 22 11, Mikolaj Golub wrote: > Author: trociny > Date: Tue Nov 22 21:14:46 2011 > New Revision: 227840 > URL: http://svn.freebsd.org/changeset/base/227840 > > Log: > No need in procfs(5). > > MFC after: 2 weeks > > Modified: > head/bin/ps/ps.1 > head/bin/ps/ps.c > > Modified: head/bin/ps/ps.1 > ============================================================================== > --- head/bin/ps/ps.1 Tue Nov 22 21:12:28 2011 (r227839) > +++ head/bin/ps/ps.1 Tue Nov 22 21:14:46 2011 (r227840) > @@ -29,7 +29,7 @@ > .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 > .\" $FreeBSD$ > .\" > -.Dd October 30, 2011 > +.Dd November 22, 2011 > .Dt PS 1 > .Os > .Sh NAME > @@ -686,9 +686,6 @@ attempts to automatically determine the > .Bl -tag -width ".Pa /boot/kernel/kernel" -compact > .It Pa /boot/kernel/kernel > default system namelist > -.It Pa /proc > -the mount point of > -.Xr procfs 5 are these references to procfs still necessary in the ps(1) man page? 1) " The process file system (see procfs(5)) should be mounted when ps is exe- cuted, otherwise not all information will be available. " and 2) " SEE ALSO kill(1), pgrep(1), pkill(1), procstat(1), w(1), kvm(3), strftime(3), mac(4), procfs(5), pstat(8), sysctl(8), mutex(9) " ? cheers. alex > .El > .Sh SEE ALSO > .Xr kill 1 , > > Modified: head/bin/ps/ps.c > ============================================================================== > --- head/bin/ps/ps.c Tue Nov 22 21:12:28 2011 (r227839) > +++ head/bin/ps/ps.c Tue Nov 22 21:14:46 2011 (r227840) > @@ -130,7 +130,6 @@ struct listinfo { > } l; > }; > > -static int check_procfs(void); > static int addelem_gid(struct listinfo *, const char *); > static int addelem_pid(struct listinfo *, const char *); > static int addelem_tty(struct listinfo *, const char *); > @@ -411,14 +410,6 @@ main(int argc, char *argv[]) > argv += optind; > > /* > - * If the user specified ps -e then they want a copy of the process > - * environment kvm_getenvv(3) attempts to open /proc//mem. > - * Check to make sure that procfs is mounted on /proc, otherwise > - * print a warning informing the user that output will be incomplete. > - */ > - if (needenv == 1 && check_procfs() == 0) > - warnx("Process environment requires procfs(5)"); > - /* > * If there arguments after processing all the options, attempt > * to treat them as a list of process ids. > */ > @@ -1360,18 +1351,6 @@ kludge_oldps_options(const char *optlist > return (newopts); > } > > -static int > -check_procfs(void) > -{ > - struct statfs mnt; > - > - if (statfs("/proc", &mnt) < 0) > - return (0); > - if (strcmp(mnt.f_fstypename, "procfs") != 0) > - return (0); > - return (1); > -} > - > static void > usage(void) > { From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:28: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 7989C106564A; Tue, 22 Nov 2011 21:28:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 653D28FC12; Tue, 22 Nov 2011 21:28:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLSLW4010625; Tue, 22 Nov 2011 21:28:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLSKqa010571; Tue, 22 Nov 2011 21:28:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111222128.pAMLSKqa010571@svn.freebsd.org> From: Marius Strobl Date: Tue, 22 Nov 2011 21:28: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: r227843 - in head/sys: amd64/amd64 arm/econa arm/mv arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 dev/aac dev/acpi_support dev/acpica dev/amr dev/arcmsr dev/bce dev/bfe dev/bge ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 21:28:21 -0000 Author: marius Date: Tue Nov 22 21:28:20 2011 New Revision: 227843 URL: http://svn.freebsd.org/changeset/base/227843 Log: - There's no need to overwrite the default device method with the default one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Modified: head/sys/amd64/amd64/legacy.c head/sys/arm/econa/ehci_ebus.c head/sys/arm/econa/ohci_ec.c head/sys/arm/mv/mv_pci.c head/sys/arm/xscale/i80321/i80321_pci.c head/sys/arm/xscale/i8134x/i81342_pci.c head/sys/arm/xscale/ixp425/ixp425_pci.c head/sys/dev/aac/aac_pci.c head/sys/dev/acpi_support/acpi_wmi.c head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_isab.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/amr/amr_pci.c head/sys/dev/arcmsr/arcmsr.c head/sys/dev/bce/if_bce.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bge/if_bge.c head/sys/dev/bm/if_bm.c head/sys/dev/bxe/if_bxe.c head/sys/dev/cas/if_cas.c head/sys/dev/cesa/cesa.c head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/dc/if_dc.c head/sys/dev/eisa/eisaconf.c head/sys/dev/et/if_et.c head/sys/dev/fb/fb.c head/sys/dev/firewire/firewire.c head/sys/dev/firewire/fwohci_pci.c head/sys/dev/gem/if_gem_pci.c head/sys/dev/gem/if_gem_sbus.c head/sys/dev/gpio/gpiobus.c head/sys/dev/hifn/hifn7751.c head/sys/dev/hme/if_hme_pci.c head/sys/dev/hme/if_hme_sbus.c head/sys/dev/ichsmb/ichsmb_pci.c head/sys/dev/ida/ida_pci.c head/sys/dev/if_ndis/if_ndis_usb.c head/sys/dev/iicbus/iicbus.c head/sys/dev/iicbus/iicsmb.c head/sys/dev/lge/if_lge.c head/sys/dev/mca/mca_bus.c head/sys/dev/mfi/mfi_pci.c head/sys/dev/mii/mii.c head/sys/dev/mlx/mlx_pci.c head/sys/dev/mps/mps_pci.c head/sys/dev/msk/if_msk.c head/sys/dev/nfe/if_nfe.c head/sys/dev/nge/if_nge.c head/sys/dev/nve/if_nve.c head/sys/dev/pccbb/pccbb_isa.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/pci/eisa_pci.c head/sys/dev/pci/isa_pci.c head/sys/dev/pci/pci_pci.c head/sys/dev/pcn/if_pcn.c head/sys/dev/ppbus/lpbb.c head/sys/dev/puc/puc_pccard.c head/sys/dev/puc/puc_pci.c head/sys/dev/quicc/quicc_bfe_fdt.c head/sys/dev/re/if_re.c head/sys/dev/rt/if_rt.c head/sys/dev/safe/safe.c head/sys/dev/scc/scc_bfe_ebus.c head/sys/dev/scc/scc_bfe_macio.c head/sys/dev/scc/scc_bfe_quicc.c head/sys/dev/scc/scc_bfe_sbus.c head/sys/dev/sec/sec.c head/sys/dev/sf/if_sf.c head/sys/dev/sfxge/sfxge.c head/sys/dev/sge/if_sge.c head/sys/dev/siba/siba_pcib.c head/sys/dev/sis/if_sis.c head/sys/dev/sk/if_sk.c head/sys/dev/smbus/smbus.c head/sys/dev/sound/isa/gusc.c head/sys/dev/sound/isa/sbc.c head/sys/dev/sound/pci/csa.c head/sys/dev/sound/pci/fm801.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/spibus/spibus.c head/sys/dev/ste/if_ste.c head/sys/dev/tl/if_tl.c head/sys/dev/tsec/if_tsec_fdt.c head/sys/dev/twa/tw_osl_freebsd.c head/sys/dev/twe/twe_freebsd.c head/sys/dev/tws/tws.c head/sys/dev/ubsec/ubsec.c head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/atmegadci_atmelarm.c head/sys/dev/usb/controller/ehci_ixp4xx.c head/sys/dev/usb/controller/ehci_mv.c head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/musb_otg_atmelarm.c head/sys/dev/usb/controller/ohci_atmelarm.c head/sys/dev/usb/controller/ohci_pci.c head/sys/dev/usb/controller/ohci_s3c24x0.c head/sys/dev/usb/controller/uhci_pci.c head/sys/dev/usb/controller/uss820dci_atmelarm.c head/sys/dev/usb/controller/xhci_pci.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/vge/if_vge.c head/sys/dev/vr/if_vr.c head/sys/dev/wb/if_wb.c head/sys/dev/xen/pcifront/pcifront.c head/sys/dev/xl/if_xl.c head/sys/i386/i386/legacy.c head/sys/isa/vga_isa.c head/sys/mips/adm5120/admpci.c head/sys/mips/atheros/apb.c head/sys/mips/atheros/ar71xx_ehci.c head/sys/mips/atheros/ar71xx_ohci.c head/sys/mips/atheros/ar71xx_pci.c head/sys/mips/atheros/ar724x_pci.c head/sys/mips/atheros/if_arge.c head/sys/mips/cavium/octopci.c head/sys/mips/cavium/usb/octusb_octeon.c head/sys/mips/idt/idtpci.c head/sys/mips/idt/if_kr.c head/sys/mips/malta/gt.c head/sys/mips/malta/gt_pci.c head/sys/mips/nlm/xlp_pci.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/sec/rmisec.c head/sys/mips/rmi/xlr_pci.c head/sys/mips/rmi/xls_ehci.c head/sys/mips/rt305x/rt305x_dotg.c head/sys/pci/if_rl.c head/sys/pci/intpm.c head/sys/pci/viapm.c head/sys/powerpc/aim/nexus.c head/sys/powerpc/mambo/mambo.c head/sys/powerpc/mpc85xx/nexus.c head/sys/powerpc/mpc85xx/pci_fdt.c head/sys/powerpc/ofw/ofw_cpu.c head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/cuda.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/pmu.c head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/ps3/ehci_ps3.c head/sys/powerpc/ps3/ohci_ps3.c head/sys/powerpc/ps3/ps3bus.c head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/sbbc.c head/sys/sparc64/pci/schizo.c head/sys/x86/pci/pci_bus.c head/sys/x86/pci/qpi.c head/sys/x86/x86/mptable_pci.c head/sys/xen/xenstore/xenstore.c Modified: head/sys/amd64/amd64/legacy.c ============================================================================== --- head/sys/amd64/amd64/legacy.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/amd64/amd64/legacy.c Tue Nov 22 21:28:20 2011 (r227843) @@ -237,19 +237,17 @@ static device_method_t cpu_methods[] = { /* Bus interface */ DEVMETHOD(bus_add_child, cpu_add_child), DEVMETHOD(bus_read_ivar, cpu_read_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_get_resource_list, cpu_get_rlist), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - { 0, 0 } + DEVMETHOD_END }; static driver_t cpu_driver = { Modified: head/sys/arm/econa/ehci_ebus.c ============================================================================== --- head/sys/arm/econa/ehci_ebus.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/arm/econa/ehci_ebus.c Tue Nov 22 21:28:20 2011 (r227843) @@ -281,10 +281,7 @@ static device_method_t ehci_methods[] = DEVMETHOD(device_resume, ehci_ebus_resume), DEVMETHOD(device_shutdown, ehci_ebus_shutdown), - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - - {0, 0} + DEVMETHOD_END }; static driver_t ehci_driver = { Modified: head/sys/arm/econa/ohci_ec.c ============================================================================== --- head/sys/arm/econa/ohci_ec.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/arm/econa/ohci_ec.c Tue Nov 22 21:28:20 2011 (r227843) @@ -222,10 +222,7 @@ static device_method_t ohci_methods[] = DEVMETHOD(device_detach, ohci_ec_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - - {0, 0} + DEVMETHOD_END }; static driver_t ohci_driver = { Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/arm/mv/mv_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -171,7 +171,6 @@ static device_method_t mv_pcib_methods[] DEVMETHOD(device_attach, mv_pcib_attach), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, mv_pcib_read_ivar), DEVMETHOD(bus_write_ivar, mv_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, mv_pcib_alloc_resource), @@ -194,7 +193,7 @@ static device_method_t mv_pcib_methods[] DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + DEVMETHOD_END }; static driver_t mv_pcib_driver = { Modified: head/sys/arm/xscale/i80321/i80321_pci.c ============================================================================== --- head/sys/arm/xscale/i80321/i80321_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/arm/xscale/i80321/i80321_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -373,7 +373,6 @@ static device_method_t i80321_pci_method DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, i80321_read_ivar), DEVMETHOD(bus_write_ivar, i80321_write_ivar), DEVMETHOD(bus_alloc_resource, i80321_pci_alloc_resource), @@ -389,7 +388,7 @@ static device_method_t i80321_pci_method DEVMETHOD(pcib_write_config, i80321_pci_write_config), DEVMETHOD(pcib_route_interrupt, machdep_pci_route_interrupt), - {0, 0} + DEVMETHOD_END }; static driver_t i80321_pci_driver = { Modified: head/sys/arm/xscale/i8134x/i81342_pci.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/arm/xscale/i8134x/i81342_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -516,7 +516,6 @@ static device_method_t i81342_pci_method DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, i81342_read_ivar), DEVMETHOD(bus_write_ivar, i81342_write_ivar), DEVMETHOD(bus_alloc_resource, i81342_pci_alloc_resource), @@ -532,7 +531,7 @@ static device_method_t i81342_pci_method DEVMETHOD(pcib_write_config, i81342_pci_write_config), DEVMETHOD(pcib_route_interrupt, i81342_pci_route_interrupt), - {0, 0} + DEVMETHOD_END }; static driver_t i81342_pci_driver = { Modified: head/sys/arm/xscale/ixp425/ixp425_pci.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/arm/xscale/ixp425/ixp425_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -445,7 +445,6 @@ static device_method_t ixppcib_methods[] DEVMETHOD(device_attach, ixppcib_attach), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, ixppcib_read_ivar), DEVMETHOD(bus_write_ivar, ixppcib_write_ivar), DEVMETHOD(bus_setup_intr, ixppcib_setup_intr), @@ -462,7 +461,7 @@ static device_method_t ixppcib_methods[] DEVMETHOD(pcib_write_config, ixppcib_write_config), DEVMETHOD(pcib_route_interrupt, ixppcib_route_interrupt), - {0, 0}, + DEVMETHOD_END }; static driver_t ixppcib_driver = { Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/aac/aac_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -68,9 +68,7 @@ static device_method_t aac_methods[] = { DEVMETHOD(device_suspend, aac_suspend), DEVMETHOD(device_resume, aac_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + DEVMETHOD_END }; static driver_t aac_pci_driver = { Modified: head/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- head/sys/dev/acpi_support/acpi_wmi.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/acpi_support/acpi_wmi.c Tue Nov 22 21:28:20 2011 (r227843) @@ -175,7 +175,6 @@ static device_method_t acpi_wmi_methods[ /* bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* acpi_wmi interface */ DEVMETHOD(acpi_wmi_provides_guid_string, @@ -189,7 +188,7 @@ static device_method_t acpi_wmi_methods[ DEVMETHOD(acpi_wmi_get_block, acpi_wmi_get_block_method), DEVMETHOD(acpi_wmi_set_block, acpi_wmi_set_block_method), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_wmi_driver = { Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/acpica/acpi_cpu.c Tue Nov 22 21:28:20 2011 (r227843) @@ -187,13 +187,12 @@ static device_method_t acpi_cpu_methods[ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_cpu_driver = { Modified: head/sys/dev/acpica/acpi_isab.c ============================================================================== --- head/sys/dev/acpica/acpi_isab.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/acpica/acpi_isab.c Tue Nov 22 21:28:20 2011 (r227843) @@ -68,7 +68,6 @@ static device_method_t acpi_isab_methods DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, acpi_isab_read_ivar), DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), @@ -77,7 +76,7 @@ static device_method_t acpi_isab_methods DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_isab_driver = { Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Tue Nov 22 21:28:20 2011 (r227843) @@ -106,7 +106,6 @@ static device_method_t acpi_pcib_acpi_me DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), DEVMETHOD(bus_write_ivar, acpi_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, acpi_pcib_acpi_alloc_resource), @@ -133,7 +132,7 @@ static device_method_t acpi_pcib_acpi_me DEVMETHOD(pcib_map_msi, acpi_pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, acpi_pcib_power_for_sleep), - {0, 0} + DEVMETHOD_END }; static devclass_t pcib_devclass; Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/amr/amr_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -106,9 +106,7 @@ static device_method_t amr_methods[] = { DEVMETHOD(device_suspend, amr_pci_suspend), DEVMETHOD(device_resume, amr_pci_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + DEVMETHOD_END }; static driver_t amr_pci_driver = { Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/arcmsr/arcmsr.c Tue Nov 22 21:28:20 2011 (r227843) @@ -70,8 +70,11 @@ ** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it ** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic ****************************************************************************************** -* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); + #if 0 #define ARCMSR_DEBUG1 1 #endif @@ -223,9 +226,8 @@ static device_method_t arcmsr_methods[]= DEVMETHOD(device_shutdown, arcmsr_shutdown), DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + + DEVMETHOD_END }; static driver_t arcmsr_driver={ Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/bce/if_bce.c Tue Nov 22 21:28:20 2011 (r227843) @@ -455,10 +455,6 @@ static device_method_t bce_methods[] = { /* DEVMETHOD(device_resume, bce_resume), */ /* DEVMETHOD(device_quiesce, bce_quiesce), */ - /* Bus interface (bus_if.h) */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface (miibus_if.h) */ DEVMETHOD(miibus_readreg, bce_miibus_read_reg), DEVMETHOD(miibus_writereg, bce_miibus_write_reg), @@ -467,7 +463,7 @@ static device_method_t bce_methods[] = { /* DEVMETHOD(miibus_linkchg, bce_miibus_linkchg), */ /* DEVMETHOD(miibus_mediainit, bce_miibus_mediainit), */ - { 0, 0 } + DEVMETHOD_END }; static driver_t bce_driver = { Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/bfe/if_bfe.c Tue Nov 22 21:28:20 2011 (r227843) @@ -137,16 +137,12 @@ static device_method_t bfe_methods[] = { DEVMETHOD(device_suspend, bfe_suspend), DEVMETHOD(device_resume, bfe_resume), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, bfe_miibus_readreg), DEVMETHOD(miibus_writereg, bfe_miibus_writereg), DEVMETHOD(miibus_statchg, bfe_miibus_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t bfe_driver = { Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/bge/if_bge.c Tue Nov 22 21:28:20 2011 (r227843) @@ -493,16 +493,12 @@ static device_method_t bge_methods[] = { DEVMETHOD(device_suspend, bge_suspend), DEVMETHOD(device_resume, bge_resume), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, bge_miibus_readreg), DEVMETHOD(miibus_writereg, bge_miibus_writereg), DEVMETHOD(miibus_statchg, bge_miibus_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t bge_driver = { Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/bm/if_bm.c Tue Nov 22 21:28:20 2011 (r227843) @@ -135,15 +135,12 @@ static device_method_t bm_methods[] = { DEVMETHOD(device_detach, bm_detach), DEVMETHOD(device_shutdown, bm_shutdown), - /* bus interface, for miibus */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, bm_miibus_readreg), DEVMETHOD(miibus_writereg, bm_miibus_writereg), DEVMETHOD(miibus_statchg, bm_miibus_statchg), - { 0, 0 } + + DEVMETHOD_END }; static driver_t bm_macio_driver = { Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/bxe/if_bxe.c Tue Nov 22 21:28:20 2011 (r227843) @@ -400,11 +400,7 @@ static device_method_t bxe_methods[] = { DEVMETHOD(device_detach, bxe_detach), DEVMETHOD(device_shutdown, bxe_shutdown), - /* Bus interface (bus_if.h) */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - - KOBJMETHOD_END + DEVMETHOD_END }; Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/cas/if_cas.c Tue Nov 22 21:28:20 2011 (r227843) @@ -2600,16 +2600,12 @@ static device_method_t cas_pci_methods[] /* Use the suspend handler here, it is all that is required. */ DEVMETHOD(device_shutdown, cas_pci_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, cas_mii_readreg), DEVMETHOD(miibus_writereg, cas_mii_writereg), DEVMETHOD(miibus_statchg, cas_mii_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t cas_pci_driver = { Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/cesa/cesa.c Tue Nov 22 21:28:20 2011 (r227843) @@ -93,16 +93,12 @@ static device_method_t cesa_methods[] = DEVMETHOD(device_attach, cesa_attach), DEVMETHOD(device_detach, cesa_detach), - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* Crypto device methods */ DEVMETHOD(cryptodev_newsession, cesa_newsession), DEVMETHOD(cryptodev_freesession,cesa_freesession), DEVMETHOD(cryptodev_process, cesa_process), - { 0, 0 } + DEVMETHOD_END }; static driver_t cesa_driver = { Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/cxgb/cxgb_main.c Tue Nov 22 21:28:20 2011 (r227843) @@ -129,11 +129,7 @@ static device_method_t cxgb_controller_m DEVMETHOD(device_attach, cxgb_controller_attach), DEVMETHOD(device_detach, cxgb_controller_detach), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - - { 0, 0 } + DEVMETHOD_END }; static driver_t cxgb_controller_driver = { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/cxgbe/t4_main.c Tue Nov 22 21:28:20 2011 (r227843) @@ -73,11 +73,7 @@ static device_method_t t4_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - - { 0, 0 } + DEVMETHOD_END }; static driver_t t4_driver = { "t4nex", Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/dc/if_dc.c Tue Nov 22 21:28:20 2011 (r227843) @@ -337,17 +337,13 @@ static device_method_t dc_methods[] = { DEVMETHOD(device_resume, dc_resume), DEVMETHOD(device_shutdown, dc_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, dc_miibus_readreg), DEVMETHOD(miibus_writereg, dc_miibus_writereg), DEVMETHOD(miibus_statchg, dc_miibus_statchg), DEVMETHOD(miibus_mediainit, dc_miibus_mediainit), - { 0, 0 } + DEVMETHOD_END }; static driver_t dc_driver = { Modified: head/sys/dev/eisa/eisaconf.c ============================================================================== --- head/sys/dev/eisa/eisaconf.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/eisa/eisaconf.c Tue Nov 22 21:28:20 2011 (r227843) @@ -557,7 +557,6 @@ static device_method_t eisa_methods[] = DEVMETHOD(bus_probe_nomatch, eisa_probe_nomatch), DEVMETHOD(bus_read_ivar, eisa_read_ivar), DEVMETHOD(bus_write_ivar, eisa_write_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_alloc_resource, eisa_alloc_resource), DEVMETHOD(bus_release_resource, eisa_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), @@ -570,7 +569,7 @@ static device_method_t eisa_methods[] = DEVMETHOD(eisa_add_iospace, eisa_add_iospace_m), DEVMETHOD(eisa_add_mspace, eisa_add_mspace_m), - { 0, 0 } + DEVMETHOD_END }; static driver_t eisa_driver = { Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/et/if_et.c Tue Nov 22 21:28:20 2011 (r227843) @@ -170,14 +170,11 @@ static device_method_t et_methods[] = { DEVMETHOD(device_detach, et_detach), DEVMETHOD(device_shutdown, et_shutdown), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - DEVMETHOD(miibus_readreg, et_miibus_readreg), DEVMETHOD(miibus_writereg, et_miibus_writereg), DEVMETHOD(miibus_statchg, et_miibus_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t et_driver = { Modified: head/sys/dev/fb/fb.c ============================================================================== --- head/sys/dev/fb/fb.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/fb/fb.c Tue Nov 22 21:28:20 2011 (r227843) @@ -315,8 +315,7 @@ static device_method_t fb_methods[] = { DEVMETHOD(device_probe, fbprobe), DEVMETHOD(device_attach, fbattach), - DEVMETHOD(bus_print_child, bus_generic_print_child), - { 0, 0 } + DEVMETHOD_END }; static driver_t fb_driver = { Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/firewire/firewire.c Tue Nov 22 21:28:20 2011 (r227843) @@ -30,11 +30,11 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -128,9 +128,8 @@ static device_method_t firewire_methods[ /* Bus interface */ DEVMETHOD(bus_add_child, firewire_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), - { 0, 0 } + DEVMETHOD_END }; char *linkspeed[] = { "S100", "S200", "S400", "S800", Modified: head/sys/dev/firewire/fwohci_pci.c ============================================================================== --- head/sys/dev/firewire/fwohci_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/firewire/fwohci_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -30,10 +30,11 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #define BOUNCE_BUFFER_TEST 0 #include @@ -536,9 +537,8 @@ static device_method_t fwohci_methods[] /* Bus interface */ DEVMETHOD(bus_add_child, fwohci_pci_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), - { 0, 0 } + DEVMETHOD_END }; static driver_t fwohci_driver = { Modified: head/sys/dev/gem/if_gem_pci.c ============================================================================== --- head/sys/dev/gem/if_gem_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/gem/if_gem_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -82,16 +82,12 @@ static device_method_t gem_pci_methods[] /* Use the suspend handler here, it is all that is required. */ DEVMETHOD(device_shutdown, gem_pci_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, gem_mii_readreg), DEVMETHOD(miibus_writereg, gem_mii_writereg), DEVMETHOD(miibus_statchg, gem_mii_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t gem_pci_driver = { Modified: head/sys/dev/gem/if_gem_sbus.c ============================================================================== --- head/sys/dev/gem/if_gem_sbus.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/gem/if_gem_sbus.c Tue Nov 22 21:28:20 2011 (r227843) @@ -78,16 +78,12 @@ static device_method_t gem_sbus_methods[ /* Use the suspend handler here, it is all that is required. */ DEVMETHOD(device_shutdown, gem_sbus_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, gem_mii_readreg), DEVMETHOD(miibus_writereg, gem_mii_writereg), DEVMETHOD(miibus_statchg, gem_mii_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t gem_sbus_driver = { Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/gpio/gpiobus.c Tue Nov 22 21:28:20 2011 (r227843) @@ -458,7 +458,6 @@ static device_method_t gpiobus_methods[] /* Bus interface */ DEVMETHOD(bus_add_child, gpiobus_add_child), DEVMETHOD(bus_print_child, gpiobus_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_child_pnpinfo_str, gpiobus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, gpiobus_child_location_str), DEVMETHOD(bus_hinted_child, gpiobus_hinted_child), @@ -475,7 +474,7 @@ static device_method_t gpiobus_methods[] DEVMETHOD(gpiobus_pin_set, gpiobus_pin_set), DEVMETHOD(gpiobus_pin_toggle, gpiobus_pin_toggle), - { 0, 0 } + DEVMETHOD_END }; driver_t gpiobus_driver = { Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/hifn/hifn7751.c Tue Nov 22 21:28:20 2011 (r227843) @@ -113,16 +113,12 @@ static device_method_t hifn_methods[] = DEVMETHOD(device_resume, hifn_resume), DEVMETHOD(device_shutdown, hifn_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* crypto device methods */ DEVMETHOD(cryptodev_newsession, hifn_newsession), DEVMETHOD(cryptodev_freesession,hifn_freesession), DEVMETHOD(cryptodev_process, hifn_process), - { 0, 0 } + DEVMETHOD_END }; static driver_t hifn_driver = { "hifn", Modified: head/sys/dev/hme/if_hme_pci.c ============================================================================== --- head/sys/dev/hme/if_hme_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/hme/if_hme_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -93,16 +93,12 @@ static device_method_t hme_pci_methods[] /* Can just use the suspend method here. */ DEVMETHOD(device_shutdown, hme_pci_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, hme_mii_readreg), DEVMETHOD(miibus_writereg, hme_mii_writereg), DEVMETHOD(miibus_statchg, hme_mii_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t hme_pci_driver = { Modified: head/sys/dev/hme/if_hme_sbus.c ============================================================================== --- head/sys/dev/hme/if_hme_sbus.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/hme/if_hme_sbus.c Tue Nov 22 21:28:20 2011 (r227843) @@ -95,16 +95,12 @@ static device_method_t hme_sbus_methods[ /* Can just use the suspend method here. */ DEVMETHOD(device_shutdown, hme_sbus_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, hme_mii_readreg), DEVMETHOD(miibus_writereg, hme_mii_writereg), DEVMETHOD(miibus_statchg, hme_mii_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t hme_sbus_driver = { Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/ichsmb/ichsmb_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -103,9 +103,6 @@ static device_method_t ichsmb_pci_method DEVMETHOD(device_attach, ichsmb_pci_attach), DEVMETHOD(device_detach, ichsmb_detach), - /* Bus methods */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - /* SMBus methods */ DEVMETHOD(smbus_callback, ichsmb_callback), DEVMETHOD(smbus_quick, ichsmb_quick), @@ -118,7 +115,8 @@ static device_method_t ichsmb_pci_method DEVMETHOD(smbus_pcall, ichsmb_pcall), DEVMETHOD(smbus_bwrite, ichsmb_bwrite), DEVMETHOD(smbus_bread, ichsmb_bread), - { 0, 0 } + + DEVMETHOD_END }; static driver_t ichsmb_pci_driver = { Modified: head/sys/dev/ida/ida_pci.c ============================================================================== --- head/sys/dev/ida/ida_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/ida/ida_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -188,9 +188,7 @@ static device_method_t ida_pci_methods[] DEVMETHOD(device_attach, ida_pci_attach), DEVMETHOD(device_detach, ida_detach), - DEVMETHOD(bus_print_child, bus_generic_print_child), - - { 0, 0 } + DEVMETHOD_END }; static driver_t ida_pci_driver = { Modified: head/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_usb.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/if_ndis/if_ndis_usb.c Tue Nov 22 21:28:20 2011 (r227843) @@ -91,11 +91,9 @@ static device_method_t ndis_methods[] = DEVMETHOD(device_shutdown, ndis_shutdown), /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_get_resource_list, ndis_get_resource_list), - { 0, 0 } + DEVMETHOD_END }; static driver_t ndis_driver = { Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/iicbus/iicbus.c Tue Nov 22 21:28:20 2011 (r227843) @@ -245,7 +245,6 @@ static device_method_t iicbus_methods[] /* bus interface */ DEVMETHOD(bus_add_child, iicbus_add_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_print_child, iicbus_print_child), DEVMETHOD(bus_probe_nomatch, iicbus_probe_nomatch), DEVMETHOD(bus_read_ivar, iicbus_read_ivar), @@ -256,7 +255,7 @@ static device_method_t iicbus_methods[] /* iicbus interface */ DEVMETHOD(iicbus_transfer, iicbus_transfer), - { 0, 0 } + DEVMETHOD_END }; driver_t iicbus_driver = { Modified: head/sys/dev/iicbus/iicsmb.c ============================================================================== --- head/sys/dev/iicbus/iicsmb.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/iicbus/iicsmb.c Tue Nov 22 21:28:20 2011 (r227843) @@ -22,11 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ - * */ +#include +__FBSDID("$FreeBSD$"); + /* * I2C to SMB bridge * @@ -106,10 +106,6 @@ static device_method_t iicsmb_methods[] DEVMETHOD(device_attach, iicsmb_attach), DEVMETHOD(device_detach, iicsmb_detach), - /* bus interface */ - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - DEVMETHOD(bus_print_child, bus_generic_print_child), - /* iicbus interface */ DEVMETHOD(iicbus_intr, iicsmb_intr), @@ -125,8 +121,8 @@ static device_method_t iicsmb_methods[] DEVMETHOD(smbus_pcall, iicsmb_pcall), DEVMETHOD(smbus_bwrite, iicsmb_bwrite), DEVMETHOD(smbus_bread, iicsmb_bread), - - { 0, 0 } + + DEVMETHOD_END }; static driver_t iicsmb_driver = { Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/lge/if_lge.c Tue Nov 22 21:28:20 2011 (r227843) @@ -170,16 +170,12 @@ static device_method_t lge_methods[] = { DEVMETHOD(device_detach, lge_detach), DEVMETHOD(device_shutdown, lge_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, lge_miibus_readreg), DEVMETHOD(miibus_writereg, lge_miibus_writereg), DEVMETHOD(miibus_statchg, lge_miibus_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t lge_driver = { Modified: head/sys/dev/mca/mca_bus.c ============================================================================== --- head/sys/dev/mca/mca_bus.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/mca/mca_bus.c Tue Nov 22 21:28:20 2011 (r227843) @@ -507,7 +507,6 @@ static device_method_t mca_methods[] = { DEVMETHOD(bus_probe_nomatch, mca_probe_nomatch), DEVMETHOD(bus_read_ivar, mca_read_ivar), DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -520,7 +519,7 @@ static device_method_t mca_methods[] = { DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - { 0, 0 } + DEVMETHOD_END }; static driver_t mca_driver = { Modified: head/sys/dev/mfi/mfi_pci.c ============================================================================== --- head/sys/dev/mfi/mfi_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/mfi/mfi_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -93,9 +93,8 @@ static device_method_t mfi_methods[] = { DEVMETHOD(device_detach, mfi_pci_detach), DEVMETHOD(device_suspend, mfi_pci_suspend), DEVMETHOD(device_resume, mfi_pci_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + + DEVMETHOD_END }; static driver_t mfi_pci_driver = { Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/mii/mii.c Tue Nov 22 21:28:20 2011 (r227843) @@ -82,7 +82,6 @@ static device_method_t miibus_methods[] /* bus interface */ DEVMETHOD(bus_print_child, miibus_print_child), DEVMETHOD(bus_read_ivar, miibus_read_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_child_pnpinfo_str, miibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, miibus_child_location_str), DEVMETHOD(bus_hinted_child, miibus_hinted_child), @@ -94,7 +93,7 @@ static device_method_t miibus_methods[] DEVMETHOD(miibus_linkchg, miibus_linkchg), DEVMETHOD(miibus_mediainit, miibus_mediainit), - { 0, 0 } + DEVMETHOD_END }; devclass_t miibus_devclass; Modified: head/sys/dev/mlx/mlx_pci.c ============================================================================== --- head/sys/dev/mlx/mlx_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/mlx/mlx_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -61,9 +61,7 @@ static device_method_t mlx_methods[] = { DEVMETHOD(device_suspend, mlx_suspend), DEVMETHOD(device_resume, mlx_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + DEVMETHOD_END }; static driver_t mlx_pci_driver = { Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/mps/mps_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -78,9 +78,8 @@ static device_method_t mps_methods[] = { DEVMETHOD(device_detach, mps_pci_detach), DEVMETHOD(device_suspend, mps_pci_suspend), DEVMETHOD(device_resume, mps_pci_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + + DEVMETHOD_END }; static driver_t mps_pci_driver = { Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/msk/if_msk.c Tue Nov 22 21:28:20 2011 (r227843) @@ -334,11 +334,7 @@ static device_method_t mskc_methods[] = DEVMETHOD(device_resume, mskc_resume), DEVMETHOD(device_shutdown, mskc_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - - { NULL, NULL } + DEVMETHOD_END }; static driver_t mskc_driver = { @@ -356,16 +352,12 @@ static device_method_t msk_methods[] = { DEVMETHOD(device_detach, msk_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, msk_miibus_readreg), DEVMETHOD(miibus_writereg, msk_miibus_writereg), DEVMETHOD(miibus_statchg, msk_miibus_statchg), - { NULL, NULL } + DEVMETHOD_END }; static driver_t msk_driver = { Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/nfe/if_nfe.c Tue Nov 22 21:28:20 2011 (r227843) @@ -165,16 +165,12 @@ static device_method_t nfe_methods[] = { DEVMETHOD(device_resume, nfe_resume), DEVMETHOD(device_shutdown, nfe_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, nfe_miibus_readreg), DEVMETHOD(miibus_writereg, nfe_miibus_writereg), DEVMETHOD(miibus_statchg, nfe_miibus_statchg), - { NULL, NULL } + DEVMETHOD_END }; static driver_t nfe_driver = { Modified: head/sys/dev/nge/if_nge.c ============================================================================== --- head/sys/dev/nge/if_nge.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/nge/if_nge.c Tue Nov 22 21:28:20 2011 (r227843) @@ -223,16 +223,12 @@ static device_method_t nge_methods[] = { DEVMETHOD(device_suspend, nge_suspend), DEVMETHOD(device_resume, nge_resume), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, nge_miibus_readreg), DEVMETHOD(miibus_writereg, nge_miibus_writereg), DEVMETHOD(miibus_statchg, nge_miibus_statchg), - { NULL, NULL } + DEVMETHOD_END }; static driver_t nge_driver = { Modified: head/sys/dev/nve/if_nve.c ============================================================================== --- head/sys/dev/nve/if_nve.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/nve/if_nve.c Tue Nov 22 21:28:20 2011 (r227843) @@ -184,15 +184,11 @@ static device_method_t nve_methods[] = { DEVMETHOD(device_detach, nve_detach), DEVMETHOD(device_shutdown, nve_shutdown), - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, nve_miibus_readreg), DEVMETHOD(miibus_writereg, nve_miibus_writereg), - {0, 0} + DEVMETHOD_END }; static driver_t nve_driver = { Modified: head/sys/dev/pccbb/pccbb_isa.c ============================================================================== --- head/sys/dev/pccbb/pccbb_isa.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/pccbb/pccbb_isa.c Tue Nov 22 21:28:20 2011 (r227843) @@ -211,7 +211,6 @@ static device_method_t cbb_methods[] = { DEVMETHOD(device_resume, cbb_resume), /* bus methods */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, cbb_read_ivar), DEVMETHOD(bus_write_ivar, cbb_write_ivar), DEVMETHOD(bus_alloc_resource, cbb_alloc_resource), @@ -232,7 +231,7 @@ static device_method_t cbb_methods[] = { DEVMETHOD(power_enable_socket, cbb_power_enable_socket), DEVMETHOD(power_disable_socket, cbb_power_disable_socket), - {0,0} + DEVMETHOD_END }; static driver_t cbb_isa_driver = { Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Tue Nov 22 21:22:06 2011 (r227842) +++ head/sys/dev/pccbb/pccbb_pci.c Tue Nov 22 21:28:20 2011 (r227843) @@ -822,7 +822,6 @@ static device_method_t cbb_methods[] = { DEVMETHOD(device_resume, cbb_resume), /* bus methods */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, cbb_read_ivar), DEVMETHOD(bus_write_ivar, cbb_write_ivar), DEVMETHOD(bus_alloc_resource, cbb_alloc_resource), @@ -849,7 +848,7 @@ static device_method_t cbb_methods[] = { DEVMETHOD(pcib_write_config, cbb_write_config), DEVMETHOD(pcib_route_interrupt, cbb_route_interrupt), - {0,0} + DEVMETHOD_END }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:34: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 34F1A106566C; Tue, 22 Nov 2011 21:34:02 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id DEBA48FC0A; Tue, 22 Nov 2011 21:34:01 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 96BB862C7; Tue, 22 Nov 2011 21:34:00 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1D4578552; Tue, 22 Nov 2011 22:34:00 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Rui Paulo References: <201111211635.pALGZvSS051067@svn.freebsd.org> <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> Date: Tue, 22 Nov 2011 22:33:59 +0100 In-Reply-To: <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> (Rui Paulo's message of "Tue, 22 Nov 2011 20:05:22 +0000") Message-ID: <8662ibkfjs.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227797 - 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: Tue, 22 Nov 2011 21:34:02 -0000 Rui Paulo writes: > With this change, I can no longer update a FreeBSD 9.0-current system > from June 2010 to FreeBSD 10.0. I suspect I'm not the only one. Sorry, my mind reader is broken at the moment, so you'll have to provide more information than that. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:35: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 D14DD106564A; Tue, 22 Nov 2011 21:35:44 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 9237F8FC17; Tue, 22 Nov 2011 21:35:44 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id B6E6762CB; Tue, 22 Nov 2011 21:35:43 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id A48008554; Tue, 22 Nov 2011 22:35:43 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jilles Tjoelker References: <201111211640.pALGedXg051270@svn.freebsd.org> <20111122204154.GA14090@stack.nl> Date: Tue, 22 Nov 2011 22:35:43 +0100 In-Reply-To: <20111122204154.GA14090@stack.nl> (Jilles Tjoelker's message of "Tue, 22 Nov 2011 21:41:55 +0100") Message-ID: <861uszkfgw.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227798 - in head: . lib/libpam lib/libpam/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:35:45 -0000 Jilles Tjoelker writes: > Although this will work, I think it trades the quality of the binaries > for a cleaner build system. It is better to pass all libraries to ld(1) > even though a .so may have unresolved references: the NEEDED entry > serves as an additional protection against version mismatches and symbol > versioning (if you ever add it) requires ld(1) to have access to the .so > containing the definition so it knows the version name to store in the > output file. These are plugins. The names and prototypes of the functions they export were set in stone 15 years ago. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:38: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 746C6106564A; Tue, 22 Nov 2011 21:38:04 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 339FD8FC15; Tue, 22 Nov 2011 21:38:04 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 20F2E62CE; Tue, 22 Nov 2011 21:38:03 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id DB6148556; Tue, 22 Nov 2011 22:38:02 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jilles Tjoelker References: <201111211640.pALGedXg051270@svn.freebsd.org> <20111122204154.GA14090@stack.nl> <861uszkfgw.fsf@ds4.des.no> Date: Tue, 22 Nov 2011 22:38:02 +0100 In-Reply-To: <861uszkfgw.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Tue, 22 Nov 2011 22:35:43 +0100") Message-ID: <86wrarj0sl.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227798 - in head: . lib/libpam lib/libpam/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:38:04 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Jilles Tjoelker writes: > > Although this will work, I think it trades the quality of the binaries > > for a cleaner build system. It is better to pass all libraries to ld(1) > > even though a .so may have unresolved references: the NEEDED entry > > serves as an additional protection against version mismatches and symbol > > versioning (if you ever add it) requires ld(1) to have access to the .so > > containing the definition so it knows the version name to store in the > > output file. > These are plugins. The names and prototypes of the functions they > export were set in stone 15 years ago. Sorry, that was a bit unclear. What I was trying to say is that symbol versioning is not and will never be an issue. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:39: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 399701065670; Tue, 22 Nov 2011 21:39:55 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 623AD8FC0C; Tue, 22 Nov 2011 21:39:53 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so1006379bkb.13 for ; Tue, 22 Nov 2011 13:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=ek2DHv+PSjIvW8Ey/UW+jrlWkhxTVwoSELz4a/MnS84=; b=oGqQBoQdLSuaWqOTmtzGyFAmoD5xFLwP5FHNJHMI7nmPK6GQ3ERsd1Zje364fztTDf 1GWjKRsfzDHI1tJXKIVTzAJMohRkxDRPTvy07b0zlxYeIq3wWn8P2DV/jY1+AjnfaIlr tweA5jJlegPaO5jh1pF95mqIBOGABcwaEDq+w= Received: by 10.204.148.67 with SMTP id o3mr21303625bkv.130.1321997993061; Tue, 22 Nov 2011 13:39:53 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id e20sm19951607fab.2.2011.11.22.13.39.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Nov 2011 13:39:51 -0800 (PST) From: Mikolaj Golub To: Alexander Best References: <201111222114.pAMLEkuU010011@svn.freebsd.org> <20111122212413.GA44084@freebsd.org> X-Comment-To: Alexander Best Sender: Mikolaj Golub Date: Tue, 22 Nov 2011 23:39:49 +0200 In-Reply-To: <20111122212413.GA44084@freebsd.org> (Alexander Best's message of "Tue, 22 Nov 2011 21:24:13 +0000") Message-ID: <86fwhfrg4a.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227840 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:39:55 -0000 On Tue, 22 Nov 2011 21:24:13 +0000 Alexander Best wrote: AB> On Tue Nov 22 11, Mikolaj Golub wrote: >> Author: trociny >> Date: Tue Nov 22 21:14:46 2011 >> New Revision: 227840 >> URL: http://svn.freebsd.org/changeset/base/227840 >> >> Log: >> No need in procfs(5). >> >> MFC after: 2 weeks >> >> Modified: >> head/bin/ps/ps.1 >> head/bin/ps/ps.c >> >> Modified: head/bin/ps/ps.1 >> ============================================================================== >> --- head/bin/ps/ps.1 Tue Nov 22 21:12:28 2011 (r227839) >> +++ head/bin/ps/ps.1 Tue Nov 22 21:14:46 2011 (r227840) >> @@ -29,7 +29,7 @@ >> .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 >> .\" $FreeBSD$ >> .\" >> -.Dd October 30, 2011 >> +.Dd November 22, 2011 >> .Dt PS 1 >> .Os >> .Sh NAME >> @@ -686,9 +686,6 @@ attempts to automatically determine the >> .Bl -tag -width ".Pa /boot/kernel/kernel" -compact >> .It Pa /boot/kernel/kernel >> default system namelist >> -.It Pa /proc >> -the mount point of >> -.Xr procfs 5 AB> are these references to procfs still necessary in the ps(1) man page? AB> 1) AB> " AB> The process file system (see procfs(5)) should be mounted when ps is exe- AB> cuted, otherwise not all information will be available. AB> " Thanks, I will remove this. AB> and 2) AB> " AB> SEE ALSO AB> kill(1), pgrep(1), pkill(1), procstat(1), w(1), kvm(3), strftime(3), AB> mac(4), procfs(5), pstat(8), sysctl(8), mutex(9) AB> " AB> ? I think this reference to procfs(5) should remain. It is here as yet another way to get process statistics. >> .El >> .Sh SEE ALSO >> .Xr kill 1 , >> >> Modified: head/bin/ps/ps.c >> ============================================================================== >> --- head/bin/ps/ps.c Tue Nov 22 21:12:28 2011 (r227839) >> +++ head/bin/ps/ps.c Tue Nov 22 21:14:46 2011 (r227840) >> @@ -130,7 +130,6 @@ struct listinfo { >> } l; >> }; >> >> -static int check_procfs(void); >> static int addelem_gid(struct listinfo *, const char *); >> static int addelem_pid(struct listinfo *, const char *); >> static int addelem_tty(struct listinfo *, const char *); >> @@ -411,14 +410,6 @@ main(int argc, char *argv[]) >> argv += optind; >> >> /* >> - * If the user specified ps -e then they want a copy of the process >> - * environment kvm_getenvv(3) attempts to open /proc//mem. >> - * Check to make sure that procfs is mounted on /proc, otherwise >> - * print a warning informing the user that output will be incomplete. >> - */ >> - if (needenv == 1 && check_procfs() == 0) >> - warnx("Process environment requires procfs(5)"); >> - /* >> * If there arguments after processing all the options, attempt >> * to treat them as a list of process ids. >> */ >> @@ -1360,18 +1351,6 @@ kludge_oldps_options(const char *optlist >> return (newopts); >> } >> >> -static int >> -check_procfs(void) >> -{ >> - struct statfs mnt; >> - >> - if (statfs("/proc", &mnt) < 0) >> - return (0); >> - if (strcmp(mnt.f_fstypename, "procfs") != 0) >> - return (0); >> - return (1); >> -} >> - >> static void >> usage(void) >> { -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:42:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 0AD291065673; Tue, 22 Nov 2011 21:42:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id B676C14D822; Tue, 22 Nov 2011 21:42:09 +0000 (UTC) Message-ID: <4ECC1731.8010509@FreeBSD.org> Date: Tue, 22 Nov 2011 13:42:09 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org, theraven@freebsd.org, dim@freebsd.org, Brooks Davis References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> <20111122202735.GA21442@zim.MIT.EDU> In-Reply-To: <20111122202735.GA21442@zim.MIT.EDU> X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:42:25 -0000 On 11/22/2011 12:27 PM, David Schultz wrote: > On Tue, Nov 22, 2011, Eitan Adler wrote: >> The problem with profiling this type of change is that it is hard to >> find a good representative benchmark. I could easily write code that >> will show you that adding the equality check is a good idea or that it >> is a horrible idea. IMHO it saves enough time when they are equal, but >> loses almost no time when the strings are not equal. > > Benchmark or not, I think you'll have a very hard time finding a > single real program that routinely calls strcasecmp() with > identical pointers! Agreed. Also, these changes seem to violate the general rule of "Don't call a change an optimization unless you have benchmarks that demonstrate that it actually is." The more critical the piece of code you are modifying, the more important this rule is. >> Is this the right course of action? Or should I just revert both >> commits entirely? Sorry to say, my vote would be to back them out. OTOH, I agree with David that you should try not to let it discourage you. Doug -- "We could put the whole Internet into a book." "Too practical." Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:49: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 6E3E31065670; Tue, 22 Nov 2011 21:49:29 +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 5EB1F8FC18; Tue, 22 Nov 2011 21:49:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLnTw5011303; Tue, 22 Nov 2011 21:49:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLnTDw011301; Tue, 22 Nov 2011 21:49:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111222149.pAMLnTDw011301@svn.freebsd.org> From: Marius Strobl Date: Tue, 22 Nov 2011 21:49: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: r227844 - head/share/examples/drivers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:49:29 -0000 Author: marius Date: Tue Nov 22 21:49:29 2011 New Revision: 227844 URL: http://svn.freebsd.org/changeset/base/227844 Log: Update to use DEVMETHOD_END. Modified: head/share/examples/drivers/make_device_driver.sh Modified: head/share/examples/drivers/make_device_driver.sh ============================================================================== --- head/share/examples/drivers/make_device_driver.sh Tue Nov 22 21:28:20 2011 (r227843) +++ head/share/examples/drivers/make_device_driver.sh Tue Nov 22 21:49:29 2011 (r227844) @@ -261,7 +261,7 @@ static device_method_t ${1}_methods[] = DEVMETHOD(device_probe, ${1}_isa_probe), DEVMETHOD(device_attach, ${1}_isa_attach), DEVMETHOD(device_detach, ${1}_isa_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ${1}_isa_driver = { From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:50: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 D6F851065673; Tue, 22 Nov 2011 21:50:38 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C79CD8FC18; Tue, 22 Nov 2011 21:50:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLocBo011390; Tue, 22 Nov 2011 21:50:38 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLocBJ011385; Tue, 22 Nov 2011 21:50:38 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201111222150.pAMLocBJ011385@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 22 Nov 2011 21:50: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: r227845 - 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: Tue, 22 Nov 2011 21:50:38 -0000 Author: luigi Date: Tue Nov 22 21:50:38 2011 New Revision: 227845 URL: http://svn.freebsd.org/changeset/base/227845 Log: forgot to merge NETMAP entries in sys/conf ! Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Nov 22 21:49:29 2011 (r227844) +++ head/sys/conf/NOTES Tue Nov 22 21:50:38 2011 (r227845) @@ -799,6 +799,12 @@ device sppp # option. DHCP requires bpf. device bpf +# The `netmap' device implements memory-mapped access to network +# devices from userspace, enabling wire-speed packet capture and +# generation even at 10Gbit/s. Requires support in the device +# driver. Supported drivers are ixgbe, e1000, re. +device netmap + # The `disc' device implements a minimal network interface, # which throws away all packets sent and never receives any. It is # included for testing and benchmarking purposes. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Nov 22 21:49:29 2011 (r227844) +++ head/sys/conf/files Tue Nov 22 21:50:38 2011 (r227845) @@ -1507,6 +1507,7 @@ dev/mxge/mxge_rss_ethp_z8e.c optional mx dev/my/if_my.c optional my dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard +dev/netmap/netmap.c optional netmap dev/nge/if_nge.c optional nge dev/nxge/if_nxge.c optional nxge dev/nxge/xgehal/xgehal-device.c optional nxge Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Nov 22 21:49:29 2011 (r227844) +++ head/sys/conf/options Tue Nov 22 21:50:38 2011 (r227845) @@ -690,6 +690,7 @@ ISAPNP opt_isa.h # various 'device presence' options. DEV_BPF opt_bpf.h +DEV_NETMAP opt_global.h DEV_MCA opt_mca.h DEV_CARP opt_carp.h DEV_SPLASH opt_splash.h From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:53: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 E52501065674; Tue, 22 Nov 2011 21:53:04 +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 93F468FC19; Tue, 22 Nov 2011 21:53:03 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA24726; Tue, 22 Nov 2011 23:53:02 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RSyGz-0003an-RF; Tue, 22 Nov 2011 23:53:01 +0200 Message-ID: <4ECC19BD.20401@FreeBSD.org> Date: Tue, 22 Nov 2011 23:53:01 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111108 Thunderbird/8.0 MIME-Version: 1.0 To: Marius Strobl References: <201111222128.pAMLSKqa010571@svn.freebsd.org> In-Reply-To: <201111222128.pAMLSKqa010571@svn.freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227843 - in head/sys: amd64/amd64 arm/econa arm/mv arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 dev/aac dev/acpi_support dev/acpica dev/amr dev/arcmsr dev/bce dev/bfe dev/bge ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 21:53:05 -0000 on 22/11/2011 23:28 Marius Strobl said the following: > Author: marius > Date: Tue Nov 22 21:28:20 2011 > New Revision: 227843 > URL: http://svn.freebsd.org/changeset/base/227843 > > Log: > - There's no need to overwrite the default device method with the default > one. Interestingly, these are actually the default for quite some time > (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) > since r52045) but even recently added device drivers do this unnecessarily. Maybe because it is not immediately obvious which methods do have sensible defaults and which do not (and why). Thus, copy+paste. E.g. bus_add_child vs bus_print_child below. > Modified: head/sys/dev/acpi_support/acpi_wmi.c > ============================================================================== > --- head/sys/dev/acpi_support/acpi_wmi.c Tue Nov 22 21:22:06 2011 (r227842) > +++ head/sys/dev/acpi_support/acpi_wmi.c Tue Nov 22 21:28:20 2011 (r227843) > @@ -175,7 +175,6 @@ static device_method_t acpi_wmi_methods[ > > /* bus interface */ > DEVMETHOD(bus_add_child, bus_generic_add_child), > - DEVMETHOD(bus_print_child, bus_generic_print_child), > > /* acpi_wmi interface */ > DEVMETHOD(acpi_wmi_provides_guid_string, -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:53: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 98AB9106566B; Tue, 22 Nov 2011 21:53:06 +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 8959C8FC1B; Tue, 22 Nov 2011 21:53:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLr6NS011513; Tue, 22 Nov 2011 21:53:06 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLr617011511; Tue, 22 Nov 2011 21:53:06 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111222153.pAMLr617011511@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 22 Nov 2011 21:53: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: r227846 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:53:06 -0000 Author: trociny Date: Tue Nov 22 21:53:06 2011 New Revision: 227846 URL: http://svn.freebsd.org/changeset/base/227846 Log: Remove yet another outdated note about procfs(5) being required. Spotted by: arundel Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Nov 22 21:50:38 2011 (r227845) +++ head/bin/ps/ps.1 Tue Nov 22 21:53:06 2011 (r227846) @@ -98,12 +98,6 @@ The default output format includes, for controlling terminal, state, CPU time (including both user and system time) and associated command. .Pp -The process file system (see -.Xr procfs 5 ) -should be mounted when -.Nm -is executed, otherwise not all information will be available. -.Pp The options are as follows: .Bl -tag -width indent .It Fl a From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:53: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 8FF76106566C; Tue, 22 Nov 2011 21:53:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 805BD8FC20; Tue, 22 Nov 2011 21:53:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLrJpJ011555; Tue, 22 Nov 2011 21:53:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLrJlC011553; Tue, 22 Nov 2011 21:53:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111222153.pAMLrJlC011553@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 22 Nov 2011 21:53: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: r227847 - 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, 22 Nov 2011 21:53:19 -0000 Author: hselasky Date: Tue Nov 22 21:53:19 2011 New Revision: 227847 URL: http://svn.freebsd.org/changeset/base/227847 Log: Style change. Suggested by: jhb @ and marius @ MFC after: 1 week Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Nov 22 21:53:06 2011 (r227846) +++ head/sys/kern/subr_bus.c Tue Nov 22 21:53:19 2011 (r227847) @@ -1862,7 +1862,7 @@ device_delete_child(device_t dev, device PDEBUG(("%s from %s", DEVICENAME(child), DEVICENAME(dev))); /* remove children first */ - while ( (grandchild = TAILQ_FIRST(&child->children)) ) { + while ((grandchild = TAILQ_FIRST(&child->children)) != NULL) { error = device_delete_child(child, grandchild); if (error) return (error); @@ -1903,7 +1903,7 @@ device_delete_all_children(device_t dev) error = 0; - while ( (child = TAILQ_FIRST(&dev->children)) ) { + while ((child = TAILQ_FIRST(&dev->children)) != NULL) { error = device_delete_child(dev, child); if (error) { PDEBUG(("Failed deleting %s", DEVICENAME(child))); From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21:55: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 3EE63106564A; Tue, 22 Nov 2011 21:55: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 2C3608FC14; Tue, 22 Nov 2011 21:55:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLtfmX011696; Tue, 22 Nov 2011 21:55:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLteHU011668; Tue, 22 Nov 2011 21:55:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111222155.pAMLteHU011668@svn.freebsd.org> From: Marius Strobl Date: Tue, 22 Nov 2011 21:55: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: r227848 - in head/sys: dev/bwn dev/esp dev/mii dev/ofw dev/siba dev/stge dev/vte sparc64/central sparc64/ebus sparc64/fhc sparc64/pci sparc64/sbus 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: Tue, 22 Nov 2011 21:55:41 -0000 Author: marius Date: Tue Nov 22 21:55:40 2011 New Revision: 227848 URL: http://svn.freebsd.org/changeset/base/227848 Log: s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention of kobj(9) from device drivers. Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/esp/esp_pci.c head/sys/dev/esp/esp_sbus.c head/sys/dev/mii/rdcphy.c head/sys/dev/ofw/ofw_iicbus.c head/sys/dev/siba/siba.c head/sys/dev/siba/siba_bwn.c head/sys/dev/siba/siba_cc.c head/sys/dev/stge/if_stge.c head/sys/dev/vte/if_vte.c head/sys/sparc64/central/central.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/ebus/epic.c head/sys/sparc64/fhc/fhc.c head/sys/sparc64/pci/apb.c head/sys/sparc64/pci/ofw_pcib.c head/sys/sparc64/pci/ofw_pcibus.c head/sys/sparc64/sbus/dma_sbus.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/eeprom.c head/sys/sparc64/sparc64/jbusppm.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/rtc.c head/sys/sparc64/sparc64/sc_machdep.c head/sys/sparc64/sparc64/schppm.c head/sys/sparc64/sparc64/ssm.c head/sys/sparc64/sparc64/upa.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/bwn/if_bwn.c Tue Nov 22 21:55:40 2011 (r227848) @@ -14226,7 +14226,7 @@ static device_method_t bwn_methods[] = { DEVMETHOD(device_detach, bwn_detach), DEVMETHOD(device_suspend, bwn_suspend), DEVMETHOD(device_resume, bwn_resume), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t bwn_driver = { "bwn", Modified: head/sys/dev/esp/esp_pci.c ============================================================================== --- head/sys/dev/esp/esp_pci.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/esp/esp_pci.c Tue Nov 22 21:55:40 2011 (r227848) @@ -146,7 +146,7 @@ static device_method_t esp_pci_methods[] DEVMETHOD(device_suspend, esp_pci_suspend), DEVMETHOD(device_resume, esp_pci_resume), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t esp_pci_driver = { Modified: head/sys/dev/esp/esp_sbus.c ============================================================================== --- head/sys/dev/esp/esp_sbus.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/esp/esp_sbus.c Tue Nov 22 21:55:40 2011 (r227848) @@ -117,7 +117,7 @@ static device_method_t esp_dma_methods[] DEVMETHOD(device_suspend, esp_suspend), DEVMETHOD(device_resume, esp_resume), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t esp_dma_driver = { @@ -136,7 +136,7 @@ static device_method_t esp_sbus_methods[ DEVMETHOD(device_suspend, esp_suspend), DEVMETHOD(device_resume, esp_resume), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t esp_sbus_driver = { Modified: head/sys/dev/mii/rdcphy.c ============================================================================== --- head/sys/dev/mii/rdcphy.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/mii/rdcphy.c Tue Nov 22 21:55:40 2011 (r227848) @@ -65,7 +65,7 @@ static device_method_t rdcphy_methods[] DEVMETHOD(device_attach, rdcphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t rdcphy_devclass; Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/ofw/ofw_iicbus.c Tue Nov 22 21:55:40 2011 (r227848) @@ -68,7 +68,7 @@ static device_method_t ofw_iicbus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; struct ofw_iicbus_devinfo { Modified: head/sys/dev/siba/siba.c ============================================================================== --- head/sys/dev/siba/siba.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/siba/siba.c Tue Nov 22 21:55:40 2011 (r227848) @@ -632,7 +632,7 @@ static device_method_t siba_methods[] = DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_write_ivar, siba_write_ivar), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t siba_driver = { Modified: head/sys/dev/siba/siba_bwn.c ============================================================================== --- head/sys/dev/siba/siba_bwn.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/siba/siba_bwn.c Tue Nov 22 21:55:40 2011 (r227848) @@ -410,7 +410,7 @@ static device_method_t siba_bwn_methods[ DEVMETHOD(pci_release_msi, siba_bwn_release_msi), DEVMETHOD(pci_msi_count, siba_bwn_msi_count), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t siba_bwn_driver = { "siba_bwn", Modified: head/sys/dev/siba/siba_cc.c ============================================================================== --- head/sys/dev/siba/siba_cc.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/siba/siba_cc.c Tue Nov 22 21:55:40 2011 (r227848) @@ -141,7 +141,7 @@ static device_method_t siba_cc_methods[] DEVMETHOD(device_attach, siba_cc_attach), DEVMETHOD(device_probe, siba_cc_probe), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t siba_cc_driver = { Modified: head/sys/dev/stge/if_stge.c ============================================================================== --- head/sys/dev/stge/if_stge.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/stge/if_stge.c Tue Nov 22 21:55:40 2011 (r227848) @@ -214,7 +214,7 @@ static device_method_t stge_methods[] = DEVMETHOD(miibus_writereg, stge_miibus_writereg), DEVMETHOD(miibus_statchg, stge_miibus_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t stge_driver = { Modified: head/sys/dev/vte/if_vte.c ============================================================================== --- head/sys/dev/vte/if_vte.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/dev/vte/if_vte.c Tue Nov 22 21:55:40 2011 (r227848) @@ -151,7 +151,7 @@ static device_method_t vte_methods[] = { DEVMETHOD(miibus_writereg, vte_miibus_writereg), DEVMETHOD(miibus_statchg, vte_miibus_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t vte_driver = { Modified: head/sys/sparc64/central/central.c ============================================================================== --- head/sys/sparc64/central/central.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/central/central.c Tue Nov 22 21:55:40 2011 (r227848) @@ -96,7 +96,7 @@ static device_method_t central_methods[] DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t central_driver = { Modified: head/sys/sparc64/ebus/ebus.c ============================================================================== --- head/sys/sparc64/ebus/ebus.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/ebus/ebus.c Tue Nov 22 21:55:40 2011 (r227848) @@ -181,7 +181,7 @@ static device_method_t ebus_nexus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t ebus_nexus_driver = { @@ -228,7 +228,7 @@ static device_method_t ebus_pci_methods[ DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t ebus_pci_driver = { Modified: head/sys/sparc64/ebus/epic.c ============================================================================== --- head/sys/sparc64/ebus/epic.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/ebus/epic.c Tue Nov 22 21:55:40 2011 (r227848) @@ -125,7 +125,7 @@ static device_method_t epic_methods[] = DEVMETHOD(device_attach, epic_attach), DEVMETHOD(device_detach, epic_detach), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t epic_devclass; Modified: head/sys/sparc64/fhc/fhc.c ============================================================================== --- head/sys/sparc64/fhc/fhc.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/fhc/fhc.c Tue Nov 22 21:55:40 2011 (r227848) @@ -110,7 +110,7 @@ static device_method_t fhc_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t fhc_driver = { Modified: head/sys/sparc64/pci/apb.c ============================================================================== --- head/sys/sparc64/pci/apb.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/pci/apb.c Tue Nov 22 21:55:40 2011 (r227848) @@ -96,7 +96,7 @@ static device_method_t apb_methods[] = { /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t pcib_devclass; Modified: head/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcib.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/pci/ofw_pcib.c Tue Nov 22 21:55:40 2011 (r227848) @@ -74,7 +74,7 @@ static device_method_t ofw_pcib_methods[ /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t pcib_devclass; Modified: head/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcibus.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/pci/ofw_pcibus.c Tue Nov 22 21:55:40 2011 (r227848) @@ -90,7 +90,7 @@ static device_method_t ofw_pcibus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; struct ofw_pcibus_devinfo { Modified: head/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- head/sys/sparc64/sbus/dma_sbus.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sbus/dma_sbus.c Tue Nov 22 21:55:40 2011 (r227848) @@ -134,7 +134,7 @@ static device_method_t dma_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t dma_driver = { Modified: head/sys/sparc64/sbus/sbus.c ============================================================================== --- head/sys/sparc64/sbus/sbus.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sbus/sbus.c Tue Nov 22 21:55:40 2011 (r227848) @@ -188,7 +188,7 @@ static device_method_t sbus_methods[] = DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t sbus_driver = { Modified: head/sys/sparc64/sparc64/eeprom.c ============================================================================== --- head/sys/sparc64/sparc64/eeprom.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sparc64/eeprom.c Tue Nov 22 21:55:40 2011 (r227848) @@ -91,7 +91,7 @@ static device_method_t eeprom_methods[] DEVMETHOD(clock_gettime, mk48txx_gettime), DEVMETHOD(clock_settime, mk48txx_settime), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t eeprom_driver = { Modified: head/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- head/sys/sparc64/sparc64/jbusppm.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sparc64/jbusppm.c Tue Nov 22 21:55:40 2011 (r227848) @@ -82,7 +82,7 @@ static device_method_t jbusppm_methods[] DEVMETHOD(device_probe, jbusppm_probe), DEVMETHOD(device_attach, jbusppm_attach), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t jbusppm_devclass; Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sparc64/nexus.c Tue Nov 22 21:55:40 2011 (r227848) @@ -144,7 +144,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t nexus_devclass; Modified: head/sys/sparc64/sparc64/rtc.c ============================================================================== --- head/sys/sparc64/sparc64/rtc.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sparc64/rtc.c Tue Nov 22 21:55:40 2011 (r227848) @@ -90,7 +90,7 @@ static device_method_t rtc_ebus_methods[ DEVMETHOD(clock_gettime, mc146818_gettime), DEVMETHOD(clock_settime, mc146818_settime), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t rtc_ebus_driver = { @@ -111,7 +111,7 @@ static device_method_t rtc_isa_methods[] DEVMETHOD(clock_gettime, mc146818_gettime), DEVMETHOD(clock_settime, mc146818_settime), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t rtc_isa_driver = { Modified: head/sys/sparc64/sparc64/sc_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/sc_machdep.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sparc64/sc_machdep.c Tue Nov 22 21:55:40 2011 (r227848) @@ -57,7 +57,7 @@ static device_method_t sc_methods[] = { DEVMETHOD(device_probe, sc_probe), DEVMETHOD(device_attach, sc_attach), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t sc_driver = { Modified: head/sys/sparc64/sparc64/schppm.c ============================================================================== --- head/sys/sparc64/sparc64/schppm.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sparc64/schppm.c Tue Nov 22 21:55:40 2011 (r227848) @@ -73,7 +73,7 @@ static device_method_t schppm_methods[] DEVMETHOD(device_probe, schppm_probe), DEVMETHOD(device_attach, schppm_attach), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t schppm_devclass; Modified: head/sys/sparc64/sparc64/ssm.c ============================================================================== --- head/sys/sparc64/sparc64/ssm.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sparc64/ssm.c Tue Nov 22 21:55:40 2011 (r227848) @@ -52,7 +52,7 @@ static device_method_t ssm_methods[] = { /* ofw_bus interface */ - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t ssm_devclass; Modified: head/sys/sparc64/sparc64/upa.c ============================================================================== --- head/sys/sparc64/sparc64/upa.c Tue Nov 22 21:53:19 2011 (r227847) +++ head/sys/sparc64/sparc64/upa.c Tue Nov 22 21:55:40 2011 (r227848) @@ -147,7 +147,7 @@ static device_method_t upa_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t upa_devclass; From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 21: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 50F7F1065670; Tue, 22 Nov 2011 21:56:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5E88FC14; Tue, 22 Nov 2011 21:56:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMLuuGw011805; Tue, 22 Nov 2011 21:56:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMLutas011772; Tue, 22 Nov 2011 21:56:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111222156.pAMLutas011772@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 22 Nov 2011 21: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: r227849 - in head/sys: arm/econa arm/xscale/ixp425 dev/ahci dev/ata dev/gpio dev/mvs dev/ppbus dev/ppc dev/siba dev/siis dev/usb/controller kern mips/atheros mips/cavium/usb mips/rmi mi... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 21:56:56 -0000 Author: hselasky Date: Tue Nov 22 21:56:55 2011 New Revision: 227849 URL: http://svn.freebsd.org/changeset/base/227849 Log: Rename device_delete_all_children() into device_delete_children(). Suggested by: jhb @ and marius @ MFC after: 1 week Modified: head/sys/arm/econa/ehci_ebus.c head/sys/arm/econa/ohci_ec.c head/sys/arm/xscale/ixp425/avila_ata.c head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-disk.c head/sys/dev/ata/ata-pci.c head/sys/dev/gpio/gpiobus.c head/sys/dev/mvs/mvs_pci.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/ppc/ppc.c head/sys/dev/siba/siba_core.c head/sys/dev/siis/siis.c head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/atmegadci_atmelarm.c head/sys/dev/usb/controller/ehci_ixp4xx.c head/sys/dev/usb/controller/ehci_mv.c head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/musb_otg_atmelarm.c head/sys/dev/usb/controller/ohci_atmelarm.c head/sys/dev/usb/controller/ohci_pci.c head/sys/dev/usb/controller/ohci_s3c24x0.c head/sys/dev/usb/controller/uhci_pci.c head/sys/dev/usb/controller/uss820dci_atmelarm.c head/sys/dev/usb/controller/xhci_pci.c head/sys/kern/subr_bus.c head/sys/mips/atheros/ar71xx_ehci.c head/sys/mips/atheros/ar71xx_ohci.c head/sys/mips/cavium/usb/octusb_octeon.c head/sys/mips/rmi/xls_ehci.c head/sys/mips/rt305x/rt305x_dotg.c head/sys/sys/bus.h Modified: head/sys/arm/econa/ehci_ebus.c ============================================================================== --- head/sys/arm/econa/ehci_ebus.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/arm/econa/ehci_ebus.c Tue Nov 22 21:56:55 2011 (r227849) @@ -235,7 +235,7 @@ ehci_ebus_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); /* * disable interrupts that might have been switched on in Modified: head/sys/arm/econa/ohci_ec.c ============================================================================== --- head/sys/arm/econa/ohci_ec.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/arm/econa/ohci_ec.c Tue Nov 22 21:56:55 2011 (r227849) @@ -185,7 +185,7 @@ ohci_ec_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); bus_space_write_4(sc->sc_ohci.sc_io_tag, sc->sc_ohci.sc_io_hdl, OHCI_CONTROL, 0); Modified: head/sys/arm/xscale/ixp425/avila_ata.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_ata.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/arm/xscale/ixp425/avila_ata.c Tue Nov 22 21:56:55 2011 (r227849) @@ -263,7 +263,7 @@ ata_avila_detach(device_t dev) /* XXX quiesce gpio? */ /* detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_rid, sc->sc_irq); Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/ahci/ahci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -518,7 +518,7 @@ ahci_detach(device_t dev) int i; /* Detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); /* Free interrupts. */ for (i = 0; i < ctlr->numirqs; i++) { Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/ata/ata-disk.c Tue Nov 22 21:56:55 2011 (r227849) @@ -181,7 +181,7 @@ ad_detach(device_t dev) callout_drain(&atadev->spindown_timer); /* detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); /* destroy disk from the system so we don't get any further requests */ disk_destroy(adp->disk); Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/ata/ata-pci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -138,7 +138,7 @@ ata_pci_detach(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(dev); /* detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); if (ctlr->r_irq) { bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle); Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/gpio/gpiobus.c Tue Nov 22 21:56:55 2011 (r227849) @@ -229,7 +229,7 @@ gpiobus_detach(device_t dev) return (err); /* detach and delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); if (sc->sc_pins_mapped) { free(sc->sc_pins_mapped, M_DEVBUF); Modified: head/sys/dev/mvs/mvs_pci.c ============================================================================== --- head/sys/dev/mvs/mvs_pci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/mvs/mvs_pci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -179,7 +179,7 @@ mvs_detach(device_t dev) struct mvs_controller *ctlr = device_get_softc(dev); /* Detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); /* Free interrupt. */ if (ctlr->irq.r_irq) { Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/mvs/mvs_soc.c Tue Nov 22 21:56:55 2011 (r227849) @@ -175,7 +175,7 @@ mvs_detach(device_t dev) struct mvs_controller *ctlr = device_get_softc(dev); /* Detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); /* Free interrupt. */ if (ctlr->irq.r_irq) { Modified: head/sys/dev/ppbus/ppbconf.c ============================================================================== --- head/sys/dev/ppbus/ppbconf.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/ppbus/ppbconf.c Tue Nov 22 21:56:55 2011 (r227849) @@ -429,7 +429,7 @@ ppbus_detach(device_t dev) return (error); /* detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); return (0); } Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/ppc/ppc.c Tue Nov 22 21:56:55 2011 (r227849) @@ -1857,7 +1857,7 @@ ppc_detach(device_t dev) } /* detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); if (ppc->res_irq != 0) { bus_teardown_intr(dev, ppc->res_irq, ppc->intr_cookie); Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/siba/siba_core.c Tue Nov 22 21:56:55 2011 (r227849) @@ -215,7 +215,7 @@ int siba_core_detach(struct siba_softc *siba) { /* detach & delete all children */ - device_delete_all_children(siba->siba_dev); + device_delete_children(siba->siba_dev); return (0); } Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/siis/siis.c Tue Nov 22 21:56:55 2011 (r227849) @@ -207,7 +207,7 @@ siis_detach(device_t dev) struct siis_controller *ctlr = device_get_softc(dev); /* Detach & delete all children */ - device_delete_all_children(dev); + device_delete_children(dev); /* Free interrupts. */ if (ctlr->irq.r_irq) { Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Nov 22 21:56:55 2011 (r227849) @@ -271,7 +271,7 @@ at91_udp_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); /* disable Transceiver */ AT91_UDP_WRITE_4(&sc->sc_dci, AT91_UDP_TXVC, AT91_UDP_TXVC_DIS); Modified: head/sys/dev/usb/controller/atmegadci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci_atmelarm.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/atmegadci_atmelarm.c Tue Nov 22 21:56:55 2011 (r227849) @@ -164,7 +164,7 @@ atmegadci_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) { /* Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_ixp4xx.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/ehci_ixp4xx.c Tue Nov 22 21:56:55 2011 (r227849) @@ -257,7 +257,7 @@ ehci_ixp_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); if (sc->sc_irq_res && sc->sc_intr_hdl) { /* Modified: head/sys/dev/usb/controller/ehci_mv.c ============================================================================== --- head/sys/dev/usb/controller/ehci_mv.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/ehci_mv.c Tue Nov 22 21:56:55 2011 (r227849) @@ -289,7 +289,7 @@ mv_ehci_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); /* * disable interrupts that might have been switched on in mv_ehci_attach Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/ehci_pci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -498,7 +498,7 @@ ehci_pci_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); pci_disable_busmaster(self); Modified: head/sys/dev/usb/controller/musb_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg_atmelarm.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/musb_otg_atmelarm.c Tue Nov 22 21:56:55 2011 (r227849) @@ -189,7 +189,7 @@ musbotg_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); if (sc->sc_otg.sc_irq_res && sc->sc_otg.sc_intr_hdl) { /* Modified: head/sys/dev/usb/controller/ohci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/ohci_atmelarm.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/ohci_atmelarm.c Tue Nov 22 21:56:55 2011 (r227849) @@ -174,7 +174,7 @@ ohci_atmelarm_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); /* * Put the controller into reset, then disable clocks and do Modified: head/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ohci_pci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/ohci_pci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -348,7 +348,7 @@ ohci_pci_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); pci_disable_busmaster(self); Modified: head/sys/dev/usb/controller/ohci_s3c24x0.c ============================================================================== --- head/sys/dev/usb/controller/ohci_s3c24x0.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/ohci_s3c24x0.c Tue Nov 22 21:56:55 2011 (r227849) @@ -156,7 +156,7 @@ ohci_s3c24x0_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); /* * Put the controller into reset, then disable clocks and do Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/uhci_pci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -406,7 +406,7 @@ uhci_pci_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); /* * disable interrupts that might have been switched on in Modified: head/sys/dev/usb/controller/uss820dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci_atmelarm.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/uss820dci_atmelarm.c Tue Nov 22 21:56:55 2011 (r227849) @@ -221,7 +221,7 @@ uss820_atmelarm_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); if (sc->sc_irq_res && sc->sc_intr_hdl) { /* Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/dev/usb/controller/xhci_pci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -242,7 +242,7 @@ xhci_pci_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); pci_disable_busmaster(self); Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/kern/subr_bus.c Tue Nov 22 21:56:55 2011 (r227849) @@ -1894,7 +1894,7 @@ device_delete_child(device_t dev, device * @retval non-zero a device would not detach */ int -device_delete_all_children(device_t dev) +device_delete_children(device_t dev) { device_t child; int error; Modified: head/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ehci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/mips/atheros/ar71xx_ehci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -244,7 +244,7 @@ ar71xx_ehci_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); if (sc->sc_irq_res && sc->sc_intr_hdl) { /* Modified: head/sys/mips/atheros/ar71xx_ohci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ohci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/mips/atheros/ar71xx_ohci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -150,7 +150,7 @@ ar71xx_ohci_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); /* * Put the controller into reset, then disable clocks and do Modified: head/sys/mips/cavium/usb/octusb_octeon.c ============================================================================== --- head/sys/mips/cavium/usb/octusb_octeon.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/mips/cavium/usb/octusb_octeon.c Tue Nov 22 21:56:55 2011 (r227849) @@ -160,7 +160,7 @@ octusb_octeon_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); if (sc->sc_dci.sc_irq_res && sc->sc_dci.sc_intr_hdl) { /* Modified: head/sys/mips/rmi/xls_ehci.c ============================================================================== --- head/sys/mips/rmi/xls_ehci.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/mips/rmi/xls_ehci.c Tue Nov 22 21:56:55 2011 (r227849) @@ -214,7 +214,7 @@ ehci_xls_detach(device_t self) device_delete_child(self, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(self); + device_delete_children(self); if (sc->sc_irq_res && sc->sc_intr_hdl) { ehci_detach(sc); Modified: head/sys/mips/rt305x/rt305x_dotg.c ============================================================================== --- head/sys/mips/rt305x/rt305x_dotg.c Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/mips/rt305x/rt305x_dotg.c Tue Nov 22 21:56:55 2011 (r227849) @@ -176,7 +176,7 @@ dotg_obio_detach(device_t dev) device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ - device_delete_all_children(dev); + device_delete_children(dev); if (sc->sc_dci.sc_irq_res && sc->sc_dci.sc_intr_hdl) { /* Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Tue Nov 22 21:55:40 2011 (r227848) +++ head/sys/sys/bus.h Tue Nov 22 21:56:55 2011 (r227849) @@ -424,7 +424,7 @@ device_t device_add_child_ordered(device const char *name, int unit); void device_busy(device_t dev); int device_delete_child(device_t dev, device_t child); -int device_delete_all_children(device_t dev); +int device_delete_children(device_t dev); int device_attach(device_t dev); int device_detach(device_t dev); void device_disable(device_t dev); From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 22: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 6939D106564A; Tue, 22 Nov 2011 22:10:37 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from stark.strangled.net (stark.strangled.net [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 507438FC17; Tue, 22 Nov 2011 22:10:37 +0000 (UTC) Received: from rui-macbook-pro.lan (bl17-149-5.dsl.telepac.pt [188.82.149.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by stark.strangled.net (Postfix) with ESMTPSA id 28D573981E; Tue, 22 Nov 2011 14:10:35 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=utf-8 From: Rui Paulo In-Reply-To: <8662ibkfjs.fsf@ds4.des.no> Date: Tue, 22 Nov 2011 22:10:34 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201111211635.pALGZvSS051067@svn.freebsd.org> <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> <8662ibkfjs.fsf@ds4.des.no> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227797 - 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: Tue, 22 Nov 2011 22:10:37 -0000 On 2011/11/22, at 21:33, Dag-Erling Sm=C3=B8rgrav wrote: > Rui Paulo writes: >> With this change, I can no longer update a FreeBSD 9.0-current system >> from June 2010 to FreeBSD 10.0. I suspect I'm not the only one. >=20 > Sorry, my mind reader is broken at the moment, so you'll have to = provide > more information than that. If I had more information, I would have provided it. I'm still = diagnosing the problem someone else created.=20 Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 22:26: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 5DD781065678; Tue, 22 Nov 2011 22:26:45 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id E99F68FC1A; Tue, 22 Nov 2011 22:26:44 +0000 (UTC) Received: by ghbg15 with SMTP id g15so434039ghb.13 for ; Tue, 22 Nov 2011 14:26:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=PjxHLAAz+sXYMXRYraSFzGFJk9+0z5XeLXkq24azc0M=; b=w3cZv8VI9NYzYmCz0yK41mG3uTi/7ixjDo7Pqz8t2p66+/mm6IlOj3VX/UnjygGwgm vzaGVz7rRsVrJYWALufqHFyJ2egB5m2Pe3f+fwuo5TIXD3T+yd0GMS/u+AZpjyDkyt+u TceLCpvO0XHUsCkPwhhcmiUFy5ruUSZubAep4= MIME-Version: 1.0 Received: by 10.236.181.134 with SMTP id l6mr30552252yhm.18.1322000804259; Tue, 22 Nov 2011 14:26:44 -0800 (PST) Received: by 10.236.110.174 with HTTP; Tue, 22 Nov 2011 14:26:44 -0800 (PST) In-Reply-To: References: <201111211635.pALGZvSS051067@svn.freebsd.org> <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> <8662ibkfjs.fsf@ds4.des.no> Date: Tue, 22 Nov 2011 17:26:44 -0500 Message-ID: From: Ben Kaduk To: Rui Paulo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227797 - 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: Tue, 22 Nov 2011 22:26:45 -0000 2011/11/22 Rui Paulo : > On 2011/11/22, at 21:33, Dag-Erling Sm=F8rgrav wrote: > >> Rui Paulo writes: >>> With this change, I can no longer update a FreeBSD 9.0-current system >>> from June 2010 to FreeBSD 10.0. I suspect I'm not the only one. >> >> Sorry, my mind reader is broken at the moment, so you'll have to provide >> more information than that. > > > If I had more information, I would have provided it. I'm still diagnosing= the problem someone else created. That is to say ... "take a machine running 9-current from june 2010 which has no issues. Fetch a HEAD source tree and try the usual buildworld process, and watch it explode." Right? -Ben From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 23:17:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 66764106566B; Tue, 22 Nov 2011 23:17:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id A6A5A1605F1; Tue, 22 Nov 2011 23:15:25 +0000 (UTC) Message-ID: <4ECC2D0D.6080608@FreeBSD.org> Date: Tue, 22 Nov 2011 15:15:25 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Ben Kaduk References: <201111211635.pALGZvSS051067@svn.freebsd.org> <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> <8662ibkfjs.fsf@ds4.des.no> In-Reply-To: X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: src-committers@freebsd.org, Rui Paulo , svn-src-all@freebsd.org, =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgra?=, svn-src-head@freebsd.org, =?ISO-8859-1?Q?v?= Subject: Re: svn commit: r227797 - 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: Tue, 22 Nov 2011 23:17:39 -0000 On 11/22/2011 2:26 PM, Ben Kaduk wrote: > 2011/11/22 Rui Paulo : >> On 2011/11/22, at 21:33, Dag-Erling Smørgrav wrote: >> >>> Rui Paulo writes: >>>> With this change, I can no longer update a FreeBSD 9.0-current system >>>> from June 2010 to FreeBSD 10.0. I suspect I'm not the only one. >>> >>> Sorry, my mind reader is broken at the moment, so you'll have to provide >>> more information than that. >> >> >> If I had more information, I would have provided it. I'm still diagnosing the problem someone else created. > > That is to say ... "take a machine running 9-current from june 2010 > which has no issues. Fetch a HEAD source tree and try the usual > buildworld process, and watch it explode." > Right? I'm not sure that's an interesting test case, since we don't "Officially" support major version upgrades other than from the latest -stable version of the branch immediately before the one you're trying to upgrade to. IOW, the interesting question is, does it work if you upgrade to stable/9 first? Doug -- "We could put the whole Internet into a book." "Too practical." Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 23: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 ABFA6106566B; Tue, 22 Nov 2011 23:19:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82B648FC0A; Tue, 22 Nov 2011 23:19:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMNJnj3014570; Tue, 22 Nov 2011 23:19:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMNJn5e014568; Tue, 22 Nov 2011 23:19:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111222319.pAMNJn5e014568@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 22 Nov 2011 23: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: r227850 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 23:19:49 -0000 Author: yongari Date: Tue Nov 22 23:19:49 2011 New Revision: 227850 URL: http://svn.freebsd.org/changeset/base/227850 Log: Writing access to RL_CFG5 register also requires EEPROM write access. While I'm here, enable WOL through magic packet but disable waking up system via unicast, multicast and broadcast frames. Otherwise, multicast or unicast frame(e.g. ICMP echo request) can wake up system which is not probably wanted behavior on most environments. This was not known as problem because RL_CFG5 register access had not effect until this change. The capability to wake up system with unicast/multicast frames are still set in driver, default off, so users who need that feature can still activate it with ifconfig(8). Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Nov 22 21:56:55 2011 (r227849) +++ head/sys/dev/re/if_re.c Tue Nov 22 23:19:49 2011 (r227850) @@ -1590,6 +1590,7 @@ re_attach(device_t dev) if (pci_find_cap(sc->rl_dev, PCIY_PMG, ®) == 0) ifp->if_capabilities |= IFCAP_WOL; ifp->if_capenable = ifp->if_capabilities; + ifp->if_capenable &= ~(IFCAP_WOL_UCAST | IFCAP_WOL_MCAST); /* * Don't enable TSO by default. It is known to generate * corrupted TCP segments(bad TCP options) under certain @@ -3622,12 +3623,9 @@ re_setwol(struct rl_softc *sc) v |= RL_CFG3_WOL_MAGIC; CSR_WRITE_1(sc, RL_CFG3, v); - /* Config register write done. */ - CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); - v = CSR_READ_1(sc, RL_CFG5); - v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); - v &= ~RL_CFG5_WOL_LANWAKE; + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST | + RL_CFG5_WOL_LANWAKE); if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) v |= RL_CFG5_WOL_UCAST; if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) @@ -3636,6 +3634,9 @@ re_setwol(struct rl_softc *sc) v |= RL_CFG5_WOL_LANWAKE; CSR_WRITE_1(sc, RL_CFG5, v); + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); + if ((ifp->if_capenable & IFCAP_WOL) != 0 && (sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) & ~0x80); From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 23:27: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 6558E1065672; Tue, 22 Nov 2011 23:27:59 +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 556B18FC0C; Tue, 22 Nov 2011 23:27:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMNRxse014858; Tue, 22 Nov 2011 23:27:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMNRx4k014856; Tue, 22 Nov 2011 23:27:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111222327.pAMNRx4k014856@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 22 Nov 2011 23:27: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: r227851 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 23:27:59 -0000 Author: yongari Date: Tue Nov 22 23:27:59 2011 New Revision: 227851 URL: http://svn.freebsd.org/changeset/base/227851 Log: Perform media change after setting IFF_DRV_RUNNING flag. Without it, driver would ignore the first link state update if controller already established a link such that it would have to take additional link state handling in re_tick(). Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Nov 22 23:19:49 2011 (r227850) +++ head/sys/dev/re/if_re.c Tue Nov 22 23:27:59 2011 (r227851) @@ -3194,14 +3194,14 @@ re_init_locked(struct rl_softc *sc) if (sc->rl_testmode) return; - mii_mediachg(mii); - CSR_WRITE_1(sc, RL_CFG1, CSR_READ_1(sc, RL_CFG1) | RL_CFG1_DRVLOAD); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->rl_flags &= ~RL_FLAG_LINK; + mii_mediachg(mii); + sc->rl_watchdog_timer = 0; callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 23:37: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 F2843106566B; Tue, 22 Nov 2011 23:37:48 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 64E618FC0A; Tue, 22 Nov 2011 23:37:47 +0000 (UTC) Received: by qadc10 with SMTP id c10so811384qad.13 for ; Tue, 22 Nov 2011 15:37:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=mM/MmUg8RGq+WaS3+awFdPrDiezW6oQCMzH/ggbLEyM=; b=aWWeO9+KSJsA3IhusUJblKteR4WN4g+UH8tOEpN/SSFjnpTYO0CXVQ2Iqnwn3zokTZ Vdn0fkzKKfeMRQQsAoNI9CWryrFzP8FjHmUyweKRkvS3OHDdyZXxVCNQCPFUnexbTNBY ry5+rbCmAPKrdgjTKDcNWT9hWNjMRXoEBdrD8= MIME-Version: 1.0 Received: by 10.68.25.199 with SMTP id e7mr2427606pbg.123.1322005066231; Tue, 22 Nov 2011 15:37:46 -0800 (PST) Received: by 10.68.59.228 with HTTP; Tue, 22 Nov 2011 15:37:46 -0800 (PST) In-Reply-To: <4ECC2D0D.6080608@FreeBSD.org> References: <201111211635.pALGZvSS051067@svn.freebsd.org> <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> <8662ibkfjs.fsf@ds4.des.no> <4ECC2D0D.6080608@FreeBSD.org> Date: Tue, 22 Nov 2011 15:37:46 -0800 Message-ID: From: Peter Wemm To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Rui Paulo , svn-src-all@freebsd.org, Ben Kaduk , svn-src-head@freebsd.org, =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Subject: Re: svn commit: r227797 - 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: Tue, 22 Nov 2011 23:37:49 -0000 On Tue, Nov 22, 2011 at 3:15 PM, Doug Barton wrote: > On 11/22/2011 2:26 PM, Ben Kaduk wrote: >> 2011/11/22 Rui Paulo : >>> On 2011/11/22, at 21:33, Dag-Erling Sm=F8rgrav wrote: >>> >>>> Rui Paulo writes: >>>>> With this change, I can no longer update a FreeBSD 9.0-current system >>>>> from June 2010 to FreeBSD 10.0. I suspect I'm not the only one. >>>> >>>> Sorry, my mind reader is broken at the moment, so you'll have to provi= de >>>> more information than that. >>> >>> >>> If I had more information, I would have provided it. I'm still diagnosi= ng the problem someone else created. >> >> That is to say ... "take a machine running 9-current from june 2010 >> which has no issues. =A0Fetch a HEAD source tree and try the usual >> buildworld process, and watch it explode." >> Right? > > I'm not sure that's an interesting test case, since we don't > "Officially" support major version upgrades other than from the latest > -stable version of the branch immediately before the one you're trying > to upgrade to. IOW, the interesting question is, does it work if you > upgrade to stable/9 first? > Rui said he was researching why. However.. the first thing I noticed was this commit *adds* a .c.o: rule in bsd.lib.mk, which replaces the default in sys.mk. The one in sys.mk has ctfconvert rules and the new one does not. At face value, this alone looks suspicious. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 23:46: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 D6BA4106566C; Tue, 22 Nov 2011 23:46:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6C948FC08; Tue, 22 Nov 2011 23:46:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAMNkuqL015487; Tue, 22 Nov 2011 23:46:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAMNkubs015485; Tue, 22 Nov 2011 23:46:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201111222346.pAMNkubs015485@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 22 Nov 2011 23:46: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: r227852 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 23:46:56 -0000 Author: jilles Date: Tue Nov 22 23:46:56 2011 New Revision: 227852 URL: http://svn.freebsd.org/changeset/base/227852 Log: fdopendir(): Do not close the passed file descriptor on failure. Reviewed by: delphij Modified: head/lib/libc/gen/opendir.c Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Tue Nov 22 23:27:59 2011 (r227851) +++ head/lib/libc/gen/opendir.c Tue Nov 22 23:46:56 2011 (r227852) @@ -75,6 +75,8 @@ __opendir2(const char *name, int flags) { int fd; struct stat statb; + DIR *dir; + int saved_errno; /* * stat() before _open() because opening of special files may be @@ -89,7 +91,13 @@ __opendir2(const char *name, int flags) if ((fd = _open(name, O_RDONLY | O_NONBLOCK | O_DIRECTORY)) == -1) return (NULL); - return __opendir_common(fd, name, flags); + dir = __opendir_common(fd, name, flags); + if (dir == NULL) { + saved_errno = errno; + _close(fd); + errno = saved_errno; + } + return (dir); } static int @@ -110,6 +118,7 @@ __opendir_common(int fd, const char *nam int incr; int saved_errno; int unionstack; + int fd2; struct stat statb; dirp = NULL; @@ -199,14 +208,15 @@ __opendir_common(int fd, const char *nam * which has also been read -- see fts.c. */ if (flags & DTF_REWIND) { - (void)_close(fd); - if ((fd = _open(name, O_RDONLY | O_DIRECTORY)) == -1) { + if ((fd2 = _open(name, O_RDONLY | O_DIRECTORY)) == -1) { saved_errno = errno; free(buf); free(dirp); errno = saved_errno; return (NULL); } + (void)_dup2(fd2, fd); + _close(fd2); } /* @@ -309,7 +319,6 @@ __opendir_common(int fd, const char *nam fail: saved_errno = errno; free(dirp); - (void)_close(fd); errno = saved_errno; return (NULL); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 22 23: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 E235A106566B; Tue, 22 Nov 2011 23:56:07 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 29D608FC14; Tue, 22 Nov 2011 23:56:06 +0000 (UTC) Received: by ggnk5 with SMTP id k5so1128748ggn.13 for ; Tue, 22 Nov 2011 15:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=rEskNM0e8wD+0/5hQbAXA2g7VtYH1ZKFaBfUs5xM/OA=; b=WUtd2fVgPjUrFsxvrAH2QUINnWzJtooi8DyAchzfeujikaMkcez+hXwKNObOHMrsrH K8QG22ENrCyxcBz84VkAO2n6J0zD1PHRV8sckHtbBmwey4ptCPJ7AdDsobGfGRWear3z JCuYy7CIXjGEuqbh9lVYwLDgKOh+wOYj7msC0= MIME-Version: 1.0 Received: by 10.68.51.135 with SMTP id k7mr2618352pbo.72.1322006166136; Tue, 22 Nov 2011 15:56:06 -0800 (PST) Received: by 10.68.59.228 with HTTP; Tue, 22 Nov 2011 15:56:06 -0800 (PST) In-Reply-To: <20111122202735.GA21442@zim.MIT.EDU> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> <20111122202735.GA21442@zim.MIT.EDU> Date: Tue, 22 Nov 2011 15:56:06 -0800 Message-ID: From: Peter Wemm To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org, theraven@freebsd.org, dim@freebsd.org, Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Nov 2011 23:56:08 -0000 On Tue, Nov 22, 2011 at 12:27 PM, David Schultz wrote: > On Tue, Nov 22, 2011, Eitan Adler wrote: >> The problem with profiling this type of change is that it is hard to >> find a good representative benchmark. I could easily write code that >> will show you that adding the equality check is a good idea or that it >> is a horrible idea. IMHO it saves enough time when they are equal, but >> loses almost no time when the strings are not equal. > > Benchmark or not, I think you'll have a very hard time finding a > single real program that routinely calls strcasecmp() with > identical pointers! At this point I'd like to mention ministat(1). What you do is generate a series of timed runs, both with and without a given change. Record the times in two files. Then have ministat show you an analysis to give you an overview to show if you are really onto something or if you're just messing around in statistical noise. ministat(1) is far from the last word, but it gives valuable clues whenever somebody wants to talk about an "optimization". -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 00: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 266B0106564A; Wed, 23 Nov 2011 00:01:46 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157948FC12; Wed, 23 Nov 2011 00:01:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN01jgP016000; Wed, 23 Nov 2011 00:01:45 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN01juv015998; Wed, 23 Nov 2011 00:01:45 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201111230001.pAN01juv015998@svn.freebsd.org> From: David Xu Date: Wed, 23 Nov 2011 00:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227853 - stable/9/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 00:01:46 -0000 Author: davidxu Date: Wed Nov 23 00:01:45 2011 New Revision: 227853 URL: http://svn.freebsd.org/changeset/base/227853 Log: MFC r227604: Pass CVWAIT flags to kernel, this should handle Timeout correctly for pthread_cond_timedwait when it uses kernel-based condition variable. Approved by: re (kib) Modified: stable/9/lib/libthr/thread/thr_umtx.c Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_umtx.c ============================================================================== --- stable/9/lib/libthr/thread/thr_umtx.c Tue Nov 22 23:46:56 2011 (r227852) +++ stable/9/lib/libthr/thread/thr_umtx.c Wed Nov 23 00:01:45 2011 (r227853) @@ -231,7 +231,7 @@ _thr_ucond_init(struct ucond *cv) int _thr_ucond_wait(struct ucond *cv, struct umutex *m, - const struct timespec *timeout, int check_unparking) + const struct timespec *timeout, int flags) { if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && timeout->tv_nsec <= 0))) { @@ -239,8 +239,7 @@ _thr_ucond_wait(struct ucond *cv, struct _thr_umutex_unlock(m, TID(curthread)); return (ETIMEDOUT); } - return _umtx_op_err(cv, UMTX_OP_CV_WAIT, - check_unparking ? UMTX_CHECK_UNPARKING : 0, + return _umtx_op_err(cv, UMTX_OP_CV_WAIT, flags, m, __DECONST(void*, timeout)); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 01:05: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 C9B2F106564A; Wed, 23 Nov 2011 01:05:33 +0000 (UTC) (envelope-from lists@eitanadler.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 490D38FC17; Wed, 23 Nov 2011 01:05:32 +0000 (UTC) Received: by wwg14 with SMTP id 14so1372230wwg.31 for ; Tue, 22 Nov 2011 17:05:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=SgZB53BcR139u2OL6VY4OIZeIcC9FneEBkTfo6FY0q4=; b=MYWk7zIFuRUqy2BM5RNrFtgVD2BWJCjVsbg9gGQEtDT3XmJ8gxdNacZJX1PIre5boQ t103s6VWrnEQFtsbLme+OytoVMjF7ZBcUmp+AcHyutKpxMwm1/5aW711n5SSVfhzOP3C w+xMYCW7OkfKaCtIu6bJL5361ZSoksEowNPbk= Received: by 10.227.205.130 with SMTP id fq2mr16558719wbb.17.1322010331105; Tue, 22 Nov 2011 17:05:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.216.21.133 with HTTP; Tue, 22 Nov 2011 17:05:00 -0800 (PST) In-Reply-To: References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> <20111122202735.GA21442@zim.MIT.EDU> From: Eitan Adler Date: Tue, 22 Nov 2011 20:05:00 -0500 X-Google-Sender-Auth: NFGy6EJn_4GJJDcHE8_n4_YnztE Message-ID: To: Peter Wemm Content-Type: text/plain; charset=UTF-8 Cc: src-committers@freebsd.org, theraven@freebsd.org, svn-src-all@freebsd.org, dim@freebsd.org, Brooks Davis , bde@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 01:05:33 -0000 On Tue, Nov 22, 2011 at 6:56 PM, Peter Wemm wrote: > On Tue, Nov 22, 2011 at 12:27 PM, David Schultz wrote: >> On Tue, Nov 22, 2011, Eitan Adler wrote: >>> The problem with profiling this type of change is that it is hard to >>> find a good representative benchmark. I could easily write code that >>> will show you that adding the equality check is a good idea or that it >>> is a horrible idea. IMHO it saves enough time when they are equal, but >>> loses almost no time when the strings are not equal. >> >> Benchmark or not, I think you'll have a very hard time finding a >> single real program that routinely calls strcasecmp() with >> identical pointers! > > At this point I'd like to mention ministat(1). I know how to use ministat ;) The problem is that I could, with some effort, write a program which will show that this change is significant, and a second program which shows you this change is not. The issue here is find a good representative benchmark upon which to use ministat. I was unable to find any "standard" string manipulation benchmark to test. When I first thought of this change I (a) asked people on C mailing lists and IRC channels (b) looked to see if anyone else did it (glibc does, netbsd and avr-libc don't). In either case I should have posted the patch to -hackers prior to committing. -- Eitan Adler Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 02:08: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 C880F106566B; Wed, 23 Nov 2011 02:08:05 +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 9E98F8FC08; Wed, 23 Nov 2011 02:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN285Vw019918; Wed, 23 Nov 2011 02:08:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN285vT019916; Wed, 23 Nov 2011 02:08:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111230208.pAN285vT019916@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 Nov 2011 02:08: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: r227854 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 02:08:05 -0000 Author: yongari Date: Wed Nov 23 02:08:05 2011 New Revision: 227854 URL: http://svn.freebsd.org/changeset/base/227854 Log: Disable accepting frames in re_stop() to put RX MAC into idle state. Because there is no reliable way to know whether RX MAC is in stopped state, rejecting all frames would be the only way to minimize possible races. Otherwise it's possible to receive frames while stop command execution is in progress and controller can DMA the frame to freed RX buffer during that period. This was observed on recent PCIe controllers(i.e. RTL8111F). While this change may not be required on old controllers it wouldn't make negative effects on old controllers. One side effect of this change is disabling receive so driver reprograms RL_RXCFG to receive WOL frames when it is put into suspend or shutdown. This should address occasional 'memory modified free' errors seen on recent RealTek controllers. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Nov 23 00:01:45 2011 (r227853) +++ head/sys/dev/re/if_re.c Wed Nov 23 02:08:05 2011 (r227854) @@ -3456,6 +3456,16 @@ re_stop(struct rl_softc *sc) callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + /* + * Disable accepting frames to put RX MAC into idle state. + * Otherwise it's possible to get frames while stop command + * execution is in progress and controller can DMA the frame + * to already freed RX buffer during that period. + */ + CSR_WRITE_4(sc, RL_RXCFG, CSR_READ_4(sc, RL_RXCFG) & + ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_MULTI | + RL_RXCFG_RX_BROAD)); + if ((sc->rl_flags & RL_FLAG_CMDSTOP) != 0) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_STOPREQ | RL_CMD_TX_ENB | RL_CMD_RX_ENB); @@ -3604,9 +3614,11 @@ re_setwol(struct rl_softc *sc) CSR_WRITE_1(sc, RL_GPIO, CSR_READ_1(sc, RL_GPIO) & ~0x01); } - if ((ifp->if_capenable & IFCAP_WOL) != 0 && - (sc->rl_flags & RL_FLAG_WOLRXENB) != 0) - CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RX_ENB); + if ((ifp->if_capenable & IFCAP_WOL) != 0) { + re_set_rxmode(sc); + if ((sc->rl_flags & RL_FLAG_WOLRXENB) != 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RX_ENB); + } /* Enable config register write. */ CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 02:51: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 F39A6106566C; Wed, 23 Nov 2011 02:51:25 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 739268FC08; Wed, 23 Nov 2011 02:51:25 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id pAN2VaFt020455; Wed, 23 Nov 2011 10:31:37 +0800 (CST) From: Kevin Lo To: Alexey Dokuchaev In-Reply-To: <20111118031921.GA43425@FreeBSD.org> References: <201111180305.pAI35LtC045952@svn.freebsd.org> <20111118031921.GA43425@FreeBSD.org> Content-Type: multipart/mixed; boundary="=-wP8d6gI8nXpDqKwCvTCn" Date: Wed, 23 Nov 2011 10:31:36 +0800 Message-ID: <1322015496.2006.7.camel@esl.kevlo.org> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227650 - in head: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/kern sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 02:51:26 -0000 --=-wP8d6gI8nXpDqKwCvTCn Content-Type: text/plain; charset="iso8859-1" Content-Transfer-Encoding: 7bit On Fri, 2011-11-18 at 03:19 +0000, Alexey Dokuchaev wrote: > On Fri, Nov 18, 2011 at 03:05:21AM +0000, Kevin Lo wrote: > > Author: kevlo > > Date: Fri Nov 18 03:05:20 2011 > > New Revision: 227650 > > URL: http://svn.freebsd.org/changeset/base/227650 > > > > Log: > > Add unicode support to msdosfs and smbfs; original pathes from imura, > > bug fixes by Kuan-Chung Chiu . > > Wow, long anticipated! Any MFCs planned? Will do until 9.0 is released. > I've also posted a message[1] on > unicode support for msdosfs/ntfs on -fs@ back in October, perhaps you could > take a look on these patches and, ultimately, fix NTFS too? :-) Could you try the attached patch which adds unicode support to NTFS? Thanks! > > Thanks! > > ./danfe > > [1] http://docs.freebsd.org/cgi/mid.cgi?20111013181602.GA35354 Kevin --=-wP8d6gI8nXpDqKwCvTCn Content-Disposition: attachment; filename="patch-ntfs" Content-Type: text/x-patch; name="patch-ntfs"; charset="iso8859-1" Content-Transfer-Encoding: 7bit Index: sys/fs/ntfs/ntfs_vnops.c =================================================================== --- sys/fs/ntfs/ntfs_vnops.c (revision 227854) +++ sys/fs/ntfs/ntfs_vnops.c (working copy) @@ -481,7 +481,7 @@ ntfs_readdir(ap) struct uio *uio = ap->a_uio; struct ntfsmount *ntmp = ip->i_mp; int i, j, error = 0; - wchar c; + char *c; u_int32_t faked = 0, num; int ncookies = 0; struct dirent cde; @@ -538,11 +538,10 @@ ntfs_readdir(ap) if(!ntfs_isnamepermitted(ntmp,iep)) continue; - for(i=0, j=0; iie_fnamelen; i++, j++) { + for(i=0, j=0; iie_fnamelen; i++) { c = NTFS_U28(iep->ie_fname[i]); - if (c&0xFF00) - cde.d_name[j++] = (char)(c>>8); - cde.d_name[j] = (char)c&0xFF; + while (*c != '\0') + cde.d_name[j++] = *c++; } cde.d_name[j] = '\0'; dprintf(("ntfs_readdir: elem: %d, fname:[%s] type: %d, flag: %d, ", Index: sys/fs/ntfs/ntfs_subr.c =================================================================== --- sys/fs/ntfs/ntfs_subr.c (revision 227854) +++ sys/fs/ntfs/ntfs_subr.c (working copy) @@ -669,23 +669,17 @@ ntfs_uastricmp(ntmp, ustr, ustrlen, astr, astrlen) const char *astr; size_t astrlen; { - int len; + const char *astrp = astr; + int len, res; size_t i, j, mbstrlen = astrlen; - int res; - wchar wc; if (ntmp->ntm_ic_l2u) { - for (i = 0, j = 0; i < ustrlen && j < astrlen; i++, j++) { - if (j < astrlen -1) { - wc = (wchar)astr[j]<<8 | (astr[j+1]&0xFF); - len = 2; - } else { - wc = (wchar)astr[j]<<8 & 0xFF00; - len = 1; - } + for (i = 0, j = 0; i < ustrlen && j < astrlen; i++) { + len = 4; res = ((int) NTFS_TOUPPER(ustr[i])) - - ((int)NTFS_TOUPPER(NTFS_82U(wc, &len))); - j += len - 1; + ((int)NTFS_TOUPPER(NTFS_82U(astrp, &len))); + astrp += len; + j += len; mbstrlen -= len - 1; if (res) @@ -698,7 +692,8 @@ ntfs_uastricmp(ntmp, ustr, ustrlen, astr, astrlen) */ for (i = 0; i < ustrlen && i < astrlen; i++) { res = ((int) NTFS_TOUPPER(NTFS_82U(NTFS_U28(ustr[i]), &len))) - - ((int)NTFS_TOUPPER(NTFS_82U((wchar)astr[i], &len))); + ((int)NTFS_TOUPPER(NTFS_82U(astrp, &len))); + astrp++; if (res) return res; } @@ -717,23 +712,18 @@ ntfs_uastrcmp(ntmp, ustr, ustrlen, astr, astrlen) const char *astr; size_t astrlen; { - char u, l; + char *c; size_t i, j, mbstrlen = astrlen; int res; - wchar wc; - for (i = 0, j = 0; (i < ustrlen) && (j < astrlen); i++, j++) { - res = 0; - wc = NTFS_U28(ustr[i]); - u = (char)(wc>>8); - l = (char)wc; - if (u != '\0' && j < astrlen -1) { - res = (int) (u - astr[j++]); + for (i = 0, j = 0; (i < ustrlen) && (j < astrlen); i++, mbstrlen++) { + c = NTFS_U28(ustr[i]); + while (*c != '\0') { + res = (int) (*c++ - astr[j++]); + if (res) + return res; mbstrlen--; } - res = (res<<8) + (int) (l - astr[j]); - if (res) - return res; } return (ustrlen - mbstrlen); } @@ -2137,50 +2127,47 @@ ntfs_82u_uninit(struct ntfsmount *ntmp) } /* - * maps the Unicode char to 8bit equivalent - * XXX currently only gets lower 8bit from the Unicode char - * and substitutes a '_' for it if the result would be '\0'; - * something better has to be definitely though out + * maps the Unicode char to local character */ -wchar +char * ntfs_u28( struct ntfsmount *ntmp, wchar wc) { - char *p, *outp, inbuf[3], outbuf[3]; + char *p, *outp, inbuf[3], outbuf[5];; size_t ilen, olen; + outp = outbuf; if (ntfs_iconv && ntmp->ntm_ic_u2l) { - ilen = olen = 2; + ilen = 2; + olen = 4; inbuf[0] = (char)(wc>>8); inbuf[1] = (char)wc; inbuf[2] = '\0'; p = inbuf; - outp = outbuf; ntfs_iconv->convchr(ntmp->ntm_ic_u2l, (const char **)&p, &ilen, &outp, &olen); - if (olen == 1) { - return ((wchar)(outbuf[0]&0xFF)); - } else if (olen == 0) { - return ((wchar)((outbuf[0]<<8) | (outbuf[1]&0xFF))); - } - return ('?'); + if (olen == 4) + *outp++ = '?'; + *outp = '\0'; + outp = outbuf; + return (outp); } p = ntmp->ntm_u28[(wc>>8)&0xFF]; - if (p == NULL) - return ('_'); - return (p[wc&0xFF]&0xFF); + outbuf[0] = (p == NULL) ? '_' : p[wc&0xFF] & 0xFF; + outbuf[1] = '\0'; + return (outp); } wchar ntfs_82u( struct ntfsmount *ntmp, - wchar wc, + const char *c, int *len) { - char *p, *outp, inbuf[3], outbuf[3]; + char *outp, outbuf[3]; wchar uc; size_t ilen, olen; @@ -2188,13 +2175,8 @@ ntfs_82u( ilen = (size_t)*len; olen = 2; - inbuf[0] = (char)(wc>>8); - inbuf[1] = (char)wc; - inbuf[2] = '\0'; - p = inbuf; outp = outbuf; - ntfs_iconv->convchr(ntmp->ntm_ic_l2u, (const char **)&p, &ilen, - &outp, &olen); + ntfs_iconv->convchr(ntmp->ntm_ic_l2u, &c, &ilen, &outp, &olen); *len -= (int)ilen; uc = (wchar)((outbuf[0]<<8) | (outbuf[1]&0xFF)); @@ -2202,7 +2184,7 @@ ntfs_82u( } if (ntmp->ntm_82u != NULL) - return (ntmp->ntm_82u[wc&0xFF]); + return (ntmp->ntm_82u[*c&0xFF]); return ('?'); } Index: sys/fs/ntfs/ntfs_subr.h =================================================================== --- sys/fs/ntfs/ntfs_subr.h (revision 227854) +++ sys/fs/ntfs/ntfs_subr.h (working copy) @@ -112,8 +112,8 @@ int ntfs_u28_init(struct ntfsmount *ntmp, wchar *u int ntfs_u28_uninit(struct ntfsmount *ntmp); int ntfs_82u_init(struct ntfsmount *ntmp, char *cs_local, char *cs_ntfs); int ntfs_82u_uninit(struct ntfsmount *ntmp); -wchar ntfs_u28(struct ntfsmount *ntmp, wchar wc); -wchar ntfs_82u(struct ntfsmount *ntmp, wchar wc, int *len); +char * ntfs_u28(struct ntfsmount *ntmp, wchar wc); +wchar ntfs_82u(struct ntfsmount *ntmp, const char *c, int *len); #define NTFS_U28(ch) ntfs_u28(ntmp, (ch)) #define NTFS_82U(ch, len) ntfs_82u(ntmp, (ch), len) #define NTFS_UASTRCMP(ustr, ustrlen, astr, astrlen) \ --=-wP8d6gI8nXpDqKwCvTCn-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 03:32: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 CA6A01065672; Wed, 23 Nov 2011 03:32:37 +0000 (UTC) (envelope-from buganini@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2488FC12; Wed, 23 Nov 2011 03:32:37 +0000 (UTC) Received: by iakl21 with SMTP id l21so1599244iak.13 for ; Tue, 22 Nov 2011 19:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NYud7CfSdcAI1IYLQxpZuApXo2PNc7PltpYfQghDDAg=; b=DHBD1BTI2DNgrt5VR2moe7QI2314MpZdKY7mmOU7PPY5LiXBojiuanKvlEkX/xV5m1 /EjLa8HYj95rJB7U9+sNv5FeBqgA+1hsbS3Y/D9rUZ/SmDSgG0pgO47VlEr5UeeHBEm6 b4WhKthCtZSfUr1sWRpC60OtZj511Hm8tJ3Is= MIME-Version: 1.0 Received: by 10.42.148.136 with SMTP id r8mr818405icv.1.1322017523996; Tue, 22 Nov 2011 19:05:23 -0800 (PST) Received: by 10.231.32.202 with HTTP; Tue, 22 Nov 2011 19:05:23 -0800 (PST) In-Reply-To: <1322015496.2006.7.camel@esl.kevlo.org> References: <201111180305.pAI35LtC045952@svn.freebsd.org> <20111118031921.GA43425@FreeBSD.org> <1322015496.2006.7.camel@esl.kevlo.org> Date: Wed, 23 Nov 2011 11:05:23 +0800 Message-ID: From: Buganini To: Kevin Lo Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r227650 - in head: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/kern sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 03:32:37 -0000 Also, I've regenerated imura's patch for cd9660 against HEAD, but I don't have test case. Please test it. http://www.cnmc.tw/~buganini/cd9660.patch.txt Buganini From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 05:00: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 A8F67106566C; Wed, 23 Nov 2011 05:00: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 8E0358FC0A; Wed, 23 Nov 2011 05:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN50PZX026116; Wed, 23 Nov 2011 05:00:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN50PXs026112; Wed, 23 Nov 2011 05:00:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111230500.pAN50PXs026112@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Nov 2011 05:00: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: r227868 - head/sys/dev/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: Wed, 23 Nov 2011 05:00:25 -0000 Author: adrian Date: Wed Nov 23 05:00:25 2011 New Revision: 227868 URL: http://svn.freebsd.org/changeset/base/227868 Log: Flesh out the TX aggregation completion statistics. * Failall is now named just that. * Add TX ok and TX fail, for aggregate frame sub-frames. This will break athstats; a followup commit wil resolve this. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Wed Nov 23 03:55:48 2011 (r227867) +++ head/sys/dev/ath/if_ath_sysctl.c Wed Nov 23 05:00:25 2011 (r227868) @@ -842,9 +842,15 @@ ath_sysctl_stats_attach(struct ath_softc &sc->sc_stats.ast_tx_data_underrun, 0, ""); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_delim_underrun", CTLFLAG_RD, &sc->sc_stats.ast_tx_delim_underrun, 0, ""); - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_aggrfail", CTLFLAG_RD, - &sc->sc_stats.ast_tx_aggrfail, 0, + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_aggr_failall", CTLFLAG_RD, + &sc->sc_stats.ast_tx_aggr_failall, 0, "Number of aggregate TX failures (whole frame)"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_aggr_ok", CTLFLAG_RD, + &sc->sc_stats.ast_tx_aggr_ok, 0, + "Number of aggregate TX OK completions (subframe)"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_aggr_fail", CTLFLAG_RD, + &sc->sc_stats.ast_tx_aggr_fail, 0, + "Number of aggregate TX failures (subframe)"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_intr", CTLFLAG_RD, &sc->sc_stats.ast_rx_intr, 0, "RX interrupts"); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed Nov 23 03:55:48 2011 (r227867) +++ head/sys/dev/ath/if_ath_tx.c Wed Nov 23 05:00:25 2011 (r227868) @@ -2940,7 +2940,6 @@ ath_tx_comp_aggr_error(struct ath_softc TAILQ_INIT(&bf_q); TAILQ_INIT(&bf_cq); - sc->sc_stats.ast_tx_aggrfail++; /* * Update rate control - all frames have failed. @@ -2955,12 +2954,14 @@ ath_tx_comp_aggr_error(struct ath_softc ATH_TXQ_LOCK(sc->sc_ac2q[tid->ac]); tap = ath_tx_get_tx_tid(an, tid->tid); + sc->sc_stats.ast_tx_aggr_failall++; /* Retry all subframes */ bf = bf_first; while (bf) { bf_next = bf->bf_next; bf->bf_next = NULL; /* Remove it from the aggr list */ + sc->sc_stats.ast_tx_aggr_fail++; if (ath_tx_retry_subframe(sc, bf, &bf_q)) { drops++; bf->bf_next = NULL; @@ -3196,6 +3197,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * ATH_BA_ISSET(ba, ba_index)); if (tx_ok && ATH_BA_ISSET(ba, ba_index)) { + sc->sc_stats.ast_tx_aggr_ok++; ath_tx_update_baw(sc, an, atid, bf); bf->bf_state.bfs_dobaw = 0; if (! bf->bf_state.bfs_addedbaw) @@ -3205,6 +3207,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * bf->bf_next = NULL; TAILQ_INSERT_TAIL(&bf_cq, bf, bf_list); } else { + sc->sc_stats.ast_tx_aggr_fail++; if (ath_tx_retry_subframe(sc, bf, &bf_q)) { drops++; bf->bf_next = NULL; Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Wed Nov 23 03:55:48 2011 (r227867) +++ head/sys/dev/ath/if_athioctl.h Wed Nov 23 05:00:25 2011 (r227868) @@ -148,12 +148,14 @@ struct ath_stats { u_int32_t ast_tx_swretrymax; /* software TX retry max limit reach */ u_int32_t ast_tx_data_underrun; u_int32_t ast_tx_delim_underrun; - u_int32_t ast_tx_aggrfail; /* aggregate TX failed in its entirety */ + u_int32_t ast_tx_aggr_failall; /* aggregate TX failed in its entirety */ u_int32_t ast_tx_getnobuf; u_int32_t ast_tx_getbusybuf; u_int32_t ast_tx_intr; u_int32_t ast_rx_intr; - u_int32_t ast_pad[4]; + u_int32_t ast_tx_aggr_ok; /* aggregate TX ok */ + u_int32_t ast_tx_aggr_fail; /* aggregate TX failed */ + u_int32_t ast_pad[2]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 05:01: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 CD5F6106566C; Wed, 23 Nov 2011 05:01: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 A382C8FC0C; Wed, 23 Nov 2011 05:01:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN51NSG026185; Wed, 23 Nov 2011 05:01:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN51N4H026183; Wed, 23 Nov 2011 05:01:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111230501.pAN51N4H026183@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Nov 2011 05:01: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: r227869 - head/tools/tools/ath/athstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 05:01:23 -0000 Author: adrian Date: Wed Nov 23 05:01:23 2011 New Revision: 227869 URL: http://svn.freebsd.org/changeset/base/227869 Log: Add the new statistics introduced in r227868. Sponsored by: Hobnob, Inc. Modified: head/tools/tools/ath/athstats/athstats.c Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Wed Nov 23 05:00:25 2011 (r227868) +++ head/tools/tools/ath/athstats/athstats.c Wed Nov 23 05:01:23 2011 (r227869) @@ -284,10 +284,14 @@ static const struct fmt athstats[] = { { 5, "txdataunderrun", "TXDAU", "A-MPDU TX FIFO data underrun" }, #define S_TX_DELIM_UNDERRUN AFTER(S_TX_DATA_UNDERRUN) { 5, "txdelimunderrun", "TXDEU", "A-MPDU TX Delimiter underrun" }, -#define S_TX_AGGR_FAIL AFTER(S_TX_DELIM_UNDERRUN) - { 10, "txaggrfail", "txaggrfail", "A-MPDU TX attempt failed" }, +#define S_TX_AGGR_OK AFTER(S_TX_DELIM_UNDERRUN) + { 5, "txaggrok", "TXAOK", "A-MPDU sub-frame TX attempt success" }, +#define S_TX_AGGR_FAIL AFTER(S_TX_AGGR_OK) + { 4, "txaggrfail", "TXAF", "A-MPDU sub-frame TX attempt success" }, +#define S_TX_AGGR_FAILALL AFTER(S_TX_AGGR_FAIL) + { 7, "txaggrfailall", "TXAFALL", "A-MPDU sub-frame TX attempt success" }, #ifndef __linux__ -#define S_CABQ_XMIT AFTER(S_TX_AGGR_FAIL) +#define S_CABQ_XMIT AFTER(S_TX_AGGR_FAILALL) { 5, "cabxmit", "cabxmit", "cabq frames transmitted" }, #define S_CABQ_BUSY AFTER(S_CABQ_XMIT) { 5, "cabqbusy", "cabqbusy", "cabq xmit overflowed beacon interval" }, @@ -299,7 +303,7 @@ static const struct fmt athstats[] = { { 5, "rxbusdma", "rxbusdma", "rx setup failed for dma resrcs" }, #define S_FF_TXOK AFTER(S_RX_BUSDMA) #else -#define S_FF_TXOK AFTER(S_TX_AGGR_FAIL) +#define S_FF_TXOK AFTER(S_TX_AGGR_FAILALL) #endif { 5, "fftxok", "fftxok", "fast frames xmit successfully" }, #define S_FF_TXERR AFTER(S_FF_TXOK) @@ -775,7 +779,9 @@ ath_get_curstat(struct statfoo *sf, int case S_TX_SWRETRIES_MAX: STAT(tx_swretrymax); case S_TX_DATA_UNDERRUN: STAT(tx_data_underrun); case S_TX_DELIM_UNDERRUN: STAT(tx_delim_underrun); - case S_TX_AGGR_FAIL: STAT(tx_aggrfail); + case S_TX_AGGR_OK: STAT(tx_aggr_ok); + case S_TX_AGGR_FAIL: STAT(tx_aggr_fail); + case S_TX_AGGR_FAILALL: STAT(tx_aggr_failall); } b[0] = '\0'; return 0; @@ -1014,9 +1020,10 @@ ath_get_totstat(struct statfoo *sf, int case S_TX_SWRETRIES_MAX: STAT(tx_swretrymax); case S_TX_DATA_UNDERRUN: STAT(tx_data_underrun); case S_TX_DELIM_UNDERRUN: STAT(tx_delim_underrun); - case S_TX_AGGR_FAIL: STAT(tx_aggrfail); + case S_TX_AGGR_OK: STAT(tx_aggr_ok); + case S_TX_AGGR_FAIL: STAT(tx_aggr_fail); + case S_TX_AGGR_FAILALL: STAT(tx_aggr_failall); } - b[0] = '\0'; return 0; #undef RXANT From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 05:03: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 55667106567F; Wed, 23 Nov 2011 05:03: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 452CA8FC0C; Wed, 23 Nov 2011 05:03:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN53ScU026282; Wed, 23 Nov 2011 05:03:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN53SHP026280; Wed, 23 Nov 2011 05:03:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111230503.pAN53SHP026280@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Nov 2011 05:03: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: r227870 - head/tools/tools/ath/athstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 05:03:28 -0000 Author: adrian Date: Wed Nov 23 05:03:27 2011 New Revision: 227870 URL: http://svn.freebsd.org/changeset/base/227870 Log: Tidy up the statistic documentation. Sponsored by: Hobnob, Inc. Modified: head/tools/tools/ath/athstats/athstats.c Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Wed Nov 23 05:01:23 2011 (r227869) +++ head/tools/tools/ath/athstats/athstats.c Wed Nov 23 05:03:27 2011 (r227870) @@ -287,9 +287,9 @@ static const struct fmt athstats[] = { #define S_TX_AGGR_OK AFTER(S_TX_DELIM_UNDERRUN) { 5, "txaggrok", "TXAOK", "A-MPDU sub-frame TX attempt success" }, #define S_TX_AGGR_FAIL AFTER(S_TX_AGGR_OK) - { 4, "txaggrfail", "TXAF", "A-MPDU sub-frame TX attempt success" }, + { 4, "txaggrfail", "TXAF", "A-MPDU sub-frame TX attempt failures" }, #define S_TX_AGGR_FAILALL AFTER(S_TX_AGGR_FAIL) - { 7, "txaggrfailall", "TXAFALL", "A-MPDU sub-frame TX attempt success" }, + { 7, "txaggrfailall", "TXAFALL", "A-MPDU TX frame failures" }, #ifndef __linux__ #define S_CABQ_XMIT AFTER(S_TX_AGGR_FAILALL) { 5, "cabxmit", "cabxmit", "cabq frames transmitted" }, From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 05:34: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 9FA171065679; Wed, 23 Nov 2011 05:34:01 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 900498FC16; Wed, 23 Nov 2011 05:34:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN5Y1AC027230; Wed, 23 Nov 2011 05:34:01 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN5Y1fB027228; Wed, 23 Nov 2011 05:34:01 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201111230534.pAN5Y1fB027228@svn.freebsd.org> From: Kevin Lo Date: Wed, 23 Nov 2011 05:34: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: r227871 - head/sys/dev/vte X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 05:34:01 -0000 Author: kevlo Date: Wed Nov 23 05:34:01 2011 New Revision: 227871 URL: http://svn.freebsd.org/changeset/base/227871 Log: Remove unused variable mii. This variable is initialized but not used. Reviewed by: yongari Modified: head/sys/dev/vte/if_vte.c Modified: head/sys/dev/vte/if_vte.c ============================================================================== --- head/sys/dev/vte/if_vte.c Wed Nov 23 05:03:27 2011 (r227870) +++ head/sys/dev/vte/if_vte.c Wed Nov 23 05:34:01 2011 (r227871) @@ -1621,14 +1621,12 @@ static void vte_init_locked(struct vte_softc *sc) { struct ifnet *ifp; - struct mii_data *mii; bus_addr_t paddr; uint8_t *eaddr; VTE_LOCK_ASSERT(sc); ifp = sc->vte_ifp; - mii = device_get_softc(sc->vte_miibus); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 06:42: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 22742106564A; Wed, 23 Nov 2011 06:42:19 +0000 (UTC) (envelope-from jrid@cubinlab.ee.unimelb.edu.au) Received: from mail-gw1.its.unimelb.edu.au (mail-gw1.its.unimelb.edu.au [128.250.5.150]) by mx1.freebsd.org (Postfix) with ESMTP id C911B8FC16; Wed, 23 Nov 2011 06:42:18 +0000 (UTC) Received: from emu.cubinlab.ee.unimelb.edu.au (cubinlab.ee.unimelb.edu.au [128.250.80.33]) by mail-gw1.its.unimelb.edu.au (Postfix) with ESMTPS id 57A4CE50; Wed, 23 Nov 2011 17:42:17 +1100 (EST) Received: from jrid.cubinlab.ee.unimelb.edu.au (jrid.cubinlab.ee.unimelb.edu.au [10.0.1.128]) (authenticated bits=0) by emu.cubinlab.ee.unimelb.edu.au (8.14.4/8.14.4) with ESMTP id pAN6gGBh098328 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 23 Nov 2011 17:42:17 +1100 (EST) (envelope-from jrid@cubinlab.ee.unimelb.edu.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Julien Ridoux In-Reply-To: <4ECBAB19.4010907@freebsd.org> Date: Wed, 23 Nov 2011 17:42:16 +1100 Content-Transfer-Encoding: quoted-printable Message-Id: <8805563E-60F9-4BF4-A292-1A43C4FA368A@cubinlab.ee.unimelb.edu.au> References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> <4EC9FD8A.5040401@freebsd.org> <201111220830.05029.jhb@freebsd.org> <4ECBAB19.4010907@freebsd.org> To: Lawrence Stewart X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ben Kaduk , John Baldwin Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 06:42:19 -0000 On 23/11/2011, at 1:00 AM, Lawrence Stewart wrote: > On 11/23/11 00:30, John Baldwin wrote: >> On Monday, November 21, 2011 2:28:10 am Lawrence Stewart wrote: >>> On 11/21/11 17:18, Julien Ridoux wrote: >>>>=20 >>>> On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: >>>>=20 >>>>> On 11/21/11 16:12, Ben Kaduk wrote: >>>>>> On Sun, Nov 20, 2011 at 11:17 PM, Lawrence >>>>>> Stewart wrote: >>>>>>> Author: lstewart Date: Mon Nov 21 04:17:24 2011 New Revision: >>>>>>> 227778 URL: http://svn.freebsd.org/changeset/base/227778 >>>>>>>=20 >>>>>>> Log: - When feed-forward clock support is compiled in, change >>>>>>> the BPF header to contain both a regular timestamp obtained >>>>>>> from the system clock and the current feed-forward ffcounter >>>>>>> value. This enables new possibilities including >>>>>>=20 >>>>>> Is it really necessary to make the ABI dependent on a kernel >>>>>> configuration option? This causes all sorts of headaches if >>>>>> loadable modules ever want to use that ABI, something that we >>>>>> just ran into with vm_page_t and friends and had a long thread on >>>>>> -current about. >>>>>=20 >>>>> Fair question. Julien, if pcap and other consumers will happily >>>>> ignore the new ffcount_stamp member in the bpf header, is there = any >>>>> reason to conditionally add the ffcounter into the header struct? >>>>=20 >>>> It is a valid question indeed. The feedback I have received so far >>>> was to not have the feed-forward clock support be a default kernel >>>> configuration option. What follows is based on this assumption. >>>>=20 >>>> The commit (r227747) introduces sysctl that are conditioned by the >>>> same "FFCLOCK" kernel configuration option. If a loadable module >>>> tests for the presence of this sysctl, it will know if the >>>> ffcount_stamp member is available. Is it too much of a hack? >>>>=20 >>>> Alternatively, if the ffcounter is added to the bpf header >>>> unconditionally, the ffcount_stamp member can be set to 0. Loadable >>>> modules will then see a consistent ABI but will retrieve a >>>> meaningless value. >>>>=20 >>>> I am not sure which option makes more sense, any preference? >>>=20 >>> If I understand the issues correctly, I think the appropriate path >>> forward is to remove the conditional change to the bpf header and = have >>> ffcount_stamp become a permanent member of the struct. We'll just = leave >>> the member uninitialised in the !FFCLOCK case. This change will make = the >>> patch un-MFCable, but I think that's ok. >>>=20 >>> As to the issue of how a kernel module would detect if it's being = loaded >>> into a FFCLOCK enabled kernel, why wouldn't we expect modules to >>> "#include opt_ffclock.h" and conditionally compile code based on = FFCLOCK >>> being defined? Is there a use case for run-time (as opposed to >>> compile-time) module detection of feed-forward clock capabilities? >>=20 >> Think of standalone modules that are not built as part of a kernel = (e.g. >> 3rd party device drivers). In general we should avoid having = structures >> change size for kernel options, especially common structures. It = just adds >> lots of pain and suffering and complexity. We are stuck with it for = PAE on >> i386 (which causes pain), and for LOCK_PROFILING (but that is = sufficiently >> rare and expensive it seems to be ok). I think 8 bytes for bpf = packet is >> not sufficiently expensive to justify the extra headache. Just = always leave >> the new field in. >=20 > hmm... Julien almost has a patch finished which accomplishes what my = most recent email in this thread describes. Julien, I suggest we get it = finished and follow up to this thread with a pointer to the patch for = people to look at. If there's still a strong feeling that what it does = is going to bring pain we can do away with the new BPF_FFCOUNTER config = option and have the bpf header struct just grow by 8 bytes. >=20 > Stay tuned... Thanks all for the feedback. With some delay, I have a patch against = r227871 that implements what Lawrence proposed. You can find it here: = http://www.cubinlab.ee.unimelb.edu.au/~jrid/patches/ffclock-bpf-header-r22= 7871.patch I have tested this under a few typical scenario, it works as expected = but already brings some headaches (hence the long delay mentioned above = :-)). I thought a bit more of user cases. I believe many of them call for = having both feed-forward counter and its conversion in second be present = in the BPF header. For example, this allows to have absolute packet = departure/arrival times (as per usual), but also provides the = opportunity to compute inter-arrival times accurately using the = difference clock. There are other examples I can think of, and if one believe the = feed-forward clock approach becomes more popular, such usages will be = more and more common. Assuming the BPF header grows by 8 bytes independent of any kernel = option, I admit that the current implementation is a bit ugly. The BPF = structure is not nicely packed and looks clunky. Ideally, the = feed-forward counter should be placed just below the bh_tstamp member, = but this would require libpcap and all ports depending on it to be = recompiled after this change. What is your favourite option? Julien= From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 07:12: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 77F1E106566B; Wed, 23 Nov 2011 07:12:26 +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 67E668FC1A; Wed, 23 Nov 2011 07:12:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN7CQkC032080; Wed, 23 Nov 2011 07:12:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN7CQ64032078; Wed, 23 Nov 2011 07:12:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111230712.pAN7CQ64032078@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Nov 2011 07:12: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: r227872 - head/sys/dev/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: Wed, 23 Nov 2011 07:12:26 -0000 Author: adrian Date: Wed Nov 23 07:12:26 2011 New Revision: 227872 URL: http://svn.freebsd.org/changeset/base/227872 Log: Re-lock the ath lock after ath_reset() has been called. The calibrate callout is done with the sc lock held. This only showed up when using an older NIC (AR5212) whose radio/phy requires the rfgain adjustment. Pointy-hat-to: adrian Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Nov 23 05:34:01 2011 (r227871) +++ head/sys/dev/ath/if_ath.c Wed Nov 23 07:12:26 2011 (r227872) @@ -5370,6 +5370,7 @@ ath_calibrate(void *arg) sc->sc_doresetcal = AH_TRUE; ATH_UNLOCK(sc); ath_reset(ifp, ATH_RESET_NOLOSS); + ATH_LOCK(sc); return; } /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 07: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 E400E106566B; Wed, 23 Nov 2011 07:14:18 +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 5E82C8FC15; Wed, 23 Nov 2011 07:14:17 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAN7ECvW057064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Nov 2011 09:14:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAN7ECTG042930; Wed, 23 Nov 2011 09:14:12 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAN7ECYf042929; Wed, 23 Nov 2011 09:14:12 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Nov 2011 09:14:12 +0200 From: Kostik Belousov To: Dag-Erling Sm??rgrav Message-ID: <20111123071412.GV50300@deviant.kiev.zoral.com.ua> References: <201111211640.pALGedXg051270@svn.freebsd.org> <20111122204154.GA14090@stack.nl> <861uszkfgw.fsf@ds4.des.no> <86wrarj0sl.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="t/cwt9bjzs+oxMrl" Content-Disposition: inline In-Reply-To: <86wrarj0sl.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker Subject: Re: svn commit: r227798 - in head: . lib/libpam lib/libpam/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 07:14:19 -0000 --t/cwt9bjzs+oxMrl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 22, 2011 at 10:38:02PM +0100, Dag-Erling Sm??rgrav wrote: > Dag-Erling Sm??rgrav writes: > > Jilles Tjoelker writes: > > > Although this will work, I think it trades the quality of the binaries > > > for a cleaner build system. It is better to pass all libraries to ld(= 1) > > > even though a .so may have unresolved references: the NEEDED entry > > > serves as an additional protection against version mismatches and sym= bol > > > versioning (if you ever add it) requires ld(1) to have access to the = .so > > > containing the definition so it knows the version name to store in the > > > output file. > > These are plugins. The names and prototypes of the functions they > > export were set in stone 15 years ago. >=20 > Sorry, that was a bit unclear. What I was trying to say is that symbol > versioning is not and will never be an issue. Does plugin depend on the library which loaded it ? In other words, does it reference the symbols from the library ? If yes, then plugin _must_ have a dependency on the library recorded as DT_NEEDED. --t/cwt9bjzs+oxMrl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7MnUQACgkQC3+MBN1Mb4h14gCg1/fvfqohmTg+kPWcGccnjGq0 YPUAoMqQGob0DGji73U4mXSySspYT6ST =rR2l -----END PGP SIGNATURE----- --t/cwt9bjzs+oxMrl-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 07:34: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 499211065673; Wed, 23 Nov 2011 07:34:10 +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 38F6E8FC0C; Wed, 23 Nov 2011 07:34:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN7YAaa033000; Wed, 23 Nov 2011 07:34:10 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN7YA78032998; Wed, 23 Nov 2011 07:34:10 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111230734.pAN7YA78032998@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 23 Nov 2011 07:34: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: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 07:34:10 -0000 Author: trociny Date: Wed Nov 23 07:34:09 2011 New Revision: 227873 URL: http://svn.freebsd.org/changeset/base/227873 Log: Fix build, hopefully. Reviewed by: kib Modified: head/usr.bin/procstat/procstat_auxv.c Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Wed Nov 23 07:12:26 2011 (r227872) +++ head/usr.bin/procstat/procstat_auxv.c Wed Nov 23 07:34:09 2011 (r227873) @@ -42,14 +42,13 @@ #include "procstat.h" -static char auxv[sizeof(Elf_Auxinfo) * 256]; +static Elf_Auxinfo auxv[256]; void procstat_auxv(struct kinfo_proc *kipp) { - Elf_Auxinfo *aux; - int i, error, name[4]; - size_t len; + int error, name[4]; + size_t len, i; if (!hflag) printf("%5s %-16s %-53s\n", "PID", "COMM", "AUXV"); @@ -58,7 +57,7 @@ procstat_auxv(struct kinfo_proc *kipp) name[1] = KERN_PROC; name[2] = KERN_PROC_AUXV; name[3] = kipp->ki_pid; - len = sizeof(auxv); + len = sizeof(auxv) * sizeof(*auxv); error = sysctl(name, 4, auxv, &len, NULL, 0); if (error < 0 && errno != ESRCH) { warn("sysctl: kern.proc.auxv: %d: %d", kipp->ki_pid, errno); @@ -72,106 +71,116 @@ procstat_auxv(struct kinfo_proc *kipp) printf(" -\n"); return; } - for (aux = (Elf_Auxinfo *)auxv, i = 0; i < 256; i++, aux++) { - switch(aux->a_type) { + for (i = 0; i < len; i++) { + switch(auxv[i].a_type) { case AT_NULL: - printf(" (%d)\n", i + 1); + printf(" (%zu)\n", i + 1); return; case AT_IGNORE: printf(" AT_IGNORE=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_EXECFD: printf(" AT_EXECFD=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_PHDR: printf(" AT_PHDR=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_PHENT: printf(" AT_PHENT=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_PHNUM: printf(" AT_PHNUM=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_PAGESZ: printf(" AT_PAGESZ=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_BASE: printf(" AT_BASE=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_FLAGS: printf(" AT_FLAGS=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_ENTRY: printf(" AT_ENTRY=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; +#ifdef AT_NOTELF case AT_NOTELF: printf(" AT_NOTELF=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; +#endif +#ifdef AT_UID case AT_UID: printf(" AT_UID=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; +#endif +#ifdef AT_EUID case AT_EUID: printf(" AT_EUID=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; +#endif +#ifdef AT_GID case AT_GID: printf(" AT_GID=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; +#endif +#ifdef AT_EGID case AT_EGID: printf(" AT_EGID=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; +#endif case AT_EXECPATH: printf(" AT_EXECPATH=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_CANARY: printf(" AT_CANARY=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_CANARYLEN: printf(" AT_CANARYLEN=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_OSRELDATE: printf(" AT_OSRELDATE=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_NCPUS: printf(" AT_NCPUS=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_PAGESIZES: printf(" AT_PAGESIZES=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_PAGESIZESLEN: printf(" AT_PAGESIZESLEN=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_STACKPROT: printf(" AT_STACKPROT=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; case AT_COUNT: printf(" AT_COUNT=0x%lu", - (unsigned long)aux->a_un.a_val); + (unsigned long)auxv[i].a_un.a_val); break; default: - printf(" %ld=0x%lu", (long)aux->a_type, - (unsigned long)aux->a_un.a_val); + printf(" %ld=0x%lu", (long)auxv[i].a_type, + (unsigned long)auxv[i].a_un.a_val); break; } } From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 07:37: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 12839106564A; Wed, 23 Nov 2011 07:37:09 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 91F9B8FC0A; Wed, 23 Nov 2011 07:37:08 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 204237E820; Wed, 23 Nov 2011 18:37:06 +1100 (EST) Message-ID: <4ECCA2A1.4020408@freebsd.org> Date: Wed, 23 Nov 2011 18:37:05 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111006 Thunderbird/7.0.1 MIME-Version: 1.0 To: Julien Ridoux References: <201111210417.pAL4HOdi023556@svn.freebsd.org> <648D11A8-3636-49E5-BF20-83E4EA87242C@cubinlab.ee.unimelb.edu.au> <4EC9FD8A.5040401@freebsd.org> <201111220830.05029.jhb@freebsd.org> <4ECBAB19.4010907@freebsd.org> <8805563E-60F9-4BF4-A292-1A43C4FA368A@cubinlab.ee.unimelb.edu.au> In-Reply-To: <8805563E-60F9-4BF4-A292-1A43C4FA368A@cubinlab.ee.unimelb.edu.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ben Kaduk , John Baldwin Subject: Re: svn commit: r227778 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 07:37:09 -0000 On 11/23/11 17:42, Julien Ridoux wrote: > > On 23/11/2011, at 1:00 AM, Lawrence Stewart wrote: > >> On 11/23/11 00:30, John Baldwin wrote: >>> On Monday, November 21, 2011 2:28:10 am Lawrence Stewart wrote: >>>> On 11/21/11 17:18, Julien Ridoux wrote: >>>>> >>>>> On 21/11/2011, at 4:39 PM, Lawrence Stewart wrote: >>>>> >>>>>> On 11/21/11 16:12, Ben Kaduk wrote: >>>>>>> On Sun, Nov 20, 2011 at 11:17 PM, Lawrence >>>>>>> Stewart wrote: >>>>>>>> Author: lstewart Date: Mon Nov 21 04:17:24 2011 New >>>>>>>> Revision: 227778 URL: >>>>>>>> http://svn.freebsd.org/changeset/base/227778 >>>>>>>> >>>>>>>> Log: - When feed-forward clock support is compiled in, >>>>>>>> change the BPF header to contain both a regular >>>>>>>> timestamp obtained from the system clock and the >>>>>>>> current feed-forward ffcounter value. This enables new >>>>>>>> possibilities including >>>>>>> >>>>>>> Is it really necessary to make the ABI dependent on a >>>>>>> kernel configuration option? This causes all sorts of >>>>>>> headaches if loadable modules ever want to use that ABI, >>>>>>> something that we just ran into with vm_page_t and >>>>>>> friends and had a long thread on -current about. >>>>>> >>>>>> Fair question. Julien, if pcap and other consumers will >>>>>> happily ignore the new ffcount_stamp member in the bpf >>>>>> header, is there any reason to conditionally add the >>>>>> ffcounter into the header struct? >>>>> >>>>> It is a valid question indeed. The feedback I have received >>>>> so far was to not have the feed-forward clock support be a >>>>> default kernel configuration option. What follows is based on >>>>> this assumption. >>>>> >>>>> The commit (r227747) introduces sysctl that are conditioned >>>>> by the same "FFCLOCK" kernel configuration option. If a >>>>> loadable module tests for the presence of this sysctl, it >>>>> will know if the ffcount_stamp member is available. Is it too >>>>> much of a hack? >>>>> >>>>> Alternatively, if the ffcounter is added to the bpf header >>>>> unconditionally, the ffcount_stamp member can be set to 0. >>>>> Loadable modules will then see a consistent ABI but will >>>>> retrieve a meaningless value. >>>>> >>>>> I am not sure which option makes more sense, any preference? >>>> >>>> If I understand the issues correctly, I think the appropriate >>>> path forward is to remove the conditional change to the bpf >>>> header and have ffcount_stamp become a permanent member of the >>>> struct. We'll just leave the member uninitialised in the >>>> !FFCLOCK case. This change will make the patch un-MFCable, but >>>> I think that's ok. >>>> >>>> As to the issue of how a kernel module would detect if it's >>>> being loaded into a FFCLOCK enabled kernel, why wouldn't we >>>> expect modules to "#include opt_ffclock.h" and conditionally >>>> compile code based on FFCLOCK being defined? Is there a use >>>> case for run-time (as opposed to compile-time) module detection >>>> of feed-forward clock capabilities? >>> >>> Think of standalone modules that are not built as part of a >>> kernel (e.g. 3rd party device drivers). In general we should >>> avoid having structures change size for kernel options, >>> especially common structures. It just adds lots of pain and >>> suffering and complexity. We are stuck with it for PAE on i386 >>> (which causes pain), and for LOCK_PROFILING (but that is >>> sufficiently rare and expensive it seems to be ok). I think 8 >>> bytes for bpf packet is not sufficiently expensive to justify the >>> extra headache. Just always leave the new field in. >> >> hmm... Julien almost has a patch finished which accomplishes what >> my most recent email in this thread describes. Julien, I suggest we >> get it finished and follow up to this thread with a pointer to the >> patch for people to look at. If there's still a strong feeling that >> what it does is going to bring pain we can do away with the new >> BPF_FFCOUNTER config option and have the bpf header struct just >> grow by 8 bytes. >> >> Stay tuned... > > Thanks all for the feedback. With some delay, I have a patch against > r227871 that implements what Lawrence proposed. You can find it > here: > http://www.cubinlab.ee.unimelb.edu.au/~jrid/patches/ffclock-bpf-header-r227871.patch There are a few nits, but the patch implements what I envisaged, thanks Julien. > I have tested this under a few typical scenario, it works as > expected but already brings some headaches (hence the long delay > mentioned above :-)). > > I thought a bit more of user cases. I believe many of them call for > having both feed-forward counter and its conversion in second be > present in the BPF header. For example, this allows to have absolute > packet departure/arrival times (as per usual), but also provides the > opportunity to compute inter-arrival times accurately using the > difference clock. There are other examples I can think of, and if one > believe the feed-forward clock approach becomes more popular, such > usages will be more and more common. > > Assuming the BPF header grows by 8 bytes independent of any kernel > option, I admit that the current implementation is a bit ugly. The > BPF structure is not nicely packed and looks clunky. Ideally, the > feed-forward counter should be placed just below the bh_tstamp > member, but this would require libpcap and all ports depending on it > to be recompiled after this change. Even though it looks a bit gross, we would still add it at the end to avoid gratuitously breaking binaries. We would then also add some explicit padding in the struct to soak up the redundant space left in between it and the second last struct member. > What is your favourite option? FreeBSD parlance is to ask what colour you would like to paint the bikeshed ;) As I've never experienced the pain John refers to, I'll defer to the wisdom of others on whether the proposed patch will create pain down the road. I think it's ok, but if consensus is 8bytes per packet isn't going to break the bank, I guess we just go for it - but I guess I am cautious about this route as we can push a lot of packets per second through the stack. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 08:11: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 0DE2D106567D; Wed, 23 Nov 2011 08:11:05 +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 F1D3D8FC0C; Wed, 23 Nov 2011 08:11:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN8B4M2034175; Wed, 23 Nov 2011 08:11:04 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN8B4sk034173; Wed, 23 Nov 2011 08:11:04 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111230811.pAN8B4sk034173@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 23 Nov 2011 08:11: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: r227874 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 08:11:05 -0000 Author: trociny Date: Wed Nov 23 08:11:04 2011 New Revision: 227874 URL: http://svn.freebsd.org/changeset/base/227874 Log: Fix build without INVARIANTS. Discussed with: kib Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Nov 23 07:34:09 2011 (r227873) +++ head/sys/kern/kern_proc.c Wed Nov 23 08:11:04 2011 (r227874) @@ -1468,6 +1468,7 @@ get_proc_vector32(struct thread *td, str break; default: KASSERT(0, ("Wrong proc vector type: %d", type)); + return (EINVAL); } proc_vector32 = malloc(size, M_TEMP, M_WAITOK); error = proc_read_mem(td, p, vptr, proc_vector32, size); @@ -1564,6 +1565,7 @@ get_proc_vector(struct thread *td, struc break; default: KASSERT(0, ("Wrong proc vector type: %d", type)); + return (EINVAL); /* In case we are built without INVARIANTS. */ } proc_vector = malloc(size, M_TEMP, M_WAITOK); if (proc_vector == NULL) From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 09:45: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 76A6A1065675; Wed, 23 Nov 2011 09:45:48 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6675B8FC0C; Wed, 23 Nov 2011 09:45:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAN9jmtW037220; Wed, 23 Nov 2011 09:45:48 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAN9jmAv037218; Wed, 23 Nov 2011 09:45:48 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201111230945.pAN9jmAv037218@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 23 Nov 2011 09:45: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: r227875 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 09:45:48 -0000 Author: luigi Date: Wed Nov 23 09:45:48 2011 New Revision: 227875 URL: http://svn.freebsd.org/changeset/base/227875 Log: fix formatting warning using casts. The numbers involved are small and these are debug statements, so there is no reason to obfuscate the format string with PRIsomeKINDofINTEGER Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Nov 23 08:11:04 2011 (r227874) +++ head/sys/dev/netmap/netmap.c Wed Nov 23 09:45:48 2011 (r227875) @@ -1624,7 +1624,7 @@ netmap_memory_init(void) nm_buf_pool.base += netmap_mem_d->nm_buf_start; netmap_buffer_base = nm_buf_pool.base; D("netmap_buffer_base %p (offset %d)", - netmap_buffer_base, netmap_mem_d->nm_buf_start); + netmap_buffer_base, (int)netmap_mem_d->nm_buf_start); /* number of buffers, they all start as free */ netmap_total_buffers = nm_buf_pool.total_buffers = @@ -1632,7 +1632,7 @@ netmap_memory_init(void) nm_buf_pool.bufsize = NETMAP_BUF_SIZE; D("Have %d MB, use %dKB for rings, %d buffers at %p", - (sz >> 20), (netmap_mem_d->nm_size >> 10), + (sz >> 20), (int)(netmap_mem_d->nm_size >> 10), nm_buf_pool.total_buffers, nm_buf_pool.base); /* allocate and initialize the bitmap. Entry 0 is considered @@ -1673,7 +1673,7 @@ netmap_memory_fini(void) TAILQ_REMOVE(&netmap_mem_d->nm_molist, mem_obj, nmo_next); if (mem_obj->nmo_used == 1) { printf("netmap: leaked %d bytes at %p\n", - mem_obj->nmo_size, + (int)mem_obj->nmo_size, mem_obj->nmo_data); } free(mem_obj, M_NETMAP); @@ -1704,7 +1704,7 @@ netmap_init(void) return (error); } printf("netmap: loaded module with %d Mbytes\n", - netmap_mem_d->nm_totalsize >> 20); + (int)(netmap_mem_d->nm_totalsize >> 20)); netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, "netmap"); From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 10:27: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 46ED9106566B; Wed, 23 Nov 2011 10:27:19 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 360F08FC1B; Wed, 23 Nov 2011 10:27:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANARJRt038664; Wed, 23 Nov 2011 10:27:19 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANARJMH038660; Wed, 23 Nov 2011 10:27:19 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201111231027.pANARJMH038660@svn.freebsd.org> From: Kevin Lo Date: Wed, 23 Nov 2011 10:27: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: r227876 - in head/usr.sbin: acpi/acpidb bluetooth/bt3cfw boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 10:27:19 -0000 Author: kevlo Date: Wed Nov 23 10:27:18 2011 New Revision: 227876 URL: http://svn.freebsd.org/changeset/base/227876 Log: Plug fd leaks Modified: head/usr.sbin/acpi/acpidb/acpidb.c head/usr.sbin/bluetooth/bt3cfw/bt3cfw.c head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/acpi/acpidb/acpidb.c ============================================================================== --- head/usr.sbin/acpi/acpidb/acpidb.c Wed Nov 23 09:45:48 2011 (r227875) +++ head/usr.sbin/acpi/acpidb/acpidb.c Wed Nov 23 10:27:18 2011 (r227876) @@ -370,6 +370,7 @@ load_dsdt(const char *dsdtfile) } if (fstat(fd, &sb) == -1) { perror("fstat"); + close(fd); return (-1); } code = mmap(NULL, (size_t)sb.st_size, PROT_READ, MAP_PRIVATE, fd, (off_t)0); Modified: head/usr.sbin/bluetooth/bt3cfw/bt3cfw.c ============================================================================== --- head/usr.sbin/bluetooth/bt3cfw/bt3cfw.c Wed Nov 23 09:45:48 2011 (r227875) +++ head/usr.sbin/bluetooth/bt3cfw/bt3cfw.c Wed Nov 23 10:27:18 2011 (r227876) @@ -221,6 +221,7 @@ main(int argc, char *argv[]) free(firmware); firmware = NULL; + fclose(firmware_file); return (0); } Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Wed Nov 23 09:45:48 2011 (r227875) +++ head/usr.sbin/boot0cfg/boot0cfg.c Wed Nov 23 10:27:18 2011 (r227876) @@ -330,10 +330,12 @@ read_mbr(const char *disk, u_int8_t **mb err(1, "%s", disk); if (n != mbr_size) errx(1, "%s: short read", disk); + close(fd); return (mbr_size); } *mbr = malloc(sizeof(buf)); memcpy(*mbr, buf, sizeof(buf)); + close(fd); return sizeof(buf); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 10:37: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 A656E1065672; Wed, 23 Nov 2011 10:37:20 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 286D88FC16; Wed, 23 Nov 2011 10:37:19 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cwma5-0-0-cust875.7-3.cable.virginmedia.com [86.11.39.108]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id pANAbI8q034741 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 23 Nov 2011 10:37:18 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20111122202735.GA21442@zim.MIT.EDU> Date: Wed, 23 Nov 2011 10:37:14 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <0DC88C34-91B4-49D1-AA8A-73B14C99D35B@FreeBSD.org> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> <20111122202735.GA21442@zim.MIT.EDU> To: David Schultz X-Mailer: Apple Mail (2.1251.1) Cc: src-committers@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, dim@FreeBSD.org, Brooks Davis , bde@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 10:37:20 -0000 On 22 Nov 2011, at 20:27, David Schultz wrote: > Benchmark or not, I think you'll have a very hard time finding a > single real program that routinely calls strcasecmp() with > identical pointers! I've seen this pattern very often. Often the linker is able to combine = constant strings defined in different compilation units. With link-time = optimisation, there are also more opportunities for the compiler to do = this. =20 A fairly common pattern is to define constant strings as macros in a = header and then use them as keys in a dictionary, first hashed and then = compared with strcmp(). In this case, the =3D=3D check is a significant = win. I've had to work around the fact that FreeBSD's libc is = significantly slower than GNU libc in this instance by adding an extra = =3D=3D outside of strcmp() - this increases the size of the code = everywhere this pattern is used, increasing cache usage, and lowering = overall performance (and good luck coming up with a microbenchmark that = demonstrates that - although I'd be happy to provide you with a = Google-authord paper from a couple of years ago explaining why it's so = hard to benchmark accurately on modern machines...). It's also worth noting that the cost of the extra branch is more or less = trivial, as every single character in the input strings will also need = to be compared. This change turns a linear complexity case into a = constant complexity case, so it's a clear algorithmic improvement for a = case that, while rare, is not as improbable as you seem to suppose. As to the | vs || issue - by all means change it to || if it fits better = with the FreeBSD style. In the general case I prefer to use | to hint = to the compiler and readers of the code that short-circuit evaluation is = not required and to remove a sequence point and make life easier for the = optimiser. In this case, the two are equivalent so it's just a hint to = the reader, and apparently (judging by the responses so far) one that is = not well understood. David= From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 11: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 82B10106564A; Wed, 23 Nov 2011 11:59:02 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7256A8FC14; Wed, 23 Nov 2011 11:59:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANBx2CU044533; Wed, 23 Nov 2011 11:59:02 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANBx2r7044531; Wed, 23 Nov 2011 11:59:02 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201111231159.pANBx2r7044531@svn.freebsd.org> From: David Xu Date: Wed, 23 Nov 2011 11:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227877 - releng/9.0/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 11:59:02 -0000 Author: davidxu Date: Wed Nov 23 11:59:01 2011 New Revision: 227877 URL: http://svn.freebsd.org/changeset/base/227877 Log: MFC r227604: Pass CVWAIT flags to kernel, this should handle Timeout correctly for pthread_cond_timedwait when it uses kernel-based condition variable. Approved by: re (kib) Modified: releng/9.0/lib/libthr/thread/thr_umtx.c Directory Properties: releng/9.0/lib/libthr/ (props changed) Modified: releng/9.0/lib/libthr/thread/thr_umtx.c ============================================================================== --- releng/9.0/lib/libthr/thread/thr_umtx.c Wed Nov 23 10:27:18 2011 (r227876) +++ releng/9.0/lib/libthr/thread/thr_umtx.c Wed Nov 23 11:59:01 2011 (r227877) @@ -231,7 +231,7 @@ _thr_ucond_init(struct ucond *cv) int _thr_ucond_wait(struct ucond *cv, struct umutex *m, - const struct timespec *timeout, int check_unparking) + const struct timespec *timeout, int flags) { if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && timeout->tv_nsec <= 0))) { @@ -239,8 +239,7 @@ _thr_ucond_wait(struct ucond *cv, struct _thr_umutex_unlock(m, TID(curthread)); return (ETIMEDOUT); } - return _umtx_op_err(cv, UMTX_OP_CV_WAIT, - check_unparking ? UMTX_CHECK_UNPARKING : 0, + return _umtx_op_err(cv, UMTX_OP_CV_WAIT, flags, m, __DECONST(void*, timeout)); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 12:05: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 844071065679; Wed, 23 Nov 2011 12:05:40 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 742A38FC17; Wed, 23 Nov 2011 12:05:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANC5ewo044802; Wed, 23 Nov 2011 12:05:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANC5ejf044799; Wed, 23 Nov 2011 12:05:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201111231205.pANC5ejf044799@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 23 Nov 2011 12:05: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: r227878 - head/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 12:05:40 -0000 Author: luigi Date: Wed Nov 23 12:05:39 2011 New Revision: 227878 URL: http://svn.freebsd.org/changeset/base/227878 Log: some tweaks to build picobsd for different architectures. Modified: head/release/picobsd/build/Makefile.conf head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/Makefile.conf ============================================================================== --- head/release/picobsd/build/Makefile.conf Wed Nov 23 11:59:01 2011 (r227877) +++ head/release/picobsd/build/Makefile.conf Wed Nov 23 12:05:39 2011 (r227878) @@ -19,9 +19,9 @@ MODULES?=-DNO_MODULES # do not build the # These 3 variables determine where the kernel is built. # If config were smart enough, we could place the config -# file in some other place than ${SRC}/sys/i386/conf, but +# file in some other place than ${SRC}/sys/${TARGET_ARCH}/conf, but # at the moment (Oct.2001) this is not possible yet. -CONF=${SRC}/sys/i386/conf +CONF=${SRC}/sys/${TARGET_ARCH}/conf #CONF=${BUILDDIR}/conf # XXX does not work yet CONFFILE=PICOBSD-${name} Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Wed Nov 23 11:59:01 2011 (r227877) +++ head/release/picobsd/build/picobsd Wed Nov 23 12:05:39 2011 (r227878) @@ -67,7 +67,7 @@ # SRC points to your FreeBSD source tree. # l_usrtree points to the /usr subdir for the source tree. # Normally /usr or ${SRC}/../usr -# l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico +# l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico-${o_arch} # c_label is either bsdlabel or disklabel # PICO_TREE is where standard picobsd stuff resides. # Normally ${SRC}/release/picobsd @@ -121,6 +121,7 @@ set_defaults() { # no arguments o_no_devfs= # default is use devfs. # You should only set it when building 4.x images o_do_modules="" # do not build modules + o_arch=`uname -m` # default to amd64 or i386 ... SRC="/usr/src" # default location for sources c_startdir=`pwd` # directory where we start @@ -451,6 +452,7 @@ do_kernel() { # OK log "do_kernel() Preparing kernel \"$name\" in $MY_TREE" (cd $MY_TREE; export name SRC BUILDDIR # used in this makefile ; # export CONFIG + export WARNS CWARNFLAGS [ "${o_do_modules}" = "yes" ] && export MODULES="" ${BINMAKE} ${o_par} -v -f ${PICO_TREE}/build/Makefile.conf ) || \ fail $? missing_kernel @@ -973,7 +975,7 @@ set_build_parameters() { else l_usrtree=${USR:-${SRC}/../usr} fi - l_objtree=${l_usrtree}/obj-pico + l_objtree=${l_usrtree}/obj-pico-${o_arch} PICO_TREE=${PICO_TREE:-${SRC}/release/picobsd} set `grep "#define[\t ]__FreeBSD_version" ${SRC}/sys/sys/param.h` @@ -981,7 +983,8 @@ set_build_parameters() { log "OSVERSION is ${OSVERSION}" if [ ${OSVERSION} -ge 500035 ] ; then export MAKEOBJDIRPREFIX=${l_objtree} - export TARGET_ARCH=i386 TARGET=i386 + export TARGET_ARCH=${o_arch} TARGET=${o_arch} + # export CWARNFLAGS="-Wextra -Wno-sign-compare -Wno-missing-field-initializers" eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` fi @@ -1035,6 +1038,11 @@ while [ true ]; do o_init_src="YES" ;; + --arch) + o_arch=$2 + shift + ;; + --floppy_size) fd_size=$2 shift From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 12:23: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 B7A3D1065670; Wed, 23 Nov 2011 12:23:25 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 756D78FC08; Wed, 23 Nov 2011 12:23:25 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 4854364CB; Wed, 23 Nov 2011 12:23:24 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id E13FC85D2; Wed, 23 Nov 2011 13:23:23 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Rui Paulo References: <201111211635.pALGZvSS051067@svn.freebsd.org> <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> <8662ibkfjs.fsf@ds4.des.no> Date: Wed, 23 Nov 2011 13:23:23 +0100 In-Reply-To: (Rui Paulo's message of "Tue, 22 Nov 2011 22:10:34 +0000") Message-ID: <86pqgjhvt0.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227797 - 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: Wed, 23 Nov 2011 12:23:25 -0000 Rui Paulo writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Sorry, my mind reader is broken at the moment, so you'll have to provide > > more information than that. > If I had more information, I would have provided it. I'm still > diagnosing the problem someone else created.=20 I assume that you have, at the very least, a buildworld log? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 12:23: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 3392B1065676; Wed, 23 Nov 2011 12:23:33 +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 234778FC15; Wed, 23 Nov 2011 12:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANCNWb0045435; Wed, 23 Nov 2011 12:23:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANCNWAs045433; Wed, 23 Nov 2011 12:23:32 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201111231223.pANCNWAs045433@svn.freebsd.org> From: Glen Barber Date: Wed, 23 Nov 2011 12:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227879 - stable/9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 12:23:33 -0000 Author: gjb (doc committer) Date: Wed Nov 23 12:23:32 2011 New Revision: 227879 URL: http://svn.freebsd.org/changeset/base/227879 Log: MFC r227769, 227770, 227771: - Add a note to src/Makefile that explains that 'rm' runs twice because thesecond invocation only needs to operate on files with the immutable flag set. - Fix the note in r227769 to be less specific to the immutable flag. - Replace 'chflags' with 'file flags' in a comment, since 'chflags'is a command, not a flag itself. Approved by: re (kib) Modified: stable/9/Makefile (contents, props changed) Modified: stable/9/Makefile ============================================================================== --- stable/9/Makefile Wed Nov 23 12:05:39 2011 (r227878) +++ stable/9/Makefile Wed Nov 23 12:23:32 2011 (r227879) @@ -182,10 +182,12 @@ buildworld: upgrade_checks # # In the following, the first 'rm' in a series will usually remove all # files and directories. If it does not, then there are probably some -# files with chflags set, so this unsets them and tries the 'rm' a +# files with file flags set, so this unsets them and tries the 'rm' a # second time. There are situations where this target will be cleaning # some directories via more than one method, but that duplication is -# needed to correctly handle all the possible situations. +# needed to correctly handle all the possible situations. Removing all +# files without file flags set in the first 'rm' instance saves time, +# because 'chflags' will need to operate on fewer files afterwards. # BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} cleanworld: From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 12:24: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 13659106566C; Wed, 23 Nov 2011 12:24:05 +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 03E198FC1A; Wed, 23 Nov 2011 12:24:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANCO44p045489; Wed, 23 Nov 2011 12:24:04 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANCO4PT045487; Wed, 23 Nov 2011 12:24:04 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201111231224.pANCO4PT045487@svn.freebsd.org> From: Glen Barber Date: Wed, 23 Nov 2011 12:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227880 - releng/9.0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 12:24:05 -0000 Author: gjb (doc committer) Date: Wed Nov 23 12:24:04 2011 New Revision: 227880 URL: http://svn.freebsd.org/changeset/base/227880 Log: MFC r227769, 227770, 227771: - Add a note to src/Makefile that explains that 'rm' runs twice because thesecond invocation only needs to operate on files with the immutable flag set. - Fix the note in r227769 to be less specific to the immutable flag. - Replace 'chflags' with 'file flags' in a comment, since 'chflags'is a command, not a flag itself. Approved by: re (kib) Modified: releng/9.0/Makefile (contents, props changed) Modified: releng/9.0/Makefile ============================================================================== --- releng/9.0/Makefile Wed Nov 23 12:23:32 2011 (r227879) +++ releng/9.0/Makefile Wed Nov 23 12:24:04 2011 (r227880) @@ -182,10 +182,12 @@ buildworld: upgrade_checks # # In the following, the first 'rm' in a series will usually remove all # files and directories. If it does not, then there are probably some -# files with chflags set, so this unsets them and tries the 'rm' a +# files with file flags set, so this unsets them and tries the 'rm' a # second time. There are situations where this target will be cleaning # some directories via more than one method, but that duplication is -# needed to correctly handle all the possible situations. +# needed to correctly handle all the possible situations. Removing all +# files without file flags set in the first 'rm' instance saves time, +# because 'chflags' will need to operate on fewer files afterwards. # BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} cleanworld: From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 12:24: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 2D6B3106574B; Wed, 23 Nov 2011 12:24:30 +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 1D15A8FC1A; Wed, 23 Nov 2011 12:24:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANCOTR8045537; Wed, 23 Nov 2011 12:24:29 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANCOTYN045535; Wed, 23 Nov 2011 12:24:29 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201111231224.pANCOTYN045535@svn.freebsd.org> From: Glen Barber Date: Wed, 23 Nov 2011 12:24:29 +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: r227881 - 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: Wed, 23 Nov 2011 12:24:30 -0000 Author: gjb (doc committer) Date: Wed Nov 23 12:24:29 2011 New Revision: 227881 URL: http://svn.freebsd.org/changeset/base/227881 Log: MFC r227769, 227770, 227771: - Add a note to src/Makefile that explains that 'rm' runs twice because thesecond invocation only needs to operate on files with the immutable flag set. - Fix the note in r227769 to be less specific to the immutable flag. - Replace 'chflags' with 'file flags' in a comment, since 'chflags'is a command, not a flag itself. Modified: stable/8/Makefile (contents, props changed) Modified: stable/8/Makefile ============================================================================== --- stable/8/Makefile Wed Nov 23 12:24:04 2011 (r227880) +++ stable/8/Makefile Wed Nov 23 12:24:29 2011 (r227881) @@ -140,10 +140,12 @@ buildworld: upgrade_checks # # In the following, the first 'rm' in a series will usually remove all # files and directories. If it does not, then there are probably some -# files with chflags set, so this unsets them and tries the 'rm' a +# files with file flags set, so this unsets them and tries the 'rm' a # second time. There are situations where this target will be cleaning # some directories via more than one method, but that duplication is -# needed to correctly handle all the possible situations. +# needed to correctly handle all the possible situations. Removing all +# files without file flags set in the first 'rm' instance saves time, +# because 'chflags' will need to operate on fewer files afterwards. # BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} cleanworld: From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 12: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 97EBF1065743; Wed, 23 Nov 2011 12:24:49 +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 87D978FC08; Wed, 23 Nov 2011 12:24:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANCOn8w045583; Wed, 23 Nov 2011 12:24:49 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANCOne9045581; Wed, 23 Nov 2011 12:24:49 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201111231224.pANCOne9045581@svn.freebsd.org> From: Glen Barber Date: Wed, 23 Nov 2011 12:24:49 +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: r227882 - stable/7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 12:24:49 -0000 Author: gjb (doc committer) Date: Wed Nov 23 12:24:48 2011 New Revision: 227882 URL: http://svn.freebsd.org/changeset/base/227882 Log: MFC r227769, 227770, 227771: - Add a note to src/Makefile that explains that 'rm' runs twice because thesecond invocation only needs to operate on files with the immutable flag set. - Fix the note in r227769 to be less specific to the immutable flag. - Replace 'chflags' with 'file flags' in a comment, since 'chflags'is a command, not a flag itself. Modified: stable/7/Makefile (contents, props changed) Modified: stable/7/Makefile ============================================================================== --- stable/7/Makefile Wed Nov 23 12:24:29 2011 (r227881) +++ stable/7/Makefile Wed Nov 23 12:24:48 2011 (r227882) @@ -139,10 +139,12 @@ buildworld: upgrade_checks # # In the following, the first 'rm' in a series will usually remove all # files and directories. If it does not, then there are probably some -# files with chflags set, so this unsets them and tries the 'rm' a +# files with file flags set, so this unsets them and tries the 'rm' a # second time. There are situations where this target will be cleaning # some directories via more than one method, but that duplication is -# needed to correctly handle all the possible situations. +# needed to correctly handle all the possible situations. Removing all +# files without file flags set in the first 'rm' instance saves time, +# because 'chflags' will need to operate on fewer files afterwards. # BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} cleanworld: From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 12:25: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 68135106567B; Wed, 23 Nov 2011 12:25:41 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 1945F8FC1A; Wed, 23 Nov 2011 12:25:40 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 1EA5D64D3; Wed, 23 Nov 2011 12:25:40 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id EEDC185D4; Wed, 23 Nov 2011 13:25:39 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Peter Wemm References: <201111211635.pALGZvSS051067@svn.freebsd.org> <4A740CCF-AB73-41E3-B2C6-344B4A067B00@FreeBSD.org> <8662ibkfjs.fsf@ds4.des.no> <4ECC2D0D.6080608@FreeBSD.org> Date: Wed, 23 Nov 2011 13:25:39 +0100 In-Reply-To: (Peter Wemm's message of "Tue, 22 Nov 2011 15:37:46 -0800") Message-ID: <86lir7hvp8.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Doug Barton , Rui Paulo , svn-src-all@freebsd.org, Ben Kaduk , src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r227797 - 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: Wed, 23 Nov 2011 12:25:41 -0000 Peter Wemm writes: > However.. the first thing I noticed was this commit *adds* a .c.o: > rule in bsd.lib.mk, which replaces the default in sys.mk. > > The one in sys.mk has ctfconvert rules and the new one does not. At > face value, this alone looks suspicious. Ah, that's a mismerge. The patch has been in my tree since before CTF support was added, and since my new rule is in a different file, there was no conflict to alert me to the problem. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 12:29: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 047271065676; Wed, 23 Nov 2011 12:29:23 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B527D8FC19; Wed, 23 Nov 2011 12:29:22 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id B815664D6; Wed, 23 Nov 2011 12:29:21 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 957F885D6; Wed, 23 Nov 2011 13:29:21 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kostik Belousov References: <201111211640.pALGedXg051270@svn.freebsd.org> <20111122204154.GA14090@stack.nl> <861uszkfgw.fsf@ds4.des.no> <86wrarj0sl.fsf@ds4.des.no> <20111123071412.GV50300@deviant.kiev.zoral.com.ua> Date: Wed, 23 Nov 2011 13:29:21 +0100 In-Reply-To: <20111123071412.GV50300@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Wed, 23 Nov 2011 09:14:12 +0200") Message-ID: <86ehwzhvj2.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker Subject: Re: svn commit: r227798 - in head: . lib/libpam lib/libpam/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 12:29:23 -0000 Kostik Belousov writes: > Does plugin depend on the library which loaded it ? In other words, does > it reference the symbols from the library ? If yes, then plugin _must_ > have a dependency on the library recorded as DT_NEEDED. Yes. I would really, really prefer to find a solution that does not involve splitting up the libpam build the way we used to. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 13: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 10B45106564A; Wed, 23 Nov 2011 13:50:15 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0080F8FC16; Wed, 23 Nov 2011 13:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANDoExO048232; Wed, 23 Nov 2011 13:50:14 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANDoESr048230; Wed, 23 Nov 2011 13:50:14 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201111231350.pANDoESr048230@svn.freebsd.org> From: Peter Holm Date: Wed, 23 Nov 2011 13:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227883 - stable/8/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 13:50:15 -0000 Author: pho Date: Wed Nov 23 13:50:14 2011 New Revision: 227883 URL: http://svn.freebsd.org/changeset/base/227883 Log: MFC: r227527 Removed extra PRELE() call. Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/8/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 23 12:24:48 2011 (r227882) +++ stable/8/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 23 13:50:14 2011 (r227883) @@ -632,8 +632,6 @@ pfs_read(struct vop_read_args *va) (offset = uio->uio_offset) != uio->uio_offset || (resid = uio->uio_resid) != uio->uio_resid || (buflen = offset + resid + 1) < offset || buflen > INT_MAX) { - if (proc != NULL) - PRELE(proc); error = EINVAL; goto ret; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 14:53: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 B7727106564A; Wed, 23 Nov 2011 14:53:07 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A542F8FC17; Wed, 23 Nov 2011 14:53:06 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so2191272bkb.13 for ; Wed, 23 Nov 2011 06:53:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=A0QhvCU/fLyR/lBZtRL5oX9vDjN5t1VzH9gKf9sTv9c=; b=okvTOpFO0HfLMhuUf7J+Zf9JlraDNcS1s2SFOU1SLRbFdZeFyyJkQbBZtOu40TBaQv SpPBh392QFIhtep3SN9AmF9XQlIXMpAbCjodj4I+qVsUNx0ONRn1i4xZM2ZLvEtJv5K2 dYnw0VK5csd4LTo9PEyExcSWqVjlLS1Ez/nk4= MIME-Version: 1.0 Received: by 10.204.199.132 with SMTP id es4mr10179172bkb.4.1322059985442; Wed, 23 Nov 2011 06:53:05 -0800 (PST) Sender: tomelite82@gmail.com Received: by 10.223.93.132 with HTTP; Wed, 23 Nov 2011 06:53:05 -0800 (PST) In-Reply-To: <20111122154312.GL96616@FreeBSD.org> References: <201111211410.pALEAD9B046139@svn.freebsd.org> <20111121195439.GE96616@FreeBSD.org> <20111122154312.GL96616@FreeBSD.org> Date: Wed, 23 Nov 2011 06:53:05 -0800 X-Google-Sender-Auth: s7xX4j0gFeBjinH3sla4nZumO8s Message-ID: From: Qing Li To: Gleb Smirnoff 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: r227791 - 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: Wed, 23 Nov 2011 14:53:07 -0000 > > =A0first I'd like to notice that we are speaking about obsoleted interfac= es. > Yup, that's why you don't see me commenting on your other commits around ia_netmask stuff, do you ? > > Back to your comments: > > I have made a test case that proves, that usage of deleted address isn't > prevented when it is removed, but loopback route still exists. > > The test is the following run a race between this program: > > =A0 =A0 =A0 =A0struct ifreq ifr; > =A0 =A0 =A0 =A0int s; > > =A0 =A0 =A0 =A0bzero(&ifr, sizeof(struct ifreq)); > > =A0 =A0 =A0 =A0strncpy(ifr.ifr_name, "igb1", sizeof ifr.ifr_name); > =A0 =A0 =A0 =A0ifr.ifr_addr.sa_family =3D AF_INET; > =A0 =A0 =A0 =A0ifr.ifr_addr.sa_len =3D sizeof(struct sockaddr_in); > =A0 =A0 =A0 =A0((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr =3D= inet_addr("10.0.0.1"); > > =A0 =A0 =A0 =A0s =3D socket(AF_INET, SOCK_DGRAM, 0); > > =A0 =A0 =A0 =A0for (;;) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ioctl(s, SIOCSIFADDR, &ifr); > > And this script: > > =A0 =A0 =A0 =A0while (true); do nc -z 10.0.0.1 22 || echo Fail; done > I am not sure if this test scenario is valid. The loopback route is wiped at line #853 and then quickly inserted back at line #936 because you are SIOCSIFADDR the same address over and over again. > > Application writers don't know this in-kernel things. They usually write = code > this way: > > =A0 =A0 =A0 =A0if (ioctl(foo) < 0) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* fatal error: can't configure address! *= / > =A0 =A0 =A0 =A0} > > And this is correct way. Look into this from viewpoint of say quagga deve= loper. > One doesn't need to know about this tricks in FreeBSD kernel. > Yes, you have a good point there and I agree completely. --Qing From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 15:03: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 E92CD1065670; Wed, 23 Nov 2011 15:03:15 +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 BF4448FC18; Wed, 23 Nov 2011 15:03:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANF3FjV050580; Wed, 23 Nov 2011 15:03:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANF3F5I050577; Wed, 23 Nov 2011 15:03:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111231503.pANF3F5I050577@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Nov 2011 15:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227884 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 15:03:16 -0000 Author: kib Date: Wed Nov 23 15:03:15 2011 New Revision: 227884 URL: http://svn.freebsd.org/changeset/base/227884 Log: MFC r227657: Consistently use process spin lock for protection of the p->p_boundary_count. Race could cause the execve(2) from the threaded process to hung since thread boundary counter was incorrect and single-threading never finished. Approved by: re (bz) Modified: stable/9/sys/kern/kern_thread.c stable/9/sys/sys/proc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Wed Nov 23 13:50:14 2011 (r227883) +++ stable/9/sys/kern/kern_thread.c Wed Nov 23 15:03:15 2011 (r227884) @@ -566,6 +566,8 @@ calc_remaining(struct proc *p, int mode) { int remaining; + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); if (mode == SINGLE_EXIT) remaining = p->p_numthreads; else if (mode == SINGLE_BOUNDARY) @@ -819,8 +821,11 @@ thread_suspend_check(int return_instead) td->td_flags &= ~TDF_BOUNDARY; thread_unlock(td); PROC_LOCK(p); - if (return_instead == 0) + if (return_instead == 0) { + PROC_SLOCK(p); p->p_boundary_count--; + PROC_SUNLOCK(p); + } } return (0); } Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Wed Nov 23 13:50:14 2011 (r227883) +++ stable/9/sys/sys/proc.h Wed Nov 23 15:03:15 2011 (r227884) @@ -532,7 +532,7 @@ struct proc { struct thread *p_singlethread;/* (c + j) If single threading this is it */ int p_suspcount; /* (j) Num threads in suspended mode. */ struct thread *p_xthread; /* (c) Trap thread */ - int p_boundary_count;/* (c) Num threads at user boundary */ + int p_boundary_count;/* (j) Num threads at user boundary */ int p_pendingcnt; /* how many signals are pending */ struct itimers *p_itimers; /* (c) POSIX interval timers. */ struct procdesc *p_procdesc; /* (e) Process descriptor, if any. */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 15:10: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 436B81065672; Wed, 23 Nov 2011 15:10:16 +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 32F268FC0C; Wed, 23 Nov 2011 15:10:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANFAGU3050855; Wed, 23 Nov 2011 15:10:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANFAGCA050853; Wed, 23 Nov 2011 15:10:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111231510.pANFAGCA050853@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 15:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227885 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 15:10:16 -0000 Author: bz Date: Wed Nov 23 15:10:15 2011 New Revision: 227885 URL: http://svn.freebsd.org/changeset/base/227885 Log: MFC r227481: Return the correct value for the IPV6_MULTICAST_HOPS getsockopt() call. Submitted by: rpaulo Approved by: re (kib) Modified: stable/9/sys/netinet6/in6_mcast.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet6/in6_mcast.c ============================================================================== --- stable/9/sys/netinet6/in6_mcast.c Wed Nov 23 15:03:15 2011 (r227884) +++ stable/9/sys/netinet6/in6_mcast.c Wed Nov 23 15:10:15 2011 (r227885) @@ -1713,7 +1713,7 @@ ip6_getmoptions(struct inpcb *inp, struc if (im6o == NULL) optval = V_ip6_defmcasthlim; else - optval = im6o->im6o_multicast_loop; + optval = im6o->im6o_multicast_hlim; INP_WUNLOCK(inp); error = sooptcopyout(sopt, &optval, sizeof(u_int)); break; From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 15:13: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 763531065670; Wed, 23 Nov 2011 15:13:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id CB9608FC15; Wed, 23 Nov 2011 15:13:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id pANFDY4V021769; Wed, 23 Nov 2011 19:13:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id pANFDYRc021768; Wed, 23 Nov 2011 19:13:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 23 Nov 2011 19:13:34 +0400 From: Gleb Smirnoff To: Qing Li Message-ID: <20111123151334.GC96616@FreeBSD.org> References: <201111211410.pALEAD9B046139@svn.freebsd.org> <20111121195439.GE96616@FreeBSD.org> <20111122154312.GL96616@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: r227791 - 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: Wed, 23 Nov 2011 15:13:36 -0000 On Wed, Nov 23, 2011 at 06:53:05AM -0800, Qing Li wrote: Q> > šfirst I'd like to notice that we are speaking about obsoleted interfaces. Q> Q> Yup, that's why you don't see me commenting on your other commits around Q> ia_netmask stuff, do you ? Oops, I didn't notice that one. Sorry! Can you please resend it? Q> > Back to your comments: Q> > Q> > I have made a test case that proves, that usage of deleted address isn't Q> > prevented when it is removed, but loopback route still exists. Q> > Q> > The test is the following run a race between this program: Q> > Q> > š š š šstruct ifreq ifr; Q> > š š š šint s; Q> > Q> > š š š šbzero(&ifr, sizeof(struct ifreq)); Q> > Q> > š š š šstrncpy(ifr.ifr_name, "igb1", sizeof ifr.ifr_name); Q> > š š š šifr.ifr_addr.sa_family = AF_INET; Q> > š š š šifr.ifr_addr.sa_len = sizeof(struct sockaddr_in); Q> > š š š š((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = inet_addr("10.0.0.1"); Q> > Q> > š š š šs = socket(AF_INET, SOCK_DGRAM, 0); Q> > Q> > š š š šfor (;;) Q> > š š š š š š š šioctl(s, SIOCSIFADDR, &ifr); Q> > Q> > And this script: Q> > Q> > š š š šwhile (true); do nc -z 10.0.0.1 22 || echo Fail; done Q> > Q> Q> I am not sure if this test scenario is valid. Q> Q> The loopback route is wiped at line #853 and then quickly inserted back at Q> line #936 because you are SIOCSIFADDR the same address over and over again. But during the procedure there is a state when we do not have this address, but still we receive traffic to it. That is the thing I don't like. If you really insist on this, let's shift in_ifscrub() down below as it was. Since it affects only obsoleted SIOCSIFADDR, I'd better just ignore that behavior rather than stand on its incorrectness. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 15:16: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 40458106566B; Wed, 23 Nov 2011 15:16:06 +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 1695E8FC15; Wed, 23 Nov 2011 15:16:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANFG5xA051099; Wed, 23 Nov 2011 15:16:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANFG5DS051096; Wed, 23 Nov 2011 15:16:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111231516.pANFG5DS051096@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Nov 2011 15:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227886 - in releng/9.0/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 15:16:06 -0000 Author: kib Date: Wed Nov 23 15:16:05 2011 New Revision: 227886 URL: http://svn.freebsd.org/changeset/base/227886 Log: MFC r227657: Consistently use process spin lock for protection of the p->p_boundary_count. Race could cause the execve(2) from the threaded process to hung since thread boundary counter was incorrect and single-threading never finished. Approved by: re (bz) Modified: releng/9.0/sys/kern/kern_thread.c releng/9.0/sys/sys/proc.h Directory Properties: releng/9.0/sys/ (props changed) Modified: releng/9.0/sys/kern/kern_thread.c ============================================================================== --- releng/9.0/sys/kern/kern_thread.c Wed Nov 23 15:10:15 2011 (r227885) +++ releng/9.0/sys/kern/kern_thread.c Wed Nov 23 15:16:05 2011 (r227886) @@ -566,6 +566,8 @@ calc_remaining(struct proc *p, int mode) { int remaining; + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); if (mode == SINGLE_EXIT) remaining = p->p_numthreads; else if (mode == SINGLE_BOUNDARY) @@ -819,8 +821,11 @@ thread_suspend_check(int return_instead) td->td_flags &= ~TDF_BOUNDARY; thread_unlock(td); PROC_LOCK(p); - if (return_instead == 0) + if (return_instead == 0) { + PROC_SLOCK(p); p->p_boundary_count--; + PROC_SUNLOCK(p); + } } return (0); } Modified: releng/9.0/sys/sys/proc.h ============================================================================== --- releng/9.0/sys/sys/proc.h Wed Nov 23 15:10:15 2011 (r227885) +++ releng/9.0/sys/sys/proc.h Wed Nov 23 15:16:05 2011 (r227886) @@ -532,7 +532,7 @@ struct proc { struct thread *p_singlethread;/* (c + j) If single threading this is it */ int p_suspcount; /* (j) Num threads in suspended mode. */ struct thread *p_xthread; /* (c) Trap thread */ - int p_boundary_count;/* (c) Num threads at user boundary */ + int p_boundary_count;/* (j) Num threads at user boundary */ int p_pendingcnt; /* how many signals are pending */ struct itimers *p_itimers; /* (c) POSIX interval timers. */ struct procdesc *p_procdesc; /* (e) Process descriptor, if any. */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 15:18: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 5FCE0106566C; Wed, 23 Nov 2011 15:18:16 +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 4FE758FC16; Wed, 23 Nov 2011 15:18:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANFIGkL051199; Wed, 23 Nov 2011 15:18:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANFIGVW051197; Wed, 23 Nov 2011 15:18:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111231518.pANFIGVW051197@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 15:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227887 - releng/9.0/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 15:18:16 -0000 Author: bz Date: Wed Nov 23 15:18:16 2011 New Revision: 227887 URL: http://svn.freebsd.org/changeset/base/227887 Log: MFC r227481: Return the correct value for the IPV6_MULTICAST_HOPS getsockopt() call. Submitted by: rpaulo Approved by: re (kib) Modified: releng/9.0/sys/netinet6/in6_mcast.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/netinet6/in6_mcast.c ============================================================================== --- releng/9.0/sys/netinet6/in6_mcast.c Wed Nov 23 15:16:05 2011 (r227886) +++ releng/9.0/sys/netinet6/in6_mcast.c Wed Nov 23 15:18:16 2011 (r227887) @@ -1713,7 +1713,7 @@ ip6_getmoptions(struct inpcb *inp, struc if (im6o == NULL) optval = V_ip6_defmcasthlim; else - optval = im6o->im6o_multicast_loop; + optval = im6o->im6o_multicast_hlim; INP_WUNLOCK(inp); error = sooptcopyout(sopt, &optval, sizeof(u_int)); break; From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 15:37:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C534A106564A; Wed, 23 Nov 2011 15:37:03 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0C28FC13; Wed, 23 Nov 2011 15:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANFb35L051806; Wed, 23 Nov 2011 15:37:03 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANFb3d1051804; Wed, 23 Nov 2011 15:37:03 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111231537.pANFb3d1051804@svn.freebsd.org> From: Attilio Rao Date: Wed, 23 Nov 2011 15:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227888 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 15:37:03 -0000 Author: attilio Date: Wed Nov 23 15:37:03 2011 New Revision: 227888 URL: http://svn.freebsd.org/changeset/base/227888 Log: MFC r227058: Disable interrupt and preemption for smp_rendezvous() also in the UP/!SMP case. Sponsored by: Sandvine Incorporated Approved by: re (kib) Modified: stable/9/sys/kern/subr_smp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/subr_smp.c ============================================================================== --- stable/9/sys/kern/subr_smp.c Wed Nov 23 15:18:16 2011 (r227887) +++ stable/9/sys/kern/subr_smp.c Wed Nov 23 15:37:03 2011 (r227888) @@ -415,13 +415,16 @@ smp_rendezvous_cpus(cpuset_t map, { int curcpumap, i, ncpus = 0; + /* Look comments in the !SMP case. */ if (!smp_started) { + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); return; } @@ -666,12 +669,18 @@ smp_rendezvous_cpus(cpuset_t map, void (*teardown_func)(void *), void *arg) { + /* + * In the !SMP case we just need to ensure the same initial conditions + * as the SMP case. + */ + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); } void @@ -681,12 +690,15 @@ smp_rendezvous(void (*setup_func)(void * void *arg) { + /* Look comments in the smp_rendezvous_cpus() case. */ + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); } /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 15:41: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 6C2431065673; Wed, 23 Nov 2011 15:41:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 429B68FC0C; Wed, 23 Nov 2011 15:41:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANFfu7L052012; Wed, 23 Nov 2011 15:41:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANFfuK0052010; Wed, 23 Nov 2011 15:41:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111231541.pANFfuK0052010@svn.freebsd.org> From: Attilio Rao Date: Wed, 23 Nov 2011 15:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227889 - releng/9.0/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 15:41:56 -0000 Author: attilio Date: Wed Nov 23 15:41:55 2011 New Revision: 227889 URL: http://svn.freebsd.org/changeset/base/227889 Log: MFC r227058: Disable interrupt and preemption for smp_rendezvous() also in the UP/!SMP case. Sponsored by: Sandvine Incorporated Approved by: re (kib) Modified: releng/9.0/sys/kern/subr_smp.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/kern/subr_smp.c ============================================================================== --- releng/9.0/sys/kern/subr_smp.c Wed Nov 23 15:37:03 2011 (r227888) +++ releng/9.0/sys/kern/subr_smp.c Wed Nov 23 15:41:55 2011 (r227889) @@ -415,13 +415,16 @@ smp_rendezvous_cpus(cpuset_t map, { int curcpumap, i, ncpus = 0; + /* Look comments in the !SMP case. */ if (!smp_started) { + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); return; } @@ -666,12 +669,18 @@ smp_rendezvous_cpus(cpuset_t map, void (*teardown_func)(void *), void *arg) { + /* + * In the !SMP case we just need to ensure the same initial conditions + * as the SMP case. + */ + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); } void @@ -681,12 +690,15 @@ smp_rendezvous(void (*setup_func)(void * void *arg) { + /* Look comments in the smp_rendezvous_cpus() case. */ + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); } /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 16:02: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 D0D01106564A; Wed, 23 Nov 2011 16:02:12 +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 C05078FC0A; Wed, 23 Nov 2011 16:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANG2CjX052706; Wed, 23 Nov 2011 16:02:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANG2CLu052704; Wed, 23 Nov 2011 16:02:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111231602.pANG2CLu052704@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 16:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227890 - stable/9/sys/dev/qlxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 16:02:12 -0000 Author: bz Date: Wed Nov 23 16:02:12 2011 New Revision: 227890 URL: http://svn.freebsd.org/changeset/base/227890 Log: MFC r227547: The maximum TSO frame size should be: maximum IP datagram size (65535 bytes) + Ethernet header size (14 bytes) + 2 * VLAN tag size (4 bytes) [1]. [1] We need to multiply by 2 to account for the double VLAN tag provision added in IEEE 802.1ad. Submitted by: David Somayajulu (david.somayajulu qlogic.com) Approved by: re (kib) Modified: stable/9/sys/dev/qlxgb/qla_def.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/qlxgb/qla_def.h ============================================================================== --- stable/9/sys/dev/qlxgb/qla_def.h Wed Nov 23 15:41:55 2011 (r227889) +++ stable/9/sys/dev/qlxgb/qla_def.h Wed Nov 23 16:02:12 2011 (r227890) @@ -86,7 +86,7 @@ typedef struct qla_tx_buf qla_tx_buf_t; #define QLA_MAX_SEGMENTS 63 /* maximum # of segs in a sg list */ #define QLA_MAX_FRAME_SIZE MJUM9BYTES #define QLA_STD_FRAME_SIZE 1514 -#define QLA_MAX_TSO_FRAME_SIZE (64 * 1024 - 1) +#define QLA_MAX_TSO_FRAME_SIZE ((64 * 1024 - 1) + 22) /* Number of MSIX/MSI Vectors required */ #define Q8_MSI_COUNT 4 From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 16:02: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 F1F5A106566C; Wed, 23 Nov 2011 16:02:36 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E13C28FC17; Wed, 23 Nov 2011 16:02:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANG2aTq052756; Wed, 23 Nov 2011 16:02:36 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANG2aXl052754; Wed, 23 Nov 2011 16:02:36 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111231602.pANG2aXl052754@svn.freebsd.org> From: Attilio Rao Date: Wed, 23 Nov 2011 16:02: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: r227891 - 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: Wed, 23 Nov 2011 16:02:37 -0000 Author: attilio Date: Wed Nov 23 16:02:36 2011 New Revision: 227891 URL: http://svn.freebsd.org/changeset/base/227891 Log: MFC r227058: Disable interrupt and preemption for smp_rendezvous() also in the UP/!SMP case. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/subr_smp.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_smp.c ============================================================================== --- stable/8/sys/kern/subr_smp.c Wed Nov 23 16:02:12 2011 (r227890) +++ stable/8/sys/kern/subr_smp.c Wed Nov 23 16:02:36 2011 (r227891) @@ -409,13 +409,16 @@ smp_rendezvous_cpus(cpumask_t map, { int i, ncpus = 0; + /* Look comments in the !SMP case. */ if (!smp_started) { + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); return; } @@ -652,12 +655,18 @@ smp_rendezvous_cpus(cpumask_t map, void (*teardown_func)(void *), void *arg) { + /* + * In the !SMP case we just need to ensure the same initial conditions + * as the SMP case. + */ + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); } void @@ -667,12 +676,15 @@ smp_rendezvous(void (*setup_func)(void * void *arg) { + /* Look comments in the smp_rendezvous_cpus() case. */ + spinlock_enter(); if (setup_func != NULL) setup_func(arg); if (action_func != NULL) action_func(arg); if (teardown_func != NULL) teardown_func(arg); + spinlock_exit(); } /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 16:03: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 B48851065670; Wed, 23 Nov 2011 16:03:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A47CA8FC08; Wed, 23 Nov 2011 16:03:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANG3lRf052828; Wed, 23 Nov 2011 16:03:47 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANG3lsT052826; Wed, 23 Nov 2011 16:03:47 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111231603.pANG3lsT052826@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 16:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227892 - releng/9.0/sys/dev/qlxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 16:03:47 -0000 Author: bz Date: Wed Nov 23 16:03:47 2011 New Revision: 227892 URL: http://svn.freebsd.org/changeset/base/227892 Log: MFC r227547: The maximum TSO frame size should be: maximum IP datagram size (65535 bytes) + Ethernet header size (14 bytes) + 2 * VLAN tag size (4 bytes) [1]. [1] We need to multiply by 2 to account for the double VLAN tag provision added in IEEE 802.1ad. Submitted by: David Somayajulu (david.somayajulu qlogic.com) Approved by: re (kib) Modified: releng/9.0/sys/dev/qlxgb/qla_def.h Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/dev/qlxgb/qla_def.h ============================================================================== --- releng/9.0/sys/dev/qlxgb/qla_def.h Wed Nov 23 16:02:36 2011 (r227891) +++ releng/9.0/sys/dev/qlxgb/qla_def.h Wed Nov 23 16:03:47 2011 (r227892) @@ -86,7 +86,7 @@ typedef struct qla_tx_buf qla_tx_buf_t; #define QLA_MAX_SEGMENTS 63 /* maximum # of segs in a sg list */ #define QLA_MAX_FRAME_SIZE MJUM9BYTES #define QLA_STD_FRAME_SIZE 1514 -#define QLA_MAX_TSO_FRAME_SIZE (64 * 1024 - 1) +#define QLA_MAX_TSO_FRAME_SIZE ((64 * 1024 - 1) + 22) /* Number of MSIX/MSI Vectors required */ #define Q8_MSI_COUNT 4 From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 17:02: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 9805F1065670; Wed, 23 Nov 2011 17:02:27 +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 879658FC13; Wed, 23 Nov 2011 17:02:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANH2Ri8054743; Wed, 23 Nov 2011 17:02:27 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANH2R24054741; Wed, 23 Nov 2011 17:02:27 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201111231702.pANH2R24054741@svn.freebsd.org> From: Ed Maste Date: Wed, 23 Nov 2011 17:02: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: r227893 - head/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 17:02:27 -0000 Author: emaste Date: Wed Nov 23 17:02:27 2011 New Revision: 227893 URL: http://svn.freebsd.org/changeset/base/227893 Log: Avoid double free creating a new RAID with invalid command line arguments. Submitted by: Xin Huang Reviewed by: rstone@ MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_config.c Modified: head/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_config.c Wed Nov 23 16:03:47 2011 (r227892) +++ head/usr.sbin/mfiutil/mfi_config.c Wed Nov 23 17:02:27 2011 (r227893) @@ -348,6 +348,7 @@ parse_array(int fd, int raid_type, char error = mfi_lookup_drive(fd, cp, &device_id); if (error) { free(info->drives); + info->drives = NULL; return (error); } @@ -355,12 +356,14 @@ parse_array(int fd, int raid_type, char error = errno; warn("Failed to fetch drive info for drive %s", cp); free(info->drives); + info->drives = NULL; return (error); } if (pinfo->fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { warnx("Drive %u is not available", device_id); free(info->drives); + info->drives = NULL; return (EINVAL); } } From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 18:04: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 E66CA106566B; Wed, 23 Nov 2011 18:04:30 +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 D4E8B8FC0A; Wed, 23 Nov 2011 18:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANI4Uin056643; Wed, 23 Nov 2011 18:04:30 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANI4UK5056641; Wed, 23 Nov 2011 18:04:30 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111231804.pANI4UK5056641@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 18:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227894 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 18:04:31 -0000 Author: bz Date: Wed Nov 23 18:04:30 2011 New Revision: 227894 URL: http://svn.freebsd.org/changeset/base/227894 Log: MFC r227061 (by mlaier): Fix a use-after-free/redzone issue in the routing code. Approved by: re (kib) Modified: stable/9/sys/net/rtsock.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/net/rtsock.c ============================================================================== --- stable/9/sys/net/rtsock.c Wed Nov 23 17:02:27 2011 (r227893) +++ stable/9/sys/net/rtsock.c Wed Nov 23 18:04:30 2011 (r227894) @@ -166,7 +166,7 @@ static void rt_setmetrics(u_long which, struct rt_metrics_lite *out); static void rt_getmetrics(const struct rt_metrics_lite *in, struct rt_metrics *out); -static void rt_dispatch(struct mbuf *, const struct sockaddr *); +static void rt_dispatch(struct mbuf *, sa_family_t); static struct netisr_handler rtsock_nh = { .nh_name = "rtsock", @@ -545,6 +545,7 @@ route_output(struct mbuf *m, struct sock int len, error = 0; struct ifnet *ifp = NULL; union sockaddr_union saun; + sa_family_t saf = AF_UNSPEC; #define senderr(e) { error = e; goto flush;} if (m == NULL || ((m->m_len < sizeof(long)) && @@ -581,6 +582,7 @@ route_output(struct mbuf *m, struct sock (info.rti_info[RTAX_GATEWAY] != NULL && info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX)) senderr(EINVAL); + saf = info.rti_info[RTAX_DST]->sa_family; /* * Verify that the caller has the appropriate privilege; RTM_GET * is the only operation the non-superuser is allowed. @@ -926,10 +928,10 @@ flush: */ unsigned short family = rp->rcb_proto.sp_family; rp->rcb_proto.sp_family = 0; - rt_dispatch(m, info.rti_info[RTAX_DST]); + rt_dispatch(m, saf); rp->rcb_proto.sp_family = family; } else - rt_dispatch(m, info.rti_info[RTAX_DST]); + rt_dispatch(m, saf); } /* info.rti_info[RTAX_DST] (used above) can point inside of rtm */ if (rtm) @@ -1185,7 +1187,7 @@ rt_missmsg_fib(int type, struct rt_addri rtm->rtm_flags = RTF_DONE | flags; rtm->rtm_errno = error; rtm->rtm_addrs = rtinfo->rti_addrs; - rt_dispatch(m, sa); + rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); } void @@ -1217,7 +1219,7 @@ rt_ifmsg(struct ifnet *ifp) ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm->ifm_data = ifp->if_data; ifm->ifm_addrs = 0; - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } /* @@ -1295,7 +1297,7 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr M_SETFIB(m, fibnum); m->m_flags |= RTS_FILTER_FIB; } - rt_dispatch(m, sa); + rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); } } @@ -1338,7 +1340,7 @@ rt_newmaddrmsg(int cmd, struct ifmultiad __func__)); ifmam->ifmam_index = ifp->if_index; ifmam->ifmam_addrs = info.rti_addrs; - rt_dispatch(m, ifma->ifma_addr); + rt_dispatch(m, ifma->ifma_addr ? ifma->ifma_addr->sa_family : AF_UNSPEC); } static struct mbuf * @@ -1398,7 +1400,7 @@ rt_ieee80211msg(struct ifnet *ifp, int w if (m->m_flags & M_PKTHDR) m->m_pkthdr.len += data_len; mtod(m, struct if_announcemsghdr *)->ifan_msglen += data_len; - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } } @@ -1414,11 +1416,11 @@ rt_ifannouncemsg(struct ifnet *ifp, int m = rt_makeifannouncemsg(ifp, RTM_IFANNOUNCE, what, &info); if (m != NULL) - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } static void -rt_dispatch(struct mbuf *m, const struct sockaddr *sa) +rt_dispatch(struct mbuf *m, sa_family_t saf) { struct m_tag *tag; @@ -1427,14 +1429,14 @@ rt_dispatch(struct mbuf *m, const struct * use when injecting the mbuf into the routing socket buffer from * the netisr. */ - if (sa != NULL) { + if (saf != AF_UNSPEC) { tag = m_tag_get(PACKET_TAG_RTSOCKFAM, sizeof(unsigned short), M_NOWAIT); if (tag == NULL) { m_freem(m); return; } - *(unsigned short *)(tag + 1) = sa->sa_family; + *(unsigned short *)(tag + 1) = saf; m_tag_prepend(m, tag); } #ifdef VIMAGE From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 18:04:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA0D0106566B; Wed, 23 Nov 2011 18:04:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFBB38FC20; Wed, 23 Nov 2011 18:04:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANI4rN6056692; Wed, 23 Nov 2011 18:04:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANI4rGN056690; Wed, 23 Nov 2011 18:04:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111231804.pANI4rGN056690@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 18:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227895 - releng/9.0/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 18:04:53 -0000 Author: bz Date: Wed Nov 23 18:04:53 2011 New Revision: 227895 URL: http://svn.freebsd.org/changeset/base/227895 Log: MFC r227061 (by mlaier): Fix a use-after-free/redzone issue in the routing code. Approved by: re (kib) Modified: releng/9.0/sys/net/rtsock.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/net/rtsock.c ============================================================================== --- releng/9.0/sys/net/rtsock.c Wed Nov 23 18:04:30 2011 (r227894) +++ releng/9.0/sys/net/rtsock.c Wed Nov 23 18:04:53 2011 (r227895) @@ -166,7 +166,7 @@ static void rt_setmetrics(u_long which, struct rt_metrics_lite *out); static void rt_getmetrics(const struct rt_metrics_lite *in, struct rt_metrics *out); -static void rt_dispatch(struct mbuf *, const struct sockaddr *); +static void rt_dispatch(struct mbuf *, sa_family_t); static struct netisr_handler rtsock_nh = { .nh_name = "rtsock", @@ -545,6 +545,7 @@ route_output(struct mbuf *m, struct sock int len, error = 0; struct ifnet *ifp = NULL; union sockaddr_union saun; + sa_family_t saf = AF_UNSPEC; #define senderr(e) { error = e; goto flush;} if (m == NULL || ((m->m_len < sizeof(long)) && @@ -581,6 +582,7 @@ route_output(struct mbuf *m, struct sock (info.rti_info[RTAX_GATEWAY] != NULL && info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX)) senderr(EINVAL); + saf = info.rti_info[RTAX_DST]->sa_family; /* * Verify that the caller has the appropriate privilege; RTM_GET * is the only operation the non-superuser is allowed. @@ -926,10 +928,10 @@ flush: */ unsigned short family = rp->rcb_proto.sp_family; rp->rcb_proto.sp_family = 0; - rt_dispatch(m, info.rti_info[RTAX_DST]); + rt_dispatch(m, saf); rp->rcb_proto.sp_family = family; } else - rt_dispatch(m, info.rti_info[RTAX_DST]); + rt_dispatch(m, saf); } /* info.rti_info[RTAX_DST] (used above) can point inside of rtm */ if (rtm) @@ -1185,7 +1187,7 @@ rt_missmsg_fib(int type, struct rt_addri rtm->rtm_flags = RTF_DONE | flags; rtm->rtm_errno = error; rtm->rtm_addrs = rtinfo->rti_addrs; - rt_dispatch(m, sa); + rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); } void @@ -1217,7 +1219,7 @@ rt_ifmsg(struct ifnet *ifp) ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm->ifm_data = ifp->if_data; ifm->ifm_addrs = 0; - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } /* @@ -1295,7 +1297,7 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr M_SETFIB(m, fibnum); m->m_flags |= RTS_FILTER_FIB; } - rt_dispatch(m, sa); + rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); } } @@ -1338,7 +1340,7 @@ rt_newmaddrmsg(int cmd, struct ifmultiad __func__)); ifmam->ifmam_index = ifp->if_index; ifmam->ifmam_addrs = info.rti_addrs; - rt_dispatch(m, ifma->ifma_addr); + rt_dispatch(m, ifma->ifma_addr ? ifma->ifma_addr->sa_family : AF_UNSPEC); } static struct mbuf * @@ -1398,7 +1400,7 @@ rt_ieee80211msg(struct ifnet *ifp, int w if (m->m_flags & M_PKTHDR) m->m_pkthdr.len += data_len; mtod(m, struct if_announcemsghdr *)->ifan_msglen += data_len; - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } } @@ -1414,11 +1416,11 @@ rt_ifannouncemsg(struct ifnet *ifp, int m = rt_makeifannouncemsg(ifp, RTM_IFANNOUNCE, what, &info); if (m != NULL) - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } static void -rt_dispatch(struct mbuf *m, const struct sockaddr *sa) +rt_dispatch(struct mbuf *m, sa_family_t saf) { struct m_tag *tag; @@ -1427,14 +1429,14 @@ rt_dispatch(struct mbuf *m, const struct * use when injecting the mbuf into the routing socket buffer from * the netisr. */ - if (sa != NULL) { + if (saf != AF_UNSPEC) { tag = m_tag_get(PACKET_TAG_RTSOCKFAM, sizeof(unsigned short), M_NOWAIT); if (tag == NULL) { m_freem(m); return; } - *(unsigned short *)(tag + 1) = sa->sa_family; + *(unsigned short *)(tag + 1) = saf; m_tag_prepend(m, tag); } #ifdef VIMAGE From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 18:05: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 2C4F51065678; Wed, 23 Nov 2011 18:05: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 17B2D8FC1B; Wed, 23 Nov 2011 18:05:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANI5cFm056757; Wed, 23 Nov 2011 18:05:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANI5b0L056749; Wed, 23 Nov 2011 18:05:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201111231805.pANI5b0L056749@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 23 Nov 2011 18:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227896 - in vendor-sys/acpica/dist: . common compiler debugger disassembler dispatcher events executer generate/unix generate/unix/acpibin generate/unix/acpiexec generate/unix/acpihelp... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 18:05:38 -0000 Author: jkim Date: Wed Nov 23 18:05:37 2011 New Revision: 227896 URL: http://svn.freebsd.org/changeset/base/227896 Log: Import ACPICA 20111123. Added: vendor-sys/acpica/dist/compiler/aslrestype2s.c (contents, props changed) vendor-sys/acpica/dist/disassembler/dmresrcl2.c (contents, props changed) vendor-sys/acpica/dist/include/actbl3.h (contents, props changed) vendor-sys/acpica/dist/resources/rsserial.c (contents, props changed) vendor-sys/acpica/dist/utilities/utxfmutex.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/common/adisasm.c vendor-sys/acpica/dist/common/adwalk.c vendor-sys/acpica/dist/common/dmrestag.c vendor-sys/acpica/dist/common/dmtable.c vendor-sys/acpica/dist/common/dmtbdump.c vendor-sys/acpica/dist/common/dmtbinfo.c vendor-sys/acpica/dist/compiler/Makefile vendor-sys/acpica/dist/compiler/aslanalyze.c vendor-sys/acpica/dist/compiler/aslcodegen.c vendor-sys/acpica/dist/compiler/aslcompiler.h vendor-sys/acpica/dist/compiler/aslcompiler.l vendor-sys/acpica/dist/compiler/aslcompiler.y vendor-sys/acpica/dist/compiler/asldefine.h vendor-sys/acpica/dist/compiler/aslerror.c vendor-sys/acpica/dist/compiler/aslload.c vendor-sys/acpica/dist/compiler/asllookup.c vendor-sys/acpica/dist/compiler/aslmain.c vendor-sys/acpica/dist/compiler/aslmap.c vendor-sys/acpica/dist/compiler/aslmessages.h vendor-sys/acpica/dist/compiler/aslopcodes.c vendor-sys/acpica/dist/compiler/aslpredef.c vendor-sys/acpica/dist/compiler/aslresource.c vendor-sys/acpica/dist/compiler/aslrestype1i.c vendor-sys/acpica/dist/compiler/aslrestype2.c vendor-sys/acpica/dist/compiler/asltransform.c vendor-sys/acpica/dist/compiler/asltree.c vendor-sys/acpica/dist/compiler/aslwalks.c vendor-sys/acpica/dist/compiler/dtcompile.c vendor-sys/acpica/dist/compiler/dtcompiler.h vendor-sys/acpica/dist/compiler/dtfield.c vendor-sys/acpica/dist/compiler/dtsubtable.c vendor-sys/acpica/dist/compiler/dttable.c vendor-sys/acpica/dist/compiler/dttemplate.h vendor-sys/acpica/dist/compiler/dtutils.c vendor-sys/acpica/dist/debugger/dbcmds.c vendor-sys/acpica/dist/debugger/dbdisply.c vendor-sys/acpica/dist/debugger/dbfileio.c vendor-sys/acpica/dist/debugger/dbinput.c vendor-sys/acpica/dist/debugger/dbutils.c vendor-sys/acpica/dist/disassembler/dmbuffer.c vendor-sys/acpica/dist/disassembler/dmopcode.c vendor-sys/acpica/dist/disassembler/dmresrc.c vendor-sys/acpica/dist/disassembler/dmresrcl.c vendor-sys/acpica/dist/disassembler/dmresrcs.c vendor-sys/acpica/dist/disassembler/dmutils.c vendor-sys/acpica/dist/disassembler/dmwalk.c vendor-sys/acpica/dist/dispatcher/dsargs.c vendor-sys/acpica/dist/dispatcher/dsfield.c vendor-sys/acpica/dist/events/evevent.c vendor-sys/acpica/dist/events/evglock.c vendor-sys/acpica/dist/events/evregion.c vendor-sys/acpica/dist/executer/exconfig.c vendor-sys/acpica/dist/executer/excreate.c vendor-sys/acpica/dist/executer/exdump.c vendor-sys/acpica/dist/executer/exfield.c vendor-sys/acpica/dist/executer/exfldio.c vendor-sys/acpica/dist/executer/exprep.c vendor-sys/acpica/dist/executer/exutils.c vendor-sys/acpica/dist/generate/unix/Makefile vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/generate/unix/acpibin/Makefile vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile vendor-sys/acpica/dist/generate/unix/acpinames/Makefile vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile vendor-sys/acpica/dist/generate/unix/acpixtract/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/hardware/hwvalid.c vendor-sys/acpica/dist/include/acconfig.h vendor-sys/acpica/dist/include/acdebug.h vendor-sys/acpica/dist/include/acdisasm.h vendor-sys/acpica/dist/include/acevents.h vendor-sys/acpica/dist/include/acglobal.h vendor-sys/acpica/dist/include/acinterp.h vendor-sys/acpica/dist/include/aclocal.h vendor-sys/acpica/dist/include/acnames.h vendor-sys/acpica/dist/include/acobject.h vendor-sys/acpica/dist/include/acopcode.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/include/acpredef.h vendor-sys/acpica/dist/include/acresrc.h vendor-sys/acpica/dist/include/acrestyp.h vendor-sys/acpica/dist/include/actbl.h vendor-sys/acpica/dist/include/actbl1.h vendor-sys/acpica/dist/include/actypes.h vendor-sys/acpica/dist/include/acutils.h vendor-sys/acpica/dist/include/amlcode.h vendor-sys/acpica/dist/include/amlresrc.h vendor-sys/acpica/dist/namespace/nspredef.c vendor-sys/acpica/dist/namespace/nsrepair.c vendor-sys/acpica/dist/namespace/nsrepair2.c vendor-sys/acpica/dist/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/parser/psargs.c vendor-sys/acpica/dist/parser/psopcode.c vendor-sys/acpica/dist/parser/pstree.c vendor-sys/acpica/dist/resources/rscalc.c vendor-sys/acpica/dist/resources/rscreate.c vendor-sys/acpica/dist/resources/rsdump.c vendor-sys/acpica/dist/resources/rsinfo.c vendor-sys/acpica/dist/resources/rsirq.c vendor-sys/acpica/dist/resources/rslist.c vendor-sys/acpica/dist/resources/rsmisc.c vendor-sys/acpica/dist/resources/rsutils.c vendor-sys/acpica/dist/resources/rsxface.c vendor-sys/acpica/dist/tables/tbfadt.c vendor-sys/acpica/dist/tables/tbutils.c vendor-sys/acpica/dist/tests/misc/badcode.asl vendor-sys/acpica/dist/tools/acpiexec/Makefile vendor-sys/acpica/dist/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/tools/acpiexec/aemain.c vendor-sys/acpica/dist/tools/acpiexec/aetables.c vendor-sys/acpica/dist/tools/acpiexec/aetables.h vendor-sys/acpica/dist/tools/acpihelp/acpihelp.h vendor-sys/acpica/dist/tools/acpihelp/ahaslkey.c vendor-sys/acpica/dist/tools/acpihelp/ahaslops.c vendor-sys/acpica/dist/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/tools/acpihelp/ahpredef.c vendor-sys/acpica/dist/tools/acpisrc/asconvrt.c vendor-sys/acpica/dist/tools/acpisrc/astable.c vendor-sys/acpica/dist/utilities/utdecode.c vendor-sys/acpica/dist/utilities/utmutex.c vendor-sys/acpica/dist/utilities/utresrc.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Wed Nov 23 18:04:53 2011 (r227895) +++ vendor-sys/acpica/dist/changes.txt Wed Nov 23 18:05:37 2011 (r227896) @@ -1,7 +1,214 @@ ---------------------------------------- -22 September 2011. Summary of changes for version 20110922: +23 November 2011. Summary of changes for version 20111123: This release is available at www.acpica.org/downloads +The ACPI 5.0 specification is available at www.acpi.info + +0) ACPI 5.0 Support: + +This release contains full support for the ACPI 5.0 specification, as +summarized below. + +Reduced Hardware Support: +------------------------- + +This support allows for ACPI systems without the usual ACPI hardware. This +support is enabled by a flag in the revision 5 FADT. If it is set, ACPICA will +not attempt to initialize or use any of the usual ACPI hardware. Note, when +this flag is set, all of the following ACPI hardware is assumed to be not +present and is not initialized or accessed: + + General Purpose Events (GPEs) + Fixed Events (PM1a/PM1b and PM Control) + Power Management Timer and Console Buttons (power/sleep) + Real-time Clock Alarm + Global Lock + System Control Interrupt (SCI) + The FACS is assumed to be non-existent + +ACPI Tables: +------------ + +All new tables and updates to existing tables are fully supported in the +ACPICA headers (for use by device drivers), the disassembler, and the iASL +Data Table Compiler. ACPI 5.0 defines these new tables: + + BGRT /* Boot Graphics Resource Table */ + DRTM /* Dynamic Root of Trust for Measurement table */ + FPDT /* Firmware Performance Data Table */ + GTDT /* Generic Timer Description Table */ + MPST /* Memory Power State Table */ + PCCT /* Platform Communications Channel Table */ + PMTT /* Platform Memory Topology Table */ + RASF /* RAS Feature table */ + +Operation Regions/SpaceIDs: +--------------------------- + +All new operation regions are fully supported by the iASL compiler, the +disassembler, and the ACPICA runtime code (for dispatch to region handlers.) +The new operation region Space IDs are: + + GeneralPurposeIo + GenericSerialBus + +Resource Descriptors: +--------------------- + +All new ASL resource descriptors are fully supported by the iASL compiler, the +ASL/AML disassembler, and the ACPICA runtime Resource Manager code (including +all new predefined resource tags). New descriptors are: + + FixedDma + GpioIo + GpioInt + I2cSerialBus + SpiSerialBus + UartSerialBus + +ASL/AML Operators, New and Modified: +------------------------------------ + +One new operator is added, the Connection operator, which is used to associate +a GeneralPurposeIo or GenericSerialBus resource descriptor with individual +field objects within an operation region. Several new protocols are associated +with the AccessAs operator. All are fully supported by the iASL compiler, +disassembler, and runtime ACPICA AML interpreter: + + Connection // Declare Field Connection attributes + AccessAs: AttribBytes (n) // Read/Write N-Bytes Protocol + AccessAs: AttribRawBytes (n) // Raw Read/Write N-Bytes Protocol + AccessAs: AttribRawProcessBytes (n) // Raw Process Call Protocol + RawDataBuffer // Data type for Vendor Data fields + +Predefined ASL/AML Objects: +--------------------------- + +All new predefined objects/control-methods are supported by the iASL compiler +and the ACPICA runtime validation/repair (arguments and return values.) New +predefined names include the following: + +Standard Predefined Names (Objects or Control Methods): + _AEI, _CLS, _CPC, _CWS, _DEP, + _DLM, _EVT, _GCP, _CRT, _GWS, + _HRV, _PRE, _PSE, _SRT, _SUB. + +Resource Tags (Names used to access individual fields within resource +descriptors): + _DBT, _DPL, _DRS, _END, _FLC, + _IOR, _LIN, _MOD, _PAR, _PHA, + _PIN, _PPI, _POL, _RXL, _SLV, + _SPE, _STB, _TXL, _VEN. + +ACPICA External Interfaces: +--------------------------- + +Several new interfaces have been defined for use by ACPI-related device +drivers and other host OS services: + +AcpiAcquireMutex and AcpiReleaseMutex: These interfaces allow the host OS to +acquire and release AML mutexes that are defined in the DSDT/SSDT tables +provided by the BIOS. They are intended to be used in conjunction with the +ACPI 5.0 _DLM (Device Lock Method) in order to provide transaction-level +mutual exclusion with the AML code/interpreter. + +AcpiGetEventResources: Returns the (formatted) resource descriptors as defined +by the ACPI 5.0 _AEI object (ACPI Event Information). This object provides +resource descriptors associated with hardware-reduced platform events, similar +to the AcpiGetCurrentResources interface. + +Operation Region Handlers: For General Purpose IO and Generic Serial Bus +operation regions, information about the Connection() object and any optional +length information is passed to the region handler within the Context +parameter. + +AcpiBufferToResource: This interface converts a raw AML buffer containing a +resource template or resource descriptor to the ACPI_RESOURCE internal format +suitable for use by device drivers. Can be used by an operation region handler +to convert the Connection() buffer object into a ACPI_RESOURCE. + +Miscellaneous/Tools/TestSuites: +------------------------------- + +Support for extended _HID names (Four alpha characters instead of three). +Support for ACPI 5.0 features in the AcpiExec and AcpiHelp utilities. +Support for ACPI 5.0 features in the ASLTS test suite. +Fully updated documentation (ACPICA and iASL reference documents.) + +ACPI Table Definition Language: +------------------------------- + +Support for this language was implemented and released as a subsystem of the +iASL compiler in 2010. (See the iASL compiler User Guide.) + + +Non-ACPI 5.0 changes for this release: +-------------------------------------- + +1) ACPICA Core Subsystem: + +Fix a problem with operation region declarations where a failure can occur if +the region name and an argument that evaluates to an object (such as the +region address) are in different namespace scopes. Lin Ming, ACPICA BZ 937. + +Do not abort an ACPI table load if an invalid space ID is found within. This +will be caught later if the offending method is executed. ACPICA BZ 925. + +Fixed an issue with the FFixedHW space ID where the ID was not always +recognized properly (Both ACPICA and iASL). ACPICA BZ 926. + +Fixed a problem with the 32-bit generation of the unix-specific OSL +(osunixxf.c). Lin Ming, ACPICA BZ 936. + +Several changes made to enable generation with the GCC 4.6 compiler. ACPICA BZ +935. + +New error messages: Unsupported I/O requests (not 8/16/32 bit), and Index/Bank +field registers out-of-range. + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented the __PATH__ operator, which returns the full pathname of +the current source file. + +AcpiHelp: Automatically display expanded keyword information for all ASL +operators. + +Debugger: Add "Template" command to disassemble/dump resource template +buffers. + +Added a new master script to generate and execute the ASLTS test suite. +Automatically handles 32- and 64-bit generation. See tests/aslts.sh + +iASL: Fix problem with listing generation during processing of the Switch() +operator where AML listing was disabled until the entire Switch block was +completed. + +iASL: Improve support for semicolon statement terminators. Fix "invalid +character" message for some cases when the semicolon is used. Semicolons are +now allowed after every grammar element. ACPICA BZ 927. + +iASL: Fixed some possible aliasing warnings during generation. ACPICA BZ 923. + +Disassembler: Fix problem with disassembly of the DataTableRegion operator +where an inadvertent "Unhandled deferred opcode" message could be generated. + +3) Example Code and Data Size + +These are the sizes for the OS-independent acpica.lib produced by the +Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code +includes the debug output trace mechanism and has a much larger code and data +size. + + Previous Release: + Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total + Debug Version: 165.6K Code, 68.4K Data, 234.0K Total + Current Release: + Non-Debug Version: 92.3K Code, 24.9K Data, 117.2K Total + Debug Version: 170.8K Code, 72.6K Data, 243.4K Total + +---------------------------------------- +22 September 2011. Summary of changes for version 20110922: 0) ACPI 5.0 News: Modified: vendor-sys/acpica/dist/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/common/adisasm.c Wed Nov 23 18:04:53 2011 (r227895) +++ vendor-sys/acpica/dist/common/adisasm.c Wed Nov 23 18:05:37 2011 (r227896) @@ -868,6 +868,7 @@ AdParseDeferredOps ( break; case AML_REGION_OP: + case AML_DATA_REGION_OP: case AML_CREATE_QWORD_FIELD_OP: case AML_CREATE_DWORD_FIELD_OP: case AML_CREATE_WORD_FIELD_OP: Modified: vendor-sys/acpica/dist/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/common/adwalk.c Wed Nov 23 18:04:53 2011 (r227895) +++ vendor-sys/acpica/dist/common/adwalk.c Wed Nov 23 18:05:37 2011 (r227896) @@ -378,6 +378,10 @@ AcpiDmDumpDescending ( AcpiOsPrintf ("%X", (UINT32) Op->Common.Value.Integer); break; + case AML_QWORD_OP: + AcpiOsPrintf ("%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer)); + break; + case AML_INT_NAMEPATH_OP: if (Op->Common.Value.String) { Modified: vendor-sys/acpica/dist/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/common/dmrestag.c Wed Nov 23 18:04:53 2011 (r227895) +++ vendor-sys/acpica/dist/common/dmrestag.c Wed Nov 23 18:05:37 2011 (r227896) @@ -63,7 +63,7 @@ AcpiDmUpdateResourceName ( static char * AcpiDmSearchTagList ( UINT32 BitIndex, - ACPI_RESOURCE_TAG *TagList); + const ACPI_RESOURCE_TAG *TagList); static char * AcpiDmGetResourceTag ( @@ -108,7 +108,7 @@ AcpiDmAddResourcesToNamespace ( * ******************************************************************************/ -static ACPI_RESOURCE_TAG AcpiDmIrqTags[] = +static const ACPI_RESOURCE_TAG AcpiDmIrqTags[] = { {( 1 * 8), ACPI_RESTAG_INTERRUPT}, {( 3 * 8) + 0, ACPI_RESTAG_INTERRUPTTYPE}, @@ -117,7 +117,7 @@ static ACPI_RESOURCE_TAG AcpiDmIr {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmDmaTags[] = +static const ACPI_RESOURCE_TAG AcpiDmDmaTags[] = { {( 1 * 8), ACPI_RESTAG_DMA}, {( 2 * 8) + 0, ACPI_RESTAG_XFERTYPE}, @@ -126,7 +126,7 @@ static ACPI_RESOURCE_TAG AcpiDmDm {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmIoTags[] = +static const ACPI_RESOURCE_TAG AcpiDmIoTags[] = { {( 1 * 8) + 0, ACPI_RESTAG_DECODE}, {( 2 * 8), ACPI_RESTAG_MINADDR}, @@ -136,14 +136,22 @@ static ACPI_RESOURCE_TAG AcpiDmIo {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmFixedIoTags[] = +static const ACPI_RESOURCE_TAG AcpiDmFixedIoTags[] = { {( 1 * 8), ACPI_RESTAG_BASEADDRESS}, {( 3 * 8), ACPI_RESTAG_LENGTH}, {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmMemory24Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmFixedDmaTags[] = +{ + {( 1 * 8), ACPI_RESTAG_DMA}, + {( 3 * 8), ACPI_RESTAG_DMATYPE}, + {( 5 * 8), ACPI_RESTAG_XFERTYPE}, + {0, NULL} +}; + +static const ACPI_RESOURCE_TAG AcpiDmMemory24Tags[] = { {( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE}, {( 4 * 8), ACPI_RESTAG_MINADDR}, @@ -153,7 +161,7 @@ static ACPI_RESOURCE_TAG AcpiDmMe {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmRegisterTags[] = +static const ACPI_RESOURCE_TAG AcpiDmRegisterTags[] = { {( 3 * 8), ACPI_RESTAG_ADDRESSSPACE}, {( 4 * 8), ACPI_RESTAG_REGISTERBITWIDTH}, @@ -163,7 +171,7 @@ static ACPI_RESOURCE_TAG AcpiDmRe {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmMemory32Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmMemory32Tags[] = { {( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE}, {( 4 * 8), ACPI_RESTAG_MINADDR}, @@ -173,7 +181,7 @@ static ACPI_RESOURCE_TAG AcpiDmMe {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmFixedMemory32Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmFixedMemory32Tags[] = { {( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE}, {( 4 * 8), ACPI_RESTAG_BASEADDRESS}, @@ -181,7 +189,7 @@ static ACPI_RESOURCE_TAG AcpiDmFi {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmInterruptTags[] = +static const ACPI_RESOURCE_TAG AcpiDmInterruptTags[] = { {( 3 * 8) + 1, ACPI_RESTAG_INTERRUPTTYPE}, {( 3 * 8) + 2, ACPI_RESTAG_INTERRUPTLEVEL}, @@ -190,7 +198,7 @@ static ACPI_RESOURCE_TAG AcpiDmIn {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmAddress16Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmAddress16Tags[] = { {( 4 * 8) + 1, ACPI_RESTAG_DECODE}, {( 4 * 8) + 2, ACPI_RESTAG_MINTYPE}, @@ -203,7 +211,7 @@ static ACPI_RESOURCE_TAG AcpiDmAd {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmAddress32Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmAddress32Tags[] = { {( 4 * 8) + 1, ACPI_RESTAG_DECODE}, {( 4 * 8) + 2, ACPI_RESTAG_MINTYPE}, @@ -216,7 +224,7 @@ static ACPI_RESOURCE_TAG AcpiDmAd {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmAddress64Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmAddress64Tags[] = { {( 4 * 8) + 1, ACPI_RESTAG_DECODE}, {( 4 * 8) + 2, ACPI_RESTAG_MINTYPE}, @@ -229,7 +237,7 @@ static ACPI_RESOURCE_TAG AcpiDmAd {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmExtendedAddressTags[] = +static const ACPI_RESOURCE_TAG AcpiDmExtendedAddressTags[] = { {( 4 * 8) + 1, ACPI_RESTAG_DECODE}, {( 4 * 8) + 2, ACPI_RESTAG_MINTYPE}, @@ -243,9 +251,71 @@ static ACPI_RESOURCE_TAG AcpiDmEx {0, NULL} }; -/* Special-case tables for the type-specific flags */ +/* Subtype tables for GPIO descriptors */ + +static const ACPI_RESOURCE_TAG AcpiDmGpioIntTags[] = +{ + {( 7 * 8) + 0, ACPI_RESTAG_MODE}, + {( 7 * 8) + 1, ACPI_RESTAG_POLARITY}, + {( 7 * 8) + 3, ACPI_RESTAG_INTERRUPTSHARE}, + {( 9 * 8), ACPI_RESTAG_PINCONFIG}, + {(10 * 8), ACPI_RESTAG_DRIVESTRENGTH}, + {(12 * 8), ACPI_RESTAG_DEBOUNCETIME}, + {0, NULL} +}; + +static const ACPI_RESOURCE_TAG AcpiDmGpioIoTags[] = +{ + {( 7 * 8) + 0, ACPI_RESTAG_IORESTRICTION}, + {( 7 * 8) + 3, ACPI_RESTAG_INTERRUPTSHARE}, + {( 9 * 8), ACPI_RESTAG_PINCONFIG}, + {(10 * 8), ACPI_RESTAG_DRIVESTRENGTH}, + {(12 * 8), ACPI_RESTAG_DEBOUNCETIME}, + {0, NULL} +}; + +/* Subtype tables for SerialBus descriptors */ + +static const ACPI_RESOURCE_TAG AcpiDmI2cSerialBusTags[] = +{ + {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, + {( 7 * 8) + 0, ACPI_RESTAG_MODE}, + {(12 * 8), ACPI_RESTAG_SPEED}, + {(16 * 8), ACPI_RESTAG_ADDRESS}, + {0, NULL} +}; + +static const ACPI_RESOURCE_TAG AcpiDmSpiSerialBusTags[] = +{ + {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, + {( 7 * 8) + 0, ACPI_RESTAG_MODE}, + {( 7 * 8) + 1, ACPI_RESTAG_DEVICEPOLARITY}, + {(12 * 8), ACPI_RESTAG_SPEED}, + {(16 * 8), ACPI_RESTAG_LENGTH}, + {(17 * 8), ACPI_RESTAG_PHASE}, + {(18 * 8), ACPI_RESTAG_POLARITY}, + {(19 * 8), ACPI_RESTAG_ADDRESS}, + {0, NULL} +}; + +static const ACPI_RESOURCE_TAG AcpiDmUartSerialBusTags[] = +{ + {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, /* Note: not part of original macro */ + {( 7 * 8) + 0, ACPI_RESTAG_FLOWCONTROL}, + {( 7 * 8) + 2, ACPI_RESTAG_STOPBITS}, + {( 7 * 8) + 4, ACPI_RESTAG_LENGTH}, + {( 7 * 8) + 7, ACPI_RESTAG_ENDIANNESS}, + {(12 * 8), ACPI_RESTAG_SPEED}, + {(16 * 8), ACPI_RESTAG_LENGTH_RX}, + {(18 * 8), ACPI_RESTAG_LENGTH_TX}, + {(20 * 8), ACPI_RESTAG_PARITY}, + {(21 * 8), ACPI_RESTAG_LINE}, + {0, NULL} +}; + +/* Subtype tables for Address descriptor type-specific flags */ -static ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] = +static const ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] = { {( 5 * 8) + 0, ACPI_RESTAG_READWRITETYPE}, {( 5 * 8) + 1, ACPI_RESTAG_MEMTYPE}, @@ -254,7 +324,7 @@ static ACPI_RESOURCE_TAG AcpiDmMe {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmIoFlagTags[] = +static const ACPI_RESOURCE_TAG AcpiDmIoFlagTags[] = { {( 5 * 8) + 0, ACPI_RESTAG_RANGETYPE}, {( 5 * 8) + 4, ACPI_RESTAG_TYPE}, @@ -263,9 +333,15 @@ static ACPI_RESOURCE_TAG AcpiDmIo }; -/* Dispatch table used to obtain the correct tag table for a descriptor */ - -static ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags [] = +/* + * Dispatch table used to obtain the correct tag table for a descriptor. + * + * A NULL in this table means one of three things: + * 1) The descriptor ID is reserved and invalid + * 2) The descriptor has no tags associated with it + * 3) The descriptor has subtypes and a separate table will be used. + */ +static const ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags[] = { /* Small descriptors */ @@ -279,7 +355,7 @@ static ACPI_RESOURCE_TAG *AcpiGbl NULL, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */ AcpiDmIoTags, /* 0x08, ACPI_RESOURCE_NAME_IO_PORT */ AcpiDmFixedIoTags, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO_PORT */ - NULL, /* 0x0A, Reserved */ + AcpiDmFixedDmaTags, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */ NULL, /* 0x0B, Reserved */ NULL, /* 0x0C, Reserved */ NULL, /* 0x0D, Reserved */ @@ -299,9 +375,29 @@ static ACPI_RESOURCE_TAG *AcpiGbl AcpiDmAddress16Tags, /* 0x08, ACPI_RESOURCE_NAME_WORD_ADDRESS_SPACE */ AcpiDmInterruptTags, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_XRUPT */ AcpiDmAddress64Tags, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */ - AcpiDmExtendedAddressTags /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */ + AcpiDmExtendedAddressTags, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */ + NULL, /* 0x0C, ACPI_RESOURCE_NAME_GPIO - Use Subtype table below */ + NULL, /* 0x0D, Reserved */ + NULL /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use Subtype table below */ +}; + +/* GPIO Subtypes */ + +static const ACPI_RESOURCE_TAG *AcpiGbl_GpioResourceTags[] = +{ + AcpiDmGpioIntTags, /* 0x00 Interrupt Connection */ + AcpiDmGpioIoTags /* 0x01 I/O Connection */ }; +/* Serial Bus Subtypes */ + +static const ACPI_RESOURCE_TAG *AcpiGbl_SerialResourceTags[] = +{ + NULL, /* 0x00 Reserved */ + AcpiDmI2cSerialBusTags, /* 0x01 I2C SerialBus */ + AcpiDmSpiSerialBusTags, /* 0x02 SPI SerialBus */ + AcpiDmUartSerialBusTags /* 0x03 UART SerialBus */ +}; /* * Globals used to generate unique resource descriptor names. We use names that @@ -666,6 +762,9 @@ AcpiDmUpdateResourceName ( * * DESCRIPTION: Convert a BitIndex into a symbolic resource tag. * + * Note: ResourceIndex should be previously validated and guaranteed to ve + * valid. + * ******************************************************************************/ static char * @@ -674,23 +773,16 @@ AcpiDmGetResourceTag ( AML_RESOURCE *Resource, UINT8 ResourceIndex) { - ACPI_RESOURCE_TAG *TagList; + const ACPI_RESOURCE_TAG *TagList; char *Tag = NULL; /* Get the tag list for this resource descriptor type */ TagList = AcpiGbl_ResourceTags[ResourceIndex]; - if (!TagList) - { - /* There are no tags for this resource type */ - - return (NULL); - } /* - * Handle the type-specific flags field for the address descriptors. - * Kindof brute force, but just blindly search for an index match. + * Handle descriptors that have multiple subtypes */ switch (Resource->DescriptorType) { @@ -699,6 +791,10 @@ AcpiDmGetResourceTag ( case ACPI_RESOURCE_NAME_ADDRESS64: case ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64: + /* + * Subtype differentiation is the flags. + * Kindof brute force, but just blindly search for an index match + */ if (Resource->Address.ResourceType == ACPI_ADDRESS_TYPE_MEMORY_RANGE) { Tag = AcpiDmSearchTagList (BitIndex, AcpiDmMemoryFlagTags); @@ -716,13 +812,42 @@ AcpiDmGetResourceTag ( } break; + case ACPI_RESOURCE_NAME_GPIO: + + /* GPIO connection has 2 subtypes: Interrupt and I/O */ + + if (Resource->Gpio.ConnectionType > AML_RESOURCE_MAX_GPIOTYPE) + { + return (NULL); + } + + TagList = AcpiGbl_GpioResourceTags[Resource->Gpio.ConnectionType]; + break; + + case ACPI_RESOURCE_NAME_SERIAL_BUS: + + /* SerialBus has 3 subtypes: I2C, SPI, and UART */ + + if ((Resource->CommonSerialBus.Type == 0) || + (Resource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)) + { + return (NULL); + } + + TagList = AcpiGbl_SerialResourceTags[Resource->CommonSerialBus.Type]; + break; + default: break; } - /* Search the tag list for this descriptor type */ + /* Search for a match against the BitIndex */ + + if (TagList) + { + Tag = AcpiDmSearchTagList (BitIndex, TagList); + } - Tag = AcpiDmSearchTagList (BitIndex, TagList); return (Tag); } @@ -744,7 +869,7 @@ AcpiDmGetResourceTag ( static char * AcpiDmSearchTagList ( UINT32 BitIndex, - ACPI_RESOURCE_TAG *TagList) + const ACPI_RESOURCE_TAG *TagList) { /* Modified: vendor-sys/acpica/dist/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtable.c Wed Nov 23 18:04:53 2011 (r227895) +++ vendor-sys/acpica/dist/common/dmtable.c Wed Nov 23 18:05:37 2011 (r227896) @@ -196,6 +196,16 @@ static const char *AcpiDmMadtS "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */ "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */ "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */ + "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */ + "Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */ + "Unknown SubTable Type" /* Reserved */ +}; + +static const char *AcpiDmPmttSubnames[] = +{ + "Socket", /* ACPI_PMTT_TYPE_SOCKET */ + "Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */ + "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ "Unknown SubTable Type" /* Reserved */ }; @@ -268,6 +278,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"}, {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"}, {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt, "Boot Graphics Resource Table"}, {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"}, {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"}, {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"}, @@ -275,14 +286,20 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"}, {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"}, {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"}, + {ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"}, + {ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"}, {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"}, {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"}, {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"}, {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"}, {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"}, {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"}, + {ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"}, {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"}, + {ACPI_SIG_PCCT, NULL, AcpiDmDumpPcct, NULL, NULL, "Platform Communications Channel Table"}, + {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"}, + {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt, "S3 Performance Table"}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"}, {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic, "Software Licensing Description Table"}, {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"}, @@ -400,7 +417,7 @@ AcpiDmDumpDataTable ( /* * Handle tables that don't use the common ACPI table header structure. - * Currently, these are the FACS and RSDP. + * Currently, these are the FACS, RSDP, and S3PT. */ if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS)) { @@ -411,6 +428,10 @@ AcpiDmDumpDataTable ( { Length = AcpiDmDumpRsdp (Table); } + else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT)) + { + Length = AcpiDmDumpS3pt (Table); + } else { /* @@ -646,6 +667,7 @@ AcpiDmDumpTable ( case ACPI_DMT_ACCWIDTH: case ACPI_DMT_IVRS: case ACPI_DMT_MADT: + case ACPI_DMT_PMTT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: @@ -670,6 +692,10 @@ AcpiDmDumpTable ( case ACPI_DMT_SLIC: ByteLength = 4; break; + case ACPI_DMT_UINT40: + ByteLength = 5; + break; + case ACPI_DMT_UINT48: case ACPI_DMT_NAME6: ByteLength = 6; break; @@ -718,6 +744,12 @@ AcpiDmDumpTable ( return (AE_BAD_DATA); } + if (Info->Opcode == ACPI_DMT_EXTRA_TEXT) + { + AcpiOsPrintf ("%s", Info->Name); + continue; + } + /* Start a new line and decode the opcode */ AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name); @@ -745,17 +777,29 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%1.1X\n", *Target & 0x03); break; + case ACPI_DMT_FLAGS1: + + AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03); + break; + case ACPI_DMT_FLAGS2: AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03); break; + case ACPI_DMT_FLAGS4: + + AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03); + break; + /* Integer Data Types */ case ACPI_DMT_UINT8: case ACPI_DMT_UINT16: case ACPI_DMT_UINT24: case ACPI_DMT_UINT32: + case ACPI_DMT_UINT40: + case ACPI_DMT_UINT48: case ACPI_DMT_UINT56: case ACPI_DMT_UINT64: /* @@ -1021,6 +1065,19 @@ AcpiDmDumpTable ( AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]); break; + case ACPI_DMT_PMTT: + + /* PMTT subtable types */ + + Temp8 = *Target; + if (Temp8 > ACPI_PMTT_TYPE_RESERVED) + { + Temp8 = ACPI_PMTT_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPmttSubnames[Temp8]); + break; + case ACPI_DMT_SLIC: /* SLIC subtable types */ Modified: vendor-sys/acpica/dist/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbdump.c Wed Nov 23 18:04:53 2011 (r227895) +++ vendor-sys/acpica/dist/common/dmtbdump.c Wed Nov 23 18:05:37 2011 (r227896) @@ -230,11 +230,18 @@ AcpiDmDumpFadt ( AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2); } - /* Check for FADT revision 3 fields and up (ACPI 2.0+ extended data) */ + /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */ else if (Table->Length > ACPI_FADT_V2_SIZE) { AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3); + + /* Check for FADT revision 5 fields and up (ACPI 5.0+) */ + + if (Table->Length > ACPI_FADT_V3_SIZE) + { + AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5); + } } /* Validate various fields in the FADT, including length */ @@ -290,6 +297,10 @@ AcpiDmValidateFadtLength ( ExpectedLength = ACPI_FADT_V3_SIZE; break; + case 5: + ExpectedLength = ACPI_FADT_V5_SIZE; + break; + default: return; } @@ -751,6 +762,84 @@ AcpiDmDumpErst ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpFpdt + * + * PARAMETERS: Table - A FPDT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a FPDT. This table type consists + * of an open-ended number of subtables. + * + ******************************************************************************/ + +void +AcpiDmDumpFpdt ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_FPDT_HEADER *SubTable; + UINT32 Length = Table->Length; + UINT32 Offset = sizeof (ACPI_TABLE_FPDT); + ACPI_DMTABLE_INFO *InfoTable; + + + /* There is no main table (other than the standard ACPI header) */ + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoFpdtHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + switch (SubTable->Type) + { + case ACPI_FPDT_TYPE_BOOT: + InfoTable = AcpiDmTableInfoFpdt0; + break; + case ACPI_FPDT_TYPE_S3PERF: + InfoTable = AcpiDmTableInfoFpdt1; + break; + default: + AcpiOsPrintf ("\n**** Unknown FPDT sub-table type 0x%X\n\n", SubTable->Type); + + /* Attempt to continue */ + + if (!SubTable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return; + } + goto NextSubTable; + } + + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + +NextSubTable: + /* Point to next sub-table */ + + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpHest * * PARAMETERS: Table - A HEST table @@ -1134,6 +1223,12 @@ AcpiDmDumpMadt ( case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: InfoTable = AcpiDmTableInfoMadt10; break; + case ACPI_MADT_TYPE_GENERIC_INTERRUPT: + InfoTable = AcpiDmTableInfoMadt11; + break; + case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: + InfoTable = AcpiDmTableInfoMadt12; + break; default: AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type); @@ -1223,6 +1318,150 @@ AcpiDmDumpMcfg ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpMpst + * + * PARAMETERS: Table - A MPST Table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a MPST table + * + ******************************************************************************/ + +void +AcpiDmDumpMpst ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_MPST); + ACPI_MPST_POWER_NODE *SubTable0; + ACPI_MPST_POWER_STATE *SubTable0A; + ACPI_MPST_COMPONENT *SubTable0B; + ACPI_MPST_DATA_HDR *SubTable1; + ACPI_MPST_POWER_DATA *SubTable2; + UINT16 SubtableCount; + UINT8 PowerStateCount; + UINT8 ComponentCount; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Subtable: Memory Power Node(s) */ + + SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount; + SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset); + + while ((Offset < Table->Length) && SubtableCount) + { + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0, + sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Extract the sub-subtable counts */ + + PowerStateCount = SubTable0->NumPowerStates; + ComponentCount = SubTable0->NumPhysicalComponents; + Offset += sizeof (ACPI_MPST_POWER_NODE); + + /* Sub-subtables - Memory Power State Structure(s) */ + + SubTable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, SubTable0, + sizeof (ACPI_MPST_POWER_NODE)); + + while (PowerStateCount) + { + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A, + sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A); + if (ACPI_FAILURE (Status)) + { + return; + } + + SubTable0A++; + PowerStateCount--; + Offset += sizeof (ACPI_MPST_POWER_STATE); + } + + /* Sub-subtables - Physical Component ID Structure(s) */ + + SubTable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, SubTable0A); + + if (ComponentCount) + { + AcpiOsPrintf ("\n"); + } + + while (ComponentCount) + { + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B, + sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B); + if (ACPI_FAILURE (Status)) + { + return; + } + + SubTable0B++; + ComponentCount--; + Offset += sizeof (ACPI_MPST_COMPONENT); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 18:06: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 876DB106564A; Wed, 23 Nov 2011 18:06:50 +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 5DA2E8FC16; Wed, 23 Nov 2011 18:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANI6otS056864; Wed, 23 Nov 2011 18:06:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANI6omp056863; Wed, 23 Nov 2011 18:06:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201111231806.pANI6omp056863@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 23 Nov 2011 18:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227897 - vendor-sys/acpica/20111123 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 18:06:50 -0000 Author: jkim Date: Wed Nov 23 18:06:50 2011 New Revision: 227897 URL: http://svn.freebsd.org/changeset/base/227897 Log: Tag ACPICA 20111123. Added: vendor-sys/acpica/20111123/ - copied from r227896, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 18:10: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 3B89D1065672; Wed, 23 Nov 2011 18:10:48 +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 2A7968FC14; Wed, 23 Nov 2011 18:10:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANIAmiW057017; Wed, 23 Nov 2011 18:10:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANIAmX6057015; Wed, 23 Nov 2011 18:10:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111231810.pANIAmX6057015@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 18:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227898 - stable/9/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 18:10:48 -0000 Author: bz Date: Wed Nov 23 18:10:47 2011 New Revision: 227898 URL: http://svn.freebsd.org/changeset/base/227898 Log: MFC r226938 (by kevlo): Add missing PF_UNLOCK in pf_test Approved by: re (kib) Modified: stable/9/sys/contrib/pf/net/pf.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Wed Nov 23 18:06:50 2011 (r227897) +++ stable/9/sys/contrib/pf/net/pf.c Wed Nov 23 18:10:47 2011 (r227898) @@ -7176,11 +7176,15 @@ pf_test6(int dir, struct ifnet *ifp, str } #ifdef __FreeBSD__ - if (pd.pf_mtag->flags & PF_TAG_GENERATED) + if (pd.pf_mtag->flags & PF_TAG_GENERATED) { + PF_UNLOCK(); #else if (m->m_pkthdr.pf.flags & PF_TAG_GENERATED) #endif return (PF_PASS); +#ifdef __FreeBSD__ + } +#endif /* We do IP header normalization and packet reassembly here */ if (pf_normalize_ip6(m0, dir, kif, &reason, &pd) != PF_PASS) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 18:11: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 F30B8106566C; Wed, 23 Nov 2011 18:11:10 +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 E21C98FC19; Wed, 23 Nov 2011 18:11:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANIBATu057080; Wed, 23 Nov 2011 18:11:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANIBAtH057078; Wed, 23 Nov 2011 18:11:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111231811.pANIBAtH057078@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 18:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227899 - releng/9.0/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 18:11:11 -0000 Author: bz Date: Wed Nov 23 18:11:10 2011 New Revision: 227899 URL: http://svn.freebsd.org/changeset/base/227899 Log: MFC r226938 (by kevlo): Add missing PF_UNLOCK in pf_test Approved by: re (kib) Modified: releng/9.0/sys/contrib/pf/net/pf.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/contrib/pf/net/pf.c ============================================================================== --- releng/9.0/sys/contrib/pf/net/pf.c Wed Nov 23 18:10:47 2011 (r227898) +++ releng/9.0/sys/contrib/pf/net/pf.c Wed Nov 23 18:11:10 2011 (r227899) @@ -7176,11 +7176,15 @@ pf_test6(int dir, struct ifnet *ifp, str } #ifdef __FreeBSD__ - if (pd.pf_mtag->flags & PF_TAG_GENERATED) + if (pd.pf_mtag->flags & PF_TAG_GENERATED) { + PF_UNLOCK(); #else if (m->m_pkthdr.pf.flags & PF_TAG_GENERATED) #endif return (PF_PASS); +#ifdef __FreeBSD__ + } +#endif /* We do IP header normalization and packet reassembly here */ if (pf_normalize_ip6(m0, dir, kif, &reason, &pd) != PF_PASS) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 18:15: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 0FCDD1065672; Wed, 23 Nov 2011 18:15:50 +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 F29EA8FC19; Wed, 23 Nov 2011 18:15:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANIFnXx057269; Wed, 23 Nov 2011 18:15:49 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANIFnAn057267; Wed, 23 Nov 2011 18:15:49 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201111231815.pANIFnAn057267@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 23 Nov 2011 18:15: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: r227900 - stable/8/usr.bin/catman X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 18:15:50 -0000 Author: uqs Date: Wed Nov 23 18:15:49 2011 New Revision: 227900 URL: http://svn.freebsd.org/changeset/base/227900 Log: MFH r224639, r224657: Disable generation of SGR sequences. This is a no-op when using base groff, as it hasn't been changed in stable. This helps when using the ports groff, though. Modified: stable/8/usr.bin/catman/catman.c Directory Properties: stable/8/usr.bin/catman/ (props changed) Modified: stable/8/usr.bin/catman/catman.c ============================================================================== --- stable/8/usr.bin/catman/catman.c Wed Nov 23 18:11:10 2011 (r227899) +++ stable/8/usr.bin/catman/catman.c Wed Nov 23 18:15:49 2011 (r227900) @@ -432,7 +432,7 @@ process_page(char *mandir, char *src, ch } snprintf(tmp_file, sizeof tmp_file, "%s.tmp", cat); snprintf(cmd, sizeof cmd, - "%scat %s | tbl | nroff -T%s -man | col | %s > %s.tmp", + "%scat %s | tbl | nroff -c -T%s -man | %s > %s.tmp", zipped == BZIP ? BZ2CAT_CMD : zipped == GZIP ? GZCAT_CMD : "", src, nroff_device, zipped == BZIP ? BZ2_CMD : zipped == GZIP ? GZ_CMD : "cat", From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 18:38: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 386AB106564A; Wed, 23 Nov 2011 18:38:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27CD38FC0A; Wed, 23 Nov 2011 18:38:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANIc9ea058053; Wed, 23 Nov 2011 18:38:09 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANIc9vo058051; Wed, 23 Nov 2011 18:38:09 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111231838.pANIc9vo058051@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 23 Nov 2011 18:38: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: r227901 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 18:38:09 -0000 Author: glebius Date: Wed Nov 23 18:38:08 2011 New Revision: 227901 URL: http://svn.freebsd.org/changeset/base/227901 Log: Fix parsing of redirect_addr argument. PR: kern/162739 MFC after: 3 days Modified: head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Wed Nov 23 18:15:49 2011 (r227900) +++ head/sbin/ipfw/nat.c Wed Nov 23 18:38:08 2011 (r227901) @@ -345,11 +345,12 @@ setup_redir_addr(char *buf, int *ac, cha space = sizeof(struct cfg_redir); /* Extract local address. */ - if ((sep = strtok(**av, ",")) != NULL) { + if (strchr(**av, ',') != NULL) { struct cfg_spool *spool; /* Setup LSNAT server pool. */ r->laddr.s_addr = INADDR_NONE; + sep = strtok(**av, ","); while (sep != NULL) { spool = (struct cfg_spool *)buf; space += sizeof(struct cfg_spool); From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 19:06: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 02012106566B; Wed, 23 Nov 2011 19:06:31 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E506A8FC15; Wed, 23 Nov 2011 19:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANJ6UG8059102; Wed, 23 Nov 2011 19:06:30 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANJ6Uq5059099; Wed, 23 Nov 2011 19:06:30 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111231906.pANJ6Uq5059099@svn.freebsd.org> From: Max Khon Date: Wed, 23 Nov 2011 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227902 - head/usr.sbin/sade X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 19:06:31 -0000 Author: fjoe Date: Wed Nov 23 19:06:30 2011 New Revision: 227902 URL: http://svn.freebsd.org/changeset/base/227902 Log: - Remove unused old libdialog includes - Remove unused functions Modified: head/usr.sbin/sade/misc.c head/usr.sbin/sade/sade.h Modified: head/usr.sbin/sade/misc.c ============================================================================== --- head/usr.sbin/sade/misc.c Wed Nov 23 18:38:08 2011 (r227901) +++ head/usr.sbin/sade/misc.c Wed Nov 23 19:06:30 2011 (r227902) @@ -226,51 +226,6 @@ root_bias(char *path) return tmp; } -/* - * These next routines are kind of specialized just for building item lists - * for dialog_menu(). - */ - -/* Add an item to an item list */ -dialogMenuItem * -item_add(dialogMenuItem *list, char *prompt, char *title, - int (*checked)(dialogMenuItem *self), - int (*fire)(dialogMenuItem *self), - void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int *aux, int *curr, int *max) -{ - dialogMenuItem *d; - - if (*curr == *max) { - *max += 20; - list = (dialogMenuItem *)safe_realloc(list, sizeof(dialogMenuItem) * *max); - } - d = &list[(*curr)++]; - bzero(d, sizeof(*d)); - d->prompt = prompt ? strdup(prompt) : NULL; - d->title = title ? strdup(title) : NULL; - d->checked = checked; - d->fire = fire; - d->selected = selected; - d->data = data; - d->aux = (long)aux; - return list; -} - -/* Toss the items out */ -void -items_free(dialogMenuItem *list, int *curr, int *max) -{ - int i; - - for (i = 0; list[i].prompt; i++) { - safe_free(list[i].prompt); - safe_free(list[i].title); - } - safe_free(list); - *curr = *max = 0; -} - int Mkdir(char *ipath) { @@ -311,12 +266,6 @@ Mkdir(char *ipath) } int -Mkdir_command(char *key, void *dir) -{ - return (Mkdir((char*)dir)); -} - -int Mount(char *mountp, void *dev) { struct ufs_args ufsargs; @@ -353,126 +302,6 @@ Mount(char *mountp, void *dev) } WINDOW * -openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height) -{ - WINDOW *win; - static char help[FILENAME_MAX]; - - /* We need a curses window */ - win = newwin(LINES, COLS, 0, 0); - if (win) { - /* Say where our help comes from */ - if (helpfile) { - use_helpline("Press F1 for more information on this screen."); - use_helpfile(systemHelpFile(helpfile, help)); - } - /* Setup a nice screen for us to splat stuff onto */ - draw_box(win, y, x, height, width, dialog_attr, border_attr); - wattrset(win, dialog_attr); - mvwaddstr(win, y, x + (COLS - strlen(title)) / 2, title); - } - return win; -} - -ComposeObj * -initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max) -{ - ComposeObj *obj = NULL, *first; - int n; - - /* Loop over the layout list, create the objects, and add them - onto the chain of objects that dialog uses for traversal*/ - - n = 0; - while (layout[n].help != NULL) { - int t = TYPE_OF_OBJ(layout[n].type); - - switch (t) { - case STRINGOBJ: - layout[n].obj = NewStringObj(win, layout[n].prompt, layout[n].var, - layout[n].y + y, layout[n].x + x, layout[n].len, layout[n].maxlen); - ((StringObj *)layout[n].obj)->attr_mask = ATTR_OF_OBJ(layout[n].type); - break; - - case BUTTONOBJ: - layout[n].obj = NewButtonObj(win, layout[n].prompt, layout[n].var, layout[n].y + y, layout[n].x + x); - break; - - default: - msgFatal("Don't support this object yet!"); - } - AddObj(&obj, t, (void *) layout[n].obj); - n++; - } - *max = n - 1; - /* Find the first object in the list */ - for (first = obj; first->prev; first = first->prev); - return first; -} - -int -layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, int *n, int max, int *cbutton, int *cancel) -{ - char help_line[80]; - int ret, i, len = strlen(layout[*n].help); - - /* Display the help line at the bottom of the screen */ - for (i = 0; i < 79; i++) - help_line[i] = (i < len) ? layout[*n].help[i] : ' '; - help_line[i] = '\0'; - use_helpline(help_line); - display_helpline(win, LINES - 1, COLS - 1); - wrefresh(win); - - /* Ask for libdialog to do its stuff */ - ret = PollObj(obj); - /* Handle special case stuff that libdialog misses. Sigh */ - switch (ret) { - case SEL_ESC: /* Bail out */ - *cancel = TRUE; - return FALSE; - - /* This doesn't work for list dialogs. Oh well. Perhaps - should special case the move from the OK button ``up'' - to make it go to the interface list, but then it gets - awkward for the user to go back and correct screw up's - in the per-interface section */ - case KEY_DOWN: - case SEL_CR: - case SEL_TAB: - if (*n < max) - ++*n; - else - *n = 0; - break; - - /* The user has pressed enter over a button object */ - case SEL_BUTTON: - if (cbutton && *cbutton) - *cancel = TRUE; - else - *cancel = FALSE; - return FALSE; - - case KEY_UP: - case SEL_BACKTAB: - if (*n) - --*n; - else - *n = max; - break; - - case KEY_F(1): - display_helpfile(); - - /* They tried some key combination we don't support - tootle them forcefully! */ - default: - beep(); - } - return TRUE; -} - -WINDOW * savescr(void) { WINDOW *w; Modified: head/usr.sbin/sade/sade.h ============================================================================== --- head/usr.sbin/sade/sade.h Wed Nov 23 18:38:08 2011 (r227901) +++ head/usr.sbin/sade/sade.h Wed Nov 23 19:06:30 2011 (r227902) @@ -40,9 +40,6 @@ #include #include #include -#include "ui_objects.h" -#include "dir.h" -#include "colors.h" /*** Defines ***/ @@ -403,19 +400,8 @@ extern char *pathBaseName(const char *pa extern void safe_free(void *ptr); extern void *safe_malloc(size_t size); extern void *safe_realloc(void *orig, size_t size); -extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, - int (*checked)(dialogMenuItem *self), - int (*fire)(dialogMenuItem *self), - void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int *aux, int *curr, int *max); -extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *); -extern int Mkdir_command(char *key, void *data); extern int Mount(char *, void *data); -extern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height); -extern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max); -extern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, - int *n, int max, int *cbutton, int *cancel); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w); From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 19:10: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 C8E0D106566C; Wed, 23 Nov 2011 19:10:49 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 08F1B8FC12; Wed, 23 Nov 2011 19:10:48 +0000 (UTC) Received: by qyg36 with SMTP id 36so1971186qyg.13 for ; Wed, 23 Nov 2011 11:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=Ag/IaFDZp+01ZWj+dttZkmS7Z64hAnjlOnv/76mLCKU=; b=MmRmrOIeoBUSF/I0sPOvxFc8LRBpzDVLKyZw7f4nB0Cc5ax+iN4Vi0GgK3fKofzQrl JOLXJsqCYWjTQDb7v57HbIn8NLOtlZO6MYkZybhlDD4/isZq5N3lAzKvA3Bswz4qvsMw 3eiqD/m7GRl7H7t1DmsH5NYCuTGtlbPFpJqJQ= MIME-Version: 1.0 Received: by 10.68.21.162 with SMTP id w2mr10232299pbe.25.1322075447552; Wed, 23 Nov 2011 11:10:47 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Wed, 23 Nov 2011 11:10:47 -0800 (PST) In-Reply-To: <201111230734.pAN7YA78032998@svn.freebsd.org> References: <201111230734.pAN7YA78032998@svn.freebsd.org> Date: Wed, 23 Nov 2011 11:10:47 -0800 X-Google-Sender-Auth: eA0NlJnv1yFCv8jI4i21ASZPulY Message-ID: From: mdf@FreeBSD.org To: Mikolaj Golub Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: base64 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 19:10:49 -0000 T24gVHVlLCBOb3YgMjIsIDIwMTEgYXQgMTE6MzQgUE0sIE1pa29sYWogR29sdWIgPHRyb2NpbnlA ZnJlZWJzZC5vcmc+IHdyb3RlOgo+IEF1dGhvcjogdHJvY2lueQo+IERhdGU6IFdlZCBOb3YgMjMg MDc6MzQ6MDkgMjAxMQo+IE5ldyBSZXZpc2lvbjogMjI3ODczCj4gVVJMOiBodHRwOi8vc3ZuLmZy ZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzIyNzg3Mwo+Cj4gTG9nOgo+IKBGaXggYnVpbGQsIGhv cGVmdWxseS4KPgo+IKBSZXZpZXdlZCBieTogoGtpYgo+Cj4gTW9kaWZpZWQ6Cj4goGhlYWQvdXNy LmJpbi9wcm9jc3RhdC9wcm9jc3RhdF9hdXh2LmMKPgo+IE1vZGlmaWVkOiBoZWFkL3Vzci5iaW4v cHJvY3N0YXQvcHJvY3N0YXRfYXV4di5jCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Cj4gLS0tIGhl YWQvdXNyLmJpbi9wcm9jc3RhdC9wcm9jc3RhdF9hdXh2LmMgoCCgIKAgV2VkIE5vdiAyMyAwNzox MjoyNiAyMDExIKAgoCCgIKAocjIyNzg3MikKPiArKysgaGVhZC91c3IuYmluL3Byb2NzdGF0L3By b2NzdGF0X2F1eHYuYyCgIKAgoCBXZWQgTm92IDIzIDA3OjM0OjA5IDIwMTEgoCCgIKAgoChyMjI3 ODczKQo+IEBAIC00MiwxNCArNDIsMTMgQEAKPgo+IKAjaW5jbHVkZSAicHJvY3N0YXQuaCIKPgo+ IC1zdGF0aWMgY2hhciBhdXh2W3NpemVvZihFbGZfQXV4aW5mbykgKiAyNTZdOwo+ICtzdGF0aWMg RWxmX0F1eGluZm8gYXV4dlsyNTZdOwo+Cj4goHZvaWQKPiCgcHJvY3N0YXRfYXV4dihzdHJ1Y3Qg a2luZm9fcHJvYyAqa2lwcCkKPiCgewo+IC0goCCgIKAgRWxmX0F1eGluZm8gKmF1eDsKPiAtIKAg oCCgIGludCBpLCBlcnJvciwgbmFtZVs0XTsKPiAtIKAgoCCgIHNpemVfdCBsZW47Cj4gKyCgIKAg oCBpbnQgZXJyb3IsIG5hbWVbNF07Cj4gKyCgIKAgoCBzaXplX3QgbGVuLCBpOwo+Cj4goCCgIKAg oGlmICghaGZsYWcpCj4goCCgIKAgoCCgIKAgoCCgcHJpbnRmKCIlNXMgJS0xNnMgJS01M3NcbiIs ICJQSUQiLCAiQ09NTSIsICJBVVhWIik7Cj4gQEAgLTU4LDcgKzU3LDcgQEAgcHJvY3N0YXRfYXV4 dihzdHJ1Y3Qga2luZm9fcHJvYyAqa2lwcCkKPiCgIKAgoCCgbmFtZVsxXSA9IEtFUk5fUFJPQzsK PiCgIKAgoCCgbmFtZVsyXSA9IEtFUk5fUFJPQ19BVVhWOwo+IKAgoCCgIKBuYW1lWzNdID0ga2lw cC0+a2lfcGlkOwo+IC0goCCgIKAgbGVuID0gc2l6ZW9mKGF1eHYpOwo+ICsgoCCgIKAgbGVuID0g c2l6ZW9mKGF1eHYpICogc2l6ZW9mKCphdXh2KTsKPiCgIKAgoCCgZXJyb3IgPSBzeXNjdGwobmFt ZSwgNCwgYXV4diwgJmxlbiwgTlVMTCwgMCk7Cj4goCCgIKAgoGlmIChlcnJvciA8IDAgJiYgZXJy bm8gIT0gRVNSQ0gpIHsKPiCgIKAgoCCgIKAgoCCgIKB3YXJuKCJzeXNjdGw6IGtlcm4ucHJvYy5h dXh2OiAlZDogJWQiLCBraXBwLT5raV9waWQsIGVycm5vKTsKPiBAQCAtNzIsMTA2ICs3MSwxMTYg QEAgcHJvY3N0YXRfYXV4dihzdHJ1Y3Qga2luZm9fcHJvYyAqa2lwcCkKPiCgIKAgoCCgIKAgoCCg IKBwcmludGYoIiAtXG4iKTsKPiCgIKAgoCCgIKAgoCCgIKByZXR1cm47Cj4goCCgIKAgoH0KPiAt IKAgoCCgIGZvciAoYXV4ID0gKEVsZl9BdXhpbmZvICopYXV4diwgaSA9IDA7IGkgPCAyNTY7IGkr KywgYXV4KyspIHsKPiAtIKAgoCCgIKAgoCCgIKAgc3dpdGNoKGF1eC0+YV90eXBlKSB7Cj4gKyCg IKAgoCBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKPiArIKAgoCCgIKAgoCCgIKAgc3dpdGNo KGF1eHZbaV0uYV90eXBlKSB7Cj4goCCgIKAgoCCgIKAgoCCgY2FzZSBBVF9OVUxMOgo+IC0goCCg IKAgoCCgIKAgoCCgIKAgoCCgIHByaW50ZigiICglZClcbiIsIGkgKyAxKTsKPiArIKAgoCCgIKAg oCCgIKAgoCCgIKAgoCBwcmludGYoIiAoJXp1KVxuIiwgaSArIDEpOwo+IKAgoCCgIKAgoCCgIKAg oCCgIKAgoCCgcmV0dXJuOwo+IKAgoCCgIKAgoCCgIKAgoGNhc2UgQVRfSUdOT1JFOgo+IKAgoCCg IKAgoCCgIKAgoCCgIKAgoCCgcHJpbnRmKCIgQVRfSUdOT1JFPTB4JWx1IiwKPiAtIKAgoCCgIKAg oCCgIKAgoCCgIKAgoCCgIKAgKHVuc2lnbmVkIGxvbmcpYXV4LT5hX3VuLmFfdmFsKTsKPiArIKAg oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgKHVuc2lnbmVkIGxvbmcpYXV4dltpXS5hX3VuLmFfdmFs KTsKCkkgZGlkbid0IHNlZSB0aGlzIGJlZm9yZSwgYnV0IHRoaXMgZ2l2ZXMgdmVyeSBtaXNsZWFk aW5nIG91dHB1dC4gIFRoZQoweCBwcmVmaXggaW1wbGllcyB0aGUgb3V0cHV0IHdpbGwgYmUgaGV4 LCBidXQgaXQncyBwcmludGVkIGFzIGRlY2ltYWwsCmhlcmUgYW5kIGJlbG93LgoKSSBkb24ndCBr bm93IGlmIHRoZXJlJ3MgYSBzdHlsZSBwcmVmZXJlbmNlIGZvciAweCVseCB2ZXJzdXMgJSNseCwK dGhvdWdoLCBvciBhIHByZWZlcmVuY2UgZm9yIGEgZGlmZmVyZW50IHR5cGUgZm9yIHRoZSBwcmlu dCAodWludG1heF90LApmb3IgZXhhbXBsZSkuICBUaGVyZSBpcyBwcm9iYWJseSBhIHByZWZlcmVu Y2UgZm9yIHVzaW5nIHVfbG9uZyByYXRoZXIKdGhhbiB1bnNpZ25lZCBsb25nLCBzaW5jZSBpdCdz IHNob3J0ZXIuCgpUaGFua3MsCm1hdHRoZXcKCj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBicmVh azsKPiCgIKAgoCCgIKAgoCCgIKBjYXNlIEFUX0VYRUNGRDoKPiCgIKAgoCCgIKAgoCCgIKAgoCCg IKAgoHByaW50ZigiIEFUX0VYRUNGRD0weCVsdSIsCj4gLSCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg oCCgICh1bnNpZ25lZCBsb25nKWF1eC0+YV91bi5hX3ZhbCk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAg oCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eHZbaV0uYV91bi5hX3ZhbCk7Cj4goCCgIKAgoCCg IKAgoCCgIKAgoCCgIKBicmVhazsKPiCgIKAgoCCgIKAgoCCgIKBjYXNlIEFUX1BIRFI6Cj4goCCg IKAgoCCgIKAgoCCgIKAgoCCgIKBwcmludGYoIiBBVF9QSERSPTB4JWx1IiwKPiAtIKAgoCCgIKAg oCCgIKAgoCCgIKAgoCCgIKAgKHVuc2lnbmVkIGxvbmcpYXV4LT5hX3VuLmFfdmFsKTsKPiArIKAg oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgKHVuc2lnbmVkIGxvbmcpYXV4dltpXS5hX3VuLmFfdmFs KTsKPiCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoGJyZWFrOwo+IKAgoCCgIKAgoCCgIKAgoGNhc2Ug QVRfUEhFTlQ6Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBwcmludGYoIiBBVF9QSEVOVD0weCVs dSIsCj4gLSCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eC0+YV91 bi5hX3ZhbCk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1 eHZbaV0uYV91bi5hX3ZhbCk7Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBicmVhazsKPiCgIKAg oCCgIKAgoCCgIKBjYXNlIEFUX1BITlVNOgo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgcHJpbnRm KCIgQVRfUEhOVU09MHglbHUiLAo+IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWdu ZWQgbG9uZylhdXgtPmFfdW4uYV92YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAo dW5zaWduZWQgbG9uZylhdXh2W2ldLmFfdW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAg oCCgYnJlYWs7Cj4goCCgIKAgoCCgIKAgoCCgY2FzZSBBVF9QQUdFU1o6Cj4goCCgIKAgoCCgIKAg oCCgIKAgoCCgIKBwcmludGYoIiBBVF9QQUdFU1o9MHglbHUiLAo+IC0goCCgIKAgoCCgIKAgoCCg IKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXgtPmFfdW4uYV92YWwpOwo+ICsgoCCgIKAgoCCg IKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXh2W2ldLmFfdW4uYV92YWwpOwo+IKAg oCCgIKAgoCCgIKAgoCCgIKAgoCCgYnJlYWs7Cj4goCCgIKAgoCCgIKAgoCCgY2FzZSBBVF9CQVNF Ogo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgcHJpbnRmKCIgQVRfQkFTRT0weCVsdSIsCj4gLSCg IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eC0+YV91bi5hX3ZhbCk7 Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eHZbaV0uYV91 bi5hX3ZhbCk7Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBicmVhazsKPiCgIKAgoCCgIKAgoCCg IKBjYXNlIEFUX0ZMQUdTOgo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgcHJpbnRmKCIgQVRfRkxB R1M9MHglbHUiLAo+IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylh dXgtPmFfdW4uYV92YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQg bG9uZylhdXh2W2ldLmFfdW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgYnJlYWs7 Cj4goCCgIKAgoCCgIKAgoCCgY2FzZSBBVF9FTlRSWToKPiCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg oHByaW50ZigiIEFUX0VOVFJZPTB4JWx1IiwKPiAtIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg KHVuc2lnbmVkIGxvbmcpYXV4LT5hX3VuLmFfdmFsKTsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAg oCCgIKAgKHVuc2lnbmVkIGxvbmcpYXV4dltpXS5hX3VuLmFfdmFsKTsKPiCgIKAgoCCgIKAgoCCg IKAgoCCgIKAgoGJyZWFrOwo+ICsjaWZkZWYgQVRfTk9URUxGCj4goCCgIKAgoCCgIKAgoCCgY2Fz ZSBBVF9OT1RFTEY6Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBwcmludGYoIiBBVF9OT1RFTEY9 MHglbHUiLAo+IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXgt PmFfdW4uYV92YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9u ZylhdXh2W2ldLmFfdW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgYnJlYWs7Cj4g KyNlbmRpZgo+ICsjaWZkZWYgQVRfVUlECj4goCCgIKAgoCCgIKAgoCCgY2FzZSBBVF9VSUQ6Cj4g oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBwcmludGYoIiBBVF9VSUQ9MHglbHUiLAo+IC0goCCgIKAg oCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXgtPmFfdW4uYV92YWwpOwo+ICsg oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXh2W2ldLmFfdW4uYV92 YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgYnJlYWs7Cj4gKyNlbmRpZgo+ICsjaWZkZWYg QVRfRVVJRAo+IKAgoCCgIKAgoCCgIKAgoGNhc2UgQVRfRVVJRDoKPiCgIKAgoCCgIKAgoCCgIKAg oCCgIKAgoHByaW50ZigiIEFUX0VVSUQ9MHglbHUiLAo+IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCg IKAgoCAodW5zaWduZWQgbG9uZylhdXgtPmFfdW4uYV92YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCg IKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXh2W2ldLmFfdW4uYV92YWwpOwo+IKAgoCCgIKAg oCCgIKAgoCCgIKAgoCCgYnJlYWs7Cj4gKyNlbmRpZgo+ICsjaWZkZWYgQVRfR0lECj4goCCgIKAg oCCgIKAgoCCgY2FzZSBBVF9HSUQ6Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBwcmludGYoIiBB VF9HSUQ9MHglbHUiLAo+IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9u ZylhdXgtPmFfdW4uYV92YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWdu ZWQgbG9uZylhdXh2W2ldLmFfdW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgYnJl YWs7Cj4gKyNlbmRpZgo+ICsjaWZkZWYgQVRfRUdJRAo+IKAgoCCgIKAgoCCgIKAgoGNhc2UgQVRf RUdJRDoKPiCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoHByaW50ZigiIEFUX0VHSUQ9MHglbHUiLAo+ IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXgtPmFfdW4uYV92 YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXh2W2ld LmFfdW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgYnJlYWs7Cj4gKyNlbmRpZgo+ IKAgoCCgIKAgoCCgIKAgoGNhc2UgQVRfRVhFQ1BBVEg6Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCg IKBwcmludGYoIiBBVF9FWEVDUEFUSD0weCVsdSIsCj4gLSCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg oCCgICh1bnNpZ25lZCBsb25nKWF1eC0+YV91bi5hX3ZhbCk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAg oCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eHZbaV0uYV91bi5hX3ZhbCk7Cj4goCCgIKAgoCCg IKAgoCCgIKAgoCCgIKBicmVhazsKPiCgIKAgoCCgIKAgoCCgIKBjYXNlIEFUX0NBTkFSWToKPiCg IKAgoCCgIKAgoCCgIKAgoCCgIKAgoHByaW50ZigiIEFUX0NBTkFSWT0weCVsdSIsCj4gLSCgIKAg oCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eC0+YV91bi5hX3ZhbCk7Cj4g KyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eHZbaV0uYV91bi5h X3ZhbCk7Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBicmVhazsKPiCgIKAgoCCgIKAgoCCgIKBj YXNlIEFUX0NBTkFSWUxFTjoKPiCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoHByaW50ZigiIEFUX0NB TkFSWUxFTj0weCVsdSIsCj4gLSCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBs b25nKWF1eC0+YV91bi5hX3ZhbCk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNp Z25lZCBsb25nKWF1eHZbaV0uYV91bi5hX3ZhbCk7Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBi cmVhazsKPiCgIKAgoCCgIKAgoCCgIKBjYXNlIEFUX09TUkVMREFURToKPiCgIKAgoCCgIKAgoCCg IKAgoCCgIKAgoHByaW50ZigiIEFUX09TUkVMREFURT0weCVsdSIsCj4gLSCgIKAgoCCgIKAgoCCg IKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eC0+YV91bi5hX3ZhbCk7Cj4gKyCgIKAgoCCg IKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eHZbaV0uYV91bi5hX3ZhbCk7Cj4g oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBicmVhazsKPiCgIKAgoCCgIKAgoCCgIKBjYXNlIEFUX05D UFVTOgo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgcHJpbnRmKCIgQVRfTkNQVVM9MHglbHUiLAo+ IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXgtPmFfdW4uYV92 YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXh2W2ld LmFfdW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgYnJlYWs7Cj4goCCgIKAgoCCg IKAgoCCgY2FzZSBBVF9QQUdFU0laRVM6Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBwcmludGYo IiBBVF9QQUdFU0laRVM9MHglbHUiLAo+IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5z aWduZWQgbG9uZylhdXgtPmFfdW4uYV92YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg oCAodW5zaWduZWQgbG9uZylhdXh2W2ldLmFfdW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCg IKAgoCCgYnJlYWs7Cj4goCCgIKAgoCCgIKAgoCCgY2FzZSBBVF9QQUdFU0laRVNMRU46Cj4goCCg IKAgoCCgIKAgoCCgIKAgoCCgIKBwcmludGYoIiBBVF9QQUdFU0laRVNMRU49MHglbHUiLAo+IC0g oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXgtPmFfdW4uYV92YWwp Owo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWduZWQgbG9uZylhdXh2W2ldLmFf dW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgYnJlYWs7Cj4goCCgIKAgoCCgIKAg oCCgY2FzZSBBVF9TVEFDS1BST1Q6Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBwcmludGYoIiBB VF9TVEFDS1BST1Q9MHglbHUiLAo+IC0goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAodW5zaWdu ZWQgbG9uZylhdXgtPmFfdW4uYV92YWwpOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAo dW5zaWduZWQgbG9uZylhdXh2W2ldLmFfdW4uYV92YWwpOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAg oCCgYnJlYWs7Cj4goCCgIKAgoCCgIKAgoCCgY2FzZSBBVF9DT1VOVDoKPiCgIKAgoCCgIKAgoCCg IKAgoCCgIKAgoHByaW50ZigiIEFUX0NPVU5UPTB4JWx1IiwKPiAtIKAgoCCgIKAgoCCgIKAgoCCg IKAgoCCgIKAgKHVuc2lnbmVkIGxvbmcpYXV4LT5hX3VuLmFfdmFsKTsKPiArIKAgoCCgIKAgoCCg IKAgoCCgIKAgoCCgIKAgKHVuc2lnbmVkIGxvbmcpYXV4dltpXS5hX3VuLmFfdmFsKTsKPiCgIKAg oCCgIKAgoCCgIKAgoCCgIKAgoGJyZWFrOwo+IKAgoCCgIKAgoCCgIKAgoGRlZmF1bHQ6Cj4gLSCg IKAgoCCgIKAgoCCgIKAgoCCgIKAgcHJpbnRmKCIgJWxkPTB4JWx1IiwgKGxvbmcpYXV4LT5hX3R5 cGUsCj4gLSCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNpZ25lZCBsb25nKWF1eC0+YV91 bi5hX3ZhbCk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgcHJpbnRmKCIgJWxkPTB4JWx1Iiwg KGxvbmcpYXV4dltpXS5hX3R5cGUsCj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICh1bnNp Z25lZCBsb25nKWF1eHZbaV0uYV91bi5hX3ZhbCk7Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBi cmVhazsKPiCgIKAgoCCgIKAgoCCgIKB9Cj4goCCgIKAgoH0KPgo= From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 19:11:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7DBA10657A0; Wed, 23 Nov 2011 19:11:03 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CB458FC13; Wed, 23 Nov 2011 19:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANJB3AZ059295; Wed, 23 Nov 2011 19:11:03 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANJB3a4059292; Wed, 23 Nov 2011 19:11:03 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111231911.pANJB3a4059292@svn.freebsd.org> From: Max Khon Date: Wed, 23 Nov 2011 19:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227903 - head/usr.sbin/sade X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 19:11:03 -0000 Author: fjoe Date: Wed Nov 23 19:11:03 2011 New Revision: 227903 URL: http://svn.freebsd.org/changeset/base/227903 Log: Remove unused functions. Modified: head/usr.sbin/sade/misc.c head/usr.sbin/sade/sade.h Modified: head/usr.sbin/sade/misc.c ============================================================================== --- head/usr.sbin/sade/misc.c Wed Nov 23 19:06:30 2011 (r227902) +++ head/usr.sbin/sade/misc.c Wed Nov 23 19:11:03 2011 (r227903) @@ -56,27 +56,6 @@ file_readable(char *fname) return FALSE; } -/* Quick check to see if a file is executable */ -Boolean -file_executable(char *fname) -{ - if (!access(fname, X_OK)) - return TRUE; - return FALSE; -} - -/* Concatenate two strings into static storage */ -char * -string_concat(char *one, char *two) -{ - static char tmp[FILENAME_MAX]; - - /* Yes, we're deliberately cavalier about not checking for overflow */ - strcpy(tmp, one); - strcat(tmp, two); - return tmp; -} - /* sane strncpy() function */ char * sstrncpy(char *dst, const char *src, int size) @@ -85,19 +64,6 @@ sstrncpy(char *dst, const char *src, int return strncpy(dst, src, size); } -/* Concatenate three strings into static storage */ -char * -string_concat3(char *one, char *two, char *three) -{ - static char tmp[FILENAME_MAX]; - - /* Yes, we're deliberately cavalier about not checking for overflow */ - strcpy(tmp, one); - strcat(tmp, two); - strcat(tmp, three); - return tmp; -} - /* Clip the whitespace off the end of a string */ char * string_prune(char *str) @@ -118,29 +84,6 @@ string_skipwhite(char *str) return str; } -/* copy optionally and allow second arg to be null */ -char * -string_copy(char *s1, char *s2) -{ - if (!s1) - return NULL; - if (!s2) - s1[0] = '\0'; - else - strcpy(s1, s2); - return s1; -} - -/* convert an integer to a string, using a static buffer */ -char * -itoa(int value) -{ - static char buf[13]; - - snprintf(buf, 12, "%d", value); - return buf; -} - Boolean directory_exists(const char *dirname) { @@ -159,22 +102,6 @@ directory_exists(const char *dirname) return (TRUE); } -char * -pathBaseName(const char *path) -{ - char *pt; - char *ret = (char *)path; - - pt = strrchr(path,(int)'/'); - - if (pt != 0) /* if there is a slash */ - { - ret = ++pt; /* start the file after it */ - } - - return(ret); -} - /* A free guaranteed to take NULL ptrs */ void safe_free(void *ptr) @@ -198,34 +125,6 @@ safe_malloc(size_t size) return ptr; } -/* A realloc that checks errors */ -void * -safe_realloc(void *orig, size_t size) -{ - void *ptr; - - if (size <= 0) - msgFatal("Invalid realloc size of %ld!", (long)size); - ptr = reallocf(orig, size); - if (!ptr) - msgFatal("Out of memory!"); - return ptr; -} - -/* Create a path biased from the VAR_INSTALL_ROOT variable (if not /) */ -char * -root_bias(char *path) -{ - static char tmp[FILENAME_MAX]; - char *cp = variable_get(VAR_INSTALL_ROOT); - - if (!strcmp(cp, "/")) - return path; - strcpy(tmp, variable_get(VAR_INSTALL_ROOT)); - strcat(tmp, path); - return tmp; -} - int Mkdir(char *ipath) { Modified: head/usr.sbin/sade/sade.h ============================================================================== --- head/usr.sbin/sade/sade.h Wed Nov 23 19:06:30 2011 (r227902) +++ head/usr.sbin/sade/sade.h Wed Nov 23 19:11:03 2011 (r227903) @@ -387,19 +387,11 @@ extern int diskLabelCommit(dialogMenuIte /* misc.c */ extern Boolean file_readable(char *fname); -extern Boolean file_executable(char *fname); extern Boolean directory_exists(const char *dirname); -extern char *root_bias(char *path); -extern char *itoa(int value); -extern char *string_concat(char *p1, char *p2); -extern char *string_concat3(char *p1, char *p2, char *p3); extern char *string_prune(char *str); extern char *string_skipwhite(char *str); -extern char *string_copy(char *s1, char *s2); -extern char *pathBaseName(const char *path); extern void safe_free(void *ptr); extern void *safe_malloc(size_t size); -extern void *safe_realloc(void *orig, size_t size); extern int Mkdir(char *); extern int Mount(char *, void *data); From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 20:08: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 5C2F71065673; Wed, 23 Nov 2011 20:08: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 41DD08FC14; Wed, 23 Nov 2011 20:08:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANK8vOM061097; Wed, 23 Nov 2011 20:08:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANK8vMD061095; Wed, 23 Nov 2011 20:08:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111232008.pANK8vMD061095@svn.freebsd.org> From: Marius Strobl Date: Wed, 23 Nov 2011 20:08: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: r227906 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 20:08:57 -0000 Author: marius Date: Wed Nov 23 20:08:56 2011 New Revision: 227906 URL: http://svn.freebsd.org/changeset/base/227906 Log: Sync with NetBSD rev. 1.104 Obtained from: NetBSD Modified: head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Wed Nov 23 20:01:35 2011 (r227905) +++ head/sys/dev/mii/miidevs Wed Nov 23 20:08:56 2011 (r227906) @@ -1,5 +1,5 @@ $FreeBSD$ -/*$NetBSD: miidevs,v 1.99 2011/01/26 18:39:04 bouyer Exp $*/ +/*$NetBSD: miidevs,v 1.104 2011/11/12 11:10:49 sekiya Exp $*/ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -146,6 +146,7 @@ model xxBROADCOM BCM5214 0x0028 BCM5214 model xxBROADCOM BCM5221 0x001e BCM5221 10/100 media interface model xxBROADCOM BCM5222 0x0032 BCM5222 Dual 10/100 media interface model xxBROADCOM BCM4401 0x0036 BCM4401 10/100 media interface +model xxBROADCOM BCM5365 0x0037 BCM5365 10/100 5-port PHY switch model BROADCOM BCM5400 0x0004 BCM5400 1000BASE-T media interface model BROADCOM BCM5401 0x0005 BCM5401 1000BASE-T media interface model BROADCOM BCM5411 0x0007 BCM5411 1000BASE-T media interface @@ -164,12 +165,14 @@ model BROADCOM BCM54K2 0x002e BCM54K2 1 model BROADCOM BCM5714 0x0034 BCM5714 1000BASE-T media interface model BROADCOM BCM5780 0x0035 BCM5780 1000BASE-T media interface model BROADCOM BCM5708C 0x0036 BCM5708C 1000BASE-T media interface +model BROADCOM2 BCM5325 0x0003 BCM5325 10/100 5-port PHY switch model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX media interface model BROADCOM2 BCM5481 0x000a BCM5481 1000BASE-T media interface model BROADCOM2 BCM5482 0x000b BCM5482 1000BASE-T media interface model BROADCOM2 BCM5755 0x000c BCM5755 1000BASE-T media interface model BROADCOM2 BCM5754 0x000e BCM5754/5787 1000BASE-T media interface model BROADCOM2 BCM5708S 0x0015 BCM5708S 1000/2500baseSX PHY +model BROADCOM2 BCM5785 0x0016 BCM5785 1000BASE-T media interface model BROADCOM2 BCM5709CAX 0x002c BCM5709CAX 10/100/1000baseT PHY model BROADCOM2 BCM5722 0x002d BCM5722 1000BASE-T media interface model BROADCOM2 BCM5784 0x003a BCM5784 10/100/1000baseT PHY @@ -218,6 +221,10 @@ model yyINTEL I82562ET 0x0033 i82562ET model yyINTEL I82553 0x0035 i82553 10/100 media interface model yyINTEL I82566 0x0039 i82566 10/100/1000 media interface model INTEL I82577 0x0005 i82577 10/100/1000 media interface +model INTEL I82579 0x0009 i82579 10/100/1000 media interface +model xxMARVELL I82563 0x000a i82563 10/100/1000 media interface + +model yyINTEL IGP01E1000 0x0038 Intel IGP01E1000 Gigabit PHY /* Jato Technologies PHYs */ model xxJATO BASEX 0x0000 Jato 1000baseX media interface @@ -246,18 +253,24 @@ model xxMARVELL E3082 0x0008 Marvell 88 model xxMARVELL E1112 0x0009 Marvell 88E1112 Gigabit PHY model xxMARVELL E1149 0x000b Marvell 88E1149 Gigabit PHY model xxMARVELL E1111 0x000c Marvell 88E1111 Gigabit PHY +model xxMARVELL E1145 0x000d Marvell 88E1145 Quad Gigabit PHY model xxMARVELL E1116 0x0021 Marvell 88E1116 Gigabit PHY model xxMARVELL E1116R 0x0024 Marvell 88E1116R Gigabit PHY model xxMARVELL E1118 0x0022 Marvell 88E1118 Gigabit PHY model xxMARVELL E1149R 0x0025 Marvell 88E1149R Quad Gigabit PHY model xxMARVELL E3016 0x0026 Marvell 88E3016 10/100 Fast Ethernet PHY model xxMARVELL PHYG65G 0x0027 Marvell PHYG65G Gigabit PHY +model xxMARVELL E1116R_29 0x0029 Marvell 88E1116R Gigabit PHY model MARVELL E1000 0x0005 Marvell 88E1000 Gigabit PHY model MARVELL E1011 0x0002 Marvell 88E1011 Gigabit PHY model MARVELL E1000_3 0x0003 Marvell 88E1000 Gigabit PHY model MARVELL E1000_5 0x0005 Marvell 88E1000 Gigabit PHY model MARVELL E1111 0x000c Marvell 88E1111 Gigabit PHY +/* Myson Technology PHYs */ +model xxMYSON MTD972 0x0000 MTD972 10/100 media interface +model MYSON MTD803 0x0000 MTD803 3-in-1 media interface + /* National Semiconductor PHYs */ model xxNATSEMI DP83840 0x0000 DP83840 10/100 media interface model xxNATSEMI DP83843 0x0001 DP83843 10/100 media interface From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 20: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 B4BFE1065670; Wed, 23 Nov 2011 20:09:34 +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 A46DC8FC15; Wed, 23 Nov 2011 20:09:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANK9Yiv061150; Wed, 23 Nov 2011 20:09:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANK9Yjt061148; Wed, 23 Nov 2011 20:09:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111232009.pANK9Yjt061148@svn.freebsd.org> From: Marius Strobl Date: Wed, 23 Nov 2011 20:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227907 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 20:09:34 -0000 Author: marius Date: Wed Nov 23 20:09:34 2011 New Revision: 227907 URL: http://svn.freebsd.org/changeset/base/227907 Log: Probe the BCM5785. Obtained from: NetBSD Modified: head/sys/dev/mii/brgphy.c Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Wed Nov 23 20:08:56 2011 (r227906) +++ head/sys/dev/mii/brgphy.c Wed Nov 23 20:09:34 2011 (r227907) @@ -139,6 +139,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(BROADCOM2, BCM5754), MII_PHY_DESC(BROADCOM2, BCM5761), MII_PHY_DESC(BROADCOM2, BCM5784), + MII_PHY_DESC(BROADCOM2, BCM5785), MII_PHY_DESC(BROADCOM3, BCM5717C), MII_PHY_DESC(BROADCOM3, BCM5719C), MII_PHY_DESC(BROADCOM3, BCM5720C), From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 20:27: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 6D46B106564A; Wed, 23 Nov 2011 20:27:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8BE8FC12; Wed, 23 Nov 2011 20:27:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANKRRA2061781; Wed, 23 Nov 2011 20:27:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANKRQNn061747; Wed, 23 Nov 2011 20:27:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111232027.pANKRQNn061747@svn.freebsd.org> From: Marius Strobl Date: Wed, 23 Nov 2011 20:27: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: r227908 - in head/sys/dev: dc mii usb/net 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: Wed, 23 Nov 2011 20:27:27 -0000 Author: marius Date: Wed Nov 23 20:27:26 2011 New Revision: 227908 URL: http://svn.freebsd.org/changeset/base/227908 Log: Use DEVMETHOD_END. Modified: head/sys/dev/dc/dcphy.c head/sys/dev/dc/pnphy.c head/sys/dev/mii/acphy.c head/sys/dev/mii/amphy.c head/sys/dev/mii/atphy.c head/sys/dev/mii/axphy.c head/sys/dev/mii/bmtphy.c head/sys/dev/mii/brgphy.c head/sys/dev/mii/ciphy.c head/sys/dev/mii/e1000phy.c head/sys/dev/mii/gentbi.c head/sys/dev/mii/icsphy.c head/sys/dev/mii/ip1000phy.c head/sys/dev/mii/jmphy.c head/sys/dev/mii/lxtphy.c head/sys/dev/mii/mlphy.c head/sys/dev/mii/nsgphy.c head/sys/dev/mii/nsphy.c head/sys/dev/mii/nsphyter.c head/sys/dev/mii/pnaphy.c head/sys/dev/mii/qsphy.c head/sys/dev/mii/rgephy.c head/sys/dev/mii/rlphy.c head/sys/dev/mii/rlswitch.c head/sys/dev/mii/smcphy.c head/sys/dev/mii/tdkphy.c head/sys/dev/mii/tlphy.c head/sys/dev/mii/truephy.c head/sys/dev/mii/ukphy.c head/sys/dev/mii/xmphy.c head/sys/dev/usb/net/ruephy.c head/sys/dev/xl/xlphy.c Modified: head/sys/dev/dc/dcphy.c ============================================================================== --- head/sys/dev/dc/dcphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/dc/dcphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -95,7 +95,7 @@ static device_method_t dcphy_methods[] = DEVMETHOD(device_attach, dcphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t dcphy_devclass; Modified: head/sys/dev/dc/pnphy.c ============================================================================== --- head/sys/dev/dc/pnphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/dc/pnphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -74,7 +74,7 @@ static device_method_t pnphy_methods[] = DEVMETHOD(device_attach, pnphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t pnphy_devclass; Modified: head/sys/dev/mii/acphy.c ============================================================================== --- head/sys/dev/mii/acphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/acphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -87,7 +87,7 @@ static device_method_t acphy_methods[] = DEVMETHOD(device_attach, acphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t acphy_devclass; Modified: head/sys/dev/mii/amphy.c ============================================================================== --- head/sys/dev/mii/amphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/amphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -66,7 +66,7 @@ static device_method_t amphy_methods[] = DEVMETHOD(device_attach, amphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t amphy_devclass; Modified: head/sys/dev/mii/atphy.c ============================================================================== --- head/sys/dev/mii/atphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/atphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -59,7 +59,7 @@ static device_method_t atphy_methods[] = DEVMETHOD(device_attach, atphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { NULL, NULL } + DEVMETHOD_END }; static devclass_t atphy_devclass; Modified: head/sys/dev/mii/axphy.c ============================================================================== --- head/sys/dev/mii/axphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/axphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -56,7 +56,7 @@ static device_method_t axphy_methods[] = DEVMETHOD(device_attach, axphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t axphy_devclass; Modified: head/sys/dev/mii/bmtphy.c ============================================================================== --- head/sys/dev/mii/bmtphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/bmtphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -91,8 +91,7 @@ static device_method_t bmtphy_methods[] DEVMETHOD(device_attach, bmtphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - - { 0, 0 } + DEVMETHOD_END }; static devclass_t bmtphy_devclass; Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/brgphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -82,7 +82,7 @@ static device_method_t brgphy_methods[] DEVMETHOD(device_attach, brgphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t brgphy_devclass; Modified: head/sys/dev/mii/ciphy.c ============================================================================== --- head/sys/dev/mii/ciphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/ciphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -67,7 +67,7 @@ static device_method_t ciphy_methods[] = DEVMETHOD(device_attach, ciphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t ciphy_devclass; Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/e1000phy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -71,7 +71,7 @@ static device_method_t e1000phy_methods[ DEVMETHOD(device_attach, e1000phy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t e1000phy_devclass; Modified: head/sys/dev/mii/gentbi.c ============================================================================== --- head/sys/dev/mii/gentbi.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/gentbi.c Wed Nov 23 20:27:26 2011 (r227908) @@ -95,7 +95,7 @@ static device_method_t gentbi_methods[] DEVMETHOD(device_attach, gentbi_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - {0, 0} + DEVMETHOD_END }; static devclass_t gentbi_devclass; Modified: head/sys/dev/mii/icsphy.c ============================================================================== --- head/sys/dev/mii/icsphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/icsphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -89,7 +89,7 @@ static device_method_t icsphy_methods[] DEVMETHOD(device_attach, icsphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t icsphy_devclass; Modified: head/sys/dev/mii/ip1000phy.c ============================================================================== --- head/sys/dev/mii/ip1000phy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/ip1000phy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -63,7 +63,7 @@ static device_method_t ip1000phy_methods DEVMETHOD(device_attach, ip1000phy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t ip1000phy_devclass; Modified: head/sys/dev/mii/jmphy.c ============================================================================== --- head/sys/dev/mii/jmphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/jmphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -62,7 +62,7 @@ static device_method_t jmphy_methods[] = DEVMETHOD(device_attach, jmphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { NULL, NULL } + DEVMETHOD_END }; static devclass_t jmphy_devclass; Modified: head/sys/dev/mii/lxtphy.c ============================================================================== --- head/sys/dev/mii/lxtphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/lxtphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -91,7 +91,7 @@ static device_method_t lxtphy_methods[] DEVMETHOD(device_attach, lxtphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t lxtphy_devclass; Modified: head/sys/dev/mii/mlphy.c ============================================================================== --- head/sys/dev/mii/mlphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/mlphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -84,7 +84,7 @@ static device_method_t mlphy_methods[] = DEVMETHOD(device_attach, mlphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t mlphy_devclass; Modified: head/sys/dev/mii/nsgphy.c ============================================================================== --- head/sys/dev/mii/nsgphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/nsgphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -83,7 +83,7 @@ static device_method_t nsgphy_methods[] DEVMETHOD(device_attach, nsgphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t nsgphy_devclass; Modified: head/sys/dev/mii/nsphy.c ============================================================================== --- head/sys/dev/mii/nsphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/nsphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -90,7 +90,7 @@ static device_method_t nsphy_methods[] = DEVMETHOD(device_attach, nsphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t nsphy_devclass; Modified: head/sys/dev/mii/nsphyter.c ============================================================================== --- head/sys/dev/mii/nsphyter.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/nsphyter.c Wed Nov 23 20:27:26 2011 (r227908) @@ -93,7 +93,7 @@ static device_method_t nsphyter_methods[ DEVMETHOD(device_attach, nsphyter_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t nsphyter_devclass; Modified: head/sys/dev/mii/pnaphy.c ============================================================================== --- head/sys/dev/mii/pnaphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/pnaphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -69,7 +69,7 @@ static device_method_t pnaphy_methods[] DEVMETHOD(device_attach, pnaphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t pnaphy_devclass; Modified: head/sys/dev/mii/qsphy.c ============================================================================== --- head/sys/dev/mii/qsphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/qsphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -91,7 +91,7 @@ static device_method_t qsphy_methods[] = DEVMETHOD(device_attach, qsphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t qsphy_devclass; Modified: head/sys/dev/mii/rgephy.c ============================================================================== --- head/sys/dev/mii/rgephy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/rgephy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -68,7 +68,7 @@ static device_method_t rgephy_methods[] DEVMETHOD(device_attach, rgephy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t rgephy_devclass; Modified: head/sys/dev/mii/rlphy.c ============================================================================== --- head/sys/dev/mii/rlphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/rlphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -66,7 +66,7 @@ static device_method_t rlphy_methods[] = DEVMETHOD(device_attach, rlphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t rlphy_devclass; Modified: head/sys/dev/mii/rlswitch.c ============================================================================== --- head/sys/dev/mii/rlswitch.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/rlswitch.c Wed Nov 23 20:27:26 2011 (r227908) @@ -70,7 +70,7 @@ static device_method_t rlswitch_methods[ DEVMETHOD(device_attach, rlswitch_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t rlswitch_devclass; Modified: head/sys/dev/mii/smcphy.c ============================================================================== --- head/sys/dev/mii/smcphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/smcphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -62,8 +62,7 @@ static device_method_t smcphy_methods[] DEVMETHOD(device_attach, smcphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - - { 0, 0 } + DEVMETHOD_END }; static devclass_t smcphy_devclass; @@ -207,8 +206,7 @@ smcphy_auto(struct mii_softc *sc, int me { uint16_t anar; - anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | - ANAR_CSMA; + anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; if ((media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) anar |= ANAR_FC; PHY_WRITE(sc, MII_ANAR, anar); Modified: head/sys/dev/mii/tdkphy.c ============================================================================== --- head/sys/dev/mii/tdkphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/tdkphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -71,7 +71,7 @@ static device_method_t tdkphy_methods[] DEVMETHOD(device_attach, tdkphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t tdkphy_devclass; Modified: head/sys/dev/mii/tlphy.c ============================================================================== --- head/sys/dev/mii/tlphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/tlphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -97,7 +97,7 @@ static device_method_t tlphy_methods[] = DEVMETHOD(device_attach, tlphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t tlphy_devclass; Modified: head/sys/dev/mii/truephy.c ============================================================================== --- head/sys/dev/mii/truephy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/truephy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -72,7 +72,7 @@ static device_method_t truephy_methods[] DEVMETHOD(device_attach, truephy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static const struct mii_phydesc truephys[] = { Modified: head/sys/dev/mii/ukphy.c ============================================================================== --- head/sys/dev/mii/ukphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/ukphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -86,7 +86,7 @@ static device_method_t ukphy_methods[] = DEVMETHOD(device_attach, ukphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t ukphy_devclass; Modified: head/sys/dev/mii/xmphy.c ============================================================================== --- head/sys/dev/mii/xmphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/mii/xmphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -66,7 +66,7 @@ static device_method_t xmphy_methods[] = DEVMETHOD(device_attach, xmphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t xmphy_devclass; Modified: head/sys/dev/usb/net/ruephy.c ============================================================================== --- head/sys/dev/usb/net/ruephy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/usb/net/ruephy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -61,7 +61,7 @@ static device_method_t ruephy_methods[] DEVMETHOD(device_attach, ruephy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t ruephy_devclass; Modified: head/sys/dev/xl/xlphy.c ============================================================================== --- head/sys/dev/xl/xlphy.c Wed Nov 23 20:09:34 2011 (r227907) +++ head/sys/dev/xl/xlphy.c Wed Nov 23 20:27:26 2011 (r227908) @@ -86,7 +86,7 @@ static device_method_t xlphy_methods[] = DEVMETHOD(device_attach, xlphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t xlphy_devclass; From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 21:19: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 60524106564A; Wed, 23 Nov 2011 21:19:38 +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 4F7488FC12; Wed, 23 Nov 2011 21:19:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANLJc95063543; Wed, 23 Nov 2011 21:19:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANLJc2A063541; Wed, 23 Nov 2011 21:19:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111232119.pANLJc2A063541@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 21:19:38 +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: r227909 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 21:19:38 -0000 Author: bz Date: Wed Nov 23 21:19:38 2011 New Revision: 227909 URL: http://svn.freebsd.org/changeset/base/227909 Log: MFC r227481: Return the correct value for the IPV6_MULTICAST_HOPS getsockopt() call. Submitted by: rpaulo Modified: stable/8/sys/netinet6/in6_mcast.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/netinet6/in6_mcast.c ============================================================================== --- stable/8/sys/netinet6/in6_mcast.c Wed Nov 23 20:27:26 2011 (r227908) +++ stable/8/sys/netinet6/in6_mcast.c Wed Nov 23 21:19:38 2011 (r227909) @@ -1713,7 +1713,7 @@ ip6_getmoptions(struct inpcb *inp, struc if (im6o == NULL) optval = V_ip6_defmcasthlim; else - optval = im6o->im6o_multicast_loop; + optval = im6o->im6o_multicast_hlim; INP_WUNLOCK(inp); error = sooptcopyout(sopt, &optval, sizeof(u_int)); break; From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 21:41: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 1670D1065670; Wed, 23 Nov 2011 21:41:32 +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 058F58FC13; Wed, 23 Nov 2011 21:41:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANLfVLv064382; Wed, 23 Nov 2011 21:41:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANLfVbZ064380; Wed, 23 Nov 2011 21:41:31 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111232141.pANLfVbZ064380@svn.freebsd.org> From: Xin LI Date: Wed, 23 Nov 2011 21:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227910 - releng/9.0/etc stable/9/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: Wed, 23 Nov 2011 21:41:32 -0000 Author: delphij Date: Wed Nov 23 21:41:31 2011 New Revision: 227910 URL: http://svn.freebsd.org/changeset/base/227910 Log: MFC r225849: Test if the interface is afif in dhcpif() and syncdhcpif(), as done in ipv6_autoconfif. This fixes a regression that causes e.g. ifconfig_DEFAULT="DHCP" to run on non-afif interfaces like pfsync0, which in turn would cause excessive delay on system startup. Sponsored by: iXsystems, Inc. Reviewed by: hrs (freebsd-rc@) Approved by: re (bz) Modified: stable/9/etc/network.subr Directory Properties: stable/9/etc/ (props changed) Changes in other areas also in this revision: Modified: releng/9.0/etc/network.subr Directory Properties: releng/9.0/etc/ (props changed) Modified: stable/9/etc/network.subr ============================================================================== --- stable/9/etc/network.subr Wed Nov 23 21:19:38 2011 (r227909) +++ stable/9/etc/network.subr Wed Nov 23 21:41:31 2011 (r227910) @@ -297,6 +297,10 @@ dhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + if noafif $1; then + return 1 + fi + for _arg in $_tmpargs; do case $_arg in [Dd][Hh][Cc][Pp]) @@ -322,6 +326,10 @@ syncdhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + if noafif $1; then + return 1 + fi + for _arg in $_tmpargs; do case $_arg in [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 21:41: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 36D541065672; Wed, 23 Nov 2011 21:41:32 +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 260FB8FC15; Wed, 23 Nov 2011 21:41:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANLfWEr064388; Wed, 23 Nov 2011 21:41:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANLfWtG064386; Wed, 23 Nov 2011 21:41:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111232141.pANLfWtG064386@svn.freebsd.org> From: Xin LI Date: Wed, 23 Nov 2011 21:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227910 - releng/9.0/etc stable/9/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: Wed, 23 Nov 2011 21:41:32 -0000 Author: delphij Date: Wed Nov 23 21:41:31 2011 New Revision: 227910 URL: http://svn.freebsd.org/changeset/base/227910 Log: MFC r225849: Test if the interface is afif in dhcpif() and syncdhcpif(), as done in ipv6_autoconfif. This fixes a regression that causes e.g. ifconfig_DEFAULT="DHCP" to run on non-afif interfaces like pfsync0, which in turn would cause excessive delay on system startup. Sponsored by: iXsystems, Inc. Reviewed by: hrs (freebsd-rc@) Approved by: re (bz) Modified: releng/9.0/etc/network.subr Directory Properties: releng/9.0/etc/ (props changed) Changes in other areas also in this revision: Modified: stable/9/etc/network.subr Directory Properties: stable/9/etc/ (props changed) Modified: releng/9.0/etc/network.subr ============================================================================== --- releng/9.0/etc/network.subr Wed Nov 23 21:19:38 2011 (r227909) +++ releng/9.0/etc/network.subr Wed Nov 23 21:41:31 2011 (r227910) @@ -297,6 +297,10 @@ dhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + if noafif $1; then + return 1 + fi + for _arg in $_tmpargs; do case $_arg in [Dd][Hh][Cc][Pp]) @@ -322,6 +326,10 @@ syncdhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + if noafif $1; then + return 1 + fi + for _arg in $_tmpargs; do case $_arg in [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 21:43: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 4A9E81065678; Wed, 23 Nov 2011 21:43:01 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 398888FC15; Wed, 23 Nov 2011 21:43:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANLh1aD064465; Wed, 23 Nov 2011 21:43:01 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANLh1T3064463; Wed, 23 Nov 2011 21:43:01 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201111232143.pANLh1T3064463@svn.freebsd.org> From: Peter Holm Date: Wed, 23 Nov 2011 21:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227911 - stable/8/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Nov 2011 21:43:01 -0000 Author: pho Date: Wed Nov 23 21:43:00 2011 New Revision: 227911 URL: http://svn.freebsd.org/changeset/base/227911 Log: MFC: r227550, r227576 Handle invalid large values for getdirentries(2) data buffer size. Fix build, use %d for int value formatting. Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/8/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 23 21:41:31 2011 (r227910) +++ stable/8/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 23 21:43:00 2011 (r227911) @@ -711,6 +711,13 @@ pfs_iterate(struct thread *td, struct pr return (0); } +/* Directory entry list */ +struct pfsentry { + STAILQ_ENTRY(pfsentry) link; + struct dirent entry; +}; +STAILQ_HEAD(pfsdirentlist, pfsentry); + /* * Return directory entries. */ @@ -723,12 +730,14 @@ pfs_readdir(struct vop_readdir_args *va) pid_t pid = pvd->pvd_pid; struct proc *p, *proc; struct pfs_node *pn; - struct dirent *entry; struct uio *uio; + struct pfsentry *pfsent, *pfsent2; + struct pfsdirentlist lst; off_t offset; int error, i, resid; - char *buf, *ent; + STAILQ_INIT(&lst); + error = 0; KASSERT(pd->pn_info == vn->v_mount->mnt_data, ("%s(): pn_info does not match mountpoint", __func__)); PFS_TRACE(("%s pid %lu", pd->pn_name, (unsigned long)pid)); @@ -748,8 +757,6 @@ pfs_readdir(struct vop_readdir_args *va) if (resid == 0) PFS_RETURN (0); - /* can't do this while holding the proc lock... */ - buf = malloc(resid, M_IOV, M_WAITOK | M_ZERO); sx_slock(&allproc_lock); pfs_lock(pd); @@ -757,7 +764,6 @@ pfs_readdir(struct vop_readdir_args *va) if (!pfs_visible(curthread, pd, pid, &proc)) { sx_sunlock(&allproc_lock); pfs_unlock(pd); - free(buf, M_IOV); PFS_RETURN (ENOENT); } KASSERT(pid == NO_PID || proc != NULL, @@ -771,57 +777,64 @@ pfs_readdir(struct vop_readdir_args *va) PROC_UNLOCK(proc); pfs_unlock(pd); sx_sunlock(&allproc_lock); - free(buf, M_IOV); PFS_RETURN (0); } } /* fill in entries */ - ent = buf; while (pfs_iterate(curthread, proc, pd, &pn, &p) != -1 && resid >= PFS_DELEN) { - entry = (struct dirent *)ent; - entry->d_reclen = PFS_DELEN; - entry->d_fileno = pn_fileno(pn, pid); + if ((pfsent = malloc(sizeof(struct pfsentry), M_IOV, + M_NOWAIT | M_ZERO)) == NULL) { + error = ENOMEM; + break; + } + pfsent->entry.d_reclen = PFS_DELEN; + pfsent->entry.d_fileno = pn_fileno(pn, pid); /* PFS_DELEN was picked to fit PFS_NAMLEN */ for (i = 0; i < PFS_NAMELEN - 1 && pn->pn_name[i] != '\0'; ++i) - entry->d_name[i] = pn->pn_name[i]; - entry->d_name[i] = 0; - entry->d_namlen = i; + pfsent->entry.d_name[i] = pn->pn_name[i]; + pfsent->entry.d_name[i] = 0; + pfsent->entry.d_namlen = i; switch (pn->pn_type) { case pfstype_procdir: KASSERT(p != NULL, ("reached procdir node with p == NULL")); - entry->d_namlen = snprintf(entry->d_name, + pfsent->entry.d_namlen = snprintf(pfsent->entry.d_name, PFS_NAMELEN, "%d", p->p_pid); /* fall through */ case pfstype_root: case pfstype_dir: case pfstype_this: case pfstype_parent: - entry->d_type = DT_DIR; + pfsent->entry.d_type = DT_DIR; break; case pfstype_file: - entry->d_type = DT_REG; + pfsent->entry.d_type = DT_REG; break; case pfstype_symlink: - entry->d_type = DT_LNK; + pfsent->entry.d_type = DT_LNK; break; default: panic("%s has unexpected node type: %d", pn->pn_name, pn->pn_type); } - PFS_TRACE(("%s", entry->d_name)); + PFS_TRACE(("%s", pfsent->entry.d_name)); + STAILQ_INSERT_TAIL(&lst, pfsent, link); offset += PFS_DELEN; resid -= PFS_DELEN; - ent += PFS_DELEN; } if (proc != NULL) PROC_UNLOCK(proc); pfs_unlock(pd); sx_sunlock(&allproc_lock); - PFS_TRACE(("%zd bytes", ent - buf)); - error = uiomove(buf, ent - buf, uio); - free(buf, M_IOV); + i = 0; + STAILQ_FOREACH_SAFE(pfsent, &lst, link, pfsent2) { + if (error == 0) + error = uiomove(&pfsent->entry, PFS_DELEN, uio); + free(pfsent, M_IOV); + i++; + } + PFS_TRACE(("%d bytes", i * PFS_DELEN)); PFS_RETURN (error); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 21:43: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 4EA25106566B; Wed, 23 Nov 2011 21:43: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 3CAAA8FC0A; Wed, 23 Nov 2011 21:43:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANLhqGl064525; Wed, 23 Nov 2011 21:43:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANLhqPw064520; Wed, 23 Nov 2011 21:43:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111232143.pANLhqPw064520@svn.freebsd.org> From: Marius Strobl Date: Wed, 23 Nov 2011 21:43: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: r227912 - in head/sys/dev: arcmsr hptiop hptmv hptrr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 21:43:52 -0000 Author: marius Date: Wed Nov 23 21:43:51 2011 New Revision: 227912 URL: http://svn.freebsd.org/changeset/base/227912 Log: - Just use cam_calc_geometry(9) on newer version of FreeBSD rather than duplicating it. - In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END. Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/hptiop/hptiop.c head/sys/dev/hptmv/entry.c head/sys/dev/hptrr/hptrr_osm_bsd.c Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Wed Nov 23 21:43:00 2011 (r227911) +++ head/sys/dev/arcmsr/arcmsr.c Wed Nov 23 21:43:51 2011 (r227912) @@ -2714,16 +2714,20 @@ static void arcmsr_action(struct cam_sim xpt_done(pccb); break; } - case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - + case XPT_CALC_GEOMETRY: if(pccb->ccb_h.target_id == 16) { pccb->ccb_h.status |= CAM_FUNC_NOTAVAIL; xpt_done(pccb); break; } +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&pccb->ccg, 1); +#else + { + struct ccb_calc_geometry *ccg; + u_int32_t size_mb; + u_int32_t secs_per_cylinder; + ccg= &pccb->ccg; if (ccg->block_size == 0) { pccb->ccb_h.status = CAM_REQ_INVALID; @@ -2746,9 +2750,10 @@ static void arcmsr_action(struct cam_sim secs_per_cylinder=ccg->heads * ccg->secs_per_track; ccg->cylinders=ccg->volume_size / secs_per_cylinder; pccb->ccb_h.status |= CAM_REQ_CMP; + } +#endif xpt_done(pccb); break; - } default: pccb->ccb_h.status |= CAM_REQ_INVALID; xpt_done(pccb); Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Wed Nov 23 21:43:00 2011 (r227911) +++ head/sys/dev/hptiop/hptiop.c Wed Nov 23 21:43:51 2011 (r227912) @@ -1813,11 +1813,15 @@ scsi_done: break; case XPT_CALC_GEOMETRY: +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else ccb->ccg.heads = 255; ccb->ccg.secs_per_track = 63; ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); ccb->ccb_h.status = CAM_REQ_CMP; +#endif break; case XPT_PATH_INQ: Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Wed Nov 23 21:43:00 2011 (r227911) +++ head/sys/dev/hptmv/entry.c Wed Nov 23 21:43:51 2011 (r227912) @@ -22,9 +22,10 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include @@ -94,7 +95,7 @@ static device_method_t driver_methods[] DEVMETHOD(device_detach, hpt_detach), DEVMETHOD(device_shutdown, hpt_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t hpt_pci_driver = { @@ -2371,7 +2372,10 @@ hpt_action(struct cam_sim *sim, union cc break; case XPT_CALC_GEOMETRY: - { +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else + { struct ccb_calc_geometry *ccg; u_int32_t size_mb; u_int32_t secs_per_cylinder; @@ -2389,9 +2393,10 @@ hpt_action(struct cam_sim *sim, union cc secs_per_cylinder = ccg->heads * ccg->secs_per_track; ccg->cylinders = ccg->volume_size / secs_per_cylinder; ccb->ccb_h.status = CAM_REQ_CMP; + } +#endif xpt_done(ccb); break; - } case XPT_PATH_INQ: /* Path routing inquiry */ { Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Wed Nov 23 21:43:00 2011 (r227911) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Wed Nov 23 21:43:51 2011 (r227912) @@ -22,9 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); + #include /* $Id: osm_bsd.c,v 1.27 2007/11/22 07:35:49 gmm Exp $ * @@ -795,10 +797,14 @@ static void hpt_action(struct cam_sim *s break; case XPT_CALC_GEOMETRY: +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else ccb->ccg.heads = 255; ccb->ccg.secs_per_track = 63; ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); ccb->ccb_h.status = CAM_REQ_CMP; +#endif break; case XPT_PATH_INQ: @@ -1250,7 +1256,7 @@ static device_method_t driver_methods[] DEVMETHOD(device_attach, hpt_attach), DEVMETHOD(device_detach, hpt_detach), DEVMETHOD(device_shutdown, hpt_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t hpt_pci_driver = { From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 22:05: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 5F895106566C; Wed, 23 Nov 2011 22:05:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F60B8FC15; Wed, 23 Nov 2011 22:05:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANM5i0A065237; Wed, 23 Nov 2011 22:05:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANM5ioZ065235; Wed, 23 Nov 2011 22:05:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111232205.pANM5ioZ065235@svn.freebsd.org> From: Marius Strobl Date: Wed, 23 Nov 2011 22:05: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: r227913 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 22:05:44 -0000 Author: marius Date: Wed Nov 23 22:05:44 2011 New Revision: 227913 URL: http://svn.freebsd.org/changeset/base/227913 Log: Wrap BCM5785 in #ifdef notyet for now. According to yongari@ there are issues probably needing workarounds in bge(4) when brgphy(4) handles this PHY. Letting ukphy(4) handle it instead results in a working configuration, although likely with performance penalties. Modified: head/sys/dev/mii/brgphy.c Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Wed Nov 23 21:43:51 2011 (r227912) +++ head/sys/dev/mii/brgphy.c Wed Nov 23 22:05:44 2011 (r227913) @@ -139,7 +139,9 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(BROADCOM2, BCM5754), MII_PHY_DESC(BROADCOM2, BCM5761), MII_PHY_DESC(BROADCOM2, BCM5784), +#ifdef notyet /* better handled by ukphy(4) until WARs are implemented */ MII_PHY_DESC(BROADCOM2, BCM5785), +#endif MII_PHY_DESC(BROADCOM3, BCM5717C), MII_PHY_DESC(BROADCOM3, BCM5719C), MII_PHY_DESC(BROADCOM3, BCM5720C), From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 22:07: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 EFE4B1065670; Wed, 23 Nov 2011 22:07:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9648FC0A; Wed, 23 Nov 2011 22:07:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANM7D7a065322; Wed, 23 Nov 2011 22:07:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANM7DAN065319; Wed, 23 Nov 2011 22:07:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111232207.pANM7DAN065319@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 Nov 2011 22:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227914 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 22:07:14 -0000 Author: yongari Date: Wed Nov 23 22:07:13 2011 New Revision: 227914 URL: http://svn.freebsd.org/changeset/base/227914 Log: Make sure to stop TX MAC before freeing queued TX frames. For RTL8111DP, check if the TX MAC is active by reading RL_GTXSTART register. For RTL8402/8168E-VL/8168F/8411, wait until TX queue is empty. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Nov 23 22:05:44 2011 (r227913) +++ head/sys/dev/re/if_re.c Wed Nov 23 22:07:13 2011 (r227914) @@ -1401,13 +1401,18 @@ re_attach(device_t dev) RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; case RL_HWREV_8401E: - case RL_HWREV_8402: case RL_HWREV_8105E: case RL_HWREV_8105E_SPIN1: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; break; + case RL_HWREV_8402: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | + RL_FLAG_CMDSTOP_WAIT_TXQ; + break; case RL_HWREV_8168B_SPIN1: case RL_HWREV_8168B_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; @@ -1424,11 +1429,15 @@ re_attach(device_t dev) /* FALLTHROUGH */ case RL_HWREV_8168CP: case RL_HWREV_8168D: - case RL_HWREV_8168DP: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; break; + case RL_HWREV_8168DP: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_AUTOPAD | + RL_FLAG_JUMBOV2 | RL_FLAG_WAIT_TXPOLL; + break; case RL_HWREV_8168E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | @@ -1439,7 +1448,8 @@ re_attach(device_t dev) case RL_HWREV_8411: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | - RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; + RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | + RL_FLAG_CMDSTOP_WAIT_TXQ; break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: @@ -3466,10 +3476,32 @@ re_stop(struct rl_softc *sc) ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_MULTI | RL_RXCFG_RX_BROAD)); - if ((sc->rl_flags & RL_FLAG_CMDSTOP) != 0) + if ((sc->rl_flags & RL_FLAG_WAIT_TXPOLL) != 0) { + for (i = RL_TIMEOUT; i > 0; i--) { + if ((CSR_READ_1(sc, sc->rl_txstart) & + RL_TXSTART_START) == 0) + break; + DELAY(20); + } + if (i == 0) + device_printf(sc->rl_dev, + "stopping TX poll timed out!\n"); + CSR_WRITE_1(sc, RL_COMMAND, 0x00); + } else if ((sc->rl_flags & RL_FLAG_CMDSTOP) != 0) { CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_STOPREQ | RL_CMD_TX_ENB | RL_CMD_RX_ENB); - else + if ((sc->rl_flags & RL_FLAG_CMDSTOP_WAIT_TXQ) != 0) { + for (i = RL_TIMEOUT; i > 0; i--) { + if ((CSR_READ_4(sc, RL_TXCFG) & + RL_TXCFG_QUEUE_EMPTY) != 0) + break; + DELAY(100); + } + if (i == 0) + device_printf(sc->rl_dev, + "stopping TXQ timed out!\n"); + } + } else CSR_WRITE_1(sc, RL_COMMAND, 0x00); DELAY(1000); CSR_WRITE_2(sc, RL_IMR, 0x0000); Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Nov 23 22:05:44 2011 (r227913) +++ head/sys/pci/if_rlreg.h Wed Nov 23 22:07:13 2011 (r227914) @@ -143,6 +143,7 @@ */ #define RL_TXCFG_CLRABRT 0x00000001 /* retransmit aborted pkt */ #define RL_TXCFG_MAXDMA 0x00000700 /* max DMA burst size */ +#define RL_TXCFG_QUEUE_EMPTY 0x00000800 /* 8168E-VL or higher */ #define RL_TXCFG_CRCAPPEND 0x00010000 /* CRC append (0 = yes) */ #define RL_TXCFG_LOOPBKTST 0x00060000 /* loopback test */ #define RL_TXCFG_IFG2 0x00080000 /* 8169 only */ @@ -897,22 +898,24 @@ struct rl_softc { int rl_int_rx_act; int rl_int_rx_mod; uint32_t rl_flags; -#define RL_FLAG_MSI 0x0001 -#define RL_FLAG_AUTOPAD 0x0002 -#define RL_FLAG_PHYWAKE_PM 0x0004 -#define RL_FLAG_PHYWAKE 0x0008 -#define RL_FLAG_JUMBOV2 0x0010 -#define RL_FLAG_PAR 0x0020 -#define RL_FLAG_DESCV2 0x0040 -#define RL_FLAG_MACSTAT 0x0080 -#define RL_FLAG_FASTETHER 0x0100 -#define RL_FLAG_CMDSTOP 0x0200 -#define RL_FLAG_MACRESET 0x0400 -#define RL_FLAG_MSIX 0x0800 -#define RL_FLAG_WOLRXENB 0x1000 -#define RL_FLAG_MACSLEEP 0x2000 -#define RL_FLAG_PCIE 0x4000 -#define RL_FLAG_LINK 0x8000 +#define RL_FLAG_MSI 0x00000001 +#define RL_FLAG_AUTOPAD 0x00000002 +#define RL_FLAG_PHYWAKE_PM 0x00000004 +#define RL_FLAG_PHYWAKE 0x00000008 +#define RL_FLAG_JUMBOV2 0x00000010 +#define RL_FLAG_PAR 0x00000020 +#define RL_FLAG_DESCV2 0x00000040 +#define RL_FLAG_MACSTAT 0x00000080 +#define RL_FLAG_FASTETHER 0x00000100 +#define RL_FLAG_CMDSTOP 0x00000200 +#define RL_FLAG_MACRESET 0x00000400 +#define RL_FLAG_MSIX 0x00000800 +#define RL_FLAG_WOLRXENB 0x00001000 +#define RL_FLAG_MACSLEEP 0x00002000 +#define RL_FLAG_WAIT_TXPOLL 0x00004000 +#define RL_FLAG_CMDSTOP_WAIT_TXQ 0x00008000 +#define RL_FLAG_PCIE 0x40000000 +#define RL_FLAG_LINK 0x80000000 }; #define RL_LOCK(_sc) mtx_lock(&(_sc)->rl_mtx) From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 22:16: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 B60E01065670; Wed, 23 Nov 2011 22:16:45 +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 9BEDC8FC13; Wed, 23 Nov 2011 22:16:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANMGjkp065817; Wed, 23 Nov 2011 22:16:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANMGjUd065815; Wed, 23 Nov 2011 22:16:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111232216.pANMGjUd065815@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 23 Nov 2011 22:16: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: r227915 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 22:16:45 -0000 Author: bz Date: Wed Nov 23 22:16:45 2011 New Revision: 227915 URL: http://svn.freebsd.org/changeset/base/227915 Log: MFC r227061 (by mlaier): Fix a use-after-free/redzone issue in the routing code. Modified: stable/8/sys/net/rtsock.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/net/rtsock.c ============================================================================== --- stable/8/sys/net/rtsock.c Wed Nov 23 22:07:13 2011 (r227914) +++ stable/8/sys/net/rtsock.c Wed Nov 23 22:16:45 2011 (r227915) @@ -166,7 +166,7 @@ static void rt_setmetrics(u_long which, struct rt_metrics_lite *out); static void rt_getmetrics(const struct rt_metrics_lite *in, struct rt_metrics *out); -static void rt_dispatch(struct mbuf *, const struct sockaddr *); +static void rt_dispatch(struct mbuf *, sa_family_t); static struct netisr_handler rtsock_nh = { .nh_name = "rtsock", @@ -545,6 +545,7 @@ route_output(struct mbuf *m, struct sock int len, error = 0; struct ifnet *ifp = NULL; union sockaddr_union saun; + sa_family_t saf = AF_UNSPEC; #define senderr(e) { error = e; goto flush;} if (m == NULL || ((m->m_len < sizeof(long)) && @@ -581,6 +582,7 @@ route_output(struct mbuf *m, struct sock (info.rti_info[RTAX_GATEWAY] != NULL && info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX)) senderr(EINVAL); + saf = info.rti_info[RTAX_DST]->sa_family; /* * Verify that the caller has the appropriate privilege; RTM_GET * is the only operation the non-superuser is allowed. @@ -927,10 +929,10 @@ flush: */ unsigned short family = rp->rcb_proto.sp_family; rp->rcb_proto.sp_family = 0; - rt_dispatch(m, info.rti_info[RTAX_DST]); + rt_dispatch(m, saf); rp->rcb_proto.sp_family = family; } else - rt_dispatch(m, info.rti_info[RTAX_DST]); + rt_dispatch(m, saf); } } return (error); @@ -1183,7 +1185,7 @@ rt_missmsg_fib(int type, struct rt_addri rtm->rtm_flags = RTF_DONE | flags; rtm->rtm_errno = error; rtm->rtm_addrs = rtinfo->rti_addrs; - rt_dispatch(m, sa); + rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); } void @@ -1215,7 +1217,7 @@ rt_ifmsg(struct ifnet *ifp) ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm->ifm_data = ifp->if_data; ifm->ifm_addrs = 0; - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } /* @@ -1293,7 +1295,7 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr M_SETFIB(m, fibnum); m->m_flags |= RTS_FILTER_FIB; } - rt_dispatch(m, sa); + rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); } } @@ -1336,7 +1338,7 @@ rt_newmaddrmsg(int cmd, struct ifmultiad __func__)); ifmam->ifmam_index = ifp->if_index; ifmam->ifmam_addrs = info.rti_addrs; - rt_dispatch(m, ifma->ifma_addr); + rt_dispatch(m, ifma->ifma_addr ? ifma->ifma_addr->sa_family : AF_UNSPEC); } static struct mbuf * @@ -1396,7 +1398,7 @@ rt_ieee80211msg(struct ifnet *ifp, int w if (m->m_flags & M_PKTHDR) m->m_pkthdr.len += data_len; mtod(m, struct if_announcemsghdr *)->ifan_msglen += data_len; - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } } @@ -1412,11 +1414,11 @@ rt_ifannouncemsg(struct ifnet *ifp, int m = rt_makeifannouncemsg(ifp, RTM_IFANNOUNCE, what, &info); if (m != NULL) - rt_dispatch(m, NULL); + rt_dispatch(m, AF_UNSPEC); } static void -rt_dispatch(struct mbuf *m, const struct sockaddr *sa) +rt_dispatch(struct mbuf *m, sa_family_t saf) { struct m_tag *tag; @@ -1425,14 +1427,14 @@ rt_dispatch(struct mbuf *m, const struct * use when injecting the mbuf into the routing socket buffer from * the netisr. */ - if (sa != NULL) { + if (saf != AF_UNSPEC) { tag = m_tag_get(PACKET_TAG_RTSOCKFAM, sizeof(unsigned short), M_NOWAIT); if (tag == NULL) { m_freem(m); return; } - *(unsigned short *)(tag + 1) = sa->sa_family; + *(unsigned short *)(tag + 1) = saf; m_tag_prepend(m, tag); } #ifdef VIMAGE From owner-svn-src-all@FreeBSD.ORG Wed Nov 23 23:29: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 3B76A1065670; Wed, 23 Nov 2011 23:29:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AE968FC13; Wed, 23 Nov 2011 23:29:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANNTJxK068040; Wed, 23 Nov 2011 23:29:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANNTJOn068037; Wed, 23 Nov 2011 23:29:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111232329.pANNTJOn068037@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 Nov 2011 23:29: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: r227916 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 23:29:19 -0000 Author: yongari Date: Wed Nov 23 23:29:18 2011 New Revision: 227916 URL: http://svn.freebsd.org/changeset/base/227916 Log: To save more power, switch to 10/100Mbps link when controller is put into suspend/shutdown. Old PCI controllers performed that operation in firmware but for RTL8111C or newer controllers, it's responsibility of driver. It's not clear whether the firmware of RTL8111B still downgrades its speed to 10/100Mbps so leave it as it was. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Nov 23 22:16:45 2011 (r227915) +++ head/sys/dev/re/if_re.c Wed Nov 23 23:29:18 2011 (r227916) @@ -294,6 +294,7 @@ static void re_set_rxmode (struct rl_so static void re_reset (struct rl_softc *); static void re_setwol (struct rl_softc *); static void re_clrwol (struct rl_softc *); +static void re_set_linkspeed (struct rl_softc *); #ifdef RE_DIAG static int re_diag (struct rl_softc *); @@ -1431,17 +1432,18 @@ re_attach(device_t dev) case RL_HWREV_8168D: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | - RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; + RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | RL_FLAG_WOL_MANLINK; break; case RL_HWREV_8168DP: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_AUTOPAD | - RL_FLAG_JUMBOV2 | RL_FLAG_WAIT_TXPOLL; + RL_FLAG_JUMBOV2 | RL_FLAG_WAIT_TXPOLL | RL_FLAG_WOL_MANLINK; break; case RL_HWREV_8168E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | - RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; + RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | + RL_FLAG_WOL_MANLINK; break; case RL_HWREV_8168E_VL: case RL_HWREV_8168F: @@ -1449,7 +1451,7 @@ re_attach(device_t dev) sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | - RL_FLAG_CMDSTOP_WAIT_TXQ; + RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK; break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: @@ -3627,6 +3629,74 @@ re_shutdown(device_t dev) } static void +re_set_linkspeed(struct rl_softc *sc) +{ + struct mii_softc *miisc; + struct mii_data *mii; + int aneg, i, phyno; + + RL_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->rl_miibus); + mii_pollstat(mii); + aneg = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch IFM_SUBTYPE(mii->mii_media_active) { + case IFM_10_T: + case IFM_100_TX: + return; + case IFM_1000_T: + aneg++; + break; + default: + break; + } + } + miisc = LIST_FIRST(&mii->mii_phys); + phyno = miisc->mii_phy; + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + re_miibus_writereg(sc->rl_dev, phyno, MII_100T2CR, 0); + re_miibus_writereg(sc->rl_dev, phyno, + MII_ANAR, ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA); + re_miibus_writereg(sc->rl_dev, phyno, + MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG); + DELAY(1000); + if (aneg != 0) { + /* + * Poll link state until re(4) get a 10/100Mbps link. + */ + for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { + mii_pollstat(mii); + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) + == (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + return; + default: + break; + } + } + RL_UNLOCK(sc); + pause("relnk", hz); + RL_LOCK(sc); + } + if (i == MII_ANEGTICKS_GIGE) + device_printf(sc->rl_dev, + "establishing a link failed, WOL may not work!"); + } + /* + * No link, force MAC to have 100Mbps, full-duplex link. + * MAC does not require reprogramming on resolved speed/duplex, + * so this is just for completeness. + */ + mii->mii_media_status = IFM_AVALID | IFM_ACTIVE; + mii->mii_media_active = IFM_ETHER | IFM_100_TX | IFM_FDX; +} + +static void re_setwol(struct rl_softc *sc) { struct ifnet *ifp; @@ -3648,6 +3718,8 @@ re_setwol(struct rl_softc *sc) } if ((ifp->if_capenable & IFCAP_WOL) != 0) { re_set_rxmode(sc); + if ((sc->rl_flags & RL_FLAG_WOL_MANLINK) != 0) + re_set_linkspeed(sc); if ((sc->rl_flags & RL_FLAG_WOLRXENB) != 0) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RX_ENB); } Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Nov 23 22:16:45 2011 (r227915) +++ head/sys/pci/if_rlreg.h Wed Nov 23 23:29:18 2011 (r227916) @@ -914,6 +914,7 @@ struct rl_softc { #define RL_FLAG_MACSLEEP 0x00002000 #define RL_FLAG_WAIT_TXPOLL 0x00004000 #define RL_FLAG_CMDSTOP_WAIT_TXQ 0x00008000 +#define RL_FLAG_WOL_MANLINK 0x00010000 #define RL_FLAG_PCIE 0x40000000 #define RL_FLAG_LINK 0x80000000 }; From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 04:19: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 E0387106564A; Thu, 24 Nov 2011 04:19:02 +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 D07EB8FC0A; Thu, 24 Nov 2011 04:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO4J26f077028; Thu, 24 Nov 2011 04:19:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO4J2YU077026; Thu, 24 Nov 2011 04:19:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240419.pAO4J2YU077026@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 04:19: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: r227917 - head/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, 24 Nov 2011 04:19:03 -0000 Author: adrian Date: Thu Nov 24 04:19:02 2011 New Revision: 227917 URL: http://svn.freebsd.org/changeset/base/227917 Log: Slim the default build down a little: * Disable the NFS client, it's not needed for booting off of flash. * Don't compile in softdep, snapshots, ufs acls and directory hashing. Modified: head/sys/mips/conf/AR91XX_BASE Modified: head/sys/mips/conf/AR91XX_BASE ============================================================================== --- head/sys/mips/conf/AR91XX_BASE Wed Nov 23 23:29:18 2011 (r227916) +++ head/sys/mips/conf/AR91XX_BASE Thu Nov 24 04:19:02 2011 (r227917) @@ -29,7 +29,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #InterNETworking -options NFSCL #Network Filesystem Client +#options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions @@ -39,10 +39,11 @@ options INVARIANTS options INVARIANT_SUPPORT options WITNESS options WITNESS_SKIPSPIN -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +options NO_FFS_SNAPSHOT # We don't require snapshot support # Wireless NIC cards options IEEE80211_DEBUG From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 04:21: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 A41DF1065680; Thu, 24 Nov 2011 04:21:19 +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 944B48FC13; Thu, 24 Nov 2011 04:21:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO4LJPN077139; Thu, 24 Nov 2011 04:21:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO4LJBu077137; Thu, 24 Nov 2011 04:21:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240421.pAO4LJBu077137@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 04:21: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: r227918 - head/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, 24 Nov 2011 04:21:19 -0000 Author: adrian Date: Thu Nov 24 04:21:19 2011 New Revision: 227918 URL: http://svn.freebsd.org/changeset/base/227918 Log: Flip on these debugging options by default. This is -HEAD after all. Modified: head/sys/mips/conf/PB92 Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Thu Nov 24 04:19:02 2011 (r227917) +++ head/sys/mips/conf/PB92 Thu Nov 24 04:21:19 2011 (r227918) @@ -31,11 +31,11 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po options ALQ # Debugging for use in -current -#options DEADLKRES -#options INVARIANTS -#options INVARIANT_SUPPORT -#options WITNESS -#options WITNESS_SKIPSPIN +options DEADLKRES +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS +options WITNESS_SKIPSPIN options FFS #Berkeley Fast Filesystem #options SOFTUPDATES #Enable FFS soft updates support #options UFS_ACL #Support for access control lists From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 04: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 02FD11065672; Thu, 24 Nov 2011 04: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 E750D8FC0A; Thu, 24 Nov 2011 04:23:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO4Ngrm077253; Thu, 24 Nov 2011 04:23:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO4Ng1x077251; Thu, 24 Nov 2011 04:23:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240423.pAO4Ng1x077251@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 04:23: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: r227919 - head/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, 24 Nov 2011 04:23:43 -0000 Author: adrian Date: Thu Nov 24 04:23:42 2011 New Revision: 227919 URL: http://svn.freebsd.org/changeset/base/227919 Log: Add a comment documenting where the WMAC hangs off of. At some point it would be nice to correctly update the bus glue to make this "correct", including having the DDR flush occur in the right spot (ie, any AHB interrupt.) Modified: head/sys/mips/conf/AR91XX_BASE.hints Modified: head/sys/mips/conf/AR91XX_BASE.hints ============================================================================== --- head/sys/mips/conf/AR91XX_BASE.hints Thu Nov 24 04:21:19 2011 (r227918) +++ head/sys/mips/conf/AR91XX_BASE.hints Thu Nov 24 04:23:42 2011 (r227919) @@ -32,6 +32,7 @@ hint.arge.1.maddr=0x1a000000 hint.arge.1.msize=0x1000 hint.arge.1.irq=3 +# XXX The ath device hangs off of the AHB, rather than the Nexus. hint.ath.0.at="nexus0" hint.ath.0.maddr=0x180c0000 hint.ath.0.msize=0x30000 From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 04:25: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 A06C5106564A; Thu, 24 Nov 2011 04:25:56 +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 3A79A8FC18; Thu, 24 Nov 2011 04:25:55 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAO4Pfml013615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Nov 2011 15:25:52 +1100 Date: Thu, 24 Nov 2011 15:25:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker In-Reply-To: <20111121235101.GA8012@stack.nl> Message-ID: <20111124145950.N1102@besplex.bde.org> References: <201111082354.pA8NsdhP055080@svn.freebsd.org> <20111109083545.GC1598@mole.fafoe.narf.at> <20111109203528.GA29992@stack.nl> <20111121181134.A882@besplex.bde.org> <20111121235101.GA8012@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , Bruce Evans , src-committers@FreeBSD.org Subject: Re: svn commit: r227369 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 04:25:56 -0000 On Tue, 22 Nov 2011, Jilles Tjoelker wrote: > On Mon, Nov 21, 2011 at 06:29:06PM +1100, Bruce Evans wrote: >> On Wed, 9 Nov 2011, Jilles Tjoelker wrote: >>> On Wed, Nov 09, 2011 at 09:35:51AM +0100, Stefan Farfeleder wrote: >>>> Isn't the behaviour undefined too when you convert an out-of-range >>>> uintmax_t value back into an intmax_t value? > >>> The result is implementation-defined or an implementation-defined signal >>> is raised. > >> C doesn't allow any signal, at least in C90 and n869.txt draft C99: > ... > The possibility of a signal is mentioned in C99TC2 draft n1124 and > remains in C1x draft n1548. The documentation in 'info gcc' is > consistent with that. I wonder why they (C standards) broke that. Though the implementation may prefer to raising a signal, C90 (and C99-non-draft?) doesn't allow that, and it is a large change to allow one. >>> ] For conversion to a type of width N, the value is reduced modulo >>> ] 2^N to be within range of the type; no signal is raised. > >>> which is exactly what we need. > >> Of course, a correct implementation would give a random result, so that >> no one depends on implementation-defined behaviour. > > That would be a non-practical implementation, as it would be both slower > and run fewer existing applications. It's point is to run fewer existing applications -- the broken ones :-). This would not necessarily be slower. The hardware might want to or be able to trap (at no cost unless there is overflow). Then the implementation can convert the trap to a random result, instead of rasing a signal. The hardware might be 1's complement, but not trap. Then the fast version would give a non-random result, but not what you want. The slow version to give the 2's complement result that you want could probably give a random result instead. Now it is apparently allowed to trap instead. A trap is of course better for running fewer existing applications. Old ones won't have a trap handler and will just crash. > I think there should be some "loopholes" to do signed integer arithmetic > with wraparound, not allowing the compiler to assume there is no > overflow. Something like FENV_ACCESS pragmas would be useful. But these are still not supported by gcc-4.2 or clang. > While POSIX leaves the behaviour on overflow and division by zero in > shell arithmetic undefined as with C arithmetic (although it mentions > the possibility of converting to floating point in case of overflow), I > prefer that sh(1) not crash. It should avoid overflow and produce its own implementation-defined result, without depending on implementation-defined or undefined behaviour in C. This is easier when someone else is doing it :-). Bruce From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 04:34: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 620A3106566B; Thu, 24 Nov 2011 04:34:04 +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 525038FC12; Thu, 24 Nov 2011 04:34:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO4Y4KE077659; Thu, 24 Nov 2011 04:34:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO4Y4xX077657; Thu, 24 Nov 2011 04:34:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240434.pAO4Y4xX077657@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 04:34: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: r227920 - head/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, 24 Nov 2011 04:34:04 -0000 Author: adrian Date: Thu Nov 24 04:34:04 2011 New Revision: 227920 URL: http://svn.freebsd.org/changeset/base/227920 Log: Compile in the right bits so the AR9130 WMAC support functions correctly. A previous commit disabled compiling the AR9130 support in the default HAL build in the kernel. Since the AR9130 support won't actually function without AH_SUPPORT_AR9130 (and that abomination needs to be undone at some point, in order to allow USB 11n NICs to also work), we now have to explicitly compile it in. But since the 11n RF backends don't (currently) join the RF linker set, one has to compile in _an_ RF backend for the HAL to compile. Modified: head/sys/mips/conf/AR91XX_BASE Modified: head/sys/mips/conf/AR91XX_BASE ============================================================================== --- head/sys/mips/conf/AR91XX_BASE Thu Nov 24 04:23:42 2011 (r227919) +++ head/sys/mips/conf/AR91XX_BASE Thu Nov 24 04:34:04 2011 (r227920) @@ -63,7 +63,19 @@ options ATH_DEBUG options ATH_DIAGAPI option ATH_ENABLE_11N -device ath_hal +# Don't bother compiling the whole HAL - AH_SUPPORT_AR9130 breaks the +# rest of the 11n chipset support at the moment and the pre-AR5212 +# HALs aren't required. +# device ath_hal + +# The AR9130 code requires AR5416; and AR5416 requires the AR5212 code. +device ath_ar5212 +device ath_ar5416 +device ath_ar9130 +# This is needed so at least one RF backend is present, or the current +# HAL setup won't compile. Remove this once the 11n chip RF backends +# are converted over to be in the linker set. +device ath_rf5111 options AH_DEBUG option AH_SUPPORT_AR5416 From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 04:39: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 C010F106566B; Thu, 24 Nov 2011 04:39: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 B00AE8FC0A; Thu, 24 Nov 2011 04:39:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO4d1tN077833; Thu, 24 Nov 2011 04:39:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO4d1w0077830; Thu, 24 Nov 2011 04:39:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240439.pAO4d1w0077830@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 04:39: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: r227921 - head/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, 24 Nov 2011 04:39:01 -0000 Author: adrian Date: Thu Nov 24 04:39:01 2011 New Revision: 227921 URL: http://svn.freebsd.org/changeset/base/227921 Log: Flesh out a geom_map setup, so the kernel can be squeezed _onto_ the device. The default flash layout gives only 1 megabyte for the kernel, gzipped. The uboot firmware running on this device only supports gzip, not lzma, so we actually _do_ have to try and slim the kernel down a bit. But, since I can't actually do that at the present, I'm opting to: * extend the kernel from 1mb to 2mb; * have rootfs fill the rest of that, save 64k; * eventually I'll hide a 64k config partition at the end, between the end of rootfs and the ART (radio configuration data.) The uboot firmware doesn't care about the partition layout. It just expects the kernel application image to sit at 0xbf020000 (right after the 128k uboot image.) The uboot header isn't actually read either - it's "faked" from a "tplink" flash image header. So as long as the map configuration here matches what is being written out via the tplink firmware generator, everything is a-ok. Modified: head/sys/mips/conf/TP-WN1043ND head/sys/mips/conf/TP-WN1043ND.hints Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Thu Nov 24 04:34:04 2011 (r227920) +++ head/sys/mips/conf/TP-WN1043ND Thu Nov 24 04:39:01 2011 (r227921) @@ -20,11 +20,12 @@ options MSDOSFS options GEOM_PART_BSD options GEOM_PART_MBR -# Just make sure the thing boots off of the first attached SCSI device for now! -#options ROOTDEVNAME=\"ufs:da0a\" -# Or an MDROOT for testing. -options MD_ROOT -options MD_ROOT_SIZE=5120 +# uzip - to boot natively from flash device geom_uzip options GEOM_UZIP -options ROOTDEVNAME=\"ufs:/dev/md0.uzip\" + +# Used for the static uboot partition map +device geom_map + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" Modified: head/sys/mips/conf/TP-WN1043ND.hints ============================================================================== --- head/sys/mips/conf/TP-WN1043ND.hints Thu Nov 24 04:34:04 2011 (r227920) +++ head/sys/mips/conf/TP-WN1043ND.hints Thu Nov 24 04:39:01 2011 (r227921) @@ -17,3 +17,57 @@ hint.arge.1.phymask=0x0 # Where the ART is hint.ath.0.eepromaddr=0x1fff1000 + +# +# Define a slightly custom flash layout. + +# The default flash layout: +# +# 128k: uboot +# 1024k: kernel +# 4096k: rootfs +# 2880k: unknown +# 64k: ART +# +# from printenv: +# bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init +# mtdparts=ar9100-nor0:128k(u-boot),1024k(kernel),4096k(rootfs),64k(art) + +# This isn't a lot of space! +# So: +# 128k: uboot +# 2048k: kernel +# 5888k: rootfs +# (todo: 64k: config) +# 64k: ART + +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x000200000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00020000 +hint.map.1.end=0x00220000 +hint.map.1.name="kernel" +hint.map.1.readonly=1 + +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00220000 +#hint.map.2.end=0x007e0000 +hint.map.2.end=0x007f0000 +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +#hint.map.3.at="flash/spi0" +#hint.map.3.start=0x007e0000 +#hint.map.3.end=0x007f0000 +#hint.map.3.name="cfg" +#hint.map.3.readonly=1 + +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007f0000 +hint.map.4.end=0x00800000 +hint.map.4.name="art" +hint.map.4.readonly=1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 05:17: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 8593F1065670; Thu, 24 Nov 2011 05:17:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 020118FC16; Thu, 24 Nov 2011 05:17:48 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAO5HjXM028760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Nov 2011 16:17:46 +1100 Date: Thu, 24 Nov 2011 16:17:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler In-Reply-To: Message-ID: <20111124152617.B1102@besplex.bde.org> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1898521387-1322111865=:1102" Cc: src-committers@FreeBSD.org, theraven@FreeBSD.org, svn-src-all@FreeBSD.org, dim@FreeBSD.org, Brooks Davis , bde@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 05:17:49 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1898521387-1322111865=:1102 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 22 Nov 2011, Eitan Adler wrote: > Meta comment: > I should have sent this patch to -hackers prior to seeking approval to > commit. I learned my lesson and will seek wider review before making > such changes in the future. > On Tue, Nov 22, 2011 at 6:21 AM, Bruce Evans wrote= : > I saw your email about the style changes. I'd like to flesh out what > changes should be made first before making another commit>> I guess > I'm a little confused. =C2=A0Do we really have profiling>> information at > this level that suggests the overhead of the branch is>> significant? > I thought most hardware had pretty good>> branch-prediction, > particularly with speculative execution. > I made this change at the direction of theraven@. I assume he knows a > little bit more about compilers than I do. ;)It seems from the rest of > this thread that even if this were an optimization it still shouldn't > be done at source code code level. >> Every time I have profiled the string functions, changes like this alway= s> have an insignificant effect, even in benchmarks. =C2=A0Normal code spen= ds> perhaps 0.01% of its time calling string functions, so the improvements= > from optimizing string functions are 0.01% of an insignificant amount. Maybe my mail client (unmentionable) is messing up something. This came back with the quotes even more mangled than usual, especially for my reply. > The problem with profiling this type of change is that it is hard to > find a good representative benchmark. I could easily write code that > will show you that adding the equality check is a good idea or that it > is a horrible idea. IMHO it saves enough time when they are equal, but > loses almost no time when the strings are not equal. >>> Wouldn't something like __predict_false() have more value for>> perform= ance, > It seems that at most this couldn't hurt. > On Tue, Nov 22, 2011 at 10:33 AM, David Schultz wrote: >> Third, it's not clear that checking whether s1 =3D=3D s2 is even an >> optimization. =C2=A0Most programs simply aren't going to pass identical >> pointers as arguments to strcmp(), so for the overwhelming >> majority of cases, this is just a wasted test and a wasted slot in >> a branch predict table. =C2=A0(FWIW, I doubt that a realistic benchmark >> would demonstrate any measurable difference.) > > It is fairly common for programs to compare a value passed to a > function to a array of strings. Also note that for the strn*cmp > functions we already have a branch so this isn't always a wasted slot. But das's mail never has these problems, even when you quote it. > Here is what I'd like to do next: > > - fix bde@'s style nits > - change the | to a || and remove the comment > - but leave the equality check as is. > - find a src committer to approve the patch > - go back to working on ports for a while ;) > > Is this the right course of action? Or should I just revert both > commits entirely? I would revert. Another point that I forgot to mention in a previous reply is that many of the MI implementations of string functions aren't actually used on primary arches, so optimizing them has no effect instead of 0.01% of an insignificant effect. This applies to at least strcmp() in the recent changes: - amd64 has a sophisticated MD strcmp. It's sophistication didn't include checking for equal pointers, and the recent changes didn't touch it. "sophisticated" may mean over-engineered. - i386 has an "optimized" MD strcmp. It uses 8-way unrolling. This may have been good when it was written for the original i386 or i486, but it is now dubious or worse. Its optimizations didn't include checking for equal pointers, and the recent changes didn't touch it. This doesn't apply to most of the other changed functions. The efficiency of the others was considered so unimportant that no one ever tried to optimize them for amd64; i386 has MD "optimized" versions for many more string functions than does i386, perhaps including a couple of the changed ones. One of the changed functions is strcasecmp(). This can't possibly be signifcantly optimized at the MD level, since it does locale stuff. The bloat in the locale stuff in it was expanded recently, so the constant factor for the O(N) in it expanded and the pointer-equality optimization does more. But if the optimality of strcasecmp() mattered, then it would have been thinner and its expansion would have generated more mail. Bruce --0-1898521387-1322111865=:1102-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 05:42: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 B2C17106564A; Thu, 24 Nov 2011 05:42:21 +0000 (UTC) (envelope-from lists@eitanadler.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 496F28FC12; Thu, 24 Nov 2011 05:42:19 +0000 (UTC) Received: by wwg14 with SMTP id 14so3572807wwg.31 for ; Wed, 23 Nov 2011 21:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=rIO3TykPuaYGy9VrbDEqO4PLJVN2etqFwEBsiuu7ICU=; b=MVw2fbEpT3STAmD8gsyyqjScR8iFl+iOg5eV2XORJdS/os8xi6yQ8WsVnUXPa4Ohgz 4bsoJypqH73dr0eSd009WCxp3zKjOBgy6xvN4nPiR7TA7cMNU4gN95UxOrFjpGUQv3W0 BgBNpNuZEFt50kvv/AqcXaTZb8to6CUFlwEUM= Received: by 10.216.154.136 with SMTP id h8mr532645wek.51.1322113339130; Wed, 23 Nov 2011 21:42:19 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.216.25.201 with HTTP; Wed, 23 Nov 2011 21:41:48 -0800 (PST) In-Reply-To: <20111124152617.B1102@besplex.bde.org> References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> <20111124152617.B1102@besplex.bde.org> From: Eitan Adler Date: Thu, 24 Nov 2011 00:41:48 -0500 X-Google-Sender-Auth: L6D6AorpDx5oFUZ1NUYCPqSiPGI Message-ID: To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, theraven@freebsd.org, svn-src-all@freebsd.org, dim@freebsd.org, Brooks Davis , bde@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 05:42:21 -0000 On Thu, Nov 24, 2011 at 12:17 AM, Bruce Evans wrote: > Maybe my mail client (unmentionable) is messing up something. =C2=A0This = came > back with the quotes even more mangled than usual, especially for my > reply. Is this better? I use Gmail as my mailer, and I have a feeling it gets confused sometimes. > I would revert. Alright. I guess I was a bit hasty with this commit. Unfortunately I won't be near my dev box for about another week. If you want to wait for me to revert the change, I'll do it when I get back. If someone else wants to revert the commit feel free :) --=20 Eitan Adler Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 06:27: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 DEC06106566B; Thu, 24 Nov 2011 06:27:47 +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 B5BE28FC17; Thu, 24 Nov 2011 06:27:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO6RlOU081138; Thu, 24 Nov 2011 06:27:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO6RlIl081136; Thu, 24 Nov 2011 06:27:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240627.pAO6RlIl081136@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 06:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227922 - 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: Thu, 24 Nov 2011 06:27:48 -0000 Author: adrian Date: Thu Nov 24 06:27:47 2011 New Revision: 227922 URL: http://svn.freebsd.org/changeset/base/227922 Log: Don't compile in the AR9130 embedded WMAC code into the HAL by default. This won't work unless AH_SUPPORT_AR9130 which can't be enabled - it breaks the other 11n chipsets for now. Sponsored by: Hobnob, Inc. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Nov 24 04:39:01 2011 (r227921) +++ head/sys/conf/files Thu Nov 24 06:27:47 2011 (r227922) @@ -778,13 +778,15 @@ dev/ath/ath_hal/ar5416/ar5416_xmit.c \ ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar9130 (depends upon ar5416) - also requires AH_SUPPORT_AR9130 -dev/ath/ath_hal/ar9001/ar9130_attach.c optional ath_hal | ath_ar9130 \ +# +# Since this is an embedded MAC SoC, there's no need to compile it into the +# default HAL. +dev/ath/ath_hal/ar9001/ar9130_attach.c optional ath_ar9130 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -dev/ath/ath_hal/ar9001/ar9130_phy.c optional ath_hal | ath_ar9130 \ +dev/ath/ath_hal/ar9001/ar9130_phy.c optional ath_ar9130 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -dev/ath/ath_hal/ar9001/ar9130_eeprom.c optional ath_hal | ath_ar9130 \ +dev/ath/ath_hal/ar9001/ar9130_eeprom.c optional ath_ar9130 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" - # ar9160 (depends on ar5416) dev/ath/ath_hal/ar9001/ar9160_attach.c optional ath_hal | ath_ar9160 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" @@ -831,7 +833,8 @@ dev/ath/ath_hal/ar5212/ar5112.c optional compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5413.c optional ath_hal | ath_rf5413 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -dev/ath/ath_hal/ar5416/ar2133.c optional ath_hal | ath_ar5416 | ath_ar9160 \ +dev/ath/ath_hal/ar5416/ar2133.c optional ath_hal | ath_ar5416 | \ + ath_ar9130 | ath_ar9160 | ath_ar9280 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9280.c optional ath_hal | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 07:12: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 9691A106567D; Thu, 24 Nov 2011 07:12:44 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id BCD0B8FC19; Thu, 24 Nov 2011 07:12:43 +0000 (UTC) Received: by faap15 with SMTP id p15so3657729faa.13 for ; Wed, 23 Nov 2011 23:12:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=oZBSD4muZo0SB1+lFk7NP8WW46Loja9c6yQ8laXNfN8=; b=Vu18LJvxiHCDexqP+Os9MagWO1JgbPCNZyq5tM/ljhgXldQWqBuyDH6uJSsZiZ2Zen KeA3jvcCWLd6IRYDQ14DYm2c58quHQ7RDrRvwchvqhV8TTaxp+oKdm0tdXGywY3VSZs2 VhLpwMFmLGskNn0IHPhL18oasXmGwI7X2s9Yo= Received: by 10.204.148.67 with SMTP id o3mr28313295bkv.130.1322118762299; Wed, 23 Nov 2011 23:12:42 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id x27sm24559721fag.14.2011.11.23.23.12.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Nov 2011 23:12:38 -0800 (PST) From: Mikolaj Golub To: mdf@FreeBSD.org Organization: TOA Ukraine References: <201111230734.pAN7YA78032998@svn.freebsd.org> Sender: Mikolaj Golub Date: Thu, 24 Nov 2011 09:12:35 +0200 In-Reply-To: (mdf@freebsd.org's message of "Wed, 23 Nov 2011 11:10:47 -0800") Message-ID: <86ipmaq9i4.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 07:12:44 -0000 On Wed, 23 Nov 2011 11:10:47 -0800 mdf@FreeBSD.org wrote: >> š š š š š š š š š š š šprintf(" AT_IGNORE=0x%lu", >> - š š š š š š š š š š š š š (unsigned long)aux->a_un.a_val); >> + š š š š š š š š š š š š š (unsigned long)auxv[i].a_un.a_val); m> I didn't see this before, but this gives very misleading output. The m> 0x prefix implies the output will be hex, but it's printed as decimal, m> here and below. Oh. Thanks! Will fix. m> I don't know if there's a style preference for 0x%lx versus %#lx, m> though, or a preference for a different type for the print (uintmax_t, m> for example). There is probably a preference for using u_long rather m> than unsigned long, since it's shorter. It looks like both 0x%lx and %#lx are widely spread in our source, I like %#lx a little more. It looks for me that (u_long) will be ok for now, so the chage for the printf above would be: printf(" AT_IGNORE=%#lx", (u_long)auxv[i].a_un.a_val); Anyway, printing all values in the same format was considered by me as a temporary solution. I am going to have format depending on a_type, so e.g. AT_PAGESZ will be 4096, not 0x1000. Also, now they are printed as one string for a process: PID COMM AUXV 2520 firefox-bin AT_PHDR=0x400040 AT_PHENT=0x38 AT_PHNUM=0x7 AT_PAGESZ=0x1000 ... I am considering changing this too, to something like below: PID COMM AUXV VALUE 2520 firefox-bin AT_PHDR 0x400040 2520 firefox-bin AT_PHENT 56 2520 firefox-bin AT_PHNUM 7 ... -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 07:25: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 14B7F106566C; Thu, 24 Nov 2011 07:25:44 +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 DEBCE8FC13; Thu, 24 Nov 2011 07:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO7PhTD083152; Thu, 24 Nov 2011 07:25:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO7Ph7l083150; Thu, 24 Nov 2011 07:25:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111240725.pAO7Ph7l083150@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 24 Nov 2011 07:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227923 - stable/9/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: Thu, 24 Nov 2011 07:25:44 -0000 Author: pjd Date: Thu Nov 24 07:25:43 2011 New Revision: 227923 URL: http://svn.freebsd.org/changeset/base/227923 Log: MFC r227110,r227111: r227110: In zvol_open() if the spa_namespace_lock is already held, it means that ZFS is trying to open and taste ZVOL as its VDEV. This is not supported, so return an error instead of panicing on spa_namespace_lock recursion. Reported by: Robert Millan PR: kern/162008 r227111: Correct typo in comment. Reported by: Fabian Keil Approved by: re (kib) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Nov 24 06:27:47 2011 (r227922) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Nov 24 07:25:43 2011 (r227923) @@ -875,6 +875,14 @@ zvol_open(struct g_provider *pp, int fla zvol_state_t *zv; int err = 0; + if (MUTEX_HELD(&spa_namespace_lock)) { + /* + * If the spa_namespace_lock is being held, it means that ZFS + * is trying to open ZVOL as its VDEV. This is not supported. + */ + return (EOPNOTSUPP); + } + mutex_enter(&spa_namespace_lock); zv = pp->private; From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 07:32:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25C2F1065675; Thu, 24 Nov 2011 07:32:53 +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 F08698FC14; Thu, 24 Nov 2011 07:32:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO7Wqv4083408; Thu, 24 Nov 2011 07:32:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO7WqU4083405; Thu, 24 Nov 2011 07:32:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240732.pAO7WqU4083405@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 07:32: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: r227924 - in head/sys: conf mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 07:32:53 -0000 Author: adrian Date: Thu Nov 24 07:32:52 2011 New Revision: 227924 URL: http://svn.freebsd.org/changeset/base/227924 Log: Introduce a new (global, sorry!) option which controls whether the ar71xx platform code should assume a uboot or redboot environment. The current code gets very confused (and just crashes) on a uboot environment, where each attribute=value pair is in a single entry. Redboot on the other hand stores it as "attribute", "value", "attribute", "value", ... This allows the kernel to boot on a TP-LINK TL-WR1043ND from flash, where the uboot environment gets setup. This didn't show up during a netboot as "tftpboot" and "go" don't setup the uboot environment variables. Modified: head/sys/conf/options head/sys/mips/atheros/ar71xx_machdep.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Nov 24 07:25:43 2011 (r227923) +++ head/sys/conf/options Thu Nov 24 07:32:52 2011 (r227924) @@ -899,4 +899,5 @@ RCTL opt_global.h # that "lies" about the amount of RAM it has. Until a cleaner method is # defined, this option will suffice in overriding what Redboot says. AR71XX_REALMEM opt_global.h - +AR71XX_ENV_UBOOT opt_global.h +AR71XX_ENV_REDBOOT opt_global.h Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Thu Nov 24 07:25:43 2011 (r227923) +++ head/sys/mips/atheros/ar71xx_machdep.c Thu Nov 24 07:32:52 2011 (r227924) @@ -168,8 +168,8 @@ platform_start(__register_t a0 __unused, __register_t a2 __unused, __register_t a3 __unused) { uint64_t platform_counter_freq; - int argc, i; - char **argv, **envp; + int argc = 0, i; + char **argv = NULL, **envp = NULL; vm_offset_t kernend; /* @@ -184,9 +184,18 @@ platform_start(__register_t a0 __unused, /* Initialize pcpu stuff */ mips_pcpu0_init(); + /* + * Until some more sensible abstractions for uboot/redboot + * environment handling, we have to make this a compile-time + * hack. The existing code handles the uboot environment + * very incorrectly so we should just ignore initialising + * the relevant pointers. + */ +#ifndef AR71XX_ENV_UBOOT argc = a0; argv = (char**)a1; envp = (char**)a2; +#endif /* * Protect ourselves from garbage in registers */ @@ -255,6 +264,9 @@ platform_start(__register_t a0 __unused, printf(" a2 = %08x\n", a2); printf(" a3 = %08x\n", a3); + /* + * XXX this code is very redboot specific. + */ printf("Cmd line:"); if (MIPS_IS_VALID_PTR(argv)) { for (i = 0; i < argc; i++) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 07:33: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 6FD811065672; Thu, 24 Nov 2011 07:33:41 +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 608F08FC12; Thu, 24 Nov 2011 07:33:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO7XfJw083477; Thu, 24 Nov 2011 07:33:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO7XfJI083475; Thu, 24 Nov 2011 07:33:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240733.pAO7XfJI083475@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 07:33: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: r227925 - head/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, 24 Nov 2011 07:33:41 -0000 Author: adrian Date: Thu Nov 24 07:33:41 2011 New Revision: 227925 URL: http://svn.freebsd.org/changeset/base/227925 Log: Flip on AR71XX_ENV_UBOOT so the environment variables are properly processed. (Which is to say they're currently ignored.) Modified: head/sys/mips/conf/TP-WN1043ND Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Thu Nov 24 07:32:52 2011 (r227924) +++ head/sys/mips/conf/TP-WN1043ND Thu Nov 24 07:33:41 2011 (r227925) @@ -20,6 +20,10 @@ options MSDOSFS options GEOM_PART_BSD options GEOM_PART_MBR +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + # uzip - to boot natively from flash device geom_uzip options GEOM_UZIP From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 07:37: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 140D6106566C; Thu, 24 Nov 2011 07:37:20 +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 DF1F88FC08; Thu, 24 Nov 2011 07:37:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO7bJxb083617; Thu, 24 Nov 2011 07:37:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO7bJss083615; Thu, 24 Nov 2011 07:37:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111240737.pAO7bJss083615@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 07:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227926 - head/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, 24 Nov 2011 07:37:20 -0000 Author: adrian Date: Thu Nov 24 07:37:19 2011 New Revision: 227926 URL: http://svn.freebsd.org/changeset/base/227926 Log: Now that I've brought up FreeBSD via flash, I've discovered that the second-last 64k seems to be the default firmware board configuration area. Since I have no idea whether uboot uses it or not - and it's prefixed with an atheros eeprom signature (0xaa55), I figure the safest thing to do is mark it as read-only. I've modified my local tplink firmware building program to generate a board configuration section - which is separate to this partition. It's located in the 64k _before_ this particular 64k. The firmware build program from OpenWRT never initialises those values and the firmware images from tplink also leave it 0x0, so I don't currently know what the exact, correct details should be. Modified: head/sys/mips/conf/TP-WN1043ND.hints Modified: head/sys/mips/conf/TP-WN1043ND.hints ============================================================================== --- head/sys/mips/conf/TP-WN1043ND.hints Thu Nov 24 07:33:41 2011 (r227925) +++ head/sys/mips/conf/TP-WN1043ND.hints Thu Nov 24 07:37:19 2011 (r227926) @@ -26,7 +26,8 @@ hint.ath.0.eepromaddr=0x1fff1000 # 128k: uboot # 1024k: kernel # 4096k: rootfs -# 2880k: unknown +# 2816: unknown +# 64k: board config? # 64k: ART # # from printenv: @@ -37,8 +38,9 @@ hint.ath.0.eepromaddr=0x1fff1000 # So: # 128k: uboot # 2048k: kernel -# 5888k: rootfs -# (todo: 64k: config) +# 5824k: rootfs +# 64k: config +# 64k: board config? # 64k: ART hint.map.0.at="flash/spi0" @@ -55,19 +57,38 @@ hint.map.1.readonly=1 hint.map.2.at="flash/spi0" hint.map.2.start=0x00220000 -#hint.map.2.end=0x007e0000 -hint.map.2.end=0x007f0000 +hint.map.2.end=0x007c0000 hint.map.2.name="rootfs" hint.map.2.readonly=1 -#hint.map.3.at="flash/spi0" -#hint.map.3.start=0x007e0000 -#hint.map.3.end=0x007f0000 -#hint.map.3.name="cfg" -#hint.map.3.readonly=1 +hint.map.3.at="flash/spi0" +hint.map.3.start=0x007c0000 +hint.map.3.end=0x007d0000 +hint.map.3.name="cfg" +hint.map.3.readonly=0 +# I'm not sure what this is! +# +# It does however start with "55 aa" which is an AR5416 EEPROM +# magic value, followed by what looks like a set of ethernet +# MAC addresses, then a bunch of what looks like my local firmware +# board configuration. +# +# For now, I'm going to leave this particular chunk of flash +# alone. +# hint.map.4.at="flash/spi0" -hint.map.4.start=0x007f0000 -hint.map.4.end=0x00800000 -hint.map.4.name="art" +hint.map.4.start=0x007d0000 +hint.map.4.end=0x007e0000 +hint.map.4.name="unknown" hint.map.4.readonly=1 + +# This is radio calibration section. It is (or should be!) unique +# for each board, to take into account thermal and electrical differences +# as well as the regulatory compliance data. +# +hint.map.5.at="flash/spi0" +hint.map.5.start=0x007f0000 +hint.map.5.end=0x00800000 +hint.map.5.name="art" +hint.map.5.readonly=1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 07:39: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 49EE0106564A; Thu, 24 Nov 2011 07:39: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 202688FC13; Thu, 24 Nov 2011 07:39:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO7d2R0083699; Thu, 24 Nov 2011 07:39:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO7d2oU083697; Thu, 24 Nov 2011 07:39:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111240739.pAO7d2oU083697@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 24 Nov 2011 07:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227927 - releng/9.0/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: Thu, 24 Nov 2011 07:39:02 -0000 Author: pjd Date: Thu Nov 24 07:39:01 2011 New Revision: 227927 URL: http://svn.freebsd.org/changeset/base/227927 Log: MFC r227110,r227111: r227110: In zvol_open() if the spa_namespace_lock is already held, it means that ZFS is trying to open and taste ZVOL as its VDEV. This is not supported, so return an error instead of panicing on spa_namespace_lock recursion. Reported by: Robert Millan PR: kern/162008 r227111: Correct typo in comment. Reported by: Fabian Keil Approved by: re (kib) Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Nov 24 07:37:19 2011 (r227926) +++ releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Nov 24 07:39:01 2011 (r227927) @@ -875,6 +875,14 @@ zvol_open(struct g_provider *pp, int fla zvol_state_t *zv; int err = 0; + if (MUTEX_HELD(&spa_namespace_lock)) { + /* + * If the spa_namespace_lock is being held, it means that ZFS + * is trying to open ZVOL as its VDEV. This is not supported. + */ + return (EOPNOTSUPP); + } + mutex_enter(&spa_namespace_lock); zv = pp->private; From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 08:56: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 5CE2B1065670; Thu, 24 Nov 2011 08:56:25 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D3F88FC12; Thu, 24 Nov 2011 08:56:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAO8uPdn086185; Thu, 24 Nov 2011 08:56:25 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAO8uPUD086182; Thu, 24 Nov 2011 08:56:25 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111240856.pAO8uPUD086182@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 08:56: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: r227928 - head/usr.sbin/sade X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 08:56:25 -0000 Author: fjoe Date: Thu Nov 24 08:56:24 2011 New Revision: 227928 URL: http://svn.freebsd.org/changeset/base/227928 Log: Remove unused code. Deleted: head/usr.sbin/sade/config.c Modified: head/usr.sbin/sade/Makefile head/usr.sbin/sade/sade.h Modified: head/usr.sbin/sade/Makefile ============================================================================== --- head/usr.sbin/sade/Makefile Thu Nov 24 07:39:01 2011 (r227927) +++ head/usr.sbin/sade/Makefile Thu Nov 24 08:56:24 2011 (r227928) @@ -6,7 +6,7 @@ _wizard= wizard.c PROG= sade MAN= sade.8 -SRCS= command.c config.c devices.c \ +SRCS= command.c devices.c \ disks.c dispatch.c dmenu.c \ globals.c install.c \ label.c main.c menus.c misc.c \ Modified: head/usr.sbin/sade/sade.h ============================================================================== --- head/usr.sbin/sade/sade.h Thu Nov 24 07:39:01 2011 (r227927) +++ head/usr.sbin/sade/sade.h Thu Nov 24 08:56:24 2011 (r227928) @@ -301,13 +301,6 @@ extern void command_execute(void); extern void command_shell_add(char *key, const char *fmt, ...) __printflike(2, 3); extern void command_func_add(char *key, commandFunc func, void *data); -/* config.c */ -extern void configEnvironmentRC_conf(void); -extern void configRC_conf(void); -extern int configFstab(dialogMenuItem *self); -extern int configRC(dialogMenuItem *self); -extern int configWriteRC_conf(dialogMenuItem *self); - /* devices.c */ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d)); From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 10:08: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 8211D106566B; Thu, 24 Nov 2011 10:08:22 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 724698FC24; Thu, 24 Nov 2011 10:08:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOA8MeD089032; Thu, 24 Nov 2011 10:08:22 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOA8MOI089030; Thu, 24 Nov 2011 10:08:22 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111241008.pAOA8MOI089030@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 10:08: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: r227929 - head/usr.sbin/sade X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 10:08:22 -0000 Author: fjoe Date: Thu Nov 24 10:08:22 2011 New Revision: 227929 URL: http://svn.freebsd.org/changeset/base/227929 Log: Remove unused code. Deleted: head/usr.sbin/sade/dispatch.c Modified: head/usr.sbin/sade/Makefile Modified: head/usr.sbin/sade/Makefile ============================================================================== --- head/usr.sbin/sade/Makefile Thu Nov 24 08:56:24 2011 (r227928) +++ head/usr.sbin/sade/Makefile Thu Nov 24 10:08:22 2011 (r227929) @@ -7,7 +7,7 @@ _wizard= wizard.c PROG= sade MAN= sade.8 SRCS= command.c devices.c \ - disks.c dispatch.c dmenu.c \ + disks.c dmenu.c \ globals.c install.c \ label.c main.c menus.c misc.c \ msg.c system.c termcap.c \ From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 10:54: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 2EDC5106566B; Thu, 24 Nov 2011 10:54:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1ED618FC12; Thu, 24 Nov 2011 10:54:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOAsVaG092876; Thu, 24 Nov 2011 10:54:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOAsVGR092874; Thu, 24 Nov 2011 10:54:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111241054.pAOAsVGR092874@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Nov 2011 10:54: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: r227930 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 10:54:31 -0000 Author: tuexen Date: Thu Nov 24 10:54:30 2011 New Revision: 227930 URL: http://svn.freebsd.org/changeset/base/227930 Log: Move up the address to the top of the sctp_paddrthlds structure like in all other structures. This avoids alignment problems. MFC after: 3 days. Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Nov 24 10:08:22 2011 (r227929) +++ head/sys/netinet/sctp_uio.h Thu Nov 24 10:54:30 2011 (r227930) @@ -521,8 +521,8 @@ struct sctp_paddrparams { #define SPP_IPV4_TOS SPP_DSCP struct sctp_paddrthlds { - sctp_assoc_t spt_assoc_id; struct sockaddr_storage spt_address; + sctp_assoc_t spt_assoc_id; uint16_t spt_pathmaxrxt; uint16_t spt_pathpfthld; }; From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 10:58: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 84235106566B; Thu, 24 Nov 2011 10:58:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7425E8FC14; Thu, 24 Nov 2011 10:58:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOAwmSh093047; Thu, 24 Nov 2011 10:58:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOAwmUk093045; Thu, 24 Nov 2011 10:58:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111241058.pAOAwmUk093045@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Nov 2011 10:58: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: r227931 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 10:58:48 -0000 Author: tuexen Date: Thu Nov 24 10:58:48 2011 New Revision: 227931 URL: http://svn.freebsd.org/changeset/base/227931 Log: Move up the address to the top of the sctp_udencaps structure like in all other structures. This avoids alignment problems. MFC after: 3 months. Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Nov 24 10:54:30 2011 (r227930) +++ head/sys/netinet/sctp_uio.h Thu Nov 24 10:58:48 2011 (r227931) @@ -672,8 +672,8 @@ struct sctp_timeouts { }; struct sctp_udpencaps { - sctp_assoc_t sue_assoc_id; struct sockaddr_storage sue_address; + sctp_assoc_t sue_assoc_id; uint16_t sue_port; }; From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 13:13: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 A0458106566B; Thu, 24 Nov 2011 13:13:51 +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 907C58FC08; Thu, 24 Nov 2011 13:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAODDpef097188; Thu, 24 Nov 2011 13:13:51 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAODDpaM097186; Thu, 24 Nov 2011 13:13:51 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201111241313.pAODDpaM097186@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 24 Nov 2011 13:13: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: r227932 - 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: Thu, 24 Nov 2011 13:13:51 -0000 Author: des Date: Thu Nov 24 13:13:50 2011 New Revision: 227932 URL: http://svn.freebsd.org/changeset/base/227932 Log: Add CTF magic to the new .c.o rule. MFC after: 3 weeks Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Thu Nov 24 10:58:48 2011 (r227931) +++ head/share/mk/bsd.lib.mk Thu Nov 24 13:13:50 2011 (r227932) @@ -69,6 +69,9 @@ PO_FLAG=-pg .c.o: ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ + (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) .c.po: ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 13:18: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 9CB9910656DB; Thu, 24 Nov 2011 13:18:59 +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 72CF88FC0A; Thu, 24 Nov 2011 13:18:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAODIxkV097400; Thu, 24 Nov 2011 13:18:59 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAODIxUh097397; Thu, 24 Nov 2011 13:18:59 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201111241318.pAODIxUh097397@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 24 Nov 2011 13:18: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: r227933 - in head: . lib/libpam/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 13:18:59 -0000 Author: des Date: Thu Nov 24 13:18:58 2011 New Revision: 227933 URL: http://svn.freebsd.org/changeset/base/227933 Log: Revert r227841 and part of r227798. We still build libpam in two passes, but we use STATIC_CFLAGS instead of our own private .c.o rule. MFC after: 3 weeks Modified: head/Makefile.inc1 head/lib/libpam/modules/Makefile.inc Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 24 13:13:50 2011 (r227932) +++ head/Makefile.inc1 Thu Nov 24 13:18:58 2011 (r227933) @@ -1230,7 +1230,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ - lib/libopie ${_lib_libthr} \ + lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ @@ -1323,7 +1323,7 @@ ${_lib}__PL: .PHONY .endif .endfor -.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs} +.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} ${_lib}__L: .PHONY .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ @@ -1335,6 +1335,17 @@ ${_lib}__L: .PHONY .endif .endfor +# libpam is special: we need to build static PAM modules before +# static PAM library, and dynamic PAM library before dynamic PAM +# modules. +lib/libpam__L: .PHONY + ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ + cd ${.CURDIR}/lib/libpam; \ + ${MAKE} DIRPRFX=lib/libpam/ obj; \ + ${MAKE} DIRPRFX=lib/libpam/ depend; \ + ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ + ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install + _prereq_libs: ${_prereq_libs:S/$/__PL/} _startup_libs: ${_startup_libs:S/$/__L/} _prebuild_libs: ${_prebuild_libs:S/$/__L/} Modified: head/lib/libpam/modules/Makefile.inc ============================================================================== --- head/lib/libpam/modules/Makefile.inc Thu Nov 24 13:13:50 2011 (r227932) +++ head/lib/libpam/modules/Makefile.inc Thu Nov 24 13:18:58 2011 (r227933) @@ -5,8 +5,17 @@ PAMDIR= ${.CURDIR}/../../../../contrib/ NO_INSTALLLIB= NO_PROFILE= -CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam +CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam +# This is nasty. +# For the static case, libpam.a depends on the modules. +# For the dynamic case, the modules depend on libpam.so.N +.if defined(_NO_LIBPAM_SO_YET) +NO_PIC= +.else SHLIB_NAME?= ${LIB}.so.${SHLIB_MAJOR} +DPADD+= ${LIBPAM} +LDADD+= -lpam +.endif .include "../Makefile.inc" From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 13:24: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 69B511065687; Thu, 24 Nov 2011 13:24:07 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58CE58FC0A; Thu, 24 Nov 2011 13:24:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAODO7De097594; Thu, 24 Nov 2011 13:24:07 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAODO7RL097591; Thu, 24 Nov 2011 13:24:07 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111241324.pAODO7RL097591@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 13:24: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: r227934 - head/usr.sbin/tzsetup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 13:24:07 -0000 Author: fjoe Date: Thu Nov 24 13:24:06 2011 New Revision: 227934 URL: http://svn.freebsd.org/changeset/base/227934 Log: Port to new libdialog. Modified: head/usr.sbin/tzsetup/Makefile head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/Makefile ============================================================================== --- head/usr.sbin/tzsetup/Makefile Thu Nov 24 13:18:58 2011 (r227933) +++ head/usr.sbin/tzsetup/Makefile Thu Nov 24 13:24:06 2011 (r227934) @@ -3,11 +3,11 @@ PROG= tzsetup MAN= tzsetup.8 -CFLAGS+= -I${.CURDIR}/../../gnu/lib/libodialog -I. +CFLAGS+= -I${.CURDIR}/../../contrib/dialog -I. WARNS?= 3 -DPADD= ${LIBODIALOG} ${LIBNCURSES} -LDADD= -lodialog -lncurses +DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} +LDADD= -ldialog -lncursesw -lm .include Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Thu Nov 24 13:18:58 2011 (r227933) +++ head/usr.sbin/tzsetup/tzsetup.c Thu Nov 24 13:24:06 2011 (r227934) @@ -35,7 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -49,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #define _PATH_ZONETAB "/usr/share/zoneinfo/zone.tab" #define _PATH_ISO3166 "/usr/share/misc/iso3166" #define _PATH_ZONEINFO "/usr/share/zoneinfo" @@ -56,8 +57,92 @@ __FBSDID("$FreeBSD$"); #define _PATH_DB "/var/db/zoneinfo" #define _PATH_WALL_CMOS_CLOCK "/etc/wall_cmos_clock" +/* special return codes for `fire' actions */ +#define DITEM_FAILURE 1 + +/* flags - returned in upper 16 bits of return status */ +#define DITEM_LEAVE_MENU (1 << 16) +#define DITEM_RECREATE (1 << 18) + +/* for use in describing more exotic behaviors */ +typedef struct dialogMenuItem { + char *prompt; + char *title; + int (*fire)(struct dialogMenuItem *self); + void *data; +} dialogMenuItem; + +static int +xdialog_menu(const char *title, const char *cprompt, int height, int width, + int menu_height, int item_no, dialogMenuItem *ditems) +{ + int i, result, choice; + DIALOG_LISTITEM *listitems; + DIALOG_VARS save_vars; + + dlg_save_vars(&save_vars); + + /* initialize list items */ + listitems = dlg_calloc(DIALOG_LISTITEM, item_no); + assert_ptr(listitems, "xdialog_menu"); + for (i = 0; i < item_no; i++) { + listitems[i].name = ditems[i].prompt; + listitems[i].text = ditems[i].title; + } + + /* calculate width */ + if (width < 0) { + int tag_x = 0; + + for (i = 0; i < item_no; i++) { + int j, l; + + l = strlen(listitems[i].name); + for (j = 0; j < item_no; j++) { + int k = strlen(listitems[j].text); + tag_x = MAX(tag_x, l + k + 2); + } + } + width = MAX(dlg_count_columns(cprompt), title != NULL ? dlg_count_columns(title) : 0); + width = MAX(width, tag_x + 4) + 4; + } + width = MAX(width, 24); + if (width > COLS) + width = COLS; + +again: + dialog_vars.default_item = ditems[choice].prompt; + result = dlg_menu(title, cprompt, height, width, + menu_height, item_no, listitems, &choice, NULL); + switch (result) { + case DLG_EXIT_ESC: + result = -1; + break; + case DLG_EXIT_OK: + if (ditems[choice].fire != NULL) { + int status; + + status = ditems[choice].fire(ditems + choice); + if (status & DITEM_RECREATE) { + dlg_clear(); + goto again; + } + } + result = 0; + break; + case DLG_EXIT_CANCEL: + default: + result = 1; + break; + } + + free(listitems); + dlg_restore_vars(&save_vars); + return result; +} + static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], - path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], + path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; static int reallydoit = 1; @@ -77,8 +162,6 @@ static int set_zone_utc(void); struct continent { dialogMenuItem *menu; int nitems; - int ch; - int sc; }; static struct continent africa, america, antarctica, arctic, asia, atlantic; @@ -98,7 +181,7 @@ static struct continent_names { { "Europe", &europe }, { "Indian", &indian }, { "Pacific", &pacific }, - { "UTC", &utc } + { "UTC", &utc } }; static struct continent_items { @@ -134,7 +217,7 @@ continent_country_menu(dialogMenuItem *c int rv; if (strcmp(continent->title, "UTC") == 0) - return set_zone_utc(); + return set_zone_utc(); /* Short cut -- if there's only one country, don't post a menu. */ if (contp->nitems == 1) @@ -152,8 +235,8 @@ continent_country_menu(dialogMenuItem *c } menulen = contp->nitems < 16 ? contp->nitems : 16; - rv = dialog_menu(title, prompt, -1, -1, menulen, -contp->nitems, - contp->menu, 0, &contp->ch, &contp->sc); + rv = xdialog_menu(title, prompt, -1, -1, menulen, contp->nitems, + contp->menu); if (rv == 0) return (DITEM_LEAVE_MENU); return (DITEM_RECREATE); @@ -266,7 +349,7 @@ add_zone_to_country(int lineno, const ch if (tlc[0] < 'A' || tlc[0] > 'Z' || tlc[1] < 'A' || tlc[1] > 'Z') errx(1, "%s:%d: country code `%s' invalid", path_zonetab, lineno, tlc); - + cp = &countries[CODE2INT(tlc)]; if (cp->name == 0) errx(1, "%s:%d: country code `%s' unknown", path_zonetab, @@ -280,7 +363,7 @@ add_zone_to_country(int lineno, const ch zp = malloc(sizeof(*zp)); if (zp == 0) errx(1, "malloc(%zu)", sizeof(*zp)); - + if (cp->nzones == 0) TAILQ_INIT(&cp->zones); @@ -451,9 +534,7 @@ make_menus(void) memset(dmi, 0, sizeof(*dmi)); asprintf(&dmi->prompt, "%d", ++cp->continent->nitems); dmi->title = cp->name; - dmi->checked = 0; dmi->fire = set_zone_whole_country; - dmi->selected = 0; dmi->data = cp; } else { cp->submenu = malloc(cp->nzones * sizeof(*dmi)); @@ -466,9 +547,7 @@ make_menus(void) memset(dmi, 0, sizeof(*dmi)); asprintf(&dmi->prompt, "%d", ++cp->nzones); dmi->title = zp->descr; - dmi->checked = 0; dmi->fire = set_zone_multi; - dmi->selected = 0; dmi->data = zp; for (zp2 = TAILQ_FIRST(&cp->zones); @@ -482,9 +561,7 @@ make_menus(void) memset(dmi, 0, sizeof(*dmi)); asprintf(&dmi->prompt, "%d", ++cont->nitems); dmi->title = cp->name; - dmi->checked = 0; dmi->fire = set_zone_menu; - dmi->selected = 0; dmi->data = cp; } } @@ -503,8 +580,8 @@ set_zone_menu(dialogMenuItem *dmi) snprintf(prompt, sizeof(prompt), "Select a zone which observes the same time as your locality."); menulen = cp->nzones < 16 ? cp->nzones : 16; - rv = dialog_menu(title, prompt, -1, -1, menulen, -cp->nzones, - cp->submenu, 0, 0, 0); + rv = xdialog_menu(title, prompt, -1, -1, menulen, cp->nzones, + cp->submenu); if (rv != 0) return (DITEM_RECREATE); return (DITEM_LEAVE_MENU); @@ -515,7 +592,7 @@ set_zone_utc(void) { if (!confirm_zone(NULL)) return (DITEM_FAILURE | DITEM_RECREATE); - + return (install_zoneinfo_file(NULL)); } @@ -559,7 +636,7 @@ install_zoneinfo_file(const char *zonein "Could not delete %s: %s", path_localtime, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); @@ -571,7 +648,7 @@ install_zoneinfo_file(const char *zonein "Could not delete %s: %s", path_db, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); @@ -579,7 +656,7 @@ install_zoneinfo_file(const char *zonein } return (DITEM_LEAVE_MENU); } - + if (copymode) { fd1 = open(zoneinfo_file, O_RDONLY, 0); if (fd1 < 0) { @@ -588,7 +665,7 @@ install_zoneinfo_file(const char *zonein "Could not open %s: %s", zoneinfo_file, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -603,7 +680,7 @@ install_zoneinfo_file(const char *zonein "Could not open %s: %s", path_localtime, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -619,7 +696,7 @@ install_zoneinfo_file(const char *zonein "Error copying %s to %s %s", zoneinfo_file, path_localtime, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); /* Better to leave none than a corrupt one. */ @@ -635,7 +712,7 @@ install_zoneinfo_file(const char *zonein "Cannot access %s: %s", zoneinfo_file, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -648,7 +725,7 @@ install_zoneinfo_file(const char *zonein path_localtime, zoneinfo_file, strerror(errno)); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -667,7 +744,7 @@ install_zoneinfo_file(const char *zonein "Created symbolic link from %s to %s", zoneinfo_file, path_localtime); if (usedialog) - dialog_mesgbox(title, prompt, 8, 72); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); #endif @@ -701,7 +778,7 @@ confirm_zone(const char *filename) time_t t = time(0); struct tm *tm; int rv; - + setenv("TZ", filename == NULL ? "" : filename, 1); tzset(); tm = localtime(&t); @@ -748,12 +825,6 @@ usage(void) exit(1); } -#if defined(__sparc64__) -#define DIALOG_UTC dialog_yesno -#else -#define DIALOG_UTC dialog_noyes -#endif - int main(int argc, char **argv) { @@ -858,15 +929,24 @@ main(int argc, char **argv) /* FALLTHROUGH */ } - init_dialog(); + init_dialog(stdin, stdout); if (skiputc == 0) { + DIALOG_VARS save_vars; + int yesno; + snprintf(title, sizeof(title), "Select local or UTC (Greenwich Mean Time) clock"); snprintf(prompt, sizeof(prompt), "Is this machine's CMOS clock set to UTC? " "If it is set to local time,\n" "or you don't know, please choose NO here!"); - if (!DIALOG_UTC(title, prompt, 7, 72)) { + dlg_save_vars(&save_vars); +#if !defined(__sparc64__) + dialog_vars.defaultno = TRUE; +#endif + yesno = dialog_yesno(title, prompt, 7, 73); + dlg_restore_vars(&save_vars); + if (!yesno) { if (reallydoit) unlink(path_wall_cmos_clock); } else { @@ -882,7 +962,7 @@ main(int argc, char **argv) close(fd); } } - dialog_clear_norefresh(); + dlg_clear(); } if (optind == argc - 1) { snprintf(title, sizeof(title), "Default timezone provided"); @@ -890,18 +970,18 @@ main(int argc, char **argv) "\nUse the default `%s' zone?", argv[optind]); if (!dialog_yesno(title, prompt, 7, 72)) { rv = install_zoneinfo_file(argv[optind]); - dialog_clear(); + dlg_clear(); end_dialog(); exit(rv & ~DITEM_LEAVE_MENU); } - dialog_clear_norefresh(); + dlg_clear(); } snprintf(title, sizeof(title), "Time Zone Selector"); snprintf(prompt, sizeof(prompt), "Select a region"); - dialog_menu(title, prompt, -1, -1, NCONTINENTS, -NCONTINENTS, - continents, 0, NULL, NULL); + xdialog_menu(title, prompt, -1, -1, NCONTINENTS, NCONTINENTS, + continents); - dialog_clear(); + dlg_clear(); end_dialog(); return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 14:16: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 B05521065673; Thu, 24 Nov 2011 14:16:01 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 874148FC08; Thu, 24 Nov 2011 14:16:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOEG1oi099179; Thu, 24 Nov 2011 14:16:01 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOEG1QQ099178; Thu, 24 Nov 2011 14:16:01 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111241416.pAOEG1QQ099178@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 14:16: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: r227935 - head/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: Thu, 24 Nov 2011 14:16:01 -0000 Author: fjoe Date: Thu Nov 24 14:16:01 2011 New Revision: 227935 URL: http://svn.freebsd.org/changeset/base/227935 Log: Utility script to build specific parts of the source tree on all arches Added: head/tools/tinder.sh (contents, props changed) Added: head/tools/tinder.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tinder.sh Thu Nov 24 14:16:01 2011 (r227935) @@ -0,0 +1,58 @@ +#!/bin/sh +# +# Copyright (c) 2011 Max Khon, The FreeBSD Project +# 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$ +# + +# +# Utility script to build specific parts of the source tree on all arches +# +# Example: +# +# cd /usr/src +# make toolchains # build toolchain for all arches +# sh tools/tinder.sh gnu/lib/libdialog usr.sbin/sade NO_CLEAN=yes +# # build libdialog and sade for all architectures +# # without making clean +# + +if [ $# -eq 0 ]; then + echo 1>&2 "Usage: `basename $0` [MAKEVAR=value...] path..." + exit 1 +fi + +# MAKE_ARGS is intentionally not reset to allow caller to specify additional MAKE_ARGS +SUBDIR= +for i in "$@"; do + case "$i" in + *=*) + MAKE_ARGS="$MAKE_ARGS $i" + ;; + *) + SUBDIR="$SUBDIR $i" + esac +done +make tinderbox UNIVERSE_TARGET="_cleanobj _obj _depend everything" $MAKE_ARGS SUBDIR_OVERRIDE="$SUBDIR" From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 14:17: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 DEC7A106566B; Thu, 24 Nov 2011 14:17:04 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEF918FC19; Thu, 24 Nov 2011 14:17:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOEH4ta099242; Thu, 24 Nov 2011 14:17:04 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOEH46a099240; Thu, 24 Nov 2011 14:17:04 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111241417.pAOEH46a099240@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 14:17: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: r227936 - head/gnu/usr.bin/dialog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 14:17:05 -0000 Author: fjoe Date: Thu Nov 24 14:17:04 2011 New Revision: 227936 URL: http://svn.freebsd.org/changeset/base/227936 Log: Use ${VAR} instead of $(VAR) consistently. Modified: head/gnu/usr.bin/dialog/Makefile Modified: head/gnu/usr.bin/dialog/Makefile ============================================================================== --- head/gnu/usr.bin/dialog/Makefile Thu Nov 24 14:16:01 2011 (r227935) +++ head/gnu/usr.bin/dialog/Makefile Thu Nov 24 14:17:04 2011 (r227936) @@ -3,7 +3,7 @@ DIALOG= ${.CURDIR}/../../../contrib/dialog PROG= dialog -DPADD= $(LIBDIALOG) $(LIBNCURSES) $(LIBM) +DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBM} LDADD= -ldialog -lncursesw -lm CFLAGS+= -I${.CURDIR} -I${DIALOG} .PATH: ${DIALOG} From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 14:22: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 67D7C1065670; Thu, 24 Nov 2011 14:22:06 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3B98FC0C; Thu, 24 Nov 2011 14:22:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOEM6LU099446; Thu, 24 Nov 2011 14:22:06 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOEM6tQ099444; Thu, 24 Nov 2011 14:22:06 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111241422.pAOEM6tQ099444@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 14:22: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: r227937 - head/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: Thu, 24 Nov 2011 14:22:06 -0000 Author: fjoe Date: Thu Nov 24 14:22:05 2011 New Revision: 227937 URL: http://svn.freebsd.org/changeset/base/227937 Log: Add missing ;; Modified: head/tools/tinder.sh Modified: head/tools/tinder.sh ============================================================================== --- head/tools/tinder.sh Thu Nov 24 14:17:04 2011 (r227936) +++ head/tools/tinder.sh Thu Nov 24 14:22:05 2011 (r227937) @@ -53,6 +53,7 @@ for i in "$@"; do ;; *) SUBDIR="$SUBDIR $i" + ;; esac done make tinderbox UNIVERSE_TARGET="_cleanobj _obj _depend everything" $MAKE_ARGS SUBDIR_OVERRIDE="$SUBDIR" From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 15:12: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 C46A8106564A; Thu, 24 Nov 2011 15:12:57 +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 9B32C8FC08; Thu, 24 Nov 2011 15:12:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOFCvpT001148; Thu, 24 Nov 2011 15:12:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOFCv4c001146; Thu, 24 Nov 2011 15:12:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111241512.pAOFCv4c001146@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Nov 2011 15:12: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: r227938 - head/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, 24 Nov 2011 15:12:57 -0000 Author: adrian Date: Thu Nov 24 15:12:57 2011 New Revision: 227938 URL: http://svn.freebsd.org/changeset/base/227938 Log: I've had verification that the second-last 64k is actually used by the tplink firmware to store configuration data. It's safe to overwrite it. Modified: head/sys/mips/conf/TP-WN1043ND.hints Modified: head/sys/mips/conf/TP-WN1043ND.hints ============================================================================== --- head/sys/mips/conf/TP-WN1043ND.hints Thu Nov 24 14:22:05 2011 (r227937) +++ head/sys/mips/conf/TP-WN1043ND.hints Thu Nov 24 15:12:57 2011 (r227938) @@ -38,9 +38,8 @@ hint.ath.0.eepromaddr=0x1fff1000 # So: # 128k: uboot # 2048k: kernel -# 5824k: rootfs +# 5888k: rootfs # 64k: config -# 64k: board config? # 64k: ART hint.map.0.at="flash/spi0" @@ -57,38 +56,22 @@ hint.map.1.readonly=1 hint.map.2.at="flash/spi0" hint.map.2.start=0x00220000 -hint.map.2.end=0x007c0000 +hint.map.2.end=0x007e0000 hint.map.2.name="rootfs" hint.map.2.readonly=1 hint.map.3.at="flash/spi0" -hint.map.3.start=0x007c0000 -hint.map.3.end=0x007d0000 +hint.map.3.start=0x007e0000 +hint.map.3.end=0x007f0000 hint.map.3.name="cfg" hint.map.3.readonly=0 -# I'm not sure what this is! -# -# It does however start with "55 aa" which is an AR5416 EEPROM -# magic value, followed by what looks like a set of ethernet -# MAC addresses, then a bunch of what looks like my local firmware -# board configuration. -# -# For now, I'm going to leave this particular chunk of flash -# alone. -# -hint.map.4.at="flash/spi0" -hint.map.4.start=0x007d0000 -hint.map.4.end=0x007e0000 -hint.map.4.name="unknown" -hint.map.4.readonly=1 - # This is radio calibration section. It is (or should be!) unique # for each board, to take into account thermal and electrical differences # as well as the regulatory compliance data. # -hint.map.5.at="flash/spi0" -hint.map.5.start=0x007f0000 -hint.map.5.end=0x00800000 -hint.map.5.name="art" -hint.map.5.readonly=1 +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007f0000 +hint.map.4.end=0x00800000 +hint.map.4.name="art" +hint.map.4.readonly=1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 15:47: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 399E3106564A; Thu, 24 Nov 2011 15:47:02 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 290C98FC0A; Thu, 24 Nov 2011 15:47:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOFl2Vn002227; Thu, 24 Nov 2011 15:47:02 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOFl2RA002220; Thu, 24 Nov 2011 15:47:02 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111241547.pAOFl2RA002220@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 15:47: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: r227939 - head/usr.sbin/sade X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 15:47:02 -0000 Author: fjoe Date: Thu Nov 24 15:47:01 2011 New Revision: 227939 URL: http://svn.freebsd.org/changeset/base/227939 Log: Disk selection dialog is now a normal menu, not a checkboxed menu: checkboxed menu is confusing and also can not be implemented in new libdialog. Modified: head/usr.sbin/sade/devices.c head/usr.sbin/sade/disks.c head/usr.sbin/sade/install.c head/usr.sbin/sade/label.c head/usr.sbin/sade/menus.c head/usr.sbin/sade/sade.h Modified: head/usr.sbin/sade/devices.c ============================================================================== --- head/usr.sbin/sade/devices.c Thu Nov 24 15:12:57 2011 (r227938) +++ head/usr.sbin/sade/devices.c Thu Nov 24 15:47:01 2011 (r227939) @@ -122,7 +122,7 @@ deviceTry(struct _devname dev, char *try /* Register a new device in the devices array */ Device * -deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, +deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean (*init)(Device *), FILE * (*get)(Device *, char *, Boolean), void (*shutdown)(Device *), void *private) { @@ -135,7 +135,6 @@ deviceRegister(char *name, char *desc, c newdev->description = desc; newdev->devname = devname; newdev->type = type; - newdev->enabled = enabled; newdev->init = init ? init : dummyInit; newdev->get = get ? get : dummyGet; newdev->shutdown = shutdown ? shutdown : dummyShutdown; @@ -223,7 +222,7 @@ deviceGetAll(void) continue; } - deviceRegister(names[i], names[i], d->name, DEVICE_TYPE_DISK, FALSE, + deviceRegister(names[i], names[i], d->name, DEVICE_TYPE_DISK, dummyInit, dummyGet, dummyShutdown, d); if (isDebug()) msgDebug("Found a disk device named %s\n", names[i]); @@ -237,7 +236,7 @@ deviceGetAll(void) /* Got one! */ snprintf(devname, sizeof devname, "/dev/%s", c1->name); - dev = deviceRegister(c1->name, c1->name, strdup(devname), DEVICE_TYPE_DOS, TRUE, + dev = deviceRegister(c1->name, c1->name, strdup(devname), DEVICE_TYPE_DOS, mediaInitDOS, mediaGetDOS, mediaShutdownDOS, NULL); dev->private = c1; if (isDebug()) @@ -314,7 +313,7 @@ deviceCount(Device **devs) * menu is cloned. */ DMenu * -deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d)) +deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d)) { Device **devs; int numdevs; @@ -338,7 +337,6 @@ deviceCreateMenu(DMenu *menu, DeviceType if (j == numDevs) tmp->items[i].title = ""; tmp->items[i].fire = hook; - tmp->items[i].checked = check; } tmp->items[i].title = NULL; return tmp; Modified: head/usr.sbin/sade/disks.c ============================================================================== --- head/usr.sbin/sade/disks.c Thu Nov 24 15:12:57 2011 (r227938) +++ head/usr.sbin/sade/disks.c Thu Nov 24 15:47:01 2011 (r227939) @@ -305,25 +305,6 @@ getBootMgr(char *dname, u_char **bootCod #endif #endif /* WITH_SLICES */ -int -diskGetSelectCount(Device ***devs) -{ - int i, cnt, enabled; - char *cp; - Device **dp; - - cp = variable_get(VAR_DISK); - dp = *devs = deviceFind(cp, DEVICE_TYPE_DISK); - cnt = deviceCount(dp); - if (!cnt) - return -1; - for (i = 0, enabled = 0; i < cnt; i++) { - if (dp[i]->enabled) - ++enabled; - } - return enabled; -} - #ifdef WITH_SLICES void diskPartition(Device *dev) @@ -641,7 +622,7 @@ diskPartition(Device *dev) Set_Boot_Mgr(d, mbrContents, mbrSize); #endif - if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS) + if (DITEM_STATUS(diskPartitionWrite(dev)) != DITEM_SUCCESS) msgConfirm("Disk partition write returned an error status!"); else msgConfirm("Wrote FDISK partition information out successfully."); @@ -770,7 +751,7 @@ bootalloc(char *name, size_t *size) } #endif /* !__ia64__ */ -#ifdef WITH_SLICES +#ifdef WITH_SLICES static int partitionHook(dialogMenuItem *selected) { @@ -781,58 +762,28 @@ partitionHook(dialogMenuItem *selected) msgConfirm("Unable to find disk %s!", selected->prompt); return DITEM_FAILURE; } - /* Toggle enabled status? */ - if (!devs[0]->enabled) { - devs[0]->enabled = TRUE; - diskPartition(devs[0]); - } - else - devs[0]->enabled = FALSE; + diskPartition(devs[0]); return DITEM_SUCCESS; } -static int -partitionCheck(dialogMenuItem *selected) -{ - Device **devs = NULL; - - devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); - if (!devs || devs[0]->enabled == FALSE) - return FALSE; - return TRUE; -} - int diskPartitionEditor(dialogMenuItem *self) { DMenu *menu; Device **devs; - int i, cnt, devcnt; - cnt = diskGetSelectCount(&devs); - devcnt = deviceCount(devs); - if (cnt == -1) { + devs = deviceFind(variable_get(VAR_DISK), DEVICE_TYPE_DISK); + if (devs == NULL) { msgConfirm("No disks found! Please verify that your disk controller is being\n" "properly probed at boot time. See the Hardware Guide on the\n" "Documentation menu for clues on diagnosing this type of problem."); return DITEM_FAILURE; } - else if (cnt) { - /* Some are already selected */ - for (i = 0; i < devcnt; i++) { - if (devs[i]->enabled) { - if (variable_get(VAR_NONINTERACTIVE) && - !variable_get(VAR_DISKINTERACTIVE)) - diskPartitionNonInteractive(devs[i]); - else - diskPartition(devs[i]); - } - } - } else { /* No disks are selected, fall-back case now */ - if (devcnt == 1) { - devs[0]->enabled = TRUE; + int cnt = deviceCount(devs); + + if (cnt == 1) { if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) diskPartitionNonInteractive(devs[0]); @@ -841,7 +792,9 @@ diskPartitionEditor(dialogMenuItem *self return DITEM_SUCCESS; } else { - menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook, partitionCheck); + int result; + + menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook); if (!menu) { msgConfirm("No devices suitable for installation found!\n\n" "Please verify that your disk controller (and attached drives)\n" @@ -850,11 +803,10 @@ diskPartitionEditor(dialogMenuItem *self "the boot messages. Press [Scroll Lock] again to return."); return DITEM_FAILURE; } - else { - i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; - free(menu); - } - return i; + + result = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; + free(menu); + return result; } } return DITEM_SUCCESS; @@ -862,48 +814,34 @@ diskPartitionEditor(dialogMenuItem *self #endif /* WITH_SLICES */ int -diskPartitionWrite(dialogMenuItem *self) +diskPartitionWrite(Device *dev) { - Device **devs; - int i; - - if (!variable_cmp(DISK_PARTITIONED, "written")) - return DITEM_SUCCESS; - - devs = deviceFind(NULL, DEVICE_TYPE_DISK); - if (!devs) { - msgConfirm("Unable to find any disks to write to??"); - return DITEM_FAILURE; - } - if (isDebug()) - msgDebug("diskPartitionWrite: Examining %d devices\n", deviceCount(devs)); - for (i = 0; devs[i]; i++) { - Disk *d = (Disk *)devs[i]->private; + Disk *d = (Disk *)dev->private; #if !defined(__ia64__) - static u_char *boot1; + static u_char *boot1; #endif #if defined(__i386__) || defined(__amd64__) - static u_char *boot2; + static u_char *boot2; #endif - if (!devs[i]->enabled) - continue; + if (!variable_cmp(DISK_PARTITIONED, "written")) + return DITEM_SUCCESS; #if defined(__i386__) || defined(__amd64__) - if (!boot1) boot1 = bootalloc("boot1", NULL); - if (!boot2) boot2 = bootalloc("boot2", NULL); - Set_Boot_Blocks(d, boot1, boot2); + if (!boot1) boot1 = bootalloc("boot1", NULL); + if (!boot2) boot2 = bootalloc("boot2", NULL); + Set_Boot_Blocks(d, boot1, boot2); #elif !defined(__ia64__) - if (!boot1) boot1 = bootalloc("boot1", NULL); - Set_Boot_Blocks(d, boot1, NULL); + if (!boot1) boot1 = bootalloc("boot1", NULL); + Set_Boot_Blocks(d, boot1, NULL); #endif - msgNotify("Writing partition information to drive %s", d->name); - if (!Fake && Write_Disk(d)) { - msgConfirm("ERROR: Unable to write data to disk %s!", d->name); - return DITEM_FAILURE; - } + msgNotify("Writing partition information to drive %s", d->name); + if (!Fake && Write_Disk(d)) { + msgConfirm("ERROR: Unable to write data to disk %s!", d->name); + return DITEM_FAILURE; } + /* Now it's not "yes", but "written" */ variable_set2(DISK_PARTITIONED, "written", 0); return DITEM_SUCCESS | DITEM_RESTORE; Modified: head/usr.sbin/sade/install.c ============================================================================== --- head/usr.sbin/sade/install.c Thu Nov 24 15:12:57 2011 (r227938) +++ head/usr.sbin/sade/install.c Thu Nov 24 15:47:01 2011 (r227939) @@ -113,12 +113,10 @@ performNewfs(PartInfo *pi, char *dname, /* Go newfs and/or mount all the filesystems we've been asked to */ int -installFilesystems(dialogMenuItem *self) +installFilesystems(Device *dev) { - int i; - Disk *disk; + Disk *disk = (Disk *)dev->private; Chunk *c1, *c2; - Device **devs; PartInfo *root; char dname[80]; Boolean upgrade = FALSE; @@ -136,84 +134,77 @@ installFilesystems(dialogMenuItem *self) command_clear(); /* Now buzz through the rest of the partitions and mount them too */ - devs = deviceFind(NULL, DEVICE_TYPE_DISK); - for (i = 0; devs[i]; i++) { - if (!devs[i]->enabled) - continue; - - disk = (Disk *)devs[i]->private; - if (!disk->chunks) { - msgConfirm("No chunk list found for %s!", disk->name); - return DITEM_FAILURE | DITEM_RESTORE; - } - for (c1 = disk->chunks->part; c1; c1 = c1->next) { + if (!disk->chunks) { + msgConfirm("No chunk list found for %s!", disk->name); + return DITEM_FAILURE | DITEM_RESTORE; + } + for (c1 = disk->chunks->part; c1; c1 = c1->next) { #ifdef __ia64__ - if (c1->type == part) { - c2 = c1; - { + if (c1->type == part) { + c2 = c1; + { #elif defined(__powerpc__) - if (c1->type == apple) { - for (c2 = c1->part; c2; c2 = c2->next) { + if (c1->type == apple) { + for (c2 = c1->part; c2; c2 = c2->next) { #else - if (c1->type == freebsd) { - for (c2 = c1->part; c2; c2 = c2->next) { + if (c1->type == freebsd) { + for (c2 = c1->part; c2; c2 = c2->next) { #endif - if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { - PartInfo *tmp = (PartInfo *)c2->private_data; + if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { + PartInfo *tmp = (PartInfo *)c2->private_data; - /* Already did root */ - if (c2 == RootChunk) - continue; - - sprintf(dname, "/dev/%s", c2->name); - - if (tmp->do_newfs && (!upgrade || - !msgNoYes("You are upgrading - are you SURE you" - " want to newfs /dev/%s?", c2->name))) - performNewfs(tmp, dname, QUEUE_YES); - else - command_shell_add(tmp->mountpoint, - "fsck_ffs -y /dev/%s", c2->name); - command_func_add(tmp->mountpoint, Mount, c2->name); - } - else if (c2->type == part && c2->subtype == FS_SWAP) { - char fname[80]; - int i; - - if (c2 == SwapChunk) - continue; - sprintf(fname, "/dev/%s", c2->name); - i = (Fake || swapon(fname)); - if (!i) { - dialog_clear_norefresh(); - msgNotify("Added %s as an additional swap device", fname); - } - else { - msgConfirm("Unable to add %s as a swap device: %s", fname, strerror(errno)); - } - } - } - } - else if (c1->type == fat && c1->private_data && - (root->do_newfs || upgrade)) { - char name[FILENAME_MAX]; - - sprintf(name, "/%s", ((PartInfo *)c1->private_data)->mountpoint); - Mkdir(name); - } + /* Already did root */ + if (c2 == RootChunk) + continue; + + sprintf(dname, "/dev/%s", c2->name); + + if (tmp->do_newfs && (!upgrade || + !msgNoYes("You are upgrading - are you SURE you" + " want to newfs /dev/%s?", c2->name))) + performNewfs(tmp, dname, QUEUE_YES); + else + command_shell_add(tmp->mountpoint, + "fsck_ffs -y /dev/%s", c2->name); + command_func_add(tmp->mountpoint, Mount, c2->name); + } + else if (c2->type == part && c2->subtype == FS_SWAP) { + char fname[80]; + int i; + + if (c2 == SwapChunk) + continue; + sprintf(fname, "/dev/%s", c2->name); + i = (Fake || swapon(fname)); + if (!i) { + dialog_clear_norefresh(); + msgNotify("Added %s as an additional swap device", fname); + } + else { + msgConfirm("Unable to add %s as a swap device: %s", fname, strerror(errno)); + } + } + } + } + else if (c1->type == fat && c1->private_data && + (root->do_newfs || upgrade)) { + char name[FILENAME_MAX]; + + sprintf(name, "/%s", ((PartInfo *)c1->private_data)->mountpoint); + Mkdir(name); + } #if defined(__ia64__) - else if (c1->type == efi && c1->private_data) { - PartInfo *pi = (PartInfo *)c1->private_data; + else if (c1->type == efi && c1->private_data) { + PartInfo *pi = (PartInfo *)c1->private_data; - sprintf(dname, "/dev/%s", c1->name); + sprintf(dname, "/dev/%s", c1->name); - if (pi->do_newfs && (!upgrade || - !msgNoYes("You are upgrading - are you SURE you want to " - "newfs /dev/%s?", c1->name))) - performNewfs(pi, dname, QUEUE_YES); - } + if (pi->do_newfs && (!upgrade || + !msgNoYes("You are upgrading - are you SURE you want to " + "newfs /dev/%s?", c1->name))) + performNewfs(pi, dname, QUEUE_YES); + } #endif - } } command_sort(); Modified: head/usr.sbin/sade/label.c ============================================================================== --- head/usr.sbin/sade/label.c Thu Nov 24 15:12:57 2011 (r227938) +++ head/usr.sbin/sade/label.c Thu Nov 24 15:47:01 2011 (r227939) @@ -110,7 +110,7 @@ static int label_focus = 0, pslice_focus static int diskLabel(Device *dev); static int diskLabelNonInteractive(Device *dev); -static char *try_auto_label(Device **devs, Device *dev, int perc, int *req); +static char *try_auto_label(Device *dev, int perc, int *req); static int labelHook(dialogMenuItem *selected) @@ -122,86 +122,59 @@ labelHook(dialogMenuItem *selected) msgConfirm("Unable to find disk %s!", selected->prompt); return DITEM_FAILURE; } - /* Toggle enabled status? */ - if (!devs[0]->enabled) { - devs[0]->enabled = TRUE; - diskLabel(devs[0]); - } - else - devs[0]->enabled = FALSE; + diskLabel(devs[0]); return DITEM_SUCCESS; } -static int -labelCheck(dialogMenuItem *selected) -{ - Device **devs = NULL; - - devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); - if (!devs || devs[0]->enabled == FALSE) - return FALSE; - return TRUE; -} - int diskLabelEditor(dialogMenuItem *self) { DMenu *menu; Device **devs; - int i, cnt; + int result; - i = 0; - cnt = diskGetSelectCount(&devs); - if (cnt == -1) { + devs = deviceFind(variable_get(VAR_DISK), DEVICE_TYPE_DISK); + if (devs == NULL) { msgConfirm("No disks found! Please verify that your disk controller is being\n" "properly probed at boot time. See the Hardware Guide on the\n" "Documentation menu for clues on diagnosing this type of problem."); return DITEM_FAILURE; } - else if (cnt) { - /* Some are already selected */ - if (variable_get(VAR_NONINTERACTIVE) && - !variable_get(VAR_DISKINTERACTIVE)) - i = diskLabelNonInteractive(NULL); - else - i = diskLabel(NULL); - } else { /* No disks are selected, fall-back case now */ - cnt = deviceCount(devs); + int cnt = deviceCount(devs); if (cnt == 1) { - devs[0]->enabled = TRUE; if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) - i = diskLabelNonInteractive(devs[0]); + result = diskLabelNonInteractive(devs[0]); else - i = diskLabel(devs[0]); + result = diskLabel(devs[0]); } else { - menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, labelHook, labelCheck); + menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, labelHook); if (!menu) { msgConfirm("No devices suitable for installation found!\n\n" "Please verify that your disk controller (and attached drives)\n" "were detected properly. This can be done by pressing the\n" "[Scroll Lock] key and using the Arrow keys to move back to\n" "the boot messages. Press [Scroll Lock] again to return."); - i = DITEM_FAILURE; + result = DITEM_FAILURE; } else { - i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; + result = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } } } - if (DITEM_STATUS(i) != DITEM_FAILURE) { + if (DITEM_STATUS(result) != DITEM_FAILURE) { if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); } - return i; + return result; } int -diskLabelCommit(dialogMenuItem *self) +diskLabelCommit(Device *dev) { char *cp; int i; @@ -214,9 +187,9 @@ diskLabelCommit(dialogMenuItem *self) i = DITEM_FAILURE; } /* The routine will guard against redundant writes, just as this one does */ - else if (DITEM_STATUS(diskPartitionWrite(self)) != DITEM_SUCCESS) + else if (DITEM_STATUS(diskPartitionWrite(dev)) != DITEM_SUCCESS) i = DITEM_FAILURE; - else if (DITEM_STATUS(installFilesystems(self)) != DITEM_SUCCESS) + else if (DITEM_STATUS(installFilesystems(dev)) != DITEM_SUCCESS) i = DITEM_FAILURE; else { msgInfo("All filesystem information written successfully."); @@ -258,98 +231,87 @@ space_free(struct chunk *c) /* Snapshot the current situation into the displayed chunks structure */ static void -record_label_chunks(Device **devs, Device *dev) +record_label_chunks(Device *dev) { - int i, j, p; + int j, p; struct chunk *c1, *c2; - Disk *d; + Disk *d = (Disk *)dev->private; j = p = 0; /* First buzz through and pick up the FreeBSD slices */ - for (i = 0; devs[i]; i++) { - if ((dev && devs[i] != dev) || !devs[i]->enabled) - continue; - d = (Disk *)devs[i]->private; - if (!d->chunks) - msgFatal("No chunk list found for %s!", d->name); + if (!d->chunks) + msgFatal("No chunk list found for %s!", d->name); #ifdef __ia64__ - label_chunk_info[j].type = PART_SLICE; - label_chunk_info[j].c = d->chunks; - j++; + label_chunk_info[j].type = PART_SLICE; + label_chunk_info[j].c = d->chunks; + j++; #endif - /* Put the slice entries first */ - for (c1 = d->chunks->part; c1; c1 = c1->next) { - if (c1->type == freebsd) { - label_chunk_info[j].type = PART_SLICE; - label_chunk_info[j].c = c1; - ++j; - } + /* Put the slice entries first */ + for (c1 = d->chunks->part; c1; c1 = c1->next) { + if (c1->type == freebsd) { + label_chunk_info[j].type = PART_SLICE; + label_chunk_info[j].c = c1; + ++j; + } #ifdef __powerpc__ - if (c1->type == apple) { - label_chunk_info[j].type = PART_SLICE; - label_chunk_info[j].c = c1; - ++j; - } + if (c1->type == apple) { + label_chunk_info[j].type = PART_SLICE; + label_chunk_info[j].c = c1; + ++j; + } #endif - } } - /* Now run through again and get the FreeBSD partition entries */ - for (i = 0; devs[i]; i++) { - if (!devs[i]->enabled) - continue; - d = (Disk *)devs[i]->private; - /* Then buzz through and pick up the partitions */ - for (c1 = d->chunks->part; c1; c1 = c1->next) { - if (c1->type == freebsd) { - for (c2 = c1->part; c2; c2 = c2->next) { - if (c2->type == part) { - if (c2->subtype == FS_SWAP) - label_chunk_info[j].type = PART_SWAP; - else - label_chunk_info[j].type = PART_FILESYSTEM; - label_chunk_info[j].c = c2; - ++j; - } - } - } - else if (c1->type == fat) { - label_chunk_info[j].type = PART_FAT; - label_chunk_info[j].c = c1; - ++j; - } + /* Then buzz through and pick up the partitions */ + for (c1 = d->chunks->part; c1; c1 = c1->next) { + if (c1->type == freebsd) { + for (c2 = c1->part; c2; c2 = c2->next) { + if (c2->type == part) { + if (c2->subtype == FS_SWAP) + label_chunk_info[j].type = PART_SWAP; + else + label_chunk_info[j].type = PART_FILESYSTEM; + label_chunk_info[j].c = c2; + ++j; + } + } + } + else if (c1->type == fat) { + label_chunk_info[j].type = PART_FAT; + label_chunk_info[j].c = c1; + ++j; + } #ifdef __ia64__ - else if (c1->type == efi) { - label_chunk_info[j].type = PART_EFI; - label_chunk_info[j].c = c1; - ++j; - } - else if (c1->type == part) { - if (c1->subtype == FS_SWAP) - label_chunk_info[j].type = PART_SWAP; - else - label_chunk_info[j].type = PART_FILESYSTEM; - label_chunk_info[j].c = c1; - ++j; - } + else if (c1->type == efi) { + label_chunk_info[j].type = PART_EFI; + label_chunk_info[j].c = c1; + ++j; + } + else if (c1->type == part) { + if (c1->subtype == FS_SWAP) + label_chunk_info[j].type = PART_SWAP; + else + label_chunk_info[j].type = PART_FILESYSTEM; + label_chunk_info[j].c = c1; + ++j; + } #endif #ifdef __powerpc__ - else if (c1->type == apple) { - for (c2 = c1->part; c2; c2 = c2->next) { - if (c2->type == part) { - if (c2->subtype == FS_SWAP) - label_chunk_info[j].type = PART_SWAP; - else - label_chunk_info[j].type = PART_FILESYSTEM; - label_chunk_info[j].c = c2; - ++j; - } - } - } + else if (c1->type == apple) { + for (c2 = c1->part; c2; c2 = c2->next) { + if (c2->type == part) { + if (c2->subtype == FS_SWAP) + label_chunk_info[j].type = PART_SWAP; + else + label_chunk_info[j].type = PART_FILESYSTEM; + label_chunk_info[j].c = c2; + ++j; + } + } + } #endif - } } label_chunk_info[j].c = NULL; if (here >= j) { @@ -845,22 +807,15 @@ diskLabel(Device *dev) char *msg = NULL; PartInfo *p, *oldp; PartType type; - Device **devs; WINDOW *w = savescr(); label_focus = 0; pslice_focus = 0; here = 0; - devs = deviceFind(NULL, DEVICE_TYPE_DISK); - if (!devs) { - msgConfirm("No disks found!"); - restorescr(w); - return DITEM_FAILURE; - } labeling = TRUE; keypad(stdscr, TRUE); - record_label_chunks(devs, dev); + record_label_chunks(dev); clear(); while (labeling) { @@ -883,7 +838,6 @@ diskLabel(Device *dev) refresh(); key = getch(); switch (toupper(key)) { - int i; static char _msg[40]; case '\014': /* ^L */ @@ -972,7 +926,7 @@ diskLabel(Device *dev) for (perc = 100; perc > 0; perc -= 5) { req = 0; /* reset for each loop */ - if ((msg = try_auto_label(devs, dev, perc, &req)) == NULL) + if ((msg = try_auto_label(dev, perc, &req)) == NULL) break; } if (msg) { @@ -1114,7 +1068,7 @@ diskLabel(Device *dev) tmp->private_free = safe_free; if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); - record_label_chunks(devs, dev); + record_label_chunks(dev); clear_wins(); /* This is where we assign focus to new label so it shows. */ { @@ -1151,7 +1105,7 @@ diskLabel(Device *dev) Delete_Chunk2(label_chunk_info[here].c->disk, label_chunk_info[here].c, rflags); if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); - record_label_chunks(devs, dev); + record_label_chunks(dev); break; case 'M': /* mount */ @@ -1183,7 +1137,7 @@ diskLabel(Device *dev) } if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); - record_label_chunks(devs, dev); + record_label_chunks(dev); clear_wins(); break; @@ -1252,22 +1206,18 @@ diskLabel(Device *dev) "it's too late to undo!"); } else if (!msgNoYes("Are you SURE you want to Undo everything?")) { + Disk *d; + variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); - for (i = 0; devs[i]; i++) { - Disk *d; - - if (!devs[i]->enabled) - continue; - else if ((d = Open_Disk(devs[i]->name)) != NULL) { - Free_Disk(devs[i]->private); - devs[i]->private = d; + if ((d = Open_Disk(dev->name)) != NULL) { + Free_Disk(dev->private); + dev->private = d; #ifdef WITH_SLICES - diskPartition(devs[i]); + diskPartition(dev); #endif - } } - record_label_chunks(devs, dev); + record_label_chunks(dev); } clear_wins(); break; @@ -1282,7 +1232,7 @@ diskLabel(Device *dev) "installation.\n\n" "Are you absolutely sure you want to continue?")) { variable_set2(DISK_LABELLED, "yes", 0); - diskLabelCommit(NULL); + diskLabelCommit(dev); } clear_wins(); break; @@ -1301,25 +1251,16 @@ diskLabel(Device *dev) if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected to understand!")) { - int i; - Device **devs; - dialog_clear(); end_dialog(); DialogActive = FALSE; - devs = deviceFind(NULL, DEVICE_TYPE_DISK); - if (!devs) { - msgConfirm("Can't find any disk devices!"); - break; - } - for (i = 0; devs[i] && ((Disk *)devs[i]->private); i++) { - if (devs[i]->enabled) - slice_wizard(((Disk *)devs[i]->private)); + if (dev->private) { + slice_wizard(((Disk *)dev->private)); } if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); DialogActive = TRUE; - record_label_chunks(devs, dev); + record_label_chunks(dev); clear_wins(); } else @@ -1378,7 +1319,7 @@ requested_part_size(char *varName, daddr * and /home. /home receives any extra left over disk space. */ static char * -try_auto_label(Device **devs, Device *dev, int perc, int *req) +try_auto_label(Device *dev, int perc, int *req) { daddr_t sz; Chunk *AutoHome, *AutoRoot, *AutoSwap; @@ -1413,7 +1354,7 @@ try_auto_label(Device **devs, Device *de AutoEfi->private_data = new_part(PART_EFI, "/efi", TRUE); AutoEfi->private_free = safe_free; AutoEfi->flags |= CHUNK_NEWFS; - record_label_chunks(devs, dev); + record_label_chunks(dev); } #endif @@ -1431,7 +1372,7 @@ try_auto_label(Device **devs, Device *de AutoRoot->private_data = new_part(PART_FILESYSTEM, "/", TRUE); AutoRoot->private_free = safe_free; AutoRoot->flags |= CHUNK_NEWFS; - record_label_chunks(devs, dev); + record_label_chunks(dev); } if (SwapChunk == NULL) { sz = requested_part_size(VAR_SWAP_SIZE, 0, 0, perc); @@ -1461,7 +1402,7 @@ try_auto_label(Device **devs, Device *de } AutoSwap->private_data = 0; AutoSwap->private_free = safe_free; - record_label_chunks(devs, dev); + record_label_chunks(dev); } if (VarChunk == NULL) { /* Work out how much extra space we want for a crash dump */ @@ -1492,7 +1433,7 @@ try_auto_label(Device **devs, Device *de AutoVar->private_data = new_part(PART_FILESYSTEM, "/var", TRUE); AutoVar->private_free = safe_free; AutoVar->flags |= CHUNK_NEWFS; - record_label_chunks(devs, dev); + record_label_chunks(dev); } if (TmpChunk == NULL && !variable_get(VAR_NO_TMP)) { sz = requested_part_size(VAR_TMP_SIZE, TMP_NOMINAL_SIZE, TMP_DEFAULT_SIZE, perc); @@ -1509,7 +1450,7 @@ try_auto_label(Device **devs, Device *de AutoTmp->private_data = new_part(PART_FILESYSTEM, "/tmp", TRUE); AutoTmp->private_free = safe_free; AutoTmp->flags |= CHUNK_NEWFS; - record_label_chunks(devs, dev); + record_label_chunks(dev); } if (UsrChunk == NULL && !variable_get(VAR_NO_USR)) { sz = requested_part_size(VAR_USR_SIZE, USR_NOMINAL_SIZE, USR_DEFAULT_SIZE, perc); @@ -1535,7 +1476,7 @@ try_auto_label(Device **devs, Device *de AutoUsr->private_data = new_part(PART_FILESYSTEM, "/usr", TRUE); AutoUsr->private_free = safe_free; AutoUsr->flags |= CHUNK_NEWFS; - record_label_chunks(devs, dev); + record_label_chunks(dev); } } #if AUTO_HOME == 1 @@ -1562,7 +1503,7 @@ try_auto_label(Device **devs, Device *de AutoHome->private_data = new_part(PART_FILESYSTEM, "/home", TRUE); AutoHome->private_free = safe_free; AutoHome->flags |= CHUNK_NEWFS; - record_label_chunks(devs, dev); + record_label_chunks(dev); } } #endif @@ -1585,7 +1526,7 @@ done: Delete_Chunk(AutoUsr->disk, AutoUsr); if (AutoHome != NULL) Delete_Chunk(AutoHome->disk, AutoHome); - record_label_chunks(devs, dev); + record_label_chunks(dev); } return(msg); } @@ -1616,7 +1557,7 @@ diskLabelNonInteractive(Device *dev) d = dev->private; else d = devs[0]->private; - record_label_chunks(devs, dev); + record_label_chunks(dev); for (i = 0; label_chunk_info[i].c; i++) { Chunk *c1 = label_chunk_info[i].c; Modified: head/usr.sbin/sade/menus.c ============================================================================== --- head/usr.sbin/sade/menus.c Thu Nov 24 15:12:57 2011 (r227938) +++ head/usr.sbin/sade/menus.c Thu Nov 24 15:47:01 2011 (r227939) @@ -42,14 +42,14 @@ static const char rcsid[] = */ DMenu MenuDiskDevices = { - DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, + DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select Drive(s)", - "Please select the drive, or drives, on which you wish to perform\n" - "this operation. If you are attempting to install a boot partition\n" + "Please select the drive on which you wish to perform this\n" + "operation. If you are attempting to install a boot partition\n" "on a drive other than the first one or have multiple operating\n" "systems on your machine, you will have the option to install a boot\n" "manager later. To select a drive, use the arrow keys to move to it\n" - "and press [SPACE] or [ENTER]. To de-select it, press it again.\n\n" + "and press [SPACE] or [ENTER].\n\n" "Use [TAB] to get to the buttons and leave this menu.", "Press F1 for important information regarding disk geometry!", "drives", Modified: head/usr.sbin/sade/sade.h ============================================================================== --- head/usr.sbin/sade/sade.h Thu Nov 24 15:12:57 2011 (r227938) +++ head/usr.sbin/sade/sade.h Thu Nov 24 15:47:01 2011 (r227939) @@ -184,7 +184,6 @@ typedef struct _device { char *description; char *devname; DeviceType type; - Boolean enabled; Boolean (*init)(struct _device *dev); FILE * (*get)(struct _device *dev, char *file, Boolean probe); void (*shutdown)(struct _device *dev); @@ -302,8 +301,7 @@ extern void command_shell_add(char *key, extern void command_func_add(char *key, commandFunc func, void *data); /* devices.c */ -extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), - int (*check)(dialogMenuItem *d)); +extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d)); extern void deviceGetAll(void); extern void deviceReset(void); extern void deviceRescan(void); @@ -311,7 +309,7 @@ extern Device **deviceFind(char *name, D extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); -extern Device *deviceRegister(char *name, char *desc, char *devicename, DeviceType type, Boolean enabled, +extern Device *deviceRegister(char *name, char *desc, char *devicename, DeviceType type, Boolean (*init)(Device *mediadev), FILE * (*get)(Device *dev, char *file, Boolean probe), void (*shutDown)(Device *mediadev), @@ -325,8 +323,7 @@ extern void dummyShutdown(Device *dev); extern void diskPartition(Device *dev); extern int diskPartitionEditor(dialogMenuItem *self); #endif -extern int diskPartitionWrite(dialogMenuItem *self); -extern int diskGetSelectCount(Device ***devs); +extern int diskPartitionWrite(Device *dev); /* dispatch.c */ extern int dispatchCommand(char *command); @@ -366,7 +363,7 @@ extern void globalsInit(void); extern Boolean checkLabels(Boolean whinge); extern int installCommit(dialogMenuItem *self); extern int installCustomCommit(dialogMenuItem *self); -extern int installFilesystems(dialogMenuItem *self); +extern int installFilesystems(Device *dev); extern int installVarDefaults(dialogMenuItem *self); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 17:21: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 B19F61065670; Thu, 24 Nov 2011 17:21:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87A6D8FC12; Thu, 24 Nov 2011 17:21:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOHLqcH005197; Thu, 24 Nov 2011 17:21:52 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOHLqk6005194; Thu, 24 Nov 2011 17:21:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111241721.pAOHLqk6005194@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Nov 2011 17:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227940 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 17:21:52 -0000 Author: tuexen Date: Thu Nov 24 17:21:52 2011 New Revision: 227940 URL: http://svn.freebsd.org/changeset/base/227940 Log: MFC r227486: Don't copy uninitialized memory. Also simplify the comparison of interface names. Approved by: re@ Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Thu Nov 24 15:47:01 2011 (r227939) +++ stable/9/sys/netinet/sctp_pcb.c Thu Nov 24 17:21:52 2011 (r227940) @@ -559,9 +559,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - memcpy(sctp_ifnp->ifn_name, if_name, SCTP_IFNAMSIZ); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - memcpy(sctp_ifnp->ifn_name, "unknown", min(7, SCTP_IFNAMSIZ)); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -768,19 +768,9 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, * panda who might recycle indexes fast. */ if (if_name) { - int len1, len2; - - len1 = min(SCTP_IFNAMSIZ, strlen(if_name)); - len2 = min(SCTP_IFNAMSIZ, strlen(sctp_ifap->ifn_p->ifn_name)); - if (len1 && len2 && (len1 == len2)) { - /* we can compare them */ - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) == 0) { - /* - * They match its a correct - * delete - */ - valid = 1; - } + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { + /* They match its a correct delete */ + valid = 1; } } if (!valid) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 17:25: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 1ADBF106566C; Thu, 24 Nov 2011 17:25:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E59358FC16; Thu, 24 Nov 2011 17:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOHPhpd005374; Thu, 24 Nov 2011 17:25:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOHPhK0005372; Thu, 24 Nov 2011 17:25:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111241725.pAOHPhK0005372@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Nov 2011 17:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227941 - releng/9.0/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 17:25:44 -0000 Author: tuexen Date: Thu Nov 24 17:25:43 2011 New Revision: 227941 URL: http://svn.freebsd.org/changeset/base/227941 Log: MFC r227486: Don't copy uninitialized memory. Also simplify the comparison of interface names. Approved by: re@ Modified: releng/9.0/sys/netinet/sctp_pcb.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/netinet/sctp_pcb.c ============================================================================== --- releng/9.0/sys/netinet/sctp_pcb.c Thu Nov 24 17:21:52 2011 (r227940) +++ releng/9.0/sys/netinet/sctp_pcb.c Thu Nov 24 17:25:43 2011 (r227941) @@ -559,9 +559,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - memcpy(sctp_ifnp->ifn_name, if_name, SCTP_IFNAMSIZ); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - memcpy(sctp_ifnp->ifn_name, "unknown", min(7, SCTP_IFNAMSIZ)); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -768,19 +768,9 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, * panda who might recycle indexes fast. */ if (if_name) { - int len1, len2; - - len1 = min(SCTP_IFNAMSIZ, strlen(if_name)); - len2 = min(SCTP_IFNAMSIZ, strlen(sctp_ifap->ifn_p->ifn_name)); - if (len1 && len2 && (len1 == len2)) { - /* we can compare them */ - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) == 0) { - /* - * They match its a correct - * delete - */ - valid = 1; - } + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { + /* They match its a correct delete */ + valid = 1; } } if (!valid) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 17:54:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4E0D1065672; Thu, 24 Nov 2011 17:54:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ADED8FC21; Thu, 24 Nov 2011 17:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOHs3dP006226; Thu, 24 Nov 2011 17:54:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOHs3Vo006224; Thu, 24 Nov 2011 17:54:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111241754.pAOHs3Vo006224@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Nov 2011 17:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227942 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 17:54:03 -0000 Author: tuexen Date: Thu Nov 24 17:54:03 2011 New Revision: 227942 URL: http://svn.freebsd.org/changeset/base/227942 Log: MFC r227540: Set the MTU of an path to an approriate value if the interface MTU can't be determined. Approved by: re@ Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Thu Nov 24 17:25:43 2011 (r227941) +++ stable/9/sys/netinet/sctp_pcb.c Thu Nov 24 17:54:03 2011 (r227942) @@ -4064,13 +4064,8 @@ sctp_add_remote_addr(struct sctp_tcb *st /* Now get the interface MTU */ if (net->ro._s_addr && net->ro._s_addr->ifn_p) { net->mtu = SCTP_GATHER_MTU_FROM_INTFC(net->ro._s_addr->ifn_p); - } else { - net->mtu = 0; } - if (net->mtu == 0) { - /* Huh ?? */ - net->mtu = SCTP_DEFAULT_MTU; - } else { + if (net->mtu > 0) { uint32_t rmtu; rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt); @@ -4090,11 +4085,31 @@ sctp_add_remote_addr(struct sctp_tcb *st net->mtu = rmtu; } } - if (from == SCTP_ALLOC_ASOC) { - stcb->asoc.smallest_mtu = net->mtu; + } + if (net->mtu == 0) { + switch (newaddr->sa_family) { +#ifdef INET + case AF_INET: + net->mtu = SCTP_DEFAULT_MTU; + break; +#endif +#ifdef INET6 + case AF_INET6: + net->mtu = 1280; + break; +#endif + default: + break; } - } else { - net->mtu = stcb->asoc.smallest_mtu; + } + if (net->port) { + net->mtu -= (uint32_t) sizeof(struct udphdr); + } + if (from == SCTP_ALLOC_ASOC) { + stcb->asoc.smallest_mtu = net->mtu; + } + if (stcb->asoc.smallest_mtu > net->mtu) { + stcb->asoc.smallest_mtu = net->mtu; } #ifdef INET6 if (newaddr->sa_family == AF_INET6) { @@ -4104,12 +4119,7 @@ sctp_add_remote_addr(struct sctp_tcb *st (void)sa6_recoverscope(sin6); } #endif - if (net->port) { - net->mtu -= sizeof(struct udphdr); - } - if (stcb->asoc.smallest_mtu > net->mtu) { - stcb->asoc.smallest_mtu = net->mtu; - } + /* JRS - Use the congestion control given in the CC module */ if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) (*stcb->asoc.cc_functions.sctp_set_initial_cc_param) (stcb, net); From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 17:58: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 866C6106566C; Thu, 24 Nov 2011 17:58:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF8A8FC15; Thu, 24 Nov 2011 17:58:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOHwEB0006403; Thu, 24 Nov 2011 17:58:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOHwEd2006401; Thu, 24 Nov 2011 17:58:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111241758.pAOHwEd2006401@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Nov 2011 17:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227943 - releng/9.0/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 17:58:14 -0000 Author: tuexen Date: Thu Nov 24 17:58:14 2011 New Revision: 227943 URL: http://svn.freebsd.org/changeset/base/227943 Log: MFC r227540: Set the MTU of an path to an approriate value if the interface MTU can't be determined. Approved by: re@ Modified: releng/9.0/sys/netinet/sctp_pcb.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/netinet/sctp_pcb.c ============================================================================== --- releng/9.0/sys/netinet/sctp_pcb.c Thu Nov 24 17:54:03 2011 (r227942) +++ releng/9.0/sys/netinet/sctp_pcb.c Thu Nov 24 17:58:14 2011 (r227943) @@ -4064,13 +4064,8 @@ sctp_add_remote_addr(struct sctp_tcb *st /* Now get the interface MTU */ if (net->ro._s_addr && net->ro._s_addr->ifn_p) { net->mtu = SCTP_GATHER_MTU_FROM_INTFC(net->ro._s_addr->ifn_p); - } else { - net->mtu = 0; } - if (net->mtu == 0) { - /* Huh ?? */ - net->mtu = SCTP_DEFAULT_MTU; - } else { + if (net->mtu > 0) { uint32_t rmtu; rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt); @@ -4090,11 +4085,31 @@ sctp_add_remote_addr(struct sctp_tcb *st net->mtu = rmtu; } } - if (from == SCTP_ALLOC_ASOC) { - stcb->asoc.smallest_mtu = net->mtu; + } + if (net->mtu == 0) { + switch (newaddr->sa_family) { +#ifdef INET + case AF_INET: + net->mtu = SCTP_DEFAULT_MTU; + break; +#endif +#ifdef INET6 + case AF_INET6: + net->mtu = 1280; + break; +#endif + default: + break; } - } else { - net->mtu = stcb->asoc.smallest_mtu; + } + if (net->port) { + net->mtu -= (uint32_t) sizeof(struct udphdr); + } + if (from == SCTP_ALLOC_ASOC) { + stcb->asoc.smallest_mtu = net->mtu; + } + if (stcb->asoc.smallest_mtu > net->mtu) { + stcb->asoc.smallest_mtu = net->mtu; } #ifdef INET6 if (newaddr->sa_family == AF_INET6) { @@ -4104,12 +4119,7 @@ sctp_add_remote_addr(struct sctp_tcb *st (void)sa6_recoverscope(sin6); } #endif - if (net->port) { - net->mtu -= sizeof(struct udphdr); - } - if (stcb->asoc.smallest_mtu > net->mtu) { - stcb->asoc.smallest_mtu = net->mtu; - } + /* JRS - Use the congestion control given in the CC module */ if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) (*stcb->asoc.cc_functions.sctp_set_initial_cc_param) (stcb, net); From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 18:37: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 D0E171065670; Thu, 24 Nov 2011 18:37:16 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF8C78FC13; Thu, 24 Nov 2011 18:37:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOIbGox007675; Thu, 24 Nov 2011 18:37:16 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOIbGPK007663; Thu, 24 Nov 2011 18:37:16 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111241837.pAOIbGPK007663@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 18:37: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: r227944 - head/usr.sbin/sade X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 18:37:16 -0000 Author: fjoe Date: Thu Nov 24 18:37:16 2011 New Revision: 227944 URL: http://svn.freebsd.org/changeset/base/227944 Log: Port to new libdialog. Modified: head/usr.sbin/sade/Makefile head/usr.sbin/sade/devices.c head/usr.sbin/sade/disks.c head/usr.sbin/sade/dmenu.c head/usr.sbin/sade/install.c head/usr.sbin/sade/label.c head/usr.sbin/sade/main.c head/usr.sbin/sade/menus.c head/usr.sbin/sade/misc.c head/usr.sbin/sade/msg.c head/usr.sbin/sade/sade.h head/usr.sbin/sade/system.c Modified: head/usr.sbin/sade/Makefile ============================================================================== --- head/usr.sbin/sade/Makefile Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/Makefile Thu Nov 24 18:37:16 2011 (r227944) @@ -19,9 +19,10 @@ WARNS?= 3 .if ${MACHINE} == "pc98" CFLAGS+= -DPC98 .endif -CFLAGS+= -I${.CURDIR}/../../gnu/lib/libodialog -I. +CFLAGS+= -I${.CURDIR}/../../contrib/dialog -I. +DEBUG_FLAGS= -O0 -g -DPADD= ${LIBODIALOG} ${LIBNCURSES} ${LIBUTIL} ${LIBDISK} -LDADD= -lodialog -lncurses -lutil -ldisk +DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} ${LIBUTIL} ${LIBDISK} +LDADD= -ldialog -lncursesw -lm -lutil -ldisk .include Modified: head/usr.sbin/sade/devices.c ============================================================================== --- head/usr.sbin/sade/devices.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/devices.c Thu Nov 24 18:37:16 2011 (r227944) @@ -29,7 +29,6 @@ * */ -#include "sade.h" #include #include #include @@ -40,6 +39,8 @@ #include #include +#include "sade.h" + /* how much to bias minor number for a given /dev/s slice */ #define SLICE_DELTA (0x10000) @@ -247,7 +248,7 @@ deviceGetAll(void) } free(names); } - dialog_clear_norefresh(); + dlg_clear(); } /* Rescan all devices, after closing previous set - convenience function */ Modified: head/usr.sbin/sade/disks.c ============================================================================== --- head/usr.sbin/sade/disks.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/disks.c Thu Nov 24 18:37:16 2011 (r227944) @@ -113,7 +113,7 @@ check_geometry(Disk *d) if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) #endif { - dialog_clear_norefresh(); + dlg_clear(); sg = msgYesNo("WARNING: It is safe to use a geometry of %lu/%lu/%lu for %s on\n" "computers with modern BIOS versions. If this disk is to be used\n" "on an old machine it is recommended that it does not have more\n" @@ -223,21 +223,21 @@ getBootMgr(char *dname, u_char **bootipl char *cp; int i = 0; + dlg_clr_result(); cp = variable_get(VAR_BOOTMGR); if (!cp) { /* Figure out what kind of IPL the user wants */ sprintf(str, "Install Boot Manager for drive %s?", dname); MenuIPLType.title = str; - i = dmenuOpenSimple(&MenuIPLType, FALSE); + i = dmenuOpen(&MenuIPLType); } else { if (!strncmp(cp, "boot", 4)) - BootMgr = 0; + dlg_add_result(MenuIPLType.items[0].prompt); else - BootMgr = 1; + dlg_add_result(MenuIPLType.items[1].prompt); } if (cp || i) { - switch (BootMgr) { - case 0: + if (!strcmp(dialog_vars.input_result, MenuIPLType.items[0].prompt)) { if (!boot0) boot0 = bootalloc("boot0", &boot0_size); *bootipl = boot0; *bootipl_size = boot0_size; @@ -245,10 +245,7 @@ getBootMgr(char *dname, u_char **bootipl *bootmenu = boot05; *bootmenu_size = boot05_size; return; - case 1: - default: - break; - } + } } *bootipl = NULL; *bootipl_size = 0; @@ -266,36 +263,33 @@ getBootMgr(char *dname, u_char **bootCod char *cp; int i = 0; + dlg_clr_result(); cp = variable_get(VAR_BOOTMGR); if (!cp) { /* Figure out what kind of MBR the user wants */ sprintf(str, "Install Boot Manager for drive %s?", dname); MenuMBRType.title = str; - i = dmenuOpenSimple(&MenuMBRType, FALSE); + i = dmenuOpen(&MenuMBRType); } else { + if (!strcmp(cp, "standard")) + dlg_add_result(MenuMBRType.items[0].prompt); if (!strncmp(cp, "boot", 4)) - BootMgr = 0; - else if (!strcmp(cp, "standard")) - BootMgr = 1; + dlg_add_result(MenuMBRType.items[1].prompt); else - BootMgr = 2; + dlg_add_result(MenuMBRType.items[2].prompt); } if (cp || i) { - switch (BootMgr) { - case 0: - if (!boot0) boot0 = bootalloc("boot0", &boot0_size); - *bootCode = boot0; - *bootCodeSize = boot0_size; - return; - case 1: + if (!strcmp(dialog_vars.input_result, MenuMBRType.items[0].prompt)) { if (!mbr) mbr = bootalloc("mbr", &mbr_size); *bootCode = mbr; *bootCodeSize = mbr_size; return; - case 2: - default: - break; + } else if (!strcmp(dialog_vars.input_result, MenuMBRType.items[1].prompt)) { + if (!boot0) boot0 = bootalloc("boot0", &boot0_size); + *bootCode = boot0; + *bootCodeSize = boot0_size; + return; } } #endif @@ -333,7 +327,7 @@ diskPartition(Device *dev) /* Flush both the dialog and curses library views of the screen since we don't always know who called us */ - dialog_clear_norefresh(), clear(); + dlg_clear(), clear(); current_chunk = 0; /* Set up the chunk array */ @@ -705,12 +699,15 @@ diskPartition(Device *dev) p = CheckRules(d); if (p) { char buf[FILENAME_MAX]; - - use_helpline("Press F1 to read more about disk slices."); - use_helpfile(systemHelpFile("partition", buf)); + DIALOG_VARS save_vars; + + dlg_save_vars(&save_vars); + dialog_vars.help_line = "Press F1 to read more about disk slices."; + dialog_vars.help_file = systemHelpFile("partition", buf); if (!variable_get(VAR_NO_WARN)) - dialog_mesgbox("Disk slicing warning:", p, -1, -1); + xdialog_msgbox("Disk slicing warning:", p, -1, -1, 1); free(p); + dlg_restore_vars(&save_vars); } restorescr(w); } @@ -751,7 +748,7 @@ bootalloc(char *name, size_t *size) } #endif /* !__ia64__ */ -#ifdef WITH_SLICES +#ifdef WITH_SLICES static int partitionHook(dialogMenuItem *selected) { @@ -804,7 +801,7 @@ diskPartitionEditor(dialogMenuItem *self return DITEM_FAILURE; } - result = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; + result = dmenuOpen(menu) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); return result; } Modified: head/usr.sbin/sade/dmenu.c ============================================================================== --- head/usr.sbin/sade/dmenu.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/dmenu.c Thu Nov 24 18:37:16 2011 (r227944) @@ -34,196 +34,6 @@ #define MAX_MENU 15 -static Boolean exited; - -int -dmenuDisplayFile(dialogMenuItem *tmp) -{ - systemDisplayHelp((char *)tmp->data); - return DITEM_SUCCESS; -} - -int -dmenuSubmenu(dialogMenuItem *tmp) -{ - return (dmenuOpenSimple((DMenu *)(tmp->data), FALSE) ? DITEM_SUCCESS : DITEM_FAILURE); -} - -int -dmenuSystemCommand(dialogMenuItem *self) -{ - WINDOW *w = NULL; /* Keep lint happy */ - - /* If aux is set, the command is known not to produce any screen-spoiling output */ - if (!self->aux) - w = savescr(); - systemExecute((char *)self->data); - if (!self->aux) - restorescr(w); - return DITEM_SUCCESS; -} - -int -dmenuSystemCommandBox(dialogMenuItem *tmp) -{ - WINDOW *w = savescr(); - - use_helpfile(NULL); - use_helpline("Select OK to dismiss this dialog"); - dialog_prgbox(tmp->title, (char *)tmp->data, 22, 76, 1, 1); - restorescr(w); - return DITEM_SUCCESS; -} - -int -dmenuExit(dialogMenuItem *tmp) -{ - exited = TRUE; - return DITEM_LEAVE_MENU; -} - -int -dmenuSetVariable(dialogMenuItem *tmp) -{ - variable_set((char *)tmp->data, *((char *)tmp->data) != '_'); - return DITEM_SUCCESS; -} - -int -dmenuSetVariables(dialogMenuItem *tmp) -{ - char *cp1, *cp2; - char *copy = strdup((char *)tmp->data); - - for (cp1 = copy; cp1 != NULL;) { - cp2 = index(cp1, ','); - if (cp2 != NULL) *cp2++ = '\0'; - variable_set(cp1, *cp1 != '_'); - cp1 = cp2; - } - free(copy); - return DITEM_SUCCESS; -} - -int -dmenuToggleVariable(dialogMenuItem *tmp) -{ - char *var, *cp; - int status; - - if (!(var = strdup((char *)tmp->data))) { - msgConfirm("Incorrect data field for `%s'!", tmp->title); - return DITEM_FAILURE; - } - if (!(cp = index(var, '='))) { - msgConfirm("Data field for %s is not in var=value format!", tmp->title); - return DITEM_FAILURE; - } - status = variable_check(var); - *cp = '\0'; - variable_set2(var, status ? "NO" : "YES", *var != '_'); - free(var); - return DITEM_SUCCESS; -} - -int -dmenuISetVariable(dialogMenuItem *tmp) -{ - char *ans, *var; - - if (!(var = (char *)tmp->data)) { - msgConfirm("Incorrect data field for `%s'!", tmp->title); - return DITEM_FAILURE; - } - ans = msgGetInput(variable_get(var), tmp->title, 1); - if (!ans) - return DITEM_FAILURE; - else if (!*ans) - variable_unset(var); - else - variable_set2(var, ans, *var != '_'); - return DITEM_SUCCESS; -} - -int -dmenuSetFlag(dialogMenuItem *tmp) -{ - if (*((unsigned int *)tmp->data) & tmp->aux) - *((unsigned int *)tmp->data) &= ~tmp->aux; - else - *((unsigned int *)tmp->data) |= tmp->aux; - return DITEM_SUCCESS; -} - -int -dmenuSetValue(dialogMenuItem *tmp) -{ - *((unsigned int *)tmp->data) = tmp->aux; - return DITEM_SUCCESS; -} - -/* Traverse menu but give user no control over positioning */ -Boolean -dmenuOpenSimple(DMenu *menu, Boolean buttons) -{ - int choice, scroll, curr, max; - - choice = scroll = curr = max = 0; - return dmenuOpen(menu, &choice, &scroll, &curr, &max, buttons); -} - -/* Work functions for the state hook */ -int -dmenuFlagCheck(dialogMenuItem *item) -{ - return (*((unsigned int *)item->data) & item->aux); -} - -int -dmenuVarCheck(dialogMenuItem *item) -{ - char *w; - - w = (char *)item->aux; - if (!w) - w = (char *)item->data; - return variable_check(w); -} - -int -dmenuVarsCheck(dialogMenuItem *item) -{ - int res, init; - char *w, *cp1, *cp2; - char *copy; - - w = (char *)item->aux; - if (!w) - w = (char *)item->data; - if (!w) - return FALSE; - - copy = strdup(w); - res = TRUE; - init = FALSE; - for (cp1 = copy; cp1 != NULL;) { - init = TRUE; - cp2 = index(cp1, ','); - if (cp2 != NULL) - *cp2++ = '\0'; - res = res && variable_check(cp1); - cp1 = cp2; - } - free(copy); - return res && init; -} - -int -dmenuRadioCheck(dialogMenuItem *item) -{ - return (*((long *)item->data) == item->aux); -} - static int menu_height(DMenu *menu, int n) { @@ -242,54 +52,42 @@ menu_height(DMenu *menu, int n) /* Traverse over an internal menu */ Boolean -dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean buttons) +dmenuOpen(DMenu *menu) { int n, rval = 0; - dialogMenuItem *items; - items = menu->items; - if (buttons) - items += 2; /* Count up all the items */ - for (n = 0; items[n].title; n++); + for (n = 0; menu->items[n].title; n++) + ; while (1) { char buf[FILENAME_MAX]; + DIALOG_VARS save_vars; WINDOW *w = savescr(); /* Any helpful hints, put 'em up! */ - use_helpline(menu->helpline); - use_helpfile(systemHelpFile(menu->helpfile, buf)); - dialog_clear_norefresh(); + dlg_save_vars(&save_vars); + dialog_vars.help_line = menu->helpline; + dialog_vars.help_file = systemHelpFile(menu->helpfile, buf); + dlg_clear(); /* Pop up that dialog! */ - if (menu->type & DMENU_NORMAL_TYPE) - rval = dialog_menu((u_char *)menu->title, (u_char *)menu->prompt, - -1, -1, menu_height(menu, n), -n, items, - (char *)(uintptr_t)buttons, choice, scroll); - - else if (menu->type & DMENU_RADIO_TYPE) - rval = dialog_radiolist((u_char *)menu->title, - (u_char *)menu->prompt, -1, -1, menu_height(menu, n), -n, - items, (char *)(uintptr_t)buttons); - - else if (menu->type & DMENU_CHECKLIST_TYPE) - rval = dialog_checklist((u_char *)menu->title, - (u_char *)menu->prompt, -1, -1, menu_height(menu, n), -n, - items, (char *)(uintptr_t)buttons); - else + if (menu->type & DMENU_NORMAL_TYPE) { + rval = xdialog_menu(menu->title, menu->prompt, + -1, -1, menu_height(menu, n), n, menu->items); + } else if (menu->type & DMENU_RADIO_TYPE) { + rval = xdialog_radiolist(menu->title, menu->prompt, + -1, -1, menu_height(menu, n), n, menu->items); + } else { msgFatal("Menu: `%s' is of an unknown type\n", menu->title); - if (exited) { - exited = FALSE; - restorescr(w); - return TRUE; } - else if (rval) { + dlg_restore_vars(&save_vars); + if (rval) { restorescr(w); return FALSE; - } - else if (menu->type & DMENU_SELECTION_RETURNS) { + } else if (menu->type & DMENU_SELECTION_RETURNS) { restorescr(w); return TRUE; - } + } else + delwin(w); } } Modified: head/usr.sbin/sade/install.c ============================================================================== --- head/usr.sbin/sade/install.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/install.c Thu Nov 24 18:37:16 2011 (r227944) @@ -29,7 +29,6 @@ * */ -#include "sade.h" #include #include #include @@ -51,6 +50,8 @@ #include #include +#include "sade.h" + #define TERMCAP_FILE "/usr/share/misc/termcap" Boolean @@ -177,7 +178,7 @@ installFilesystems(Device *dev) sprintf(fname, "/dev/%s", c2->name); i = (Fake || swapon(fname)); if (!i) { - dialog_clear_norefresh(); + dlg_clear(); msgNotify("Added %s as an additional swap device", fname); } else { @@ -209,7 +210,7 @@ installFilesystems(Device *dev) command_sort(); command_execute(); - dialog_clear_norefresh(); + dlg_clear(); return DITEM_SUCCESS | DITEM_RESTORE; } Modified: head/usr.sbin/sade/label.c ============================================================================== --- head/usr.sbin/sade/label.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/label.c Thu Nov 24 18:37:16 2011 (r227944) @@ -29,7 +29,7 @@ * */ -#include "sade.h" +#include #include #include #include @@ -37,6 +37,8 @@ #include #include +#include "sade.h" + #define AUTO_HOME 0 /* do not create /home automatically */ /* @@ -161,7 +163,7 @@ diskLabelEditor(dialogMenuItem *self) result = DITEM_FAILURE; } else { - result = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; + result = dmenuOpen(menu) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } } @@ -417,9 +419,8 @@ get_mountpoint(PartType type, struct chu static PartType get_partition_type(void) { - char selection[20]; int i; - static unsigned char *fs_types[] = { + static char *fs_types[] = { #ifdef __ia64__ "EFI", "An EFI system partition", #endif @@ -428,6 +429,7 @@ get_partition_type(void) }; WINDOW *w = savescr(); + dlg_clr_result(); i = dialog_menu("Please choose a partition type", "If you want to use this partition for swap space, select Swap.\n" "If you want to put a filesystem on it, choose FS.", @@ -437,16 +439,16 @@ get_partition_type(void) #else 2, 2, #endif - fs_types, selection, NULL, NULL); + fs_types); restorescr(w); if (!i) { #ifdef __ia64__ - if (!strcmp(selection, "EFI")) + if (!strcmp(dialog_vars.input_result, "EFI")) return PART_EFI; #endif - if (!strcmp(selection, "FS")) + if (!strcmp(dialog_vars.input_result, "FS")) return PART_FILESYSTEM; - else if (!strcmp(selection, "Swap")) + else if (!strcmp(dialog_vars.input_result, "Swap")) return PART_SWAP; } return PART_NONE; @@ -1251,7 +1253,7 @@ diskLabel(Device *dev) if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected to understand!")) { - dialog_clear(); + dlg_clear(); end_dialog(); DialogActive = FALSE; if (dev->private) { Modified: head/usr.sbin/sade/main.c ============================================================================== --- head/usr.sbin/sade/main.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/main.c Thu Nov 24 18:37:16 2011 (r227944) @@ -39,8 +39,8 @@ const char *ProgName = "sade"; int main(int argc, char **argv) { - int choice, scroll, curr, max, status; - + int status; + /* Record name to be able to restart */ StartName = argv[0]; @@ -77,7 +77,9 @@ main(int argc, char **argv) /* Try to preserve our scroll-back buffer */ if (OnVTY) { - for (curr = 0; curr < 25; curr++) + int i; + + for (i = 0; i < 25; i++) putchar('\n'); } /* Move stderr aside */ @@ -105,10 +107,9 @@ main(int argc, char **argv) } /* Begin user dialog at outer menu */ - dialog_clear(); + dlg_clear(); while (1) { - choice = scroll = curr = max = 0; - dmenuOpen(&MenuMain, &choice, &scroll, &curr, &max, FALSE); + dmenuOpen(&MenuMain); if (getpid() != 1 || !msgNoYes("Are you sure you wish to exit?") ) Modified: head/usr.sbin/sade/menus.c ============================================================================== --- head/usr.sbin/sade/menus.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/menus.c Thu Nov 24 18:37:16 2011 (r227944) @@ -53,7 +53,7 @@ DMenu MenuDiskDevices = { "Use [TAB] to get to the buttons and leave this menu.", "Press F1 for important information regarding disk geometry!", "drives", - { { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0 } }, + { { NULL, NULL, NULL } }, }; DMenu MenuMain = { @@ -62,12 +62,12 @@ DMenu MenuMain = { "This is a utility for partitioning and/or labelling your disks.", "DISKUTIL", "main", - { + { #ifdef WITH_SLICES - { "1 Partition", "Managing disk partitions", NULL, diskPartitionEditor, NULL, NULL, 0, 0, 0, 0 }, + { "1 Partition", "Managing disk partitions", diskPartitionEditor }, #endif - { "2 Label", "Label allocated disk partitions", NULL, diskLabelEditor, NULL, NULL, 0, 0, 0, 0 }, - { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0 } + { "2 Label", "Label allocated disk partitions", diskLabelEditor }, + { NULL, NULL, NULL } }, }; @@ -75,22 +75,20 @@ DMenu MenuMain = { #ifdef PC98 /* IPL type menu */ DMenu MenuIPLType = { - DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, + DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "overwrite me", /* will be disk specific label */ "If you want a FreeBSD Boot Manager, select \"BootMgr\". If you would\n" "prefer your Boot Manager to remain untouched then select \"None\".\n\n", "Press F1 to read about drive setup", "drives", - { { "BootMgr", "Install the FreeBSD Boot Manager", - dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, 0, 0, 0, 0 }, - { "None", "Leave the IPL untouched", - dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, - { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0 } }, + { { "BootMgr", "Install the FreeBSD Boot Manager", NULL }, + { "None", "Leave the IPL untouched", NULL }, + { NULL, NULL, NULL } }, }; #else /* MBR type menu */ DMenu MenuMBRType = { - DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, + DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "overwrite me", /* will be disk specific label */ "FreeBSD comes with a boot manager that allows you to easily\n" "select between FreeBSD and any other operating systems on your machine\n" @@ -99,18 +97,13 @@ DMenu MenuMBRType = { "to do so (limitations in the PC BIOS usually prevent this otherwise).\n" "If you have other operating systems installed and would like a choice when\n" "booting, choose \"BootMgr\". If you would prefer to keep your existing\n" - "boot manager, select \"None\".\n\n", + "boot manager, select \"None\".\n", "", "drives", - { { "Standard", "Install a standard MBR (non-interactive boot manager)", - dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, - { "BootMgr", "Install the FreeBSD boot manager", - dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 0 }, - { "None", "Do not install a boot manager", - dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 2 }, - { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0 } } + { { "Standard", "Install a standard MBR (non-interactive boot manager)", NULL }, + { "BootMgr", "Install the FreeBSD boot manager", NULL }, + { "None", "Do not install a boot manager", NULL }, + { NULL, NULL, NULL } } }; #endif /* PC98 */ #endif /* __i386__ */ - - Modified: head/usr.sbin/sade/misc.c ============================================================================== --- head/usr.sbin/sade/misc.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/misc.c Thu Nov 24 18:37:16 2011 (r227944) @@ -31,7 +31,6 @@ * */ -#include "sade.h" #include #include #include @@ -47,6 +46,8 @@ #include #include +#include "sade.h" + /* Quick check to see if a file is readable */ Boolean file_readable(char *fname) @@ -217,3 +218,192 @@ restorescr(WINDOW *w) delwin(w); } +static int +xdialog_count_rows(const char *p) +{ + int rows = 0; + + while ((p = strchr(p, '\n')) != NULL) { + p++; + if (*p == '\0') + break; + rows++; + } + + return rows ? rows : 1; +} + +int +xdialog_menu(const char *title, const char *cprompt, int height, int width, + int menu_height, int item_no, dialogMenuItem *ditems) +{ + int i, result, choice = 0; + DIALOG_LISTITEM *listitems; + DIALOG_VARS save_vars; + + dlg_save_vars(&save_vars); + + /* initialize list items */ + listitems = dlg_calloc(DIALOG_LISTITEM, item_no + 1); + assert_ptr(listitems, "xdialog_menu"); + for (i = 0; i < item_no; i++) { + listitems[i].name = ditems[i].prompt; + listitems[i].text = ditems[i].title; + } + + /* calculate height */ + if (height < 0) + height = xdialog_count_rows(cprompt) + menu_height + 4 + 2; + if (height > LINES) + height = LINES; + + /* calculate width */ + if (width < 0) { + int tag_x = 0; + + for (i = 0; i < item_no; i++) { + int j, l; + + l = strlen(listitems[i].name); + for (j = 0; j < item_no; j++) { + int k = strlen(listitems[j].text); + tag_x = MAX(tag_x, l + k + 2); + } + } + width = MAX(dlg_count_columns(cprompt), title != NULL ? dlg_count_columns(title) : 0); + width = MAX(width, tag_x + 4) + 4; + } + width = MAX(width, 24); + if (width > COLS) + width = COLS; + + /* show menu */ + dialog_vars.default_item = listitems[choice].name; + result = dlg_menu(title, cprompt, height, width, + menu_height, item_no, listitems, &choice, NULL); + switch (result) { + case DLG_EXIT_ESC: + result = -1; + break; + case DLG_EXIT_OK: + if (ditems[choice].fire != NULL) { + int status; + WINDOW *save; + + save = savescr(); + status = ditems[choice].fire(ditems + choice); + restorescr(save); + } + result = 0; + break; + case DLG_EXIT_CANCEL: + default: + result = 1; + break; + } + + free(listitems); + dlg_restore_vars(&save_vars); + return result; +} + +int +xdialog_radiolist(const char *title, const char *cprompt, int height, int width, + int menu_height, int item_no, dialogMenuItem *ditems) +{ + int i, result, choice = 0; + DIALOG_LISTITEM *listitems; + DIALOG_VARS save_vars; + + dlg_save_vars(&save_vars); + + /* initialize list items */ + listitems = dlg_calloc(DIALOG_LISTITEM, item_no + 1); + assert_ptr(listitems, "xdialog_menu"); + for (i = 0; i < item_no; i++) { + listitems[i].name = ditems[i].prompt; + listitems[i].text = ditems[i].title; + listitems[i].state = i == choice; + } + + /* calculate height */ + if (height < 0) + height = xdialog_count_rows(cprompt) + menu_height + 4 + 2; + if (height > LINES) + height = LINES; + + /* calculate width */ + if (width < 0) { + int check_x = 0; + + for (i = 0; i < item_no; i++) { + int j, l; + + l = strlen(listitems[i].name); + for (j = 0; j < item_no; j++) { + int k = strlen(listitems[j].text); + check_x = MAX(check_x, l + k + 6); + } + } + width = MAX(dlg_count_columns(cprompt), title != NULL ? dlg_count_columns(title) : 0); + width = MAX(width, check_x + 4) + 4; + } + width = MAX(width, 24); + if (width > COLS) + width = COLS; + + /* show menu */ + dialog_vars.default_item = listitems[choice].name; + result = dlg_checklist(title, cprompt, height, width, + menu_height, item_no, listitems, NULL, FLAG_RADIO, &choice); + switch (result) { + case DLG_EXIT_ESC: + result = -1; + break; + case DLG_EXIT_OK: + if (ditems[choice].fire != NULL) { + int status; + WINDOW *save; + + save = savescr(); + status = ditems[choice].fire(ditems + choice); + restorescr(save); + } + result = 0; + break; + case DLG_EXIT_CANCEL: + default: + result = 1; + break; + } + + /* save result */ + if (result == 0) + dlg_add_result(listitems[choice].name); + free(listitems); + dlg_restore_vars(&save_vars); + return result; +} + +int +xdialog_msgbox(const char *title, const char *cprompt, + int height, int width, int pauseopt) +{ + /* calculate height */ + if (height < 0) + height = 2 + xdialog_count_rows(cprompt) + 2 + !!pauseopt; + if (height > LINES) + height = LINES; + + /* calculate width */ + if (width < 0) { + width = title != NULL ? dlg_count_columns(title) : 0; + width = MAX(width, dlg_count_columns(cprompt)) + 4; + } + if (pauseopt) + width = MAX(width, 10); + if (width > COLS) + width = COLS; + + return dialog_msgbox(title, cprompt, height, width, pauseopt); +} Modified: head/usr.sbin/sade/msg.c ============================================================================== --- head/usr.sbin/sade/msg.c Thu Nov 24 17:58:14 2011 (r227943) +++ head/usr.sbin/sade/msg.c Thu Nov 24 18:37:16 2011 (r227944) @@ -184,13 +184,16 @@ msgConfirm(const char *fmt, ...) va_start(args, fmt); vsnprintf(errstr, FILENAME_MAX, fmt, args); va_end(args); - use_helpline(NULL); - use_helpfile(NULL); + dialog_vars.help_line = NULL; + dialog_vars.help_file = NULL; if (OnVTY) { ioctl(0, VT_ACTIVATE, 1); msgInfo(NULL); } - dialog_notify(errstr); + dialog_vars.help_line = "Press Enter or Space"; + xdialog_msgbox("Message", errstr, -1, -1, 1); + dialog_vars.help_line = NULL; + restorescr(w); } @@ -205,11 +208,11 @@ msgNotify(const char *fmt, ...) va_start(args, fmt); vsnprintf(errstr, FILENAME_MAX, fmt, args); va_end(args); - use_helpline(NULL); - use_helpfile(NULL); + dialog_vars.help_line = NULL; + dialog_vars.help_file = NULL; if (isDebug()) msgDebug("Notify: %s\n", errstr); - dialog_msgbox(NULL, errstr, -1, -1, 0); + xdialog_msgbox(NULL, errstr, -1, -1, 0); } /* Put up a message in a popup yes/no box and return 0 for YES, 1 for NO */ @@ -225,8 +228,8 @@ msgYesNo(const char *fmt, ...) va_start(args, fmt); vsnprintf(errstr, FILENAME_MAX, fmt, args); va_end(args); - use_helpline(NULL); - use_helpfile(NULL); + dialog_vars.help_line = NULL; + dialog_vars.help_file = NULL; if (OnVTY) { ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); @@ -246,20 +249,24 @@ msgNoYes(const char *fmt, ...) char *errstr; int ret; WINDOW *w = savescr(); - + DIALOG_VARS save_vars; + errstr = (char *)alloca(FILENAME_MAX); va_start(args, fmt); vsnprintf(errstr, FILENAME_MAX, fmt, args); va_end(args); - use_helpline(NULL); - use_helpfile(NULL); + dialog_vars.help_line = NULL; + dialog_vars.help_file = NULL; if (OnVTY) { ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } if (variable_get(VAR_NONINTERACTIVE)) return 1; /* If non-interactive, return NO all the time */ - ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1); + dlg_save_vars(&save_vars); + dialog_vars.defaultno = TRUE; + ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1); + dlg_restore_vars(&save_vars); restorescr(w); return ret; } @@ -278,8 +285,8 @@ msgGetInput(char *buf, const char *fmt, va_start(args, fmt); vsnprintf(errstr, FILENAME_MAX, fmt, args); va_end(args); - use_helpline(NULL); - use_helpfile(NULL); + dialog_vars.help_line = NULL; + dialog_vars.help_file = NULL; if (buf) SAFE_STRCPY(input_buffer, buf); else @@ -288,10 +295,10 @@ msgGetInput(char *buf, const char *fmt, ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 18:44: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 7C912106566B; Thu, 24 Nov 2011 18:44:09 +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 69B098FC15; Thu, 24 Nov 2011 18:44:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOIi9JF007940; Thu, 24 Nov 2011 18:44:09 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOIi9GI007932; Thu, 24 Nov 2011 18:44:09 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111241844.pAOIi9GI007932@svn.freebsd.org> From: Ryan Stone Date: Thu, 24 Nov 2011 18:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227945 - in stable/9/sys: amd64/amd64 amd64/include cddl/contrib/opensolaris/uts/intel/dtrace 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: Thu, 24 Nov 2011 18:44:09 -0000 Author: rstone Date: Thu Nov 24 18:44:09 2011 New Revision: 227945 URL: http://svn.freebsd.org/changeset/base/227945 Log: MFC r227290 and r227291: r227290: Fix the DTrace pid return trap interrupt vector. Previously we were using 31, but that vector is reserved. Without this fix, running dtrace -p would either cause the target process to crash or the kernel to page fault r227291: Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able to write to the .text section of a process. Approved by: re (kib) Modified: stable/9/sys/amd64/amd64/trap.c stable/9/sys/amd64/include/segments.h stable/9/sys/amd64/include/trap.h stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/9/sys/i386/i386/trap.c stable/9/sys/i386/include/segments.h stable/9/sys/i386/include/trap.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Thu Nov 24 18:37:16 2011 (r227944) +++ stable/9/sys/amd64/amd64/trap.c Thu Nov 24 18:44:09 2011 (r227945) @@ -125,7 +125,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 30 +#define MAX_TRAP_MSG 33 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -158,6 +158,9 @@ static char *trap_msg[] = { "machine check trap", /* 28 T_MCHK */ "SIMD floating-point exception", /* 29 T_XMMFLT */ "reserved (unknown) fault", /* 30 T_RESERVED */ + "", /* 31 unused (reserved) */ + "DTrace pid return trap", /* 32 T_DTRACE_RET */ + "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -245,28 +248,26 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (dtrace_trap_func != NULL) - if ((*dtrace_trap_func)(frame, type)) - goto out; if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; - + fill_frame_regs(frame, ®s); if (type == T_DTRACE_PROBE && dtrace_fasttrap_probe_ptr != NULL && dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - if (type == T_BPTFLT && + goto out; + else if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) - goto out; - if (type == T_DTRACE_RET && + goto out; + else if (type == T_DTRACE_RET && dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) goto out; - } + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + goto out; #endif if ((frame->tf_rflags & PSL_I) == 0) { Modified: stable/9/sys/amd64/include/segments.h ============================================================================== --- stable/9/sys/amd64/include/segments.h Thu Nov 24 18:37:16 2011 (r227944) +++ stable/9/sys/amd64/include/segments.h Thu Nov 24 18:44:09 2011 (r227945) @@ -214,7 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ -#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: stable/9/sys/amd64/include/trap.h ============================================================================== --- stable/9/sys/amd64/include/trap.h Thu Nov 24 18:37:16 2011 (r227944) +++ stable/9/sys/amd64/include/trap.h Thu Nov 24 18:44:09 2011 (r227945) @@ -62,8 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 31 /* DTrace pid return */ -#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ +#define T_DTRACE_RET 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 24 18:37:16 2011 (r227944) +++ stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 24 18:44:09 2011 (r227945) @@ -97,7 +97,7 @@ uwrite(proc_t *p, void *kaddr, size_t le return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); } -#endif +#endif /* sun */ #ifdef __i386__ #define r_rax r_eax #define r_rbx r_ebx @@ -1380,6 +1380,7 @@ fasttrap_pid_probe(struct reg *rp) { int ret = 0; uintptr_t addr = 0; + #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); @@ -1558,7 +1559,7 @@ fasttrap_pid_probe(struct reg *rp) * ------------------------ ----- * a: <= 15 * jmp ftt_size> 5 - * b: <= 15 + * b: <= 15 * int T_DTRACE_RET 2 * ----- * <= 37 @@ -1731,12 +1732,16 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); + +#if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { +#else + if (uwrite(curproc, scratch, i, addr)) { +#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break; } - if (tp->ftt_retids != NULL) { curthread->t_dtrace_step = 1; curthread->t_dtrace_ret = 1; Modified: stable/9/sys/i386/i386/trap.c ============================================================================== --- stable/9/sys/i386/i386/trap.c Thu Nov 24 18:37:16 2011 (r227944) +++ stable/9/sys/i386/i386/trap.c Thu Nov 24 18:44:09 2011 (r227945) @@ -136,7 +136,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 30 +#define MAX_TRAP_MSG 33 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -169,6 +169,10 @@ static char *trap_msg[] = { "machine check trap", /* 28 T_MCHK */ "SIMD floating-point exception", /* 29 T_XMMFLT */ "reserved (unknown) fault", /* 30 T_RESERVED */ + "", /* 31 unused (reserved) */ + "DTrace pid return trap", /* 32 T_DTRACE_RET */ + "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ + }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -265,10 +269,6 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if ((type == T_PROTFLT || type == T_PAGEFLT) && - dtrace_trap_func != NULL) - if ((*dtrace_trap_func)(frame, type)) - goto out; if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; @@ -287,6 +287,9 @@ trap(struct trapframe *frame) dtrace_return_probe_ptr(®s) == 0) goto out; } + if ((type == T_PROTFLT || type == T_PAGEFLT) && + dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + goto out; #endif if ((frame->tf_eflags & PSL_I) == 0) { Modified: stable/9/sys/i386/include/segments.h ============================================================================== --- stable/9/sys/i386/include/segments.h Thu Nov 24 18:37:16 2011 (r227944) +++ stable/9/sys/i386/include/segments.h Thu Nov 24 18:44:09 2011 (r227945) @@ -207,7 +207,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ -#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: stable/9/sys/i386/include/trap.h ============================================================================== --- stable/9/sys/i386/include/trap.h Thu Nov 24 18:37:16 2011 (r227944) +++ stable/9/sys/i386/include/trap.h Thu Nov 24 18:44:09 2011 (r227945) @@ -62,8 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 31 /* DTrace pid return */ -#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ +#define T_DTRACE_RET 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 18:44: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 CB90B106564A; Thu, 24 Nov 2011 18:44:14 +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 B90B38FC08; Thu, 24 Nov 2011 18:44:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOIiEYu007985; Thu, 24 Nov 2011 18:44:14 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOIiEd1007977; Thu, 24 Nov 2011 18:44:14 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111241844.pAOIiEd1007977@svn.freebsd.org> From: Ryan Stone Date: Thu, 24 Nov 2011 18:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227946 - in releng/9.0/sys: amd64/amd64 amd64/include cddl/contrib/opensolaris/uts/intel/dtrace 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: Thu, 24 Nov 2011 18:44:14 -0000 Author: rstone Date: Thu Nov 24 18:44:14 2011 New Revision: 227946 URL: http://svn.freebsd.org/changeset/base/227946 Log: MFC r227290 and r227291: r227290: Fix the DTrace pid return trap interrupt vector. Previously we were using 31, but that vector is reserved. Without this fix, running dtrace -p would either cause the target process to crash or the kernel to page fault r227291: Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able to write to the .text section of a process. Approved by: re (kib) Modified: releng/9.0/sys/amd64/amd64/trap.c releng/9.0/sys/amd64/include/segments.h releng/9.0/sys/amd64/include/trap.h releng/9.0/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c releng/9.0/sys/i386/i386/trap.c releng/9.0/sys/i386/include/segments.h releng/9.0/sys/i386/include/trap.h Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/amd64/amd64/trap.c ============================================================================== --- releng/9.0/sys/amd64/amd64/trap.c Thu Nov 24 18:44:09 2011 (r227945) +++ releng/9.0/sys/amd64/amd64/trap.c Thu Nov 24 18:44:14 2011 (r227946) @@ -125,7 +125,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 30 +#define MAX_TRAP_MSG 33 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -158,6 +158,9 @@ static char *trap_msg[] = { "machine check trap", /* 28 T_MCHK */ "SIMD floating-point exception", /* 29 T_XMMFLT */ "reserved (unknown) fault", /* 30 T_RESERVED */ + "", /* 31 unused (reserved) */ + "DTrace pid return trap", /* 32 T_DTRACE_RET */ + "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -245,28 +248,26 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (dtrace_trap_func != NULL) - if ((*dtrace_trap_func)(frame, type)) - goto out; if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; - + fill_frame_regs(frame, ®s); if (type == T_DTRACE_PROBE && dtrace_fasttrap_probe_ptr != NULL && dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - if (type == T_BPTFLT && + goto out; + else if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) - goto out; - if (type == T_DTRACE_RET && + goto out; + else if (type == T_DTRACE_RET && dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) goto out; - } + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + goto out; #endif if ((frame->tf_rflags & PSL_I) == 0) { Modified: releng/9.0/sys/amd64/include/segments.h ============================================================================== --- releng/9.0/sys/amd64/include/segments.h Thu Nov 24 18:44:09 2011 (r227945) +++ releng/9.0/sys/amd64/include/segments.h Thu Nov 24 18:44:14 2011 (r227946) @@ -214,7 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ -#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: releng/9.0/sys/amd64/include/trap.h ============================================================================== --- releng/9.0/sys/amd64/include/trap.h Thu Nov 24 18:44:09 2011 (r227945) +++ releng/9.0/sys/amd64/include/trap.h Thu Nov 24 18:44:14 2011 (r227946) @@ -62,8 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 31 /* DTrace pid return */ -#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ +#define T_DTRACE_RET 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- releng/9.0/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 24 18:44:09 2011 (r227945) +++ releng/9.0/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 24 18:44:14 2011 (r227946) @@ -97,7 +97,7 @@ uwrite(proc_t *p, void *kaddr, size_t le return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); } -#endif +#endif /* sun */ #ifdef __i386__ #define r_rax r_eax #define r_rbx r_ebx @@ -1380,6 +1380,7 @@ fasttrap_pid_probe(struct reg *rp) { int ret = 0; uintptr_t addr = 0; + #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); @@ -1558,7 +1559,7 @@ fasttrap_pid_probe(struct reg *rp) * ------------------------ ----- * a: <= 15 * jmp ftt_size> 5 - * b: <= 15 + * b: <= 15 * int T_DTRACE_RET 2 * ----- * <= 37 @@ -1731,12 +1732,16 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); + +#if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { +#else + if (uwrite(curproc, scratch, i, addr)) { +#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break; } - if (tp->ftt_retids != NULL) { curthread->t_dtrace_step = 1; curthread->t_dtrace_ret = 1; Modified: releng/9.0/sys/i386/i386/trap.c ============================================================================== --- releng/9.0/sys/i386/i386/trap.c Thu Nov 24 18:44:09 2011 (r227945) +++ releng/9.0/sys/i386/i386/trap.c Thu Nov 24 18:44:14 2011 (r227946) @@ -136,7 +136,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 30 +#define MAX_TRAP_MSG 33 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -169,6 +169,10 @@ static char *trap_msg[] = { "machine check trap", /* 28 T_MCHK */ "SIMD floating-point exception", /* 29 T_XMMFLT */ "reserved (unknown) fault", /* 30 T_RESERVED */ + "", /* 31 unused (reserved) */ + "DTrace pid return trap", /* 32 T_DTRACE_RET */ + "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ + }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -265,10 +269,6 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if ((type == T_PROTFLT || type == T_PAGEFLT) && - dtrace_trap_func != NULL) - if ((*dtrace_trap_func)(frame, type)) - goto out; if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; @@ -287,6 +287,9 @@ trap(struct trapframe *frame) dtrace_return_probe_ptr(®s) == 0) goto out; } + if ((type == T_PROTFLT || type == T_PAGEFLT) && + dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + goto out; #endif if ((frame->tf_eflags & PSL_I) == 0) { Modified: releng/9.0/sys/i386/include/segments.h ============================================================================== --- releng/9.0/sys/i386/include/segments.h Thu Nov 24 18:44:09 2011 (r227945) +++ releng/9.0/sys/i386/include/segments.h Thu Nov 24 18:44:14 2011 (r227946) @@ -207,7 +207,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ -#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: releng/9.0/sys/i386/include/trap.h ============================================================================== --- releng/9.0/sys/i386/include/trap.h Thu Nov 24 18:44:09 2011 (r227945) +++ releng/9.0/sys/i386/include/trap.h Thu Nov 24 18:44:14 2011 (r227946) @@ -62,8 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 31 /* DTrace pid return */ -#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ +#define T_DTRACE_RET 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 18:45: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 683E71065672; Thu, 24 Nov 2011 18:45:23 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 587398FC16; Thu, 24 Nov 2011 18:45:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOIjNhX008060; Thu, 24 Nov 2011 18:45:23 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOIjNvY008058; Thu, 24 Nov 2011 18:45:23 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111241845.pAOIjNvY008058@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 18:45: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: r227947 - head/usr.sbin/tzsetup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 18:45:23 -0000 Author: fjoe Date: Thu Nov 24 18:45:23 2011 New Revision: 227947 URL: http://svn.freebsd.org/changeset/base/227947 Log: calloc +1 DIALOG_LISTITEM to prevent possible wild pointer access in dlg_default_listitem(). Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Thu Nov 24 18:44:14 2011 (r227946) +++ head/usr.sbin/tzsetup/tzsetup.c Thu Nov 24 18:45:23 2011 (r227947) @@ -76,14 +76,14 @@ static int xdialog_menu(const char *title, const char *cprompt, int height, int width, int menu_height, int item_no, dialogMenuItem *ditems) { - int i, result, choice; + int i, result, choice = 0; DIALOG_LISTITEM *listitems; DIALOG_VARS save_vars; dlg_save_vars(&save_vars); /* initialize list items */ - listitems = dlg_calloc(DIALOG_LISTITEM, item_no); + listitems = dlg_calloc(DIALOG_LISTITEM, item_no + 1); assert_ptr(listitems, "xdialog_menu"); for (i = 0; i < item_no; i++) { listitems[i].name = ditems[i].prompt; @@ -111,7 +111,7 @@ xdialog_menu(const char *title, const ch width = COLS; again: - dialog_vars.default_item = ditems[choice].prompt; + dialog_vars.default_item = listitems[choice].name; result = dlg_menu(title, cprompt, height, width, menu_height, item_no, listitems, &choice, NULL); switch (result) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 18:51: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 B54A2106564A; Thu, 24 Nov 2011 18:51:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A49AD8FC12; Thu, 24 Nov 2011 18:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOIpVUU008300; Thu, 24 Nov 2011 18:51:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOIpVk4008298; Thu, 24 Nov 2011 18:51:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111241851.pAOIpVk4008298@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Nov 2011 18:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227948 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 18:51:31 -0000 Author: tuexen Date: Thu Nov 24 18:51:31 2011 New Revision: 227948 URL: http://svn.freebsd.org/changeset/base/227948 Log: MFC r227930: Move up the address to the top of the sctp_paddrthlds structure like in all other structures. This avoids alignment problems. Approved by: re@ Modified: stable/9/sys/netinet/sctp_uio.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Thu Nov 24 18:45:23 2011 (r227947) +++ stable/9/sys/netinet/sctp_uio.h Thu Nov 24 18:51:31 2011 (r227948) @@ -521,8 +521,8 @@ struct sctp_paddrparams { #define SPP_IPV4_TOS SPP_DSCP struct sctp_paddrthlds { - sctp_assoc_t spt_assoc_id; struct sockaddr_storage spt_address; + sctp_assoc_t spt_assoc_id; uint16_t spt_pathmaxrxt; uint16_t spt_pathpfthld; }; From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 18:57: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 77387106566C; Thu, 24 Nov 2011 18:57:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66F808FC15; Thu, 24 Nov 2011 18:57:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOIvVEb008528; Thu, 24 Nov 2011 18:57:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOIvVSA008526; Thu, 24 Nov 2011 18:57:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111241857.pAOIvVSA008526@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Nov 2011 18:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227949 - releng/9.0/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 18:57:31 -0000 Author: tuexen Date: Thu Nov 24 18:57:31 2011 New Revision: 227949 URL: http://svn.freebsd.org/changeset/base/227949 Log: MFC r227930: Move up the address to the top of the sctp_paddrthlds structure like in all other structures. This avoids alignment problems. Approved by: re@ Modified: releng/9.0/sys/netinet/sctp_uio.h Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/netinet/sctp_uio.h ============================================================================== --- releng/9.0/sys/netinet/sctp_uio.h Thu Nov 24 18:51:31 2011 (r227948) +++ releng/9.0/sys/netinet/sctp_uio.h Thu Nov 24 18:57:31 2011 (r227949) @@ -521,8 +521,8 @@ struct sctp_paddrparams { #define SPP_IPV4_TOS SPP_DSCP struct sctp_paddrthlds { - sctp_assoc_t spt_assoc_id; struct sockaddr_storage spt_address; + sctp_assoc_t spt_assoc_id; uint16_t spt_pathmaxrxt; uint16_t spt_pathpfthld; }; From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 19:02: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 98A5E106566C; Thu, 24 Nov 2011 19:02:04 +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 85D058FC14; Thu, 24 Nov 2011 19:02:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOJ243l008726; Thu, 24 Nov 2011 19:02:04 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOJ24tk008718; Thu, 24 Nov 2011 19:02:04 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111241902.pAOJ24tk008718@svn.freebsd.org> From: Ryan Stone Date: Thu, 24 Nov 2011 19:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227950 - in stable/8/sys: amd64/amd64 amd64/include cddl/contrib/opensolaris/uts/intel/dtrace 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: Thu, 24 Nov 2011 19:02:04 -0000 Author: rstone Date: Thu Nov 24 19:02:04 2011 New Revision: 227950 URL: http://svn.freebsd.org/changeset/base/227950 Log: MFC r227290 and r227291: r227290: Fix the DTrace pid return trap interrupt vector. Previously we were using 31, but that vector is reserved. Without this fix, running dtrace -p would either cause the target process to crash or the kernel to page fault r227291: Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able to write to the .text section of a process. Modified: stable/8/sys/amd64/amd64/trap.c stable/8/sys/amd64/include/segments.h stable/8/sys/amd64/include/trap.h stable/8/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/8/sys/i386/i386/trap.c stable/8/sys/i386/include/segments.h stable/8/sys/i386/include/trap.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/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Thu Nov 24 18:57:31 2011 (r227949) +++ stable/8/sys/amd64/amd64/trap.c Thu Nov 24 19:02:04 2011 (r227950) @@ -129,7 +129,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 30 +#define MAX_TRAP_MSG 33 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -162,6 +162,9 @@ static char *trap_msg[] = { "machine check trap", /* 28 T_MCHK */ "SIMD floating-point exception", /* 29 T_XMMFLT */ "reserved (unknown) fault", /* 30 T_RESERVED */ + "", /* 31 unused (reserved) */ + "DTrace pid return trap", /* 32 T_DTRACE_RET */ + "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -249,28 +252,26 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (dtrace_trap_func != NULL) - if ((*dtrace_trap_func)(frame, type)) - goto out; if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; - + fill_frame_regs(frame, ®s); if (type == T_DTRACE_PROBE && dtrace_fasttrap_probe_ptr != NULL && dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - if (type == T_BPTFLT && + goto out; + else if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) - goto out; - if (type == T_DTRACE_RET && + goto out; + else if (type == T_DTRACE_RET && dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) goto out; - } + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + goto out; #endif if ((frame->tf_rflags & PSL_I) == 0) { Modified: stable/8/sys/amd64/include/segments.h ============================================================================== --- stable/8/sys/amd64/include/segments.h Thu Nov 24 18:57:31 2011 (r227949) +++ stable/8/sys/amd64/include/segments.h Thu Nov 24 19:02:04 2011 (r227950) @@ -214,7 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ -#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: stable/8/sys/amd64/include/trap.h ============================================================================== --- stable/8/sys/amd64/include/trap.h Thu Nov 24 18:57:31 2011 (r227949) +++ stable/8/sys/amd64/include/trap.h Thu Nov 24 19:02:04 2011 (r227950) @@ -62,8 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 31 /* DTrace pid return */ -#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ +#define T_DTRACE_RET 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 24 18:57:31 2011 (r227949) +++ stable/8/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 24 19:02:04 2011 (r227950) @@ -97,7 +97,7 @@ uwrite(proc_t *p, void *kaddr, size_t le return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); } -#endif +#endif /* sun */ #ifdef __i386__ #define r_rax r_eax #define r_rbx r_ebx @@ -1380,6 +1380,7 @@ fasttrap_pid_probe(struct reg *rp) { int ret = 0; uintptr_t addr = 0; + #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); @@ -1558,7 +1559,7 @@ fasttrap_pid_probe(struct reg *rp) * ------------------------ ----- * a: <= 15 * jmp ftt_size> 5 - * b: <= 15 + * b: <= 15 * int T_DTRACE_RET 2 * ----- * <= 37 @@ -1731,12 +1732,16 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); + +#if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { +#else + if (uwrite(curproc, scratch, i, addr)) { +#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break; } - if (tp->ftt_retids != NULL) { curthread->t_dtrace_step = 1; curthread->t_dtrace_ret = 1; Modified: stable/8/sys/i386/i386/trap.c ============================================================================== --- stable/8/sys/i386/i386/trap.c Thu Nov 24 18:57:31 2011 (r227949) +++ stable/8/sys/i386/i386/trap.c Thu Nov 24 19:02:04 2011 (r227950) @@ -140,7 +140,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 30 +#define MAX_TRAP_MSG 33 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -173,6 +173,10 @@ static char *trap_msg[] = { "machine check trap", /* 28 T_MCHK */ "SIMD floating-point exception", /* 29 T_XMMFLT */ "reserved (unknown) fault", /* 30 T_RESERVED */ + "", /* 31 unused (reserved) */ + "DTrace pid return trap", /* 32 T_DTRACE_RET */ + "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ + }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -269,10 +273,6 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if ((type == T_PROTFLT || type == T_PAGEFLT) && - dtrace_trap_func != NULL) - if ((*dtrace_trap_func)(frame, type)) - goto out; if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; @@ -291,6 +291,9 @@ trap(struct trapframe *frame) dtrace_return_probe_ptr(®s) == 0) goto out; } + if ((type == T_PROTFLT || type == T_PAGEFLT) && + dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + goto out; #endif if ((frame->tf_eflags & PSL_I) == 0) { Modified: stable/8/sys/i386/include/segments.h ============================================================================== --- stable/8/sys/i386/include/segments.h Thu Nov 24 18:57:31 2011 (r227949) +++ stable/8/sys/i386/include/segments.h Thu Nov 24 19:02:04 2011 (r227950) @@ -207,7 +207,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ -#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: stable/8/sys/i386/include/trap.h ============================================================================== --- stable/8/sys/i386/include/trap.h Thu Nov 24 18:57:31 2011 (r227949) +++ stable/8/sys/i386/include/trap.h Thu Nov 24 19:02:04 2011 (r227950) @@ -62,8 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 31 /* DTrace pid return */ -#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ +#define T_DTRACE_RET 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 20:31: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 8E46B106567E; Thu, 24 Nov 2011 20:31:06 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64B058FC16; Thu, 24 Nov 2011 20:31:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOKV6Ps011400; Thu, 24 Nov 2011 20:31:06 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOKV608011396; Thu, 24 Nov 2011 20:31:06 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111242031.pAOKV608011396@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 20:31: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: r227951 - in head: . gnu/lib 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: Thu, 24 Nov 2011 20:31:06 -0000 Author: fjoe Date: Thu Nov 24 20:31:06 2011 New Revision: 227951 URL: http://svn.freebsd.org/changeset/base/227951 Log: libodialog: disconnect from the build and obsolete. Modified: head/ObsoleteFiles.inc head/gnu/lib/Makefile head/share/mk/bsd.libnames.mk Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Nov 24 19:02:04 2011 (r227950) +++ head/ObsoleteFiles.inc Thu Nov 24 20:31:06 2011 (r227951) @@ -38,6 +38,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20111125: libodialog removed +OLD_FILES+=usr/lib/libodialog.a +OLD_FILES+=usr/lib/libodialog.so +OLD_LIBS+=usr/lib/libodialog.so.7 +OLD_FILES+=usr/lib/libodialog_p.a +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" +OLD_FILES+=usr/lib32/libodialog.a +OLD_FILES+=usr/lib32/libodialog.so +OLD_LIBS+=usr/lib32/libodialog.so.7 +OLD_FILES+=usr/lib32/libodialog_p.a +.endif # 20110930: sysinstall removed OLD_FILES+=usr/sbin/sysinstall OLD_FILES+=usr/share/man/man8/sysinstall.8.gz Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Thu Nov 24 19:02:04 2011 (r227950) +++ head/gnu/lib/Makefile Thu Nov 24 20:31:06 2011 (r227951) @@ -2,8 +2,7 @@ .include -SUBDIR= csu libgcc libgcov libdialog libgomp libodialog libregex libreadline \ - libssp +SUBDIR= csu libgcc libgcov libdialog libgomp libregex libreadline libssp # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Nov 24 19:02:04 2011 (r227950) +++ head/share/mk/bsd.libnames.mk Thu Nov 24 20:31:06 2011 (r227951) @@ -100,7 +100,6 @@ LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncu LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a -LIBODIALOG?= ${DESTDIR}${LIBDIR}/libodialog.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a # The static PAM library doesn't know its secondary dependencies, From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 20:34: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 9A8AE106564A; Thu, 24 Nov 2011 20:34:06 +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 8A9008FC16; Thu, 24 Nov 2011 20:34:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOKY6d7011541; Thu, 24 Nov 2011 20:34:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOKY6FN011539; Thu, 24 Nov 2011 20:34:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111242034.pAOKY6FN011539@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 Nov 2011 20:34: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: r227952 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 20:34:06 -0000 Author: kib Date: Thu Nov 24 20:34:06 2011 New Revision: 227952 URL: http://svn.freebsd.org/changeset/base/227952 Log: Fix a race between getvnode() dereferencing half-constructed file and dupfdopen(). Reported and tested by: pho MFC after: 3 days Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Nov 24 20:31:06 2011 (r227951) +++ head/sys/kern/vfs_syscalls.c Thu Nov 24 20:34:06 2011 (r227952) @@ -4344,7 +4344,20 @@ getvnode(struct filedesc *fdp, int fd, c fp = fp_fromcap; } #endif /* CAPABILITIES */ - if (fp->f_vnode == NULL) { + + /* + * The file could be not of the vnode type, or it may be not + * yet fully initialized, in which case the f_vnode pointer + * may be set, but f_ops is still badfileops. E.g., + * devfs_open() transiently create such situation to + * facilitate csw d_fdopen(). + * + * Dupfdopen() handling in kern_openat() installs the + * half-baked file into the process descriptor table, allowing + * other thread to dereference it. Guard against the race by + * checking f_ops. + */ + if (fp->f_vnode == NULL || fp->f_ops == &badfileops) { fdrop(fp, curthread); return (EINVAL); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 20:34: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 8C96B106566C; Thu, 24 Nov 2011 20:34:50 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 636088FC17; Thu, 24 Nov 2011 20:34:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOKYoIq011597; Thu, 24 Nov 2011 20:34:50 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOKYoG0011596; Thu, 24 Nov 2011 20:34:50 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111242034.pAOKYoG0011596@svn.freebsd.org> From: Max Khon Date: Thu, 24 Nov 2011 20:34: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: r227953 - head/gnu/lib/libodialog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 20:34:50 -0000 Author: fjoe Date: Thu Nov 24 20:34:50 2011 New Revision: 227953 URL: http://svn.freebsd.org/changeset/base/227953 Log: libodialog: Remove no longer used library. Deleted: head/gnu/lib/libodialog/ From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 20:37: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 F07D81065672; Thu, 24 Nov 2011 20:37:09 +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 E07228FC0A; Thu, 24 Nov 2011 20:37:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOKb9Mw011708; Thu, 24 Nov 2011 20:37:09 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOKb9RI011706; Thu, 24 Nov 2011 20:37:09 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111242037.pAOKb9RI011706@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 24 Nov 2011 20:37: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: r227954 - 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: Thu, 24 Nov 2011 20:37:10 -0000 Author: trociny Date: Thu Nov 24 20:37:09 2011 New Revision: 227954 URL: http://svn.freebsd.org/changeset/base/227954 Log: Add const qualifier to rlimit_ident. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/sys/resource.h Modified: head/sys/sys/resource.h ============================================================================== --- head/sys/sys/resource.h Thu Nov 24 20:34:50 2011 (r227953) +++ head/sys/sys/resource.h Thu Nov 24 20:37:09 2011 (r227954) @@ -108,7 +108,7 @@ struct rusage { */ #ifdef _RLIMIT_IDENT -static char *rlimit_ident[RLIM_NLIMITS] = { +static const char *rlimit_ident[RLIM_NLIMITS] = { "cpu", "fsize", "data", From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 20:41: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 B101A106564A; Thu, 24 Nov 2011 20:41:57 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8FDE68FC16; Thu, 24 Nov 2011 20:41:54 +0000 (UTC) Received: by ghbg20 with SMTP id g20so2866724ghb.13 for ; Thu, 24 Nov 2011 12:41:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=1c/UgwQv06w6ZC+1odrV8mklA254qVPXjie6YZ85NA4=; b=hkhq8rLGQWV86LD3jBO32W+uLIyfqh571YQD0+v6rWbq97lO53FLtXcly2hSo/o7JE mFTaCwGNiDSlkPX4jUtesXXMR58C3evHFZy98MLik6MI9oDjkbDzvezmK/7wzuIG/7Xg tXYZQicSYZ5eDaxex1AbATF8a9jxpe4kUa8xU= MIME-Version: 1.0 Received: by 10.182.231.7 with SMTP id tc7mr9684751obc.2.1322167313985; Thu, 24 Nov 2011 12:41:53 -0800 (PST) Received: by 10.182.62.227 with HTTP; Thu, 24 Nov 2011 12:41:53 -0800 (PST) In-Reply-To: <201111242031.pAOKV608011396@svn.freebsd.org> References: <201111242031.pAOKV608011396@svn.freebsd.org> Date: Thu, 24 Nov 2011 12:41:53 -0800 Message-ID: From: Garrett Cooper To: Max Khon 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: r227951 - in head: . gnu/lib 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: Thu, 24 Nov 2011 20:41:57 -0000 On Thu, Nov 24, 2011 at 12:31 PM, Max Khon wrote: > Author: fjoe > Date: Thu Nov 24 20:31:06 2011 > New Revision: 227951 > URL: http://svn.freebsd.org/changeset/base/227951 > > Log: > =A0libodialog: disconnect from the build and obsolete. > > Modified: > =A0head/ObsoleteFiles.inc > =A0head/gnu/lib/Makefile > =A0head/share/mk/bsd.libnames.mk > > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/ObsoleteFiles.inc =A0 =A0 =A0Thu Nov 24 19:02:04 2011 =A0 =A0 = =A0 =A0(r227950) > +++ head/ObsoleteFiles.inc =A0 =A0 =A0Thu Nov 24 20:31:06 2011 =A0 =A0 = =A0 =A0(r227951) > @@ -38,6 +38,17 @@ > =A0# =A0 xargs -n1 | sort | uniq -d; > =A0# done > > +# 20111125: libodialog removed > +OLD_FILES+=3Dusr/lib/libodialog.a > +OLD_FILES+=3Dusr/lib/libodialog.so > +OLD_LIBS+=3Dusr/lib/libodialog.so.7 > +OLD_FILES+=3Dusr/lib/libodialog_p.a > +.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" > +OLD_FILES+=3Dusr/lib32/libodialog.a > +OLD_FILES+=3Dusr/lib32/libodialog.so > +OLD_LIBS+=3Dusr/lib32/libodialog.so.7 > +OLD_FILES+=3Dusr/lib32/libodialog_p.a > +.endif > =A0# 20110930: sysinstall removed > =A0OLD_FILES+=3Dusr/sbin/sysinstall > =A0OLD_FILES+=3Dusr/share/man/man8/sysinstall.8.gz > > Modified: head/gnu/lib/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/gnu/lib/Makefile =A0 =A0 =A0 Thu Nov 24 19:02:04 2011 =A0 =A0 = =A0 =A0(r227950) > +++ head/gnu/lib/Makefile =A0 =A0 =A0 Thu Nov 24 20:31:06 2011 =A0 =A0 = =A0 =A0(r227951) > @@ -2,8 +2,7 @@ > > =A0.include > > -SUBDIR=3D csu libgcc libgcov libdialog libgomp libodialog libregex libre= adline \ > - =A0 =A0 =A0 libssp > +SUBDIR=3D csu libgcc libgcov libdialog libgomp libregex libreadline libs= sp > > =A0# libsupc++ uses libstdc++ headers, although 'make includes' should > =A0# have taken care of that already. > > Modified: head/share/mk/bsd.libnames.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/mk/bsd.libnames.mk =A0 =A0 =A0 Thu Nov 24 19:02:04 2011 = =A0 =A0 =A0 =A0(r227950) > +++ head/share/mk/bsd.libnames.mk =A0 =A0 =A0 Thu Nov 24 20:31:06 2011 = =A0 =A0 =A0 =A0(r227951) > @@ -100,7 +100,6 @@ LIBNCURSESW?=3D =A0 =A0 =A0 ${DESTDIR}${LIBDIR}/libnc= u > =A0LIBNETGRAPH?=3D =A0${DESTDIR}${LIBDIR}/libnetgraph.a > =A0LIBNGATM?=3D =A0 =A0 ${DESTDIR}${LIBDIR}/libngatm.a > =A0LIBNVPAIR?=3D =A0 =A0${DESTDIR}${LIBDIR}/libnvpair.a > -LIBODIALOG?=3D =A0 ${DESTDIR}${LIBDIR}/libodialog.a > =A0LIBOPIE?=3D =A0 =A0 =A0${DESTDIR}${LIBDIR}/libopie.a tzsetup? From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 20: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 39A7F106566B; Thu, 24 Nov 2011 20:43:02 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 743388FC13; Thu, 24 Nov 2011 20:43:01 +0000 (UTC) Received: by ywp17 with SMTP id 17so1935280ywp.13 for ; Thu, 24 Nov 2011 12:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Sc3XzDISOtX2/d1rPEwLmz1LJ/PreZ74DRXIcpQEXP4=; b=YM7Go7aHjNegm8yn6juuTzTDxl6CTZHCwpHt9BpXjTK4lfxfUlEU/DHGNPn+BjUyJr EKgUxlfTZ+CBmdS4Zt5w4m3/t1qMd6QtKZQIbFWrAZRWfaV8OCh6fbbxoc4rAGnSx0Vh hPOena58so4TjC4t3Widtv7CAVwa1+LycJQ1Q= MIME-Version: 1.0 Received: by 10.182.231.7 with SMTP id tc7mr9685531obc.2.1322167380816; Thu, 24 Nov 2011 12:43:00 -0800 (PST) Received: by 10.182.62.227 with HTTP; Thu, 24 Nov 2011 12:43:00 -0800 (PST) In-Reply-To: References: <201111242031.pAOKV608011396@svn.freebsd.org> Date: Thu, 24 Nov 2011 12:43:00 -0800 Message-ID: From: Garrett Cooper To: Max Khon 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: r227951 - in head: . gnu/lib 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: Thu, 24 Nov 2011 20:43:02 -0000 On Thu, Nov 24, 2011 at 12:41 PM, Garrett Cooper wrote= : > On Thu, Nov 24, 2011 at 12:31 PM, Max Khon wrote: >> Author: fjoe >> Date: Thu Nov 24 20:31:06 2011 >> New Revision: 227951 >> URL: http://svn.freebsd.org/changeset/base/227951 >> >> Log: >> =A0libodialog: disconnect from the build and obsolete. >> >> Modified: >> =A0head/ObsoleteFiles.inc >> =A0head/gnu/lib/Makefile >> =A0head/share/mk/bsd.libnames.mk >> >> Modified: head/ObsoleteFiles.inc >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/ObsoleteFiles.inc =A0 =A0 =A0Thu Nov 24 19:02:04 2011 =A0 =A0 = =A0 =A0(r227950) >> +++ head/ObsoleteFiles.inc =A0 =A0 =A0Thu Nov 24 20:31:06 2011 =A0 =A0 = =A0 =A0(r227951) >> @@ -38,6 +38,17 @@ >> =A0# =A0 xargs -n1 | sort | uniq -d; >> =A0# done >> >> +# 20111125: libodialog removed >> +OLD_FILES+=3Dusr/lib/libodialog.a >> +OLD_FILES+=3Dusr/lib/libodialog.so >> +OLD_LIBS+=3Dusr/lib/libodialog.so.7 >> +OLD_FILES+=3Dusr/lib/libodialog_p.a >> +.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" >> +OLD_FILES+=3Dusr/lib32/libodialog.a >> +OLD_FILES+=3Dusr/lib32/libodialog.so >> +OLD_LIBS+=3Dusr/lib32/libodialog.so.7 >> +OLD_FILES+=3Dusr/lib32/libodialog_p.a >> +.endif >> =A0# 20110930: sysinstall removed >> =A0OLD_FILES+=3Dusr/sbin/sysinstall >> =A0OLD_FILES+=3Dusr/share/man/man8/sysinstall.8.gz >> >> Modified: head/gnu/lib/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/gnu/lib/Makefile =A0 =A0 =A0 Thu Nov 24 19:02:04 2011 =A0 =A0 = =A0 =A0(r227950) >> +++ head/gnu/lib/Makefile =A0 =A0 =A0 Thu Nov 24 20:31:06 2011 =A0 =A0 = =A0 =A0(r227951) >> @@ -2,8 +2,7 @@ >> >> =A0.include >> >> -SUBDIR=3D csu libgcc libgcov libdialog libgomp libodialog libregex libr= eadline \ >> - =A0 =A0 =A0 libssp >> +SUBDIR=3D csu libgcc libgcov libdialog libgomp libregex libreadline lib= ssp >> >> =A0# libsupc++ uses libstdc++ headers, although 'make includes' should >> =A0# have taken care of that already. >> >> Modified: head/share/mk/bsd.libnames.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/mk/bsd.libnames.mk =A0 =A0 =A0 Thu Nov 24 19:02:04 2011 = =A0 =A0 =A0 =A0(r227950) >> +++ head/share/mk/bsd.libnames.mk =A0 =A0 =A0 Thu Nov 24 20:31:06 2011 = =A0 =A0 =A0 =A0(r227951) >> @@ -100,7 +100,6 @@ LIBNCURSESW?=3D =A0 =A0 =A0 ${DESTDIR}${LIBDIR}/libn= cu >> =A0LIBNETGRAPH?=3D =A0${DESTDIR}${LIBDIR}/libnetgraph.a >> =A0LIBNGATM?=3D =A0 =A0 ${DESTDIR}${LIBDIR}/libngatm.a >> =A0LIBNVPAIR?=3D =A0 =A0${DESTDIR}${LIBDIR}/libnvpair.a >> -LIBODIALOG?=3D =A0 ${DESTDIR}${LIBDIR}/libodialog.a >> =A0LIBOPIE?=3D =A0 =A0 =A0${DESTDIR}${LIBDIR}/libopie.a > > tzsetup? Nevermind. Missed that commit.. -Garrett From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 20:43: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 C06B1106566B; Thu, 24 Nov 2011 20:43:37 +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 968DA8FC18; Thu, 24 Nov 2011 20:43:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOKhbiv011950; Thu, 24 Nov 2011 20:43:37 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOKhbkD011947; Thu, 24 Nov 2011 20:43:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111242043.pAOKhbkD011947@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 24 Nov 2011 20:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227955 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 20:43:37 -0000 Author: trociny Date: Thu Nov 24 20:43:37 2011 New Revision: 227955 URL: http://svn.freebsd.org/changeset/base/227955 Log: Add sysctl to get process resource limits. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/kern_proc.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Nov 24 20:37:09 2011 (r227954) +++ head/sys/kern/kern_proc.c Thu Nov 24 20:43:37 2011 (r227955) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2389,6 +2390,48 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A return (error); } +/* + * This sysctl allows a process to retrieve the resource limits for + * another process. + */ +static int +sysctl_kern_proc_rlimit(SYSCTL_HANDLER_ARGS) +{ + int *name = (int*) arg1; + u_int namelen = arg2; + struct plimit *limp; + struct proc *p; + int error = 0; + + if (namelen != 1) + return (EINVAL); + + p = pfind((pid_t)name[0]); + if (p == NULL) + return (ESRCH); + + if ((error = p_cansee(curthread, p)) != 0) { + PROC_UNLOCK(p); + return (error); + } + + /* + * Check the request size. We alow sizes smaller rlimit array for + * backward binary compatibility: the number of resource limits may + * grow. + */ + if (sizeof(limp->pl_rlimit) < req->oldlen) { + PROC_UNLOCK(p); + return (EINVAL); + } + + limp = lim_hold(p->p_limit); + PROC_UNLOCK(p); + error = SYSCTL_OUT(req, limp->pl_rlimit, req->oldlen); + lim_free(limp); + return (error); +} + SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD, 0, "Process table"); SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT| @@ -2484,3 +2527,6 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC static SYSCTL_NODE(_kern_proc, KERN_PROC_GROUPS, groups, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc_groups, "Process groups"); + +static SYSCTL_NODE(_kern_proc, KERN_PROC_RLIMIT, rlimit, CTLFLAG_RD | + CTLFLAG_MPSAFE, sysctl_kern_proc_rlimit, "Process resource limits"); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu Nov 24 20:37:09 2011 (r227954) +++ head/sys/sys/sysctl.h Thu Nov 24 20:43:37 2011 (r227955) @@ -561,6 +561,7 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define KERN_PROC_GROUPS 34 /* process groups */ #define KERN_PROC_ENV 35 /* get environment */ #define KERN_PROC_AUXV 36 /* get ELF auxiliary vector */ +#define KERN_PROC_RLIMIT 37 /* process resource limits */ /* * KERN_IPC identifiers From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 20:54: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 C8C6E106566B; Thu, 24 Nov 2011 20:54:06 +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 B74DF8FC16; Thu, 24 Nov 2011 20:54:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOKs6IT012302; Thu, 24 Nov 2011 20:54:06 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOKs6vj012296; Thu, 24 Nov 2011 20:54:06 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111242054.pAOKs6vj012296@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 24 Nov 2011 20:54: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: r227956 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 20:54:06 -0000 Author: trociny Date: Thu Nov 24 20:54:06 2011 New Revision: 227956 URL: http://svn.freebsd.org/changeset/base/227956 Log: usr.bin/procstat Add -l flag to display resource limits. PR: bin/161257 Reviewed by: kib MFC after: 2 weeks Added: head/usr.bin/procstat/procstat_rlimit.c (contents, props changed) Modified: head/usr.bin/procstat/Makefile head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Thu Nov 24 20:43:37 2011 (r227955) +++ head/usr.bin/procstat/Makefile Thu Nov 24 20:54:06 2011 (r227956) @@ -10,6 +10,7 @@ SRCS= procstat.c \ procstat_cred.c \ procstat_files.c \ procstat_kstack.c \ + procstat_rlimit.c \ procstat_sigs.c \ procstat_threads.c \ procstat_vm.c Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Thu Nov 24 20:43:37 2011 (r227955) +++ head/usr.bin/procstat/procstat.1 Thu Nov 24 20:54:06 2011 (r227956) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2011 +.Dd November 24, 2011 .Dt PROCSTAT 1 .Os .Sh NAME @@ -69,6 +69,8 @@ Display the stacks of kernel threads in threads currently running on a CPU and threads with stacks swapped to disk. If the flag is repeated, function offsets as well as function names are printed. +.It Fl l +Display resource limits for the process. .It Fl s Display security credential information for the process. .It Fl t Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Thu Nov 24 20:43:37 2011 (r227955) +++ head/usr.bin/procstat/procstat.c Thu Nov 24 20:54:06 2011 (r227956) @@ -39,8 +39,8 @@ #include "procstat.h" -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, sflag, tflag; -static int vflag, xflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, sflag; +static int tflag, vflag, xflag; int hflag, nflag, Cflag; static void @@ -50,7 +50,7 @@ usage(void) fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " "[-w interval] \n"); fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-s | -t | -v | -x] [-a | pid ...]\n"); + "-l | -s | -t | -v | -x] [-a | pid ...]\n"); exit(EX_USAGE); } @@ -72,6 +72,8 @@ procstat(struct procstat *prstat, struct procstat_threads_sigs(prstat, kipp); else if (kflag) procstat_kstack(kipp, kflag); + else if (lflag) + procstat_rlimit(kipp); else if (sflag) procstat_cred(kipp); else if (tflag) @@ -123,7 +125,7 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CN:M:abcefijkhstvw:x")) != -1) { + while ((ch = getopt(argc, argv, "CN:M:abcefijklhstvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -167,6 +169,10 @@ main(int argc, char *argv[]) kflag++; break; + case 'l': + lflag++; + break; + case 'n': nflag++; break; @@ -210,8 +216,8 @@ main(int argc, char *argv[]) argv += optind; /* We require that either 0 or 1 mode flags be set. */ - tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + sflag + tflag + - vflag + xflag; + tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + lflag + sflag + + tflag + vflag + xflag; if (!(tmp == 0 || tmp == 1)) usage(); Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Thu Nov 24 20:43:37 2011 (r227955) +++ head/usr.bin/procstat/procstat.h Thu Nov 24 20:54:06 2011 (r227956) @@ -42,6 +42,7 @@ void procstat_cred(struct kinfo_proc *ki void procstat_env(struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct kinfo_proc *kipp, int kflag); +void procstat_rlimit(struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads(struct kinfo_proc *kipp); void procstat_threads_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Added: head/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/procstat_rlimit.c Thu Nov 24 20:54:06 2011 (r227956) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2011 Mikolaj Golub + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#define _RLIMIT_IDENT +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "procstat.h" + +static struct rlimit rlimit[RLIM_NLIMITS]; + +void +procstat_rlimit(struct kinfo_proc *kipp) +{ + int error, i, name[4]; + size_t len; + + if (!hflag) + printf("%5s %-16s %-10s %12s %12s\n", "PID", "COMM", "RLIMIT", + "CURRENT", "MAX"); + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = kipp->ki_pid; + len = sizeof(rlimit); + error = sysctl(name, 4, rlimit, &len, NULL, 0); + if (error < 0 && errno != ESRCH) { + warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); + return; + } + if (error < 0 || len != sizeof(rlimit)) + return; + + for (i = 0; i < RLIM_NLIMITS; i++) { + printf("%5d %-16s %-10s %12jd %12jd\n", kipp->ki_pid, + kipp->ki_comm, rlimit_ident[i], + rlimit[i].rlim_cur == RLIM_INFINITY ? + -1 : rlimit[i].rlim_cur, + rlimit[i].rlim_max == RLIM_INFINITY ? + -1 : rlimit[i].rlim_max); + } +} From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 21:12:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 01C7010656A3; Thu, 24 Nov 2011 21:12:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 62C191608B8; Thu, 24 Nov 2011 21:12:16 +0000 (UTC) Message-ID: <4ECEB330.5090201@FreeBSD.org> Date: Thu, 24 Nov 2011 13:12:16 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111110 Thunderbird/8.0 MIME-Version: 1.0 To: Max Khon References: <201111242034.pAOKYoG0011596@svn.freebsd.org> In-Reply-To: <201111242034.pAOKYoG0011596@svn.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227953 - head/gnu/lib/libodialog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Nov 2011 21:12:26 -0000 On 11/24/2011 12:34, Max Khon wrote: > Author: fjoe > Date: Thu Nov 24 20:34:50 2011 > New Revision: 227953 > URL: http://svn.freebsd.org/changeset/base/227953 > > Log: > libodialog: Remove no longer used library. > > Deleted: > head/gnu/lib/libodialog/ I'm curious ... I asked Nathan to please bring back sysinstall until we have a suitable replacement for the post-install configuration role that it plays. Is your change here going to make that more difficult? Doug -- "We could put the whole Internet into a book." "Too practical." Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 21: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 E4DB5106564A; Thu, 24 Nov 2011 21:23:58 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D47FA8FC12; Thu, 24 Nov 2011 21:23:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOLNwnw013297; Thu, 24 Nov 2011 21:23:58 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOLNwVZ013294; Thu, 24 Nov 2011 21:23:58 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201111242123.pAOLNwVZ013294@svn.freebsd.org> From: Robert Millan Date: Thu, 24 Nov 2011 21: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: r227957 - head/sys/contrib/ipfilter/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 21:23:59 -0000 Author: rmh Date: Thu Nov 24 21:23:58 2011 New Revision: 227957 URL: http://svn.freebsd.org/changeset/base/227957 Log: Adjust a few old checks to use __FreeBSD_version macro to determine which version of FreeBSD kernel we're compiling. Approved by: kib (mentor) Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h head/sys/contrib/ipfilter/netinet/ip_proxy.c Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Thu Nov 24 20:54:06 2011 (r227956) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Thu Nov 24 21:23:58 2011 (r227957) @@ -985,10 +985,10 @@ typedef u_int32_t u_32_t; typedef struct mbuf mb_t; # endif /* _KERNEL */ -# if __FreeBSD__ < 3 +# if __FreeBSD_version < 300000 # include # else -# if __FreeBSD__ == 3 +# if __FreeBSD_version < 400000 # if defined(IPFILTER_LKM) && !defined(ACTUALLY_LKM_NOT_KERNEL) # define ACTUALLY_LKM_NOT_KERNEL # endif Modified: head/sys/contrib/ipfilter/netinet/ip_proxy.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_proxy.c Thu Nov 24 20:54:06 2011 (r227956) +++ head/sys/contrib/ipfilter/netinet/ip_proxy.c Thu Nov 24 21:23:58 2011 (r227957) @@ -63,7 +63,7 @@ struct file; # include # include #endif -#if __FreeBSD__ > 2 +#if __FreeBSD_version >= 300000 # include #endif #include From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 22:43: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 9EA1F106564A; Thu, 24 Nov 2011 22:43:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E8FA8FC14; Thu, 24 Nov 2011 22:43:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOMhmAd015873; Thu, 24 Nov 2011 22:43:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOMhmrr015871; Thu, 24 Nov 2011 22:43:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111242243.pAOMhmrr015871@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 24 Nov 2011 22:43: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: r227958 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 22:43:48 -0000 Author: glebius Date: Thu Nov 24 22:43:48 2011 New Revision: 227958 URL: http://svn.freebsd.org/changeset/base/227958 Log: Fix stupid typo in r227830. PR: 162806 Pointy hat to: glebius Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Nov 24 21:23:58 2011 (r227957) +++ head/sys/netinet/in.c Thu Nov 24 22:43:48 2011 (r227958) @@ -376,7 +376,7 @@ in_control(struct socket *so, u_long cmd switch (cmd) { case SIOCAIFADDR: case SIOCDIFADDR: - if (ifra->ifra_addr.sin_len == AF_INET) { + if (ifra->ifra_addr.sin_family == AF_INET) { struct in_ifaddr *oia; IN_IFADDR_RLOCK(); From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 22: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 47289106564A; Thu, 24 Nov 2011 22:46:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 373CD8FC0C; Thu, 24 Nov 2011 22:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAOMkCwg016011; Thu, 24 Nov 2011 22:46:12 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAOMkC0B016009; Thu, 24 Nov 2011 22:46:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111242246.pAOMkC0B016009@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 24 Nov 2011 22:46: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: r227959 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 22:46:12 -0000 Author: glebius Date: Thu Nov 24 22:46:11 2011 New Revision: 227959 URL: http://svn.freebsd.org/changeset/base/227959 Log: Remove superfluous check: SIOCAIFADDR must have ifra_addr supplied. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Nov 24 22:43:48 2011 (r227958) +++ head/sys/netinet/in.c Thu Nov 24 22:46:11 2011 (r227959) @@ -541,10 +541,7 @@ in_control(struct socket *so, u_long cmd maskIsNew = 0; hostIsNew = 1; error = 0; - if (ifra->ifra_addr.sin_len == 0) { - ifra->ifra_addr = ia->ia_addr; - hostIsNew = 0; - } else if (ifra->ifra_addr.sin_addr.s_addr == + if (ifra->ifra_addr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) hostIsNew = 0; if (ifra->ifra_mask.sin_len) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 24 23: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 416361065670; Thu, 24 Nov 2011 23:48:23 +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 3161D8FC15; Thu, 24 Nov 2011 23:48:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAONmNIx018036; Thu, 24 Nov 2011 23:48:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAONmNP1018034; Thu, 24 Nov 2011 23:48:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111242348.pAONmNP1018034@svn.freebsd.org> From: Marius Strobl Date: Thu, 24 Nov 2011 23: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: r227960 - head/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 23:48:23 -0000 Author: marius Date: Thu Nov 24 23:48:22 2011 New Revision: 227960 URL: http://svn.freebsd.org/changeset/base/227960 Log: Increase the CDMA sync timeout for Schizo bridges to 15 seconds as used by OpenSolaris. One second turned out to be not enough for certain loads while 10 seconds were sufficient. Reported by: Peter Jeremy MFC after: 3 days Modified: head/sys/sparc64/pci/schizo.c Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Thu Nov 24 22:46:11 2011 (r227959) +++ head/sys/sparc64/pci/schizo.c Thu Nov 24 23:48:22 2011 (r227960) @@ -1175,7 +1175,7 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus ; SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, INTCLR_RECEIVED); microuptime(&cur); - end.tv_sec = 1; + end.tv_sec = 15; end.tv_usec = 0; timevaladd(&end, &cur); for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 04:03: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 CFD5B106566B; Fri, 25 Nov 2011 04:03:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6B08FC12; Fri, 25 Nov 2011 04:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAP43bjX026043; Fri, 25 Nov 2011 04:03:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAP43bZG026036; Fri, 25 Nov 2011 04:03:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201111250403.pAP43bZG026036@svn.freebsd.org> From: Ed Maste Date: Fri, 25 Nov 2011 04:03: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: r227961 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 04:03:37 -0000 Author: emaste Date: Fri Nov 25 04:03:37 2011 New Revision: 227961 URL: http://svn.freebsd.org/changeset/base/227961 Log: Add firmware update support for SCSI devices. Firmware can be reprogrammed on devices from Hitachi, HP, IBM, Plextor, Quantum, and Seagate. At least one device from each manufacturer has been tested with some version of this code, and it has been used to update thousands of drives so far. The man page suggests having a backup of the drive's data, and the operation must be confirmed, either interactively or on the command line. (This is the same as the confirmation on the format command.) This work is largely derived from fwprog.c by Andre Albsmeier. Submitted by: Nima Misaghian Sponsored by: Sandvine Incorporated MFC after: 3 months Added: head/sbin/camcontrol/fwdownload.c (contents, props changed) Modified: head/sbin/camcontrol/Makefile head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/camcontrol.h head/sbin/camcontrol/util.c Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Thu Nov 24 23:48:22 2011 (r227960) +++ head/sbin/camcontrol/Makefile Fri Nov 25 04:03:37 2011 (r227961) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= camcontrol -SRCS= camcontrol.c util.c +SRCS= camcontrol.c fwdownload.c util.c .if !defined(RELEASE_CRUNCH) SRCS+= modeedit.c .else Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu Nov 24 23:48:22 2011 (r227960) +++ head/sbin/camcontrol/camcontrol.8 Fri Nov 25 04:03:37 2011 (r227961) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2010 +.Dd November 24, 2011 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -220,6 +220,13 @@ .Op device id .Op generic args .Nm +.Ic fwdownload +.Op device id +.Op generic args +.Aq Fl f Ar fw_image +.Op Fl y +.Op Fl s +.Nm .Ic help .Sh DESCRIPTION The @@ -1060,6 +1067,54 @@ specifies automatic standby timer value .It Ic sleep Put ATA device into SLEEP state. Note that the only way get device out of this state may be reset. +.It Ic fwdownload +Program firmware of the named SCSI device using the image file provided. +.Pp +Current list of supported vendors: +.Bl -bullet -offset indent -compact +.It +HITACHI +.It +HP +.It +IBM +.It +PLEXTOR +.It +QUANTUM +.It +SEAGATE +.El +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Little testing has been done to make sure that different device models from +each vendor work correctly with the fwdownload command. +A vendor name appearing in the supported list means only that firmware of at +least one device type from that vendor has successfully been programmed with +the fwdownload command. +Extra caution should be taken when using this command since there is no +guarantee it will not break a device from the listed vendors. +Ensure that you have a recent backup of the data on the device before +performing a firmware update. +.Bl -tag -width 11n +.It Fl f Ar fw_image +Path to the firmware image file to be downloaded to the specified device. +.It Fl y +Do not ask for confirmation. +.It Fl s +Run in simulation mode. +Packet sizes that will be sent are shown, but no actual packet is sent to the +device. +No confimation is asked in simulation mode. +.It Fl v +Besides showing sense information in case of a failure, the verbose option +causes +.Nm +to output a line for every firmware segment that is sent to the device by the +fwdownload command +-- the same as the ones shown in simulation mode. +.El .It Ic help Print out verbose usage information. .El Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Nov 24 23:48:22 2011 (r227960) +++ head/sbin/camcontrol/camcontrol.c Fri Nov 25 04:03:37 2011 (r227961) @@ -86,7 +86,8 @@ typedef enum { CAM_CMD_SMP_RG = 0x00000018, CAM_CMD_SMP_PC = 0x00000019, CAM_CMD_SMP_PHYLIST = 0x0000001a, - CAM_CMD_SMP_MANINFO = 0x0000001b + CAM_CMD_SMP_MANINFO = 0x0000001b, + CAM_CMD_DOWNLOAD_FW = 0x0000001c } cam_cmdmask; typedef enum { @@ -180,6 +181,7 @@ static struct camcontrol_opts option_tab {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, + {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:ys"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -222,8 +224,6 @@ static int testunitready(struct cam_devi int timeout, int quiet); static int scsistart(struct cam_device *device, int startstop, int loadeject, int retry_count, int timeout); -static int scsidoinquiry(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); static int scsiinquiry(struct cam_device *device, int retry_count, int timeout); static int scsiserial(struct cam_device *device, int retry_count, int timeout); static int camxferrate(struct cam_device *device); @@ -683,7 +683,7 @@ scsistart(struct cam_device *device, int return(error); } -static int +int scsidoinquiry(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { @@ -3571,7 +3571,7 @@ scsiformat(struct cam_device *device, in union ccb *ccb; int c; int ycount = 0, quiet = 0; - int error = 0, response = 0, retval = 0; + int error = 0, retval = 0; int use_timeout = 10800 * 1000; int immediate = 1; struct format_defect_list_header fh; @@ -3625,27 +3625,7 @@ scsiformat(struct cam_device *device, in } if (ycount == 0) { - - do { - char str[1024]; - - fprintf(stdout, "Are you SURE you want to do " - "this? (yes/no) "); - - if (fgets(str, sizeof(str), stdin) != NULL) { - - if (strncasecmp(str, "yes", 3) == 0) - response = 1; - else if (strncasecmp(str, "no", 2) == 0) - response = -1; - else { - fprintf(stdout, "Please answer" - " \"yes\" or \"no\"\n"); - } - } - } while (response == 0); - - if (response == -1) { + if (!get_confirmation()) { error = 1; goto scsiformat_bailout; } @@ -5693,6 +5673,7 @@ usage(int verbose) " camcontrol idle [dev_id][generic args][-t time]\n" " camcontrol standby [dev_id][generic args][-t time]\n" " camcontrol sleep [dev_id][generic args]\n" +" camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!verbose) @@ -5728,6 +5709,7 @@ usage(int verbose) "idle send the ATA IDLE command to the named device\n" "standby send the ATA STANDBY command to the named device\n" "sleep send the ATA SLEEP command to the named device\n" +"fwdownload program firmware of the named device with the given image" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -5819,7 +5801,12 @@ usage(int verbose) "-w don't send immediate format command\n" "-y don't ask any questions\n" "idle/standby arguments:\n" -"-t number of seconds before respective state.\n"); +"-t number of seconds before respective state.\n" +"fwdownload arguments:\n" +"-f fw_image path to firmware image file\n" +"-y don't ask any questions\n" +"-s run in simulation mode\n" +"-v print info for every firmware segment sent to device\n"); #endif /* MINIMALISTIC */ } @@ -6135,6 +6122,10 @@ main(int argc, char **argv) combinedopt, retry_count, timeout); break; + case CAM_CMD_DOWNLOAD_FW: + error = fwdownload(cam_dev, argc, argv, combinedopt, + arglist & CAM_ARG_VERBOSE, retry_count, timeout); + break; #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: usage(1); Modified: head/sbin/camcontrol/camcontrol.h ============================================================================== --- head/sbin/camcontrol/camcontrol.h Thu Nov 24 23:48:22 2011 (r227960) +++ head/sbin/camcontrol/camcontrol.h Fri Nov 25 04:03:37 2011 (r227961) @@ -40,6 +40,8 @@ struct get_hook int got; }; +int fwdownload(struct cam_device *device, int argc, char **argv, + char *combinedopt, int verbose, int retry_count, int timeout); void mode_sense(struct cam_device *device, int mode_page, int page_control, int dbd, int retry_count, int timeout, u_int8_t *data, int datalen); @@ -49,8 +51,11 @@ void mode_edit(struct cam_device *device int edit, int binary, int retry_count, int timeout); void mode_list(struct cam_device *device, int page_control, int dbd, int retry_count, int timeout); +int scsidoinquiry(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); +int get_confirmation(void); void usage(int verbose); #endif /* _CAMCONTROL_H */ Added: head/sbin/camcontrol/fwdownload.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/camcontrol/fwdownload.c Fri Nov 25 04:03:37 2011 (r227961) @@ -0,0 +1,380 @@ +/*- + * Copyright (c) 2011 Sandvine Incorporated. All rights reserved. + * Copyright (c) 2002-2011 Andre Albsmeier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 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. + */ + +/* + * BEWARE: + * + * The fact that you see your favorite vendor listed below does not + * imply that your equipment won't break when you use this software + * with it. It only means that the firmware of at least one device type + * of each vendor listed has been programmed successfully using this code. + * + * The -s option simulates a download but does nothing apart from that. + * It can be used to check what chunk sizes would have been used with the + * specified device. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "camcontrol.h" + +#define CMD_TIMEOUT 50000 /* 50 seconds */ + +typedef enum { + VENDOR_HITACHI, + VENDOR_HP, + VENDOR_IBM, + VENDOR_PLEXTOR, + VENDOR_QUANTUM, + VENDOR_SEAGATE, + VENDOR_UNKNOWN +} fw_vendor_t; + +struct fw_vendor { + fw_vendor_t type; + const char *pattern; + int max_pkt_size; + u_int8_t cdb_byte2; + u_int8_t cdb_byte2_last; + int inc_cdb_buffer_id; + int inc_cdb_offset; +}; + +struct fw_vendor vendors_list[] = { + {VENDOR_HITACHI, "HITACHI", 0x8000, 0x05, 0x05, 1, 0}, + {VENDOR_HP, "HP", 0x8000, 0x07, 0x07, 0, 1}, + {VENDOR_IBM, "IBM", 0x8000, 0x05, 0x05, 1, 0}, + {VENDOR_PLEXTOR, "PLEXTOR", 0x2000, 0x04, 0x05, 0, 1}, + {VENDOR_QUANTUM, "QUANTUM", 0x2000, 0x04, 0x05, 0, 1}, + {VENDOR_SEAGATE, "SEAGATE", 0x8000, 0x07, 0x07, 0, 1}, + {VENDOR_UNKNOWN, NULL, 0x0000, 0x00, 0x00, 0, 0} +}; + +static struct fw_vendor *fw_get_vendor(struct cam_device *cam_dev); +static char *fw_read_img(char *fw_img_path, struct fw_vendor *vp, + int *num_bytes); +static int fw_download_img(struct cam_device *cam_dev, + struct fw_vendor *vp, char *buf, int img_size, + int sim_mode, int verbose, int retry_count, int timeout); + +/* + * Find entry in vendors list that belongs to + * the vendor of given cam device. + */ +static struct fw_vendor * +fw_get_vendor(struct cam_device *cam_dev) +{ + char vendor[SID_VENDOR_SIZE + 1]; + struct fw_vendor *vp; + + if (cam_dev == NULL) + return (NULL); + cam_strvis((u_char *)vendor, (u_char *)cam_dev->inq_data.vendor, + sizeof(cam_dev->inq_data.vendor), sizeof(vendor)); + for (vp = vendors_list; vp->pattern != NULL; vp++) { + if (!cam_strmatch((const u_char *)vendor, + (const u_char *)vp->pattern, strlen(vendor))) + break; + } + return (vp); +} + +/* + * Allocate a buffer and read fw image file into it + * from given path. Number of bytes read is stored + * in num_bytes. + */ +static char * +fw_read_img(char *fw_img_path, struct fw_vendor *vp, int *num_bytes) +{ + int fd; + struct stat stbuf; + char *buf; + off_t img_size; + int skip_bytes = 0; + + if ((fd = open(fw_img_path, O_RDONLY)) < 0) { + warn("Could not open image file %s", fw_img_path); + return (NULL); + } + if (fstat(fd, &stbuf) < 0) { + warn("Could not stat image file %s", fw_img_path); + goto bailout1; + } + if ((img_size = stbuf.st_size) == 0) { + warnx("Zero length image file %s", fw_img_path); + goto bailout1; + } + if ((buf = malloc(img_size)) == NULL) { + warnx("Could not allocate buffer to read image file %s", + fw_img_path); + goto bailout1; + } + /* Skip headers if applicable. */ + switch (vp->type) { + case VENDOR_SEAGATE: + if (read(fd, buf, 16) != 16) { + warn("Could not read image file %s", fw_img_path); + goto bailout; + } + if (lseek(fd, 0, SEEK_SET) == -1) { + warn("Unable to lseek"); + goto bailout; + } + if ((strncmp(buf, "SEAGATE,SEAGATE ", 16) == 0) || + (img_size % 512 == 80)) + skip_bytes = 80; + break; + default: + break; + } + if (skip_bytes != 0) { + fprintf(stdout, "Skipping %d byte header.\n", skip_bytes); + if (lseek(fd, skip_bytes, SEEK_SET) == -1) { + warn("Could not lseek"); + goto bailout; + } + img_size -= skip_bytes; + } + /* Read image into a buffer. */ + if (read(fd, buf, img_size) != img_size) { + warn("Could not read image file %s", fw_img_path); + goto bailout; + } + *num_bytes = img_size; + return (buf); +bailout: + free(buf); +bailout1: + close(fd); + *num_bytes = 0; + return (NULL); +} + +/* + * Download firmware stored in buf to cam_dev. If simulation mode + * is enabled, only show what packet sizes would be sent to the + * device but do not sent any actual packets + */ +static int +fw_download_img(struct cam_device *cam_dev, struct fw_vendor *vp, + char *buf, int img_size, int sim_mode, int verbose, int retry_count, + int timeout) +{ + struct scsi_write_buffer cdb; + union ccb *ccb; + int pkt_count = 0; + u_int32_t pkt_size = 0; + char *pkt_ptr = buf; + u_int32_t offset; + int last_pkt = 0; + + if ((ccb = cam_getccb(cam_dev)) == NULL) { + warnx("Could not allocate CCB"); + return (1); + } + scsi_test_unit_ready(&ccb->csio, 0, NULL, MSG_SIMPLE_Q_TAG, + SSD_FULL_SIZE, 5000); + /* Disable freezing the device queue. */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (cam_send_ccb(cam_dev, ccb) < 0) { + warnx("Error sending test unit ready"); + if (verbose) + cam_error_print(cam_dev, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + cam_freeccb(ccb); + return(1); + } + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + warnx("Device is not ready"); + if (verbose) + cam_error_print(cam_dev, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + cam_freeccb(ccb); + return (1); + } + pkt_size = vp->max_pkt_size; + if (verbose || sim_mode) { + fprintf(stdout, + "--------------------------------------------------\n"); + fprintf(stdout, + "PktNo. PktSize BytesRemaining LastPkt\n"); + fprintf(stdout, + "--------------------------------------------------\n"); + } + /* Download single fw packets. */ + do { + if (img_size <= vp->max_pkt_size) { + last_pkt = 1; + pkt_size = img_size; + } + if (verbose || sim_mode) + fprintf(stdout, "%3u %5u (0x%05X) %7u (0x%06X) " + "%d\n", pkt_count, pkt_size, pkt_size, + img_size - pkt_size, img_size - pkt_size, + last_pkt); + bzero(&cdb, sizeof(cdb)); + cdb.opcode = WRITE_BUFFER; + cdb.control = 0; + /* Parameter list length. */ + scsi_ulto3b(pkt_size, &cdb.length[0]); + offset = vp->inc_cdb_offset ? (pkt_ptr - buf) : 0; + scsi_ulto3b(offset, &cdb.offset[0]); + cdb.byte2 = last_pkt ? vp->cdb_byte2_last : vp->cdb_byte2; + cdb.buffer_id = vp->inc_cdb_buffer_id ? pkt_count : 0; + /* Zero out payload of ccb union after ccb header. */ + bzero((u_char *)ccb + sizeof(struct ccb_hdr), + sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + /* Copy previously constructed cdb into ccb_scsiio struct. */ + bcopy(&cdb, &ccb->csio.cdb_io.cdb_bytes[0], + sizeof(struct scsi_write_buffer)); + /* Fill rest of ccb_scsiio struct. */ + if (!sim_mode) { + cam_fill_csio(&ccb->csio, /* ccb_scsiio */ + retry_count, /* retries */ + NULL, /* cbfcnp */ + CAM_DIR_OUT | CAM_DEV_QFRZDIS, /* flags */ + CAM_TAG_ACTION_NONE, /* tag_action */ + (u_char *)pkt_ptr, /* data_ptr */ + pkt_size, /* dxfer_len */ + SSD_FULL_SIZE, /* sense_len */ + sizeof(struct scsi_write_buffer), /* cdb_len */ + timeout ? timeout : CMD_TIMEOUT); /* timeout */ + /* Execute the command. */ + if (cam_send_ccb(cam_dev, ccb) < 0) { + warnx("Error writing image to device"); + if (verbose) + cam_error_print(cam_dev, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + goto bailout; + } + } + /* Prepare next round. */ + pkt_count++; + pkt_ptr += pkt_size; + img_size -= pkt_size; + } while(!last_pkt); + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (verbose) + cam_error_print(cam_dev, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + goto bailout; + } + cam_freeccb(ccb); + return (0); +bailout: + cam_freeccb(ccb); + return (1); +} + +int +fwdownload(struct cam_device *device, int argc, char **argv, + char *combinedopt, int verbose, int retry_count, int timeout) +{ + struct fw_vendor *vp; + char *fw_img_path = NULL; + char *buf; + int img_size; + int c; + int sim_mode = 0; + int confirmed = 0; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 's': + sim_mode = 1; + confirmed = 1; + break; + case 'f': + fw_img_path = optarg; + break; + case 'y': + confirmed = 1; + break; + default: + break; + } + } + + if (fw_img_path == NULL) + errx(1, + "you must specify a firmware image file using -f option"); + + vp = fw_get_vendor(device); + if (vp == NULL || vp->type == VENDOR_UNKNOWN) + errx(1, "Unsupported device"); + + buf = fw_read_img(fw_img_path, vp, &img_size); + if (buf == NULL) + goto fail; + + if (!confirmed) { + fprintf(stdout, "You are about to download firmware image (%s)" + " into the following device:\n", + fw_img_path); + if (scsidoinquiry(device, argc, argv, combinedopt, 0, + 5000) != 0) { + warnx("Error sending inquiry"); + goto fail; + } + fprintf(stdout, "\nIt may damage your drive. "); + if (!get_confirmation()) + goto fail; + } + if (sim_mode) + fprintf(stdout, "Running in simulation mode\n"); + + if (fw_download_img(device, vp, buf, img_size, sim_mode, verbose, + retry_count, timeout) != 0) { + fprintf(stderr, "Firmware download failed\n"); + goto fail; + } else + fprintf(stdout, "Firmware download successful\n"); + + free(buf); + return (0); +fail: + if (buf != NULL) + free(buf); + return (1); +} + Modified: head/sbin/camcontrol/util.c ============================================================================== --- head/sbin/camcontrol/util.c Thu Nov 24 23:48:22 2011 (r227960) +++ head/sbin/camcontrol/util.c Fri Nov 25 04:03:37 2011 (r227961) @@ -154,3 +154,31 @@ arg_put(void *hook __unused, int letter, if (verbose) putchar('\n'); } + +/* + * Get confirmation from user + * Return values: + * 1: confirmed + * 0: unconfirmed + */ +int +get_confirmation() +{ + char str[1024]; + int response = -1; + + do { + fprintf(stdout, "Are you SURE you want to do this? (yes/no) "); + if (fgets(str, sizeof(str), stdin) != NULL) { + if (strncasecmp(str, "yes", 3) == 0) + response = 1; + else if (strncasecmp(str, "no", 2) == 0) + response = 0; + else + fprintf(stdout, + "Please answer \"yes\" or \"no\"\n"); + } else + response = 0; + } while (response == -1); + return (response); +} From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 07:11: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 4D6FE106564A; Fri, 25 Nov 2011 07:11:00 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D6988FC0A; Fri, 25 Nov 2011 07:11:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAP7B0XQ031957; Fri, 25 Nov 2011 07:11:00 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAP7B0jT031955; Fri, 25 Nov 2011 07:11:00 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111250711.pAP7B0jT031955@svn.freebsd.org> From: Max Khon Date: Fri, 25 Nov 2011 07:11: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: r227962 - head/usr.sbin/sade X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 07:11:00 -0000 Author: fjoe Date: Fri Nov 25 07:10:59 2011 New Revision: 227962 URL: http://svn.freebsd.org/changeset/base/227962 Log: Remove DEBUG_FLAGS. Modified: head/usr.sbin/sade/Makefile Modified: head/usr.sbin/sade/Makefile ============================================================================== --- head/usr.sbin/sade/Makefile Fri Nov 25 04:03:37 2011 (r227961) +++ head/usr.sbin/sade/Makefile Fri Nov 25 07:10:59 2011 (r227962) @@ -20,7 +20,6 @@ WARNS?= 3 CFLAGS+= -DPC98 .endif CFLAGS+= -I${.CURDIR}/../../contrib/dialog -I. -DEBUG_FLAGS= -O0 -g DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} ${LIBUTIL} ${LIBDISK} LDADD= -ldialog -lncursesw -lm -lutil -ldisk From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 07:11:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 893A8106566B; Fri, 25 Nov 2011 07:11:03 +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 5FF2D8FC08; Fri, 25 Nov 2011 07:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAP7B3Qw032008; Fri, 25 Nov 2011 07:11:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAP7B3UO032006; Fri, 25 Nov 2011 07:11:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111250711.pAP7B3UO032006@svn.freebsd.org> From: Xin LI Date: Fri, 25 Nov 2011 07:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227963 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 07:11:03 -0000 Author: delphij Date: Fri Nov 25 07:11:02 2011 New Revision: 227963 URL: http://svn.freebsd.org/changeset/base/227963 Log: Fix build. Modified: head/sbin/camcontrol/util.c Modified: head/sbin/camcontrol/util.c ============================================================================== --- head/sbin/camcontrol/util.c Fri Nov 25 07:10:59 2011 (r227962) +++ head/sbin/camcontrol/util.c Fri Nov 25 07:11:02 2011 (r227963) @@ -162,7 +162,7 @@ arg_put(void *hook __unused, int letter, * 0: unconfirmed */ int -get_confirmation() +get_confirmation(void) { char str[1024]; int response = -1; From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 09: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 14EE1106566C; Fri, 25 Nov 2011 09:46:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE8F18FC16; Fri, 25 Nov 2011 09:46:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAP9kaaH036812; Fri, 25 Nov 2011 09:46:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAP9kaRX036809; Fri, 25 Nov 2011 09:46:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111250946.pAP9kaRX036809@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Nov 2011 09:46: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: r227964 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2011 09:46:37 -0000 Author: kib Date: Fri Nov 25 09:46:36 2011 New Revision: 227964 URL: http://svn.freebsd.org/changeset/base/227964 Log: MFC r227657: Consistently use process spin lock for protection of the p->p_boundary_count. Race could cause the execve(2) from the threaded process to hung since thread boundary counter was incorrect and single-threading never finished. Modified: stable/8/sys/kern/kern_thread.c stable/8/sys/sys/proc.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_thread.c ============================================================================== --- stable/8/sys/kern/kern_thread.c Fri Nov 25 07:11:02 2011 (r227963) +++ stable/8/sys/kern/kern_thread.c Fri Nov 25 09:46:36 2011 (r227964) @@ -518,6 +518,8 @@ calc_remaining(struct proc *p, int mode) { int remaining; + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); if (mode == SINGLE_EXIT) remaining = p->p_numthreads; else if (mode == SINGLE_BOUNDARY) @@ -767,8 +769,11 @@ thread_suspend_check(int return_instead) td->td_flags &= ~TDF_BOUNDARY; thread_unlock(td); PROC_LOCK(p); - if (return_instead == 0) + if (return_instead == 0) { + PROC_SLOCK(p); p->p_boundary_count--; + PROC_SUNLOCK(p); + } } return (0); } Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Fri Nov 25 07:11:02 2011 (r227963) +++ stable/8/sys/sys/proc.h Fri Nov 25 09:46:36 2011 (r227964) @@ -527,7 +527,7 @@ struct proc { struct thread *p_singlethread;/* (c + j) If single threading this is it */ int p_suspcount; /* (j) Num threads in suspended mode. */ struct thread *p_xthread; /* (c) Trap thread */ - int p_boundary_count;/* (c) Num threads at user boundary */ + int p_boundary_count;/* (j) Num threads at user boundary */ int p_pendingcnt; /* how many signals are pending */ struct itimers *p_itimers; /* (c) POSIX interval timers. */ /* End area that is zeroed on creation. */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 10:29: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 E21AA1065672; Fri, 25 Nov 2011 10:29:22 +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 D10588FC18; Fri, 25 Nov 2011 10:29:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPATMEs038172; Fri, 25 Nov 2011 10:29:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPATM8M038170; Fri, 25 Nov 2011 10:29:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111251029.pAPATM8M038170@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Nov 2011 10:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227965 - stable/9/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 10:29:23 -0000 Author: kib Date: Fri Nov 25 10:29:22 2011 New Revision: 227965 URL: http://svn.freebsd.org/changeset/base/227965 Log: MFC r227660: Fix fd leak. Approved by: re (bz) Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Fri Nov 25 09:46:36 2011 (r227964) +++ stable/9/libexec/rtld-elf/rtld.c Fri Nov 25 10:29:22 2011 (r227965) @@ -1657,6 +1657,7 @@ load_object(const char *name, const Obj_ } if (flags & RTLD_LO_NOLOAD) { free(path); + close(fd); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 10:30: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 84D131065673; Fri, 25 Nov 2011 10:30:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73E338FC13; Fri, 25 Nov 2011 10:30:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPAUTYK038248; Fri, 25 Nov 2011 10:30:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPAUTe7038246; Fri, 25 Nov 2011 10:30:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111251030.pAPAUTe7038246@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 25 Nov 2011 10:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227966 - stable/9/lib/librt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 10:30:29 -0000 Author: kib Date: Fri Nov 25 10:30:29 2011 New Revision: 227966 URL: http://svn.freebsd.org/changeset/base/227966 Log: MFC r227661: Free unused allocation on error. Approved by: re (bz) Modified: stable/9/lib/librt/timer.c Directory Properties: stable/9/lib/librt/ (props changed) Modified: stable/9/lib/librt/timer.c ============================================================================== --- stable/9/lib/librt/timer.c Fri Nov 25 10:29:22 2011 (r227965) +++ stable/9/lib/librt/timer.c Fri Nov 25 10:30:29 2011 (r227966) @@ -102,12 +102,14 @@ __timer_create(clockid_t clockid, struct } if (__sigev_check_init()) { + free(timer); errno = EINVAL; return (-1); } sn = __sigev_alloc(SI_TIMER, evp, NULL, 0); if (sn == NULL) { + free(timer); errno = EAGAIN; return (-1); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 12:19: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 AD463106564A; Fri, 25 Nov 2011 12:19:13 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9271C8FC14; Fri, 25 Nov 2011 12:19:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPCJDkh042893; Fri, 25 Nov 2011 12:19:13 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPCJDow042890; Fri, 25 Nov 2011 12:19:13 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201111251219.pAPCJDow042890@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 Nov 2011 12:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227967 - stable/9/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 12:19:13 -0000 Author: bschmidt Date: Fri Nov 25 12:19:13 2011 New Revision: 227967 URL: http://svn.freebsd.org/changeset/base/227967 Log: MFC r227805: The DC calibration result obtained during initialization can't be passed over to the runtime firmware on 6050 devices. Instead let the runtime firmware do the calibration itself. This fixes support for the 6050 series devices. Submitted by: kevlo Approved by: re (kib) Obtained from: OpenBSD Tested by: lx, Tz-Huan Huang(earlier version) Modified: stable/9/sys/dev/iwn/if_iwn.c stable/9/sys/dev/iwn/if_iwnreg.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Fri Nov 25 10:30:29 2011 (r227966) +++ stable/9/sys/dev/iwn/if_iwn.c Fri Nov 25 12:19:13 2011 (r227967) @@ -246,6 +246,7 @@ static int iwn_send_sensitivity(struct i static int iwn_set_pslevel(struct iwn_softc *, int, int, int); static int iwn_send_btcoex(struct iwn_softc *); static int iwn_send_advanced_btcoex(struct iwn_softc *); +static int iwn5000_runtime_calib(struct iwn_softc *); static int iwn_config(struct iwn_softc *); static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); static int iwn_scan(struct iwn_softc *); @@ -2505,7 +2506,8 @@ iwn5000_rx_calib_results(struct iwn_soft case IWN5000_PHY_CALIB_DC: if ((sc->sc_flags & IWN_FLAG_INTERNAL_PA) == 0 && (sc->hw_type == IWN_HW_REV_TYPE_5150 || - sc->hw_type >= IWN_HW_REV_TYPE_6000)) + sc->hw_type >= IWN_HW_REV_TYPE_6000) && + sc->hw_type != IWN_HW_REV_TYPE_6050) idx = 0; break; case IWN5000_PHY_CALIB_LO: @@ -4996,6 +4998,19 @@ iwn_send_advanced_btcoex(struct iwn_soft } static int +iwn5000_runtime_calib(struct iwn_softc *sc) +{ + struct iwn5000_calib_config cmd; + + memset(&cmd, 0, sizeof cmd); + cmd.ucode.once.enable = 0xffffffff; + cmd.ucode.once.start = IWN5000_CALIB_DC; + DPRINTF(sc, IWN_DEBUG_CALIBRATE, + "%s: configuring runtime calibration\n", __func__); + return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0); +} + +static int iwn_config(struct iwn_softc *sc) { struct iwn_ops *ops = &sc->ops; @@ -5015,6 +5030,17 @@ iwn_config(struct iwn_softc *sc) } } + if (sc->hw_type == IWN_HW_REV_TYPE_6050) { + /* Configure runtime DC calibration. */ + error = iwn5000_runtime_calib(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not configure runtime calibration\n", + __func__); + return error; + } + } + /* Configure valid TX chains for >=5000 Series. */ if (sc->hw_type != IWN_HW_REV_TYPE_4965) { txmask = htole32(sc->txchainmask); Modified: stable/9/sys/dev/iwn/if_iwnreg.h ============================================================================== --- stable/9/sys/dev/iwn/if_iwnreg.h Fri Nov 25 10:30:29 2011 (r227966) +++ stable/9/sys/dev/iwn/if_iwnreg.h Fri Nov 25 12:19:13 2011 (r227967) @@ -739,6 +739,8 @@ struct iwn5000_wimax_coex { struct iwn5000_calib_elem { uint32_t enable; uint32_t start; +#define IWN5000_CALIB_DC (1 << 1) + uint32_t send; uint32_t apply; uint32_t reserved; From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 12:20: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 664A21065673; Fri, 25 Nov 2011 12:20:15 +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 4B58A8FC18; Fri, 25 Nov 2011 12:20:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPCKFwT042966; Fri, 25 Nov 2011 12:20:15 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPCKFdc042963; Fri, 25 Nov 2011 12:20:15 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201111251220.pAPCKFdc042963@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 25 Nov 2011 12:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227968 - releng/9.0/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 12:20:15 -0000 Author: bschmidt Date: Fri Nov 25 12:20:14 2011 New Revision: 227968 URL: http://svn.freebsd.org/changeset/base/227968 Log: MFC r227805: The DC calibration result obtained during initialization can't be passed over to the runtime firmware on 6050 devices. Instead let the runtime firmware do the calibration itself. This fixes support for the 6050 series devices. Submitted by: kevlo Approved by: re (kib) Obtained from: OpenBSD Tested by: lx, Tz-Huan Huang(earlier version) Modified: releng/9.0/sys/dev/iwn/if_iwn.c releng/9.0/sys/dev/iwn/if_iwnreg.h Directory Properties: releng/9.0/sys/ (props changed) Modified: releng/9.0/sys/dev/iwn/if_iwn.c ============================================================================== --- releng/9.0/sys/dev/iwn/if_iwn.c Fri Nov 25 12:19:13 2011 (r227967) +++ releng/9.0/sys/dev/iwn/if_iwn.c Fri Nov 25 12:20:14 2011 (r227968) @@ -246,6 +246,7 @@ static int iwn_send_sensitivity(struct i static int iwn_set_pslevel(struct iwn_softc *, int, int, int); static int iwn_send_btcoex(struct iwn_softc *); static int iwn_send_advanced_btcoex(struct iwn_softc *); +static int iwn5000_runtime_calib(struct iwn_softc *); static int iwn_config(struct iwn_softc *); static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); static int iwn_scan(struct iwn_softc *); @@ -2505,7 +2506,8 @@ iwn5000_rx_calib_results(struct iwn_soft case IWN5000_PHY_CALIB_DC: if ((sc->sc_flags & IWN_FLAG_INTERNAL_PA) == 0 && (sc->hw_type == IWN_HW_REV_TYPE_5150 || - sc->hw_type >= IWN_HW_REV_TYPE_6000)) + sc->hw_type >= IWN_HW_REV_TYPE_6000) && + sc->hw_type != IWN_HW_REV_TYPE_6050) idx = 0; break; case IWN5000_PHY_CALIB_LO: @@ -4996,6 +4998,19 @@ iwn_send_advanced_btcoex(struct iwn_soft } static int +iwn5000_runtime_calib(struct iwn_softc *sc) +{ + struct iwn5000_calib_config cmd; + + memset(&cmd, 0, sizeof cmd); + cmd.ucode.once.enable = 0xffffffff; + cmd.ucode.once.start = IWN5000_CALIB_DC; + DPRINTF(sc, IWN_DEBUG_CALIBRATE, + "%s: configuring runtime calibration\n", __func__); + return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0); +} + +static int iwn_config(struct iwn_softc *sc) { struct iwn_ops *ops = &sc->ops; @@ -5015,6 +5030,17 @@ iwn_config(struct iwn_softc *sc) } } + if (sc->hw_type == IWN_HW_REV_TYPE_6050) { + /* Configure runtime DC calibration. */ + error = iwn5000_runtime_calib(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not configure runtime calibration\n", + __func__); + return error; + } + } + /* Configure valid TX chains for >=5000 Series. */ if (sc->hw_type != IWN_HW_REV_TYPE_4965) { txmask = htole32(sc->txchainmask); Modified: releng/9.0/sys/dev/iwn/if_iwnreg.h ============================================================================== --- releng/9.0/sys/dev/iwn/if_iwnreg.h Fri Nov 25 12:19:13 2011 (r227967) +++ releng/9.0/sys/dev/iwn/if_iwnreg.h Fri Nov 25 12:20:14 2011 (r227968) @@ -739,6 +739,8 @@ struct iwn5000_wimax_coex { struct iwn5000_calib_elem { uint32_t enable; uint32_t start; +#define IWN5000_CALIB_DC (1 << 1) + uint32_t send; uint32_t apply; uint32_t reserved; From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 12:43: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 A8B7B106566B; Fri, 25 Nov 2011 12:43:34 +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 97FF58FC08; Fri, 25 Nov 2011 12:43:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPChY5I043744; Fri, 25 Nov 2011 12:43:34 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPChY3O043742; Fri, 25 Nov 2011 12:43:34 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111251243.pAPChY3O043742@svn.freebsd.org> From: Ryan Stone Date: Fri, 25 Nov 2011 12:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227969 - releng/9.0/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, 25 Nov 2011 12:43:34 -0000 Author: rstone Date: Fri Nov 25 12:43:34 2011 New Revision: 227969 URL: http://svn.freebsd.org/changeset/base/227969 Log: MFC r227342. Note that the original commit message, reproduced below, has error. The final sentence should read "*without* CTF data". The in-kernel CTF parser caches the result of its first attempt to parse CTF data from a module. On subsequent attempts to retrieve CTF data for a module, return an error if there no CTF data. This fixes a panic if you try to enable fbt probes on a module with CTF data twice. Approved by: re (kib) Modified: releng/9.0/sys/kern/kern_ctf.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/kern/kern_ctf.c ============================================================================== --- releng/9.0/sys/kern/kern_ctf.c Fri Nov 25 12:20:14 2011 (r227968) +++ releng/9.0/sys/kern/kern_ctf.c Fri Nov 25 12:43:34 2011 (r227969) @@ -90,7 +90,7 @@ link_elf_ctf_get(linker_file_t lf, linke * ctfcnt to -1. See below. */ if (ef->ctfcnt < 0) - return (0); + return (EFTYPE); /* Now check if we've already loaded the CTF data.. */ if (ef->ctfcnt > 0) { From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 13:34: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 A0AD51065676; Fri, 25 Nov 2011 13:34:27 +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 8F9728FC1B; Fri, 25 Nov 2011 13:34:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPDYRtM045354; Fri, 25 Nov 2011 13:34:27 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPDYR20045352; Fri, 25 Nov 2011 13:34:27 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111251334.pAPDYR20045352@svn.freebsd.org> From: Ryan Stone Date: Fri, 25 Nov 2011 13:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227971 - stable/9/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, 25 Nov 2011 13:34:27 -0000 Author: rstone Date: Fri Nov 25 13:34:27 2011 New Revision: 227971 URL: http://svn.freebsd.org/changeset/base/227971 Log: MFC r227342. Note that the original commit message, reproduced below, has error. The final sentence should read "*without* CTF data". The in-kernel CTF parser caches the result of its first attempt to parse CTF data from a module. On subsequent attempts to retrieve CTF data for a module, return an error if there no CTF data. This fixes a panic if you try to enable fbt probes on a module with CTF data twice. Approved by: re (kib) Modified: stable/9/sys/kern/kern_ctf.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/kern_ctf.c ============================================================================== --- stable/9/sys/kern/kern_ctf.c Fri Nov 25 12:51:32 2011 (r227970) +++ stable/9/sys/kern/kern_ctf.c Fri Nov 25 13:34:27 2011 (r227971) @@ -90,7 +90,7 @@ link_elf_ctf_get(linker_file_t lf, linke * ctfcnt to -1. See below. */ if (ef->ctfcnt < 0) - return (0); + return (EFTYPE); /* Now check if we've already loaded the CTF data.. */ if (ef->ctfcnt > 0) { From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 14:37: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 1D235106566B; Fri, 25 Nov 2011 14:37:38 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id D18188FC12; Fri, 25 Nov 2011 14:37:37 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Fri, 25 Nov 2011 09:26:47 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id CBC7A33C02; Fri, 25 Nov 2011 09:26:47 -0500 (EST) Date: Fri, 25 Nov 2011 09:26:47 -0500 From: Ed Maste To: Xin LI Message-ID: <20111125142647.GA37733@sandvine.com> References: <201111250711.pAP7B3UO032006@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201111250711.pAP7B3UO032006@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: r227963 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 14:37:38 -0000 On Fri, Nov 25, 2011 at 07:11:03AM +0000, Xin LI wrote: > Author: delphij > Date: Fri Nov 25 07:11:02 2011 > New Revision: 227963 > URL: http://svn.freebsd.org/changeset/base/227963 > > Log: > Fix build. Pointy-hat-to: emaste Sorry, thanks for fixing. From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 09:10: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 6E8491065677; Fri, 25 Nov 2011 09:10:52 +0000 (UTC) (envelope-from fjoe@samodelkin.net) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id EF4CC8FC19; Fri, 25 Nov 2011 09:10:51 +0000 (UTC) Received: by ggnk5 with SMTP id k5so4627874ggn.13 for ; Fri, 25 Nov 2011 01:10:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.77.193 with SMTP id u1mr9995840obw.33.1322210766147; Fri, 25 Nov 2011 00:46:06 -0800 (PST) Sender: fjoe@samodelkin.net Received: by 10.182.76.225 with HTTP; Fri, 25 Nov 2011 00:46:06 -0800 (PST) X-Originating-IP: [93.92.220.178] In-Reply-To: <4ECEB330.5090201@FreeBSD.org> References: <201111242034.pAOKYoG0011596@svn.freebsd.org> <4ECEB330.5090201@FreeBSD.org> Date: Fri, 25 Nov 2011 15:46:06 +0700 X-Google-Sender-Auth: bo0Kfd_zEgdJJ1yi-QMAySWuYoo Message-ID: From: Max Khon To: Doug Barton X-Mailman-Approved-At: Fri, 25 Nov 2011 14:48:58 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227953 - head/gnu/lib/libodialog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 09:10:52 -0000 Doug, On Fri, Nov 25, 2011 at 4:12 AM, Doug Barton wrote: > Author: fjoe > > Date: Thu Nov 24 20:34:50 2011 > > New Revision: 227953 > > URL: http://svn.freebsd.org/changeset/base/227953 > > > > Log: > > libodialog: Remove no longer used library. > > > > Deleted: > > head/gnu/lib/libodialog/ > > I'm curious ... I asked Nathan to please bring back sysinstall until we > have a suitable replacement for the post-install configuration role that > it plays. Is your change here going to make that more difficult? I did not know about that. If we ever would want to resurrect it 1) I would insist on removing (or merging in) sade functionality 2) I would remove all installation and scripting functionality, leaving only post-configuration 3) Given 1) and 2) I can help porting it to the new libdialog Aside from that, I'd better implement new post-install configuration tool. Max From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 15:46: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 8553A1065670; Fri, 25 Nov 2011 15:46:25 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73DD58FC0A; Fri, 25 Nov 2011 15:46:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPFkPg9049396; Fri, 25 Nov 2011 15:46:25 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPFkPmF049388; Fri, 25 Nov 2011 15:46:25 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111251546.pAPFkPmF049388@svn.freebsd.org> From: David Chisnall Date: Fri, 25 Nov 2011 15:46:25 +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: r227972 - vendor/libcxxrt/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: Fri, 25 Nov 2011 15:46:25 -0000 Author: theraven Date: Fri Nov 25 15:46:25 2011 New Revision: 227972 URL: http://svn.freebsd.org/changeset/base/227972 Log: Import the new version of libcxxrt, which grew an extra ARM. Approved by: dim (mentor) Added: vendor/libcxxrt/dist/unwind-arm.h vendor/libcxxrt/dist/unwind-itanium.h vendor/libcxxrt/dist/unwind.h Modified: vendor/libcxxrt/dist/cxxabi.h vendor/libcxxrt/dist/dwarf_eh.h vendor/libcxxrt/dist/exception.cc vendor/libcxxrt/dist/guard.cc Modified: vendor/libcxxrt/dist/cxxabi.h ============================================================================== --- vendor/libcxxrt/dist/cxxabi.h Fri Nov 25 13:34:27 2011 (r227971) +++ vendor/libcxxrt/dist/cxxabi.h Fri Nov 25 15:46:25 2011 (r227972) @@ -1,7 +1,7 @@ #ifndef __CXXABI_H_ #define __CXXABI_H_ #include -#include +#include "unwind.h" namespace std { class type_info; @@ -87,6 +87,18 @@ struct __cxa_exception * handler count reaches 0 (which it doesn't with the top bit set). */ int handlerCount; +#ifdef __arm__ + /** + * The ARM EH ABI requires the unwind library to keep track of exceptions + * during cleanups. These support nesting, so we need to keep a list of + * them. + */ + _Unwind_Exception *nextCleanup; + /** + * The number of cleanups that are currently being run on this exception. + */ + int cleanupCount; +#endif /** * The selector value to be returned when installing the catch handler. * Used at the call site to determine which catch() block should execute. Modified: vendor/libcxxrt/dist/dwarf_eh.h ============================================================================== --- vendor/libcxxrt/dist/dwarf_eh.h Fri Nov 25 13:34:27 2011 (r227971) +++ vendor/libcxxrt/dist/dwarf_eh.h Fri Nov 25 15:46:25 2011 (r227972) @@ -16,10 +16,10 @@ // that it doesn't impact the rest of the program. #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 -# include +# include "unwind.h" # undef _GNU_SOURCE #else -# include +# include "unwind.h" #endif #include @@ -340,6 +340,9 @@ static inline struct dwarf_eh_lsda parse lsda.type_table = type_table; //lsda.type_table = (uintptr_t*)(data + v); } +#if __arm__ + lsda.type_table_encoding = (DW_EH_PE_pcrel | DW_EH_PE_indirect); +#endif lsda.callsite_encoding = (enum dwarf_data_encoding)(*(data++)); Modified: vendor/libcxxrt/dist/exception.cc ============================================================================== --- vendor/libcxxrt/dist/exception.cc Fri Nov 25 13:34:27 2011 (r227971) +++ vendor/libcxxrt/dist/exception.cc Fri Nov 25 15:46:25 2011 (r227972) @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "typeinfo.h" #include "dwarf_eh.h" @@ -9,6 +10,66 @@ using namespace ABI_NAMESPACE; +/** + * Saves the result of the landing pad that we have found. For ARM, this is + * stored in the generic unwind structure, while on other platforms it is + * stored in the C++ exception. + */ +static void saveLandingPad(struct _Unwind_Context *context, + struct _Unwind_Exception *ucb, + struct __cxa_exception *ex, + int selector, + dw_eh_ptr_t landingPad) +{ +#ifdef __arm__ + // On ARM, we store the saved exception in the generic part of the structure + ucb->barrier_cache.sp = _Unwind_GetGR(context, 13); + ucb->barrier_cache.bitpattern[1] = (uint32_t)selector; + ucb->barrier_cache.bitpattern[3] = (uint32_t)landingPad; +#endif + // Cache the results for the phase 2 unwind, if we found a handler + // and this is not a foreign exception. + if (ex) + { + ex->handlerSwitchValue = selector; + ex->catchTemp = landingPad; + } +} + +/** + * Loads the saved landing pad. Returns 1 on success, 0 on failure. + */ +static int loadLandingPad(struct _Unwind_Context *context, + struct _Unwind_Exception *ucb, + struct __cxa_exception *ex, + unsigned long *selector, + dw_eh_ptr_t *landingPad) +{ +#ifdef __arm__ + *selector = ucb->barrier_cache.bitpattern[1]; + *landingPad = (dw_eh_ptr_t)ucb->barrier_cache.bitpattern[3]; + return 1; +#else + if (ex) + { + *selector = ex->handlerSwitchValue; + *landingPad = (dw_eh_ptr_t)ex->catchTemp; + return 0; + } + return 0; +#endif +} + +static inline _Unwind_Reason_Code continueUnwinding(struct _Unwind_Exception *ex, + struct _Unwind_Context *context) +{ +#ifdef __arm__ + if (__gnu_unwind_frame(ex, context) != _URC_OK) { return _URC_FAILURE; } +#endif + return _URC_CONTINUE_UNWIND; +} + + extern "C" void __cxa_free_exception(void *thrown_exception); extern "C" void __cxa_free_dependent_exception(void *thrown_exception); extern "C" void* __dynamic_cast(const void *sub, @@ -59,6 +120,10 @@ struct __cxa_thread_info */ int emergencyBuffersHeld; /** + * The exception currently running in a cleanup. + */ + _Unwind_Exception *currentCleanup; + /** * The public part of this structure, accessible from outside of this * module. */ @@ -78,6 +143,10 @@ struct __cxa_dependent_exception terminate_handler terminateHandler; __cxa_exception *nextException; int handlerCount; +#ifdef __arm__ + _Unwind_Exception *nextCleanup; + int cleanupCount; +#endif int handlerSwitchValue; const char *actionRecord; const char *languageSpecificData; @@ -519,9 +588,11 @@ static void report_failure(_Unwind_Reaso case _URC_FATAL_PHASE1_ERROR: fprintf(stderr, "Fatal error during phase 1 unwinding\n"); break; +#ifndef __arm__ case _URC_FATAL_PHASE2_ERROR: fprintf(stderr, "Fatal error during phase 2 unwinding\n"); break; +#endif case _URC_END_OF_STACK: fprintf(stderr, "Terminating due to uncaught exception %p", (void*)thrown_exception); @@ -696,6 +767,7 @@ static std::type_info *get_type_info_ent // Get the address of the record in the table. dw_eh_ptr_t record = lsda->type_table - dwarf_size_of_fixed_size_field(lsda->type_table_encoding)*filter; + //record -= 4; dw_eh_ptr_t start = record; // Read the value, but it's probably an indirect reference... int64_t offset = read_value(lsda->type_table_encoding, &record); @@ -709,6 +781,7 @@ static std::type_info *get_type_info_ent } + /** * Checks the type signature found in a handler against the type of the thrown * object. If ex is 0 then it is assumed to be a foreign exception and only @@ -829,9 +902,22 @@ static handler_type check_action_record( } else if (filter < 0 && 0 != ex) { - unsigned char *type_index = ((unsigned char*)lsda->type_table - filter - 1); bool matched = false; *selector = filter; +#ifdef __arm__ + filter++; + std::type_info *handler_type = get_type_info_entry(context, lsda, filter--); + while (handler_type) + { + if (check_type_signature(ex, handler_type, adjustedPtr)) + { + matched = true; + break; + } + handler_type = get_type_info_entry(context, lsda, filter--); + } +#else + unsigned char *type_index = ((unsigned char*)lsda->type_table - filter - 1); while (*type_index) { std::type_info *handler_type = get_type_info_entry(context, lsda, *(type_index++)); @@ -844,6 +930,7 @@ static handler_type check_action_record( break; } } +#endif if (matched) { continue; } // If we don't find an allowed exception spec, we need to install // the context for this action. The landing pad will then call the @@ -859,17 +946,32 @@ static handler_type check_action_record( return found; } +static void pushCleanupException(_Unwind_Exception *exceptionObject, + __cxa_exception *ex) +{ +#ifdef __arm__ + __cxa_thread_info *info = thread_info_fast(); + if (ex) + { + ex->cleanupCount++; + if (ex->cleanupCount > 1) + { + assert(exceptionObject == info->currentCleanup); + return; + } + ex->nextCleanup = info->currentCleanup; + } + info->currentCleanup = exceptionObject; +#endif +} + /** * The exception personality function. This is referenced in the unwinding * DWARF metadata and is called by the unwind library for each C++ stack frame * containing catch or cleanup code. */ -extern "C" _Unwind_Reason_Code __gxx_personality_v0(int version, - _Unwind_Action actions, - uint64_t exceptionClass, - struct _Unwind_Exception *exceptionObject, - struct _Unwind_Context *context) -{ +extern "C" +BEGIN_PERSONALITY_FUNCTION(__gxx_personality_v0) // This personality function is for version 1 of the ABI. If you use it // with a future version of the ABI, it won't know what to do, so it // reports a fatal error and give up before it breaks anything. @@ -896,7 +998,7 @@ extern "C" _Unwind_Reason_Code __gxx_pe (unsigned char*)_Unwind_GetLanguageSpecificData(context); // No LSDA implies no landing pads - try the next frame - if (0 == lsda_addr) { return _URC_CONTINUE_UNWIND; } + if (0 == lsda_addr) { return continueUnwinding(exceptionObject, context); } // These two variables define how the exception will be handled. dwarf_eh_action action = {0}; @@ -941,15 +1043,14 @@ extern "C" _Unwind_Reason_Code __gxx_pe // and this is not a foreign exception. if (ex) { - ex->handlerSwitchValue = selector; - ex->actionRecord = (const char*)action.action_record; + saveLandingPad(context, exceptionObject, ex, selector, action.landing_pad); ex->languageSpecificData = (const char*)lsda_addr; - ex->catchTemp = action.landing_pad; + ex->actionRecord = (const char*)action.action_record; // ex->adjustedPtr is set when finding the action record. } return _URC_HANDLER_FOUND; } - return _URC_CONTINUE_UNWIND; + return continueUnwinding(exceptionObject, context); } @@ -962,11 +1063,12 @@ extern "C" _Unwind_Reason_Code __gxx_pe // cleanup struct dwarf_eh_lsda lsda = parse_lsda(context, lsda_addr); dwarf_eh_find_callsite(context, &lsda, &action); - if (0 == action.landing_pad) { return _URC_CONTINUE_UNWIND; } + if (0 == action.landing_pad) { return continueUnwinding(exceptionObject, context); } handler_type found_handler = check_action_record(context, &lsda, action.action_record, realEx, &selector, ex->adjustedPtr); // Ignore handlers this time. - if (found_handler != handler_cleanup) { return _URC_CONTINUE_UNWIND; } + if (found_handler != handler_cleanup) { return continueUnwinding(exceptionObject, context); } + pushCleanupException(exceptionObject, ex); } else if (foreignException) { @@ -983,9 +1085,8 @@ extern "C" _Unwind_Reason_Code __gxx_pe else { // Restore the saved info if we saved some last time. - action.landing_pad = (dw_eh_ptr_t)ex->catchTemp; + loadLandingPad(context, exceptionObject, ex, &selector, &action.landing_pad); ex->catchTemp = 0; - selector = (unsigned long)ex->handlerSwitchValue; ex->handlerSwitchValue = 0; } @@ -1063,6 +1164,8 @@ extern "C" void *__cxa_begin_catch(void return ((char*)exceptionObject + sizeof(_Unwind_Exception)); } + + /** * ABI function called when exiting a catch block. This will free the current * exception if it is no longer referenced in other catch blocks. @@ -1281,3 +1384,38 @@ namespace std return terminateHandler; } } +#ifdef __arm__ +extern "C" _Unwind_Exception *__cxa_get_cleanup(void) +{ + __cxa_thread_info *info = thread_info_fast(); + _Unwind_Exception *exceptionObject = info->currentCleanup; + if (isCXXException(exceptionObject->exception_class)) + { + __cxa_exception *ex = exceptionFromPointer(exceptionObject); + ex->cleanupCount--; + if (ex->cleanupCount == 0) + { + info->currentCleanup = ex->nextCleanup; + ex->nextCleanup = 0; + } + } + else + { + info->currentCleanup = 0; + } + return exceptionObject; +} + +asm ( +".pushsection .text.__cxa_end_cleanup \n" +".global __cxa_end_cleanup \n" +".type __cxa_end_cleanup, \"function\" \n" +"__cxa_end_cleanup: \n" +" push {r1, r2, r3, r4} \n" +" bl __cxa_get_cleanup \n" +" push {r1, r2, r3, r4} \n" +" b _Unwind_Resume \n" +" bl abort \n" +".popsection \n" +); +#endif Modified: vendor/libcxxrt/dist/guard.cc ============================================================================== --- vendor/libcxxrt/dist/guard.cc Fri Nov 25 13:34:27 2011 (r227971) +++ vendor/libcxxrt/dist/guard.cc Fri Nov 25 15:46:25 2011 (r227972) @@ -16,6 +16,59 @@ */ #include #include +#include + +#ifdef __arm__ +// ARM ABI - 32-bit guards. + +/** + * Acquires a lock on a guard, returning 0 if the object has already been + * initialised, and 1 if it has not. If the object is already constructed then + * this function just needs to read a byte from memory and return. + */ +extern "C" int __cxa_guard_acquire(volatile int32_t *guard_object) +{ + if ((1<<31) == *guard_object) { return 0; } + // If we can atomically move the value from 0 -> 1, then this is + // uninitialised. + if (__sync_bool_compare_and_swap(guard_object, 0, 1)) + { + return 1; + } + // If the value is not 0, some other thread was initialising this. Spin + // until it's finished. + while (__sync_bool_compare_and_swap(guard_object, (1<<31), (1<<31))) + { + // If the other thread aborted, then we grab the lock + if (__sync_bool_compare_and_swap(guard_object, 0, 1)) + { + return 1; + } + sched_yield(); + } + return 0; +} + +/** + * Releases the lock without marking the object as initialised. This function + * is called if initialising a static causes an exception to be thrown. + */ +extern "C" void __cxa_guard_abort(int32_t *guard_object) +{ + assert(__sync_bool_compare_and_swap(guard_object, 1, 0)); +} +/** + * Releases the guard and marks the object as initialised. This function is + * called after successful initialisation of a static. + */ +extern "C" void __cxa_guard_release(int32_t *guard_object) +{ + assert(__sync_bool_compare_and_swap(guard_object, 1, (1<<31))); +} + + +#else +// Itanium ABI: 64-bit guards /** * Returns a pointer to the low 32 bits in a 64-bit value, respecting the @@ -78,3 +131,4 @@ extern "C" void __cxa_guard_release(int6 __cxa_guard_abort(guard_object); } +#endif Added: vendor/libcxxrt/dist/unwind-arm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/dist/unwind-arm.h Fri Nov 25 15:46:25 2011 (r227972) @@ -0,0 +1,201 @@ +/** + * ARM-specific unwind definitions. These are taken from the ARM EHABI + * specification. + */ + typedef enum +{ + _URC_OK = 0, /* operation completed successfully */ + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8, + _URC_FAILURE = 9, /* unspecified failure of some kind */ + _URC_FATAL_PHASE1_ERROR = _URC_FAILURE +} _Unwind_Reason_Code; + +typedef uint32_t _Unwind_State; +#ifdef __clang__ +static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME = 0; +static const _Unwind_State _US_UNWIND_FRAME_STARTING = 1; +static const _Unwind_State _US_UNWIND_FRAME_RESUME = 2; +#else // GCC fails at knowing what a constant expression is +# define _US_VIRTUAL_UNWIND_FRAME 0 +# define _US_UNWIND_FRAME_STARTING 1 +# define _US_UNWIND_FRAME_RESUME 2 +#endif + +typedef struct _Unwind_Context _Unwind_Context; + +typedef uint32_t _Unwind_EHT_Header; + +struct _Unwind_Exception +{ + uint64_t exception_class; + void (*exception_cleanup)(_Unwind_Reason_Code, struct _Unwind_Exception *); + /* Unwinder cache, private fields for the unwinder's use */ + struct + { + uint32_t reserved1; + uint32_t reserved2; + uint32_t reserved3; + uint32_t reserved4; + uint32_t reserved5; + /* init reserved1 to 0, then don't touch */ + } unwinder_cache; + /* Propagation barrier cache (valid after phase 1): */ + struct + { + uint32_t sp; + uint32_t bitpattern[5]; + } barrier_cache; + /* Cleanup cache (preserved over cleanup): */ + struct + { + uint32_t bitpattern[4]; + } cleanup_cache; + /* Pr cache (for pr's benefit): */ + struct + { + /** function start address */ + uint32_t fnstart; + /** pointer to EHT entry header word */ + _Unwind_EHT_Header *ehtp; + /** additional data */ + uint32_t additional; + uint32_t reserved1; + } pr_cache; + /** Force alignment of next item to 8-byte boundary */ + long long int :0; +}; + +/* Unwinding functions */ +_Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *ucbp); +void _Unwind_Resume(struct _Unwind_Exception *ucbp); +void _Unwind_Complete(struct _Unwind_Exception *ucbp); +void _Unwind_DeleteException(struct _Unwind_Exception *ucbp); +void *_Unwind_GetLanguageSpecificData(struct _Unwind_Context*); + +typedef enum +{ + _UVRSR_OK = 0, + _UVRSR_NOT_IMPLEMENTED = 1, + _UVRSR_FAILED = 2 +} _Unwind_VRS_Result; +typedef enum +{ + _UVRSC_CORE = 0, + _UVRSC_VFP = 1, + _UVRSC_WMMXD = 3, + _UVRSC_WMMXC = 4 +} _Unwind_VRS_RegClass; +typedef enum +{ + _UVRSD_UINT32 = 0, + _UVRSD_VFPX = 1, + _UVRSD_UINT64 = 3, + _UVRSD_FLOAT = 4, + _UVRSD_DOUBLE = 5 +} _Unwind_VRS_DataRepresentation; + +_Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *context, + _Unwind_VRS_RegClass regclass, + uint32_t regno, + _Unwind_VRS_DataRepresentation representation, + void *valuep); +_Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *context, + _Unwind_VRS_RegClass regclass, + uint32_t regno, + _Unwind_VRS_DataRepresentation representation, + void *valuep); + +/* Return the base-address for data references. */ +extern unsigned long _Unwind_GetDataRelBase(struct _Unwind_Context *); + +/* Return the base-address for text references. */ +extern unsigned long _Unwind_GetTextRelBase(struct _Unwind_Context *); +extern unsigned long _Unwind_GetRegionStart(struct _Unwind_Context *); + +typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *, + void *); +extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); +extern _Unwind_Reason_Code + _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); + +/** + * The next set of functions are compatibility extensions, implementing Itanium + * ABI functions on top of ARM ones. + */ + +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 + +static inline unsigned long _Unwind_GetGR(struct _Unwind_Context *context, int reg) +{ + unsigned long val; + _Unwind_VRS_Get(context, _UVRSC_CORE, reg, _UVRSD_UINT32, &val); + return val; +} +static inline void _Unwind_SetGR(struct _Unwind_Context *context, int reg, unsigned long val) +{ + _Unwind_VRS_Set(context, _UVRSC_CORE, reg, _UVRSD_UINT32, &val); +} +static inline unsigned long _Unwind_GetIP(_Unwind_Context *context) +{ + // Low bit store the thumb state - discard it + return _Unwind_GetGR(context, 15) & ~1; +} +static inline void _Unwind_SetIP(_Unwind_Context *context, unsigned long val) +{ + // The lowest bit of the instruction pointer indicates whether we're in + // thumb or ARM mode. This is assumed to be fixed throughout a function, + // so must be propagated when setting the program counter. + unsigned long thumbState = _Unwind_GetGR(context, 15) & 1; + _Unwind_SetGR(context, 15, (val | thumbState)); +} + +/** GNU API function that unwinds the frame */ +_Unwind_Reason_Code __gnu_unwind_frame(struct _Unwind_Exception*, struct _Unwind_Context*); + + +#define DECLARE_PERSONALITY_FUNCTION(name) \ +_Unwind_Reason_Code name(_Unwind_State state,\ + struct _Unwind_Exception *exceptionObject,\ + struct _Unwind_Context *context); + +#define BEGIN_PERSONALITY_FUNCTION(name) \ +_Unwind_Reason_Code name(_Unwind_State state,\ + struct _Unwind_Exception *exceptionObject,\ + struct _Unwind_Context *context)\ +{\ + int version = 1;\ + uint64_t exceptionClass = exceptionObject->exception_class;\ + int actions;\ + switch (state)\ + {\ + default: return _URC_FAILURE;\ + case _US_VIRTUAL_UNWIND_FRAME:\ + {\ + actions = _UA_SEARCH_PHASE;\ + break;\ + }\ + case _US_UNWIND_FRAME_STARTING:\ + {\ + actions = _UA_CLEANUP_PHASE;\ + if (exceptionObject->barrier_cache.sp == _Unwind_GetGR(context, 13))\ + {\ + actions |= _UA_HANDLER_FRAME;\ + }\ + break;\ + }\ + case _US_UNWIND_FRAME_RESUME:\ + {\ + return continueUnwinding(exceptionObject, context);\ + break;\ + }\ + }\ + _Unwind_SetGR (context, 12, (unsigned long)exceptionObject);\ + +#define CALL_PERSONALITY_FUNCTION(name) name(state,exceptionObject,context) Added: vendor/libcxxrt/dist/unwind-itanium.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/dist/unwind-itanium.h Fri Nov 25 15:46:25 2011 (r227972) @@ -0,0 +1,170 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef _UNWIND_H +#define _UNWIND_H + +/* For uint64_t */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Minimal interface as per C++ ABI draft standard: + + http://www.codesourcery.com/cxx-abi/abi-eh.html */ + +typedef enum + { + _URC_NO_REASON = 0, + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_FATAL_PHASE2_ERROR = 2, + _URC_FATAL_PHASE1_ERROR = 3, + _URC_NORMAL_STOP = 4, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8 + } +_Unwind_Reason_Code; + +typedef int _Unwind_Action; + +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 + +struct _Unwind_Context; /* opaque data-structure */ +struct _Unwind_Exception; /* forward-declaration */ + +typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, + struct _Unwind_Exception *); + +typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action, + uint64_t, + struct _Unwind_Exception *, + struct _Unwind_Context *, + void *); + +/* The C++ ABI requires exception_class, private_1, and private_2 to + be of type uint64 and the entire structure to be + double-word-aligned. Please note that exception_class stays 64-bit + even on 32-bit machines for gcc compatibility. */ +struct _Unwind_Exception + { + uint64_t exception_class; + _Unwind_Exception_Cleanup_Fn exception_cleanup; + unsigned long private_1; + unsigned long private_2; + } __attribute__((__aligned__)); + +extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); +extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, + _Unwind_Stop_Fn, void *); +extern void _Unwind_Resume (struct _Unwind_Exception *); +extern void _Unwind_DeleteException (struct _Unwind_Exception *); +extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int); +extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long); +extern unsigned long _Unwind_GetIP (struct _Unwind_Context *); +extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *); +extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long); +extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*); +extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *); + +#ifdef _GNU_SOURCE + +/* Callback for _Unwind_Backtrace(). The backtrace stops immediately + if the callback returns any value other than _URC_NO_REASON. */ +typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *, + void *); + +/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why + _UA_END_OF_STACK exists. */ +# define _UA_END_OF_STACK 16 + +/* If the unwind was initiated due to a forced unwind, resume that + operation, else re-raise the exception. This is used by + __cxa_rethrow(). */ +extern _Unwind_Reason_Code + _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); + +/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why + _Unwind_GetBSP() exists. */ +extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *); + +/* Return the "canonical frame address" for the given context. + This is used by NPTL... */ +extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *); + +/* Return the base-address for data references. */ +extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *); + +/* Return the base-address for text references. */ +extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *); + +/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any + cleanup. The first frame for which the callback is invoked is the + one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace() + returns _URC_END_OF_STACK when the backtrace stopped due to + reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it + stops for any other reason. */ +extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); + +/* Find the start-address of the procedure containing the specified IP + or NULL if it cannot be found (e.g., because the function has no + unwind info). Note: there is not necessarily a one-to-one + correspondence between source-level functions and procedures: some + functions don't have unwind-info and others are split into multiple + procedures. */ +extern void *_Unwind_FindEnclosingFunction (void *); + +/* See also Linux Standard Base Spec: + http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */ + +#endif /* _GNU_SOURCE */ + +#define DECLARE_PERSONALITY_FUNCTION(name) \ +_Unwind_Reason_Code name(int version,\ + _Unwind_Action actions,\ + uint64_t exceptionClass,\ + struct _Unwind_Exception *exceptionObject,\ + struct _Unwind_Context *context); +#define BEGIN_PERSONALITY_FUNCTION(name) \ +_Unwind_Reason_Code name(int version,\ + _Unwind_Action actions,\ + uint64_t exceptionClass,\ + struct _Unwind_Exception *exceptionObject,\ + struct _Unwind_Context *context)\ +{ + +#define CALL_PERSONALITY_FUNCTION(name) name(version, actions, exceptionClass, exceptionObject, context) + +#ifdef __cplusplus +} +#endif + +#endif /* _UNWIND_H */ Added: vendor/libcxxrt/dist/unwind.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/dist/unwind.h Fri Nov 25 15:46:25 2011 (r227972) @@ -0,0 +1,18 @@ +#ifndef UNWIND_H_INCLUDED +#define UNWIND_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __arm__ +#include "unwind-arm.h" +#else +#include "unwind-itanium.h" +#endif + +#ifdef __cplusplus +} +#endif + +#endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 15:48: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 27D9F1065677; Fri, 25 Nov 2011 15:48:31 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1576C8FC12; Fri, 25 Nov 2011 15:48:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPFmVH8049494; Fri, 25 Nov 2011 15:48:31 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPFmVqs049490; Fri, 25 Nov 2011 15:48:31 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111251548.pAPFmVqs049490@svn.freebsd.org> From: David Chisnall Date: Fri, 25 Nov 2011 15:48:31 +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: r227973 - vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 15:48:31 -0000 Author: theraven Date: Fri Nov 25 15:48:30 2011 New Revision: 227973 URL: http://svn.freebsd.org/changeset/base/227973 Log: libcxxrt version snapshot created. Approved by: dim (mentor) Added: vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/ - copied from r227971, vendor/libcxxrt/dist/ vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/unwind-arm.h - copied unchanged from r227972, vendor/libcxxrt/dist/unwind-arm.h vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/unwind-itanium.h - copied unchanged from r227972, vendor/libcxxrt/dist/unwind-itanium.h vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/unwind.h - copied unchanged from r227972, vendor/libcxxrt/dist/unwind.h Replaced: vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/cxxabi.h - copied unchanged from r227972, vendor/libcxxrt/dist/cxxabi.h vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/dwarf_eh.h - copied unchanged from r227972, vendor/libcxxrt/dist/dwarf_eh.h vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/exception.cc - copied unchanged from r227972, vendor/libcxxrt/dist/exception.cc vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/guard.cc - copied unchanged from r227972, vendor/libcxxrt/dist/guard.cc Copied: vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/cxxabi.h (from r227972, vendor/libcxxrt/dist/cxxabi.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/cxxabi.h Fri Nov 25 15:48:30 2011 (r227973, copy of r227972, vendor/libcxxrt/dist/cxxabi.h) @@ -0,0 +1,219 @@ +#ifndef __CXXABI_H_ +#define __CXXABI_H_ +#include +#include "unwind.h" +namespace std +{ + class type_info; +} +/* + * The cxxabi.h header provides a set of public definitions for types and + * functions defined by the Itanium C++ ABI specification. For reference, see + * the ABI specification here: + * + * http://sourcery.mentor.com/public/cxx-abi/abi.html + * + * All deviations from this specification, unless otherwise noted, are + * accidental. + */ + +#ifdef __cplusplus +namespace __cxxabiv1 { +extern "C" { +#endif +/** + * Function type to call when an unexpected exception is encountered. + */ +typedef void (*unexpected_handler)(); +/** + * Function type to call when an unrecoverable condition is encountered. + */ +typedef void (*terminate_handler)(); + + +/** + * Structure used as a header on thrown exceptions. This is the same layout as + * defined by the Itanium ABI spec, so should be interoperable with any other + * implementation of this spec, such as GNU libsupc++. + * + * This structure is allocated when an exception is thrown. Unwinding happens + * in two phases, the first looks for a handler and the second installs the + * context. This structure stores a cache of the handler location between + * phase 1 and phase 2. Unfortunately, cleanup information is not cached, so + * must be looked up in both phases. This happens for two reasons. The first + * is that we don't know how many frames containing cleanups there will be, and + * we should avoid dynamic allocation during unwinding (the exception may be + * reporting that we've run out of memory). The second is that finding + * cleanups is much cheaper than finding handlers, because we don't have to + * look at the type table at all. + * + * Note: Several fields of this structure have not-very-informative names. + * These are taken from the ABI spec and have not been changed to make it + * easier for people referring to to the spec while reading this code. + */ +struct __cxa_exception +{ +#if __LP64__ + /** + * Reference count. Used to support the C++11 exception_ptr class. This + * is prepended to the structure in 64-bit mode and squeezed in to the + * padding left before the 64-bit aligned _Unwind_Exception at the end in + * 32-bit mode. + * + * Note that it is safe to extend this structure at the beginning, rather + * than the end, because the public API for creating it returns the address + * of the end (where the exception object can be stored). + */ + uintptr_t referenceCount; +#endif + /** Type info for the thrown object. */ + std::type_info *exceptionType; + /** Destructor for the object, if one exists. */ + void (*exceptionDestructor) (void *); + /** Handler called when an exception specification is violated. */ + unexpected_handler unexpectedHandler; + /** Hander called to terminate. */ + terminate_handler terminateHandler; + /** + * Next exception in the list. If an exception is thrown inside a catch + * block and caught in a nested catch, this points to the exception that + * will be handled after the inner catch block completes. + */ + __cxa_exception *nextException; + /** + * The number of handlers that currently have references to this + * exception. The top (non-sign) bit of this is used as a flag to indicate + * that the exception is being rethrown, so should not be deleted when its + * handler count reaches 0 (which it doesn't with the top bit set). + */ + int handlerCount; +#ifdef __arm__ + /** + * The ARM EH ABI requires the unwind library to keep track of exceptions + * during cleanups. These support nesting, so we need to keep a list of + * them. + */ + _Unwind_Exception *nextCleanup; + /** + * The number of cleanups that are currently being run on this exception. + */ + int cleanupCount; +#endif + /** + * The selector value to be returned when installing the catch handler. + * Used at the call site to determine which catch() block should execute. + * This is found in phase 1 of unwinding then installed in phase 2. + */ + int handlerSwitchValue; + /** + * The action record for the catch. This is cached during phase 1 + * unwinding. + */ + const char *actionRecord; + /** + * Pointer to the language-specific data area (LSDA) for the handler + * frame. This is unused in this implementation, but set for ABI + * compatibility in case we want to mix code in very weird ways. + */ + const char *languageSpecificData; + /** The cached landing pad for the catch handler.*/ + void *catchTemp; + /** + * The pointer that will be returned as the pointer to the object. When + * throwing a class and catching a virtual superclass (for example), we + * need to adjust the thrown pointer to make it all work correctly. + */ + void *adjustedPtr; +#if !__LP64__ + /** + * Reference count. Used to support the C++11 exception_ptr class. This + * is prepended to the structure in 64-bit mode and squeezed in to the + * padding left before the 64-bit aligned _Unwind_Exception at the end in + * 32-bit mode. + * + * Note that it is safe to extend this structure at the beginning, rather + * than the end, because the public API for creating it returns the address + * of the end (where the exception object can be stored) + */ + uintptr_t referenceCount; +#endif + /** The language-agnostic part of the exception header. */ + _Unwind_Exception unwindHeader; +}; + +/** + * ABI-specified globals structure. Returned by the __cxa_get_globals() + * function and its fast variant. This is a per-thread structure - every + * thread will have one lazily allocated. + * + * This structure is defined by the ABI, so may be used outside of this + * library. + */ +struct __cxa_eh_globals +{ + /** + * A linked list of exceptions that are currently caught. There may be + * several of these in nested catch() blocks. + */ + __cxa_exception *caughtExceptions; + /** + * The number of uncaught exceptions. + */ + unsigned int uncaughtExceptions; +}; +/** + * ABI function returning the __cxa_eh_globals structure. + */ +__cxa_eh_globals *__cxa_get_globals(void); +/** + * Version of __cxa_get_globals() assuming that __cxa_get_globals() has already + * been called at least once by this thread. + */ +__cxa_eh_globals *__cxa_get_globals_fast(void); + +/** + * Throws an exception returned by __cxa_current_primary_exception(). This + * exception may have been caught in another thread. + */ +void __cxa_rethrow_primary_exception(void* thrown_exception); +/** + * Returns the current exception in a form that can be stored in an + * exception_ptr object and then rethrown by a call to + * __cxa_rethrow_primary_exception(). + */ +void *__cxa_current_primary_exception(void); +/** + * Increments the reference count of an exception. Called when an + * exception_ptr is copied. + */ +void __cxa_increment_exception_refcount(void* thrown_exception); +/** + * Decrements the reference count of an exception. Called when an + * exception_ptr is deleted. + */ +void __cxa_decrement_exception_refcount(void* thrown_exception); +/** + * Demangles a C++ symbol or type name. The buffer, if non-NULL, must be + * allocated with malloc() and must be *n bytes or more long. This function + * may call realloc() on the value pointed to by buf, and will return the + * length of the string via *n. + * + * The value pointed to by status is set to one of the following: + * + * 0: success + * -1: memory allocation failure + * -2: invalid mangled name + * -3: invalid arguments + */ +char* __cxa_demangle(const char* mangled_name, + char* buf, + size_t* n, + int* status); +#ifdef __cplusplus +} // extern "C" +} // namespace + +namespace abi = __cxxabiv1; + +#endif /* __cplusplus */ +#endif /* __CXXABI_H_ */ Copied: vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/dwarf_eh.h (from r227972, vendor/libcxxrt/dist/dwarf_eh.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/dwarf_eh.h Fri Nov 25 15:48:30 2011 (r227973, copy of r227972, vendor/libcxxrt/dist/dwarf_eh.h) @@ -0,0 +1,454 @@ +/** + * dwarf_eh.h - Defines some helper functions for parsing DWARF exception + * handling tables. + * + * This file contains various helper functions that are independent of the + * language-specific code. It can be used in any personality function for the + * Itanium ABI. + */ +#include + +// TODO: Factor out Itanium / ARM differences. We probably want an itanium.h +// and arm.h that can be included by this file depending on the target ABI. + +// _GNU_SOURCE must be defined for unwind.h to expose some of the functions +// that we want. If it isn't, then we define it and undefine it to make sure +// that it doesn't impact the rest of the program. +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +# include "unwind.h" +# undef _GNU_SOURCE +#else +# include "unwind.h" +#endif + +#include + +/// Type used for pointers into DWARF data +typedef unsigned char *dw_eh_ptr_t; + +// Flag indicating a signed quantity +#define DW_EH_PE_signed 0x08 +/// DWARF data encoding types. +enum dwarf_data_encoding +{ + /// Unsigned, little-endian, base 128-encoded (variable length). + DW_EH_PE_uleb128 = 0x01, + /// Unsigned 16-bit integer. + DW_EH_PE_udata2 = 0x02, + /// Unsigned 32-bit integer. + DW_EH_PE_udata4 = 0x03, + /// Unsigned 64-bit integer. + DW_EH_PE_udata8 = 0x04, + /// Signed, little-endian, base 128-encoded (variable length) + DW_EH_PE_sleb128 = DW_EH_PE_uleb128 | DW_EH_PE_signed, + /// Signed 16-bit integer. + DW_EH_PE_sdata2 = DW_EH_PE_udata2 | DW_EH_PE_signed, + /// Signed 32-bit integer. + DW_EH_PE_sdata4 = DW_EH_PE_udata4 | DW_EH_PE_signed, + /// Signed 32-bit integer. + DW_EH_PE_sdata8 = DW_EH_PE_udata8 | DW_EH_PE_signed +}; + +/** + * Returns the encoding for a DWARF EH table entry. The encoding is stored in + * the low four of an octet. The high four bits store the addressing mode. + */ +static inline enum dwarf_data_encoding get_encoding(unsigned char x) +{ + return (enum dwarf_data_encoding)(x & 0xf); +} + +/** + * DWARF addressing mode constants. When reading a pointer value from a DWARF + * exception table, you must know how it is stored and what the addressing mode + * is. The low four bits tell you the encoding, allowing you to decode a + * number. The high four bits tell you the addressing mode, allowing you to + * turn that number into an address in memory. + */ +enum dwarf_data_relative +{ + /// Value is omitted + DW_EH_PE_omit = 0xff, + /// Absolute pointer value + DW_EH_PE_absptr = 0x00, + /// Value relative to program counter + DW_EH_PE_pcrel = 0x10, + /// Value relative to the text segment + DW_EH_PE_textrel = 0x20, + /// Value relative to the data segment + DW_EH_PE_datarel = 0x30, + /// Value relative to the start of the function + DW_EH_PE_funcrel = 0x40, + /// Aligned pointer (Not supported yet - are they actually used?) + DW_EH_PE_aligned = 0x50, + /// Pointer points to address of real value + DW_EH_PE_indirect = 0x80 +}; +/** + * Returns the addressing mode component of this encoding. + */ +static inline enum dwarf_data_relative get_base(unsigned char x) +{ + return (enum dwarf_data_relative)(x & 0x70); +} +/** + * Returns whether an encoding represents an indirect address. + */ +static int is_indirect(unsigned char x) +{ + return ((x & DW_EH_PE_indirect) == DW_EH_PE_indirect); +} + +/** + * Returns the size of a fixed-size encoding. This function will abort if + * called with a value that is not a fixed-size encoding. + */ +static inline int dwarf_size_of_fixed_size_field(unsigned char type) +{ + switch (get_encoding(type)) + { + default: abort(); + case DW_EH_PE_sdata2: + case DW_EH_PE_udata2: return 2; + case DW_EH_PE_sdata4: + case DW_EH_PE_udata4: return 4; + case DW_EH_PE_sdata8: + case DW_EH_PE_udata8: return 8; + case DW_EH_PE_absptr: return sizeof(void*); + } +} + +/** + * Read an unsigned, little-endian, base-128, DWARF value. Updates *data to + * point to the end of the value. Stores the number of bits read in the value + * pointed to by b, allowing you to determine the value of the highest bit, and + * therefore the sign of a signed value. + * + * This function is not intended to be called directly. Use read_sleb128() or + * read_uleb128() for reading signed and unsigned versions, respectively. + */ +static uint64_t read_leb128(dw_eh_ptr_t *data, int *b) +{ + uint64_t uleb = 0; + unsigned int bit = 0; + unsigned char digit = 0; + // We have to read at least one octet, and keep reading until we get to one + // with the high bit unset + do + { + // This check is a bit too strict - we should also check the highest + // bit of the digit. + assert(bit < sizeof(uint64_t) * 8); + // Get the base 128 digit + digit = (**data) & 0x7f; + // Add it to the current value + uleb += digit << bit; + // Increase the shift value + bit += 7; + // Proceed to the next octet + (*data)++; + // Terminate when we reach a value that does not have the high bit set + // (i.e. which was not modified when we mask it with 0x7f) + } while ((*(*data - 1)) != digit); + *b = bit; + + return uleb; +} + +/** + * Reads an unsigned little-endian base-128 value starting at the address + * pointed to by *data. Updates *data to point to the next byte after the end + * of the variable-length value. + */ +static int64_t read_uleb128(dw_eh_ptr_t *data) +{ + int b; + return read_leb128(data, &b); +} + +/** + * Reads a signed little-endian base-128 value starting at the address pointed + * to by *data. Updates *data to point to the next byte after the end of the + * variable-length value. + */ +static int64_t read_sleb128(dw_eh_ptr_t *data) +{ + int bits; + // Read as if it's signed + uint64_t uleb = read_leb128(data, &bits); + // If the most significant bit read is 1, then we need to sign extend it + if ((uleb >> (bits-1)) == 1) + { + // Sign extend by setting all bits in front of it to 1 + uleb |= ((int64_t)-1) << bits; + } + return (int64_t)uleb; +} +/** + * Reads a value using the specified encoding from the address pointed to by + * *data. Updates the value of *data to point to the next byte after the end + * of the data. + */ +static uint64_t read_value(char encoding, dw_eh_ptr_t *data) +{ + enum dwarf_data_encoding type = get_encoding(encoding); + uint64_t v; + switch (type) + { + // Read fixed-length types +#define READ(dwarf, type) \ + case dwarf:\ + v = (uint64_t)(*(type*)(*data));\ + *data += sizeof(type);\ + break; + READ(DW_EH_PE_udata2, uint16_t) + READ(DW_EH_PE_udata4, uint32_t) + READ(DW_EH_PE_udata8, uint64_t) + READ(DW_EH_PE_sdata2, int16_t) + READ(DW_EH_PE_sdata4, int32_t) + READ(DW_EH_PE_sdata8, int64_t) + READ(DW_EH_PE_absptr, intptr_t) +#undef READ + // Read variable-length types + case DW_EH_PE_sleb128: + v = read_sleb128(data); + break; + case DW_EH_PE_uleb128: + v = read_uleb128(data); + break; + default: abort(); + } + + return v; +} + +/** + * Resolves an indirect value. This expects an unwind context, an encoding, a + * decoded value, and the start of the region as arguments. The returned value + * is a pointer to the address identified by the encoded value. + * + * If the encoding does not specify an indirect value, then this returns v. + */ +static uint64_t resolve_indirect_value(_Unwind_Context *c, + unsigned char encoding, + int64_t v, + dw_eh_ptr_t start) +{ + switch (get_base(encoding)) + { + case DW_EH_PE_pcrel: + v += (uint64_t)start; + break; + case DW_EH_PE_textrel: + v += (uint64_t)_Unwind_GetTextRelBase(c); + break; + case DW_EH_PE_datarel: + v += (uint64_t)_Unwind_GetDataRelBase(c); + break; + case DW_EH_PE_funcrel: + v += (uint64_t)_Unwind_GetRegionStart(c); + default: + break; + } + // If this is an indirect value, then it is really the address of the real + // value + // TODO: Check whether this should really always be a pointer - it seems to + // be a GCC extensions, so not properly documented... + if (is_indirect(encoding)) + { + v = (uint64_t)(uintptr_t)*(void**)v; + } + return v; +} + + +/** + * Reads an encoding and a value, updating *data to point to the next byte. + */ +static inline void read_value_with_encoding(_Unwind_Context *context, + dw_eh_ptr_t *data, + uint64_t *out) +{ + dw_eh_ptr_t start = *data; + unsigned char encoding = *((*data)++); + // If this value is omitted, skip it and don't touch the output value + if (encoding == DW_EH_PE_omit) { return; } + + *out = read_value(encoding, data); + *out = resolve_indirect_value(context, encoding, *out, start); +} + +/** + * Structure storing a decoded language-specific data area. Use parse_lsda() + * to generate an instance of this structure from the address returned by the + * generic unwind library. + * + * You should not need to inspect the fields of this structure directly if you + * are just using this header. The structure stores the locations of the + * various tables used for unwinding exceptions and is used by the functions + * for reading values from these tables. + */ +struct dwarf_eh_lsda +{ + /// The start of the region. This is a cache of the value returned by + /// _Unwind_GetRegionStart(). + dw_eh_ptr_t region_start; + /// The start of the landing pads table. + dw_eh_ptr_t landing_pads; + /// The start of the type table. + dw_eh_ptr_t type_table; + /// The encoding used for entries in the type tables. + unsigned char type_table_encoding; + /// The location of the call-site table. + dw_eh_ptr_t call_site_table; + /// The location of the action table. + dw_eh_ptr_t action_table; + /// The encoding used for entries in the call-site table. + unsigned char callsite_encoding; +}; + +/** + * Parse the header on the language-specific data area and return a structure + * containing the addresses and encodings of the various tables. + */ +static inline struct dwarf_eh_lsda parse_lsda(_Unwind_Context *context, + unsigned char *data) +{ + struct dwarf_eh_lsda lsda; + + lsda.region_start = (dw_eh_ptr_t)(uintptr_t)_Unwind_GetRegionStart(context); + + // If the landing pads are relative to anything other than the start of + // this region, find out where. This is @LPStart in the spec, although the + // encoding that GCC uses does not quite match the spec. + uint64_t v = (uint64_t)(uintptr_t)lsda.region_start; + read_value_with_encoding(context, &data, &v); + lsda.landing_pads = (dw_eh_ptr_t)(uintptr_t)v; + + // If there is a type table, find out where it is. This is @TTBase in the + // spec. Note: we find whether there is a type table pointer by checking + // whether the leading byte is DW_EH_PE_omit (0xff), which is not what the + // spec says, but does seem to be how G++ indicates this. + lsda.type_table = 0; + lsda.type_table_encoding = *data++; + if (lsda.type_table_encoding != DW_EH_PE_omit) + { + v = read_uleb128(&data); + dw_eh_ptr_t type_table = data; + type_table += v; + lsda.type_table = type_table; + //lsda.type_table = (uintptr_t*)(data + v); + } +#if __arm__ + lsda.type_table_encoding = (DW_EH_PE_pcrel | DW_EH_PE_indirect); +#endif + + lsda.callsite_encoding = (enum dwarf_data_encoding)(*(data++)); + + // Action table is immediately after the call site table + lsda.action_table = data; + uintptr_t callsite_size = (uintptr_t)read_uleb128(&data); + lsda.action_table = data + callsite_size; + // Call site table is immediately after the header + lsda.call_site_table = (dw_eh_ptr_t)data; + + + return lsda; +} + +/** + * Structure representing an action to be performed while unwinding. This + * contains the address that should be unwound to and the action record that + * provoked this action. + */ +struct dwarf_eh_action +{ + /** + * The address that this action directs should be the new program counter + * value after unwinding. + */ + dw_eh_ptr_t landing_pad; + /// The address of the action record. + dw_eh_ptr_t action_record; +}; + +/** + * Look up the landing pad that corresponds to the current invoke. + * Returns true if record exists. The context is provided by the generic + * unwind library and the lsda should be the result of a call to parse_lsda(). + * + * The action record is returned via the result parameter. + */ +static bool dwarf_eh_find_callsite(struct _Unwind_Context *context, + struct dwarf_eh_lsda *lsda, + struct dwarf_eh_action *result) +{ + result->action_record = 0; + result->landing_pad = 0; + // The current instruction pointer offset within the region + uint64_t ip = _Unwind_GetIP(context) - _Unwind_GetRegionStart(context); + unsigned char *callsite_table = (unsigned char*)lsda->call_site_table; + + while (callsite_table <= lsda->action_table) + { + // Once again, the layout deviates from the spec. + uint64_t call_site_start, call_site_size, landing_pad, action; + call_site_start = read_value(lsda->callsite_encoding, &callsite_table); + call_site_size = read_value(lsda->callsite_encoding, &callsite_table); + + // Call site entries are sorted, so if we find a call site that's after + // the current instruction pointer then there is no action associated + // with this call and we should unwind straight through this frame + // without doing anything. + if (call_site_start > ip) { break; } + + // Read the address of the landing pad and the action from the call + // site table. + landing_pad = read_value(lsda->callsite_encoding, &callsite_table); + action = read_uleb128(&callsite_table); + + // We should not include the call_site_start (beginning of the region) + // address in the ip range. For each call site: + // + // address1: call proc + // address2: next instruction + // + // The call stack contains address2 and not address1, address1 can be + // at the end of another EH region. + if (call_site_start < ip && ip <= call_site_start + call_site_size) + { + if (action) + { + // Action records are 1-biased so both no-record and zeroth + // record can be stored. + result->action_record = lsda->action_table + action - 1; + } + // No landing pad means keep unwinding. + if (landing_pad) + { + // Landing pad is the offset from the value in the header + result->landing_pad = lsda->landing_pads + landing_pad; + } + return true; + } + } + return false; +} + +/// Defines an exception class from 8 bytes (endian independent) +#define EXCEPTION_CLASS(a,b,c,d,e,f,g,h) \ + (((uint64_t)a << 56) +\ + ((uint64_t)b << 48) +\ + ((uint64_t)c << 40) +\ + ((uint64_t)d << 32) +\ + ((uint64_t)e << 24) +\ + ((uint64_t)f << 16) +\ + ((uint64_t)g << 8) +\ + ((uint64_t)h)) + +#define GENERIC_EXCEPTION_CLASS(e,f,g,h) \ + ((uint32_t)e << 24) +\ + ((uint32_t)f << 16) +\ + ((uint32_t)g << 8) +\ + ((uint32_t)h) Copied: vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/exception.cc (from r227972, vendor/libcxxrt/dist/exception.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/exception.cc Fri Nov 25 15:48:30 2011 (r227973, copy of r227972, vendor/libcxxrt/dist/exception.cc) @@ -0,0 +1,1421 @@ +#include +#include +#include +#include +#include +#include +#include "typeinfo.h" +#include "dwarf_eh.h" +#include "cxxabi.h" + +using namespace ABI_NAMESPACE; + +/** + * Saves the result of the landing pad that we have found. For ARM, this is + * stored in the generic unwind structure, while on other platforms it is + * stored in the C++ exception. + */ +static void saveLandingPad(struct _Unwind_Context *context, + struct _Unwind_Exception *ucb, + struct __cxa_exception *ex, + int selector, + dw_eh_ptr_t landingPad) +{ +#ifdef __arm__ + // On ARM, we store the saved exception in the generic part of the structure + ucb->barrier_cache.sp = _Unwind_GetGR(context, 13); + ucb->barrier_cache.bitpattern[1] = (uint32_t)selector; + ucb->barrier_cache.bitpattern[3] = (uint32_t)landingPad; +#endif + // Cache the results for the phase 2 unwind, if we found a handler + // and this is not a foreign exception. + if (ex) + { + ex->handlerSwitchValue = selector; + ex->catchTemp = landingPad; + } +} + +/** + * Loads the saved landing pad. Returns 1 on success, 0 on failure. + */ +static int loadLandingPad(struct _Unwind_Context *context, + struct _Unwind_Exception *ucb, + struct __cxa_exception *ex, + unsigned long *selector, + dw_eh_ptr_t *landingPad) +{ +#ifdef __arm__ + *selector = ucb->barrier_cache.bitpattern[1]; + *landingPad = (dw_eh_ptr_t)ucb->barrier_cache.bitpattern[3]; + return 1; +#else + if (ex) + { + *selector = ex->handlerSwitchValue; + *landingPad = (dw_eh_ptr_t)ex->catchTemp; + return 0; + } + return 0; +#endif +} + +static inline _Unwind_Reason_Code continueUnwinding(struct _Unwind_Exception *ex, + struct _Unwind_Context *context) +{ +#ifdef __arm__ + if (__gnu_unwind_frame(ex, context) != _URC_OK) { return _URC_FAILURE; } +#endif + return _URC_CONTINUE_UNWIND; +} + + +extern "C" void __cxa_free_exception(void *thrown_exception); +extern "C" void __cxa_free_dependent_exception(void *thrown_exception); +extern "C" void* __dynamic_cast(const void *sub, + const __class_type_info *src, + const __class_type_info *dst, + ptrdiff_t src2dst_offset); + +/** + * The type of a handler that has been found. + */ +typedef enum +{ + /** No handler. */ + handler_none, + /** + * A cleanup - the exception will propagate through this frame, but code + * must be run when this happens. + */ + handler_cleanup, + /** + * A catch statement. The exception will not propagate past this frame + * (without an explicit rethrow). + */ + handler_catch +} handler_type; + +/** + * Per-thread info required by the runtime. We store a single structure + * pointer in thread-local storage, because this tends to be a scarce resource + * and it's impolite to steal all of it and not leave any for the rest of the + * program. + * + * Instances of this structure are allocated lazily - at most one per thread - + * and are destroyed on thread termination. + */ +struct __cxa_thread_info +{ + /** The termination handler for this thread. */ + terminate_handler terminateHandler; + /** The unexpected exception handler for this thread. */ + unexpected_handler unexpectedHandler; + /** + * The number of emergency buffers held by this thread. This is 0 in + * normal operation - the emergency buffers are only used when malloc() + * fails to return memory for allocating an exception. Threads are not + * permitted to hold more than 4 emergency buffers (as per recommendation + * in ABI spec [3.3.1]). + */ + int emergencyBuffersHeld; + /** + * The exception currently running in a cleanup. + */ + _Unwind_Exception *currentCleanup; + /** + * The public part of this structure, accessible from outside of this + * module. + */ + __cxa_eh_globals globals; +}; +/** + * Dependent exception. This + */ +struct __cxa_dependent_exception +{ +#if __LP64__ + void *primaryException; +#endif + std::type_info *exceptionType; + void (*exceptionDestructor) (void *); + unexpected_handler unexpectedHandler; + terminate_handler terminateHandler; + __cxa_exception *nextException; + int handlerCount; +#ifdef __arm__ + _Unwind_Exception *nextCleanup; + int cleanupCount; +#endif + int handlerSwitchValue; + const char *actionRecord; + const char *languageSpecificData; + void *catchTemp; + void *adjustedPtr; +#if !__LP64__ + void *primaryException; +#endif + _Unwind_Exception unwindHeader; +}; + + +namespace std +{ + void unexpected(); + class exception + { + public: + virtual ~exception() throw(); + virtual const char* what() const throw(); + }; + +} + +extern "C" std::type_info *__cxa_current_exception_type(); + +/** + * Class of exceptions to distinguish between this and other exception types. + * + * The first four characters are the vendor ID. Currently, we use GNUC, + * because we aim for ABI-compatibility with the GNU implementation, and + * various checks may test for equality of the class, which is incorrect. + */ +static const uint64_t exception_class = + EXCEPTION_CLASS('G', 'N', 'U', 'C', 'C', '+', '+', '\0'); +/** + * Class used for dependent exceptions. + */ +static const uint64_t dependent_exception_class = + EXCEPTION_CLASS('G', 'N', 'U', 'C', 'C', '+', '+', '\x01'); +/** + * The low four bytes of the exception class, indicating that we conform to the + * Itanium C++ ABI. This is currently unused, but should be used in the future + * if we change our exception class, to allow this library and libsupc++ to be + * linked to the same executable and both to interoperate. + */ +static const uint32_t abi_exception_class = + GENERIC_EXCEPTION_CLASS('C', '+', '+', '\0'); + +static bool isCXXException(uint64_t cls) +{ + return (cls == exception_class) || (cls == dependent_exception_class); +} + +static bool isDependentException(uint64_t cls) +{ + return cls == dependent_exception_class; +} + +static __cxa_exception *exceptionFromPointer(void *ex) +{ + return (__cxa_exception*)((char*)ex - + offsetof(struct __cxa_exception, unwindHeader)); +} +static __cxa_exception *realExceptionFromException(__cxa_exception *ex) +{ + if (!isDependentException(ex->unwindHeader.exception_class)) { return ex; } + return ((__cxa_exception*)(((__cxa_dependent_exception*)ex)->primaryException))-1; +} + + +namespace std +{ + // Forward declaration of standard library terminate() function used to + // abort execution. + void terminate(void); +} + +using namespace ABI_NAMESPACE; + + + +/** The global termination handler. */ +static terminate_handler terminateHandler = abort; +/** The global unexpected exception handler. */ +static unexpected_handler unexpectedHandler = std::terminate; + +/** Key used for thread-local data. */ +static pthread_key_t eh_key; + + +/** + * Cleanup function, allowing foreign exception handlers to correctly destroy + * this exception if they catch it. + */ +static void exception_cleanup(_Unwind_Reason_Code reason, + struct _Unwind_Exception *ex) +{ + __cxa_free_exception((void*)ex); +} +static void dependent_exception_cleanup(_Unwind_Reason_Code reason, + struct _Unwind_Exception *ex) +{ + + __cxa_free_dependent_exception((void*)ex); +} + +/** + * Recursively walk a list of exceptions and delete them all in post-order. + */ +static void free_exception_list(__cxa_exception *ex) +{ + if (0 != ex->nextException) + { + free_exception_list(ex->nextException); + } + // __cxa_free_exception() expects to be passed the thrown object, which + // immediately follows the exception, not the exception itself + __cxa_free_exception(ex+1); +} + +/** + * Cleanup function called when a thread exists to make certain that all of the + * per-thread data is deleted. + */ +static void thread_cleanup(void* thread_info) +{ + __cxa_thread_info *info = (__cxa_thread_info*)thread_info; + if (info->globals.caughtExceptions) + { + free_exception_list(info->globals.caughtExceptions); + } + free(thread_info); +} + + +/** + * Once control used to protect the key creation. + */ +static pthread_once_t once_control = PTHREAD_ONCE_INIT; + +/** + * Initialise eh_key. + */ +static void init_key(void) +{ + pthread_key_create(&eh_key, thread_cleanup); +} + +/** + * Returns the thread info structure, creating it if it is not already created. + */ +static __cxa_thread_info *thread_info() +{ + pthread_once(&once_control, init_key); + __cxa_thread_info *info = (__cxa_thread_info*)pthread_getspecific(eh_key); + if (0 == info) + { + info = (__cxa_thread_info*)calloc(1, sizeof(__cxa_thread_info)); + pthread_setspecific(eh_key, info); + } + return info; +} +/** + * Fast version of thread_info(). May fail if thread_info() is not called on + * this thread at least once already. + */ +static __cxa_thread_info *thread_info_fast() +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 16:54: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 C0A94106566B; Fri, 25 Nov 2011 16:54: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 AFAB88FC0A; Fri, 25 Nov 2011 16:54:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPGsGUI051596; Fri, 25 Nov 2011 16:54:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPGsGWq051594; Fri, 25 Nov 2011 16:54:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111251654.pAPGsGWq051594@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Nov 2011 16:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227974 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 16:54:16 -0000 Author: marius Date: Fri Nov 25 16:54:16 2011 New Revision: 227974 URL: http://svn.freebsd.org/changeset/base/227974 Log: MFC: r204602, r204650 - Add missing includes to make example "compilable". - Use NULL for pointer arguments instead of 0. Modified: stable/8/share/man/man9/driver.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/driver.9 ============================================================================== --- stable/8/share/man/man9/driver.9 Fri Nov 25 15:48:30 2011 (r227973) +++ stable/8/share/man/man9/driver.9 Fri Nov 25 16:54:16 2011 (r227974) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd March 3, 2010 .Dt DRIVER 9 .Os .Sh NAME @@ -37,7 +37,9 @@ .Sh SYNOPSIS .Bd -literal #include +#include #include +#include static int foo_probe(device_t); static int foo_attach(device_t); @@ -59,7 +61,7 @@ static device_method_t foo_methods[] = { { 0, 0 } }; -static driver_t foo_driver { +static driver_t foo_driver = { "foo", foo_methods, sizeof(struct foo_softc) @@ -67,7 +69,7 @@ static driver_t foo_driver { static devclass_t foo_devclass; -DRIVER_MODULE(foo, bogo, foo_driver, foo_devclass, 0, 0); +DRIVER_MODULE(foo, bogo, foo_driver, foo_devclass, NULL, NULL); .Ed .Sh DESCRIPTION Each driver in the kernel is described by a From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 16:54: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 A433B106564A; Fri, 25 Nov 2011 16:54: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 934DC8FC14; Fri, 25 Nov 2011 16:54:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPGsIPg051631; Fri, 25 Nov 2011 16:54:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPGsIh8051629; Fri, 25 Nov 2011 16:54:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111251654.pAPGsIh8051629@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Nov 2011 16:54: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: r227975 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 16:54:18 -0000 Author: marius Date: Fri Nov 25 16:54:18 2011 New Revision: 227975 URL: http://svn.freebsd.org/changeset/base/227975 Log: MFC: r204602, r204650 - Add missing includes to make example "compilable". - Use NULL for pointer arguments instead of 0. Modified: stable/7/share/man/man9/driver.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/driver.9 ============================================================================== --- stable/7/share/man/man9/driver.9 Fri Nov 25 16:54:16 2011 (r227974) +++ stable/7/share/man/man9/driver.9 Fri Nov 25 16:54:18 2011 (r227975) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd March 3, 2010 .Dt DRIVER 9 .Os .Sh NAME @@ -37,7 +37,9 @@ .Sh SYNOPSIS .Bd -literal #include +#include #include +#include static int foo_probe(device_t); static int foo_attach(device_t); @@ -59,7 +61,7 @@ static device_method_t foo_methods[] = { { 0, 0 } }; -static driver_t foo_driver { +static driver_t foo_driver = { "foo", foo_methods, sizeof(struct foo_softc) @@ -67,7 +69,7 @@ static driver_t foo_driver { static devclass_t foo_devclass; -DRIVER_MODULE(foo, bogo, foo_driver, foo_devclass, 0, 0); +DRIVER_MODULE(foo, bogo, foo_driver, foo_devclass, NULL, NULL); .Ed .Sh DESCRIPTION Each driver in the kernel is described by a From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 17:06: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 98959106564A; Fri, 25 Nov 2011 17:06:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA8D8FC08; Fri, 25 Nov 2011 17:06:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPH6Wld052103; Fri, 25 Nov 2011 17:06:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPH6WAr052099; Fri, 25 Nov 2011 17:06:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111251706.pAPH6WAr052099@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Nov 2011 17:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227976 - in stable/9: share/examples/drivers share/man/man9 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: Fri, 25 Nov 2011 17:06:32 -0000 Author: marius Date: Fri Nov 25 17:06:32 2011 New Revision: 227976 URL: http://svn.freebsd.org/changeset/base/227976 Log: MFC: r227829, r227844 - Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t' and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from device drivers. - Update the device driver examples to use DEVMETHOD_END. Submitted by: jhb Approved by: re (kib) Modified: stable/9/share/examples/drivers/make_device_driver.sh stable/9/share/man/man9/driver.9 stable/9/sys/sys/bus.h Directory Properties: stable/9/share/examples/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/share/examples/drivers/make_device_driver.sh ============================================================================== --- stable/9/share/examples/drivers/make_device_driver.sh Fri Nov 25 16:54:18 2011 (r227975) +++ stable/9/share/examples/drivers/make_device_driver.sh Fri Nov 25 17:06:32 2011 (r227976) @@ -261,7 +261,7 @@ static device_method_t ${1}_methods[] = DEVMETHOD(device_probe, ${1}_isa_probe), DEVMETHOD(device_attach, ${1}_isa_attach), DEVMETHOD(device_detach, ${1}_isa_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ${1}_isa_driver = { Modified: stable/9/share/man/man9/driver.9 ============================================================================== --- stable/9/share/man/man9/driver.9 Fri Nov 25 16:54:18 2011 (r227975) +++ stable/9/share/man/man9/driver.9 Fri Nov 25 17:06:32 2011 (r227976) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2010 +.Dd November 22, 2011 .Dt DRIVER 9 .Os .Sh NAME @@ -58,7 +58,7 @@ static device_method_t foo_methods[] = { DEVMETHOD(bogo_twiddle, foo_twiddle), /* Terminate method list */ - { 0, 0 } + DEVMETHOD_END }; static driver_t foo_driver = { Modified: stable/9/sys/sys/bus.h ============================================================================== --- stable/9/sys/sys/bus.h Fri Nov 25 16:54:18 2011 (r227975) +++ stable/9/sys/sys/bus.h Fri Nov 25 17:06:32 2011 (r227976) @@ -570,9 +570,10 @@ extern int bus_current_pass; void bus_set_pass(int pass); /** - * Shorthand for constructing method tables. + * Shorthands for constructing method tables. */ #define DEVMETHOD KOBJMETHOD +#define DEVMETHOD_END KOBJMETHOD_END /* * Some common device interfaces. From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 17:07: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 753C8106564A; Fri, 25 Nov 2011 17:07:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC9B8FC19; Fri, 25 Nov 2011 17:07:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPH7Rit052163; Fri, 25 Nov 2011 17:07:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPH7RsZ052159; Fri, 25 Nov 2011 17:07:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111251707.pAPH7RsZ052159@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Nov 2011 17:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227977 - in releng/9.0: share/examples/drivers share/man/man9 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: Fri, 25 Nov 2011 17:07:27 -0000 Author: marius Date: Fri Nov 25 17:07:27 2011 New Revision: 227977 URL: http://svn.freebsd.org/changeset/base/227977 Log: MFC: r227829, r227844 - Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t' and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from device drivers. - Update the device driver examples to use DEVMETHOD_END. Submitted by: jhb Approved by: re (kib) Modified: releng/9.0/share/examples/drivers/make_device_driver.sh releng/9.0/share/man/man9/driver.9 releng/9.0/sys/sys/bus.h Directory Properties: releng/9.0/share/examples/ (props changed) releng/9.0/share/man/man9/ (props changed) releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/share/examples/drivers/make_device_driver.sh ============================================================================== --- releng/9.0/share/examples/drivers/make_device_driver.sh Fri Nov 25 17:06:32 2011 (r227976) +++ releng/9.0/share/examples/drivers/make_device_driver.sh Fri Nov 25 17:07:27 2011 (r227977) @@ -261,7 +261,7 @@ static device_method_t ${1}_methods[] = DEVMETHOD(device_probe, ${1}_isa_probe), DEVMETHOD(device_attach, ${1}_isa_attach), DEVMETHOD(device_detach, ${1}_isa_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ${1}_isa_driver = { Modified: releng/9.0/share/man/man9/driver.9 ============================================================================== --- releng/9.0/share/man/man9/driver.9 Fri Nov 25 17:06:32 2011 (r227976) +++ releng/9.0/share/man/man9/driver.9 Fri Nov 25 17:07:27 2011 (r227977) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2010 +.Dd November 22, 2011 .Dt DRIVER 9 .Os .Sh NAME @@ -58,7 +58,7 @@ static device_method_t foo_methods[] = { DEVMETHOD(bogo_twiddle, foo_twiddle), /* Terminate method list */ - { 0, 0 } + DEVMETHOD_END }; static driver_t foo_driver = { Modified: releng/9.0/sys/sys/bus.h ============================================================================== --- releng/9.0/sys/sys/bus.h Fri Nov 25 17:06:32 2011 (r227976) +++ releng/9.0/sys/sys/bus.h Fri Nov 25 17:07:27 2011 (r227977) @@ -570,9 +570,10 @@ extern int bus_current_pass; void bus_set_pass(int pass); /** - * Shorthand for constructing method tables. + * Shorthands for constructing method tables. */ #define DEVMETHOD KOBJMETHOD +#define DEVMETHOD_END KOBJMETHOD_END /* * Some common device interfaces. From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 17:08: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 95DF4106566B; Fri, 25 Nov 2011 17:08: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 6B0118FC17; Fri, 25 Nov 2011 17:08:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPH8XFM052236; Fri, 25 Nov 2011 17:08:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPH8XB8052232; Fri, 25 Nov 2011 17:08:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111251708.pAPH8XB8052232@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Nov 2011 17:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227978 - in stable/8: share/examples/drivers share/man/man9 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: Fri, 25 Nov 2011 17:08:33 -0000 Author: marius Date: Fri Nov 25 17:08:33 2011 New Revision: 227978 URL: http://svn.freebsd.org/changeset/base/227978 Log: MFC: r227829, r227844 - Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t' and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from device drivers. - Update the device driver examples to use DEVMETHOD_END. Submitted by: jhb Modified: stable/8/share/examples/drivers/make_device_driver.sh stable/8/share/man/man9/driver.9 stable/8/sys/sys/bus.h Directory Properties: stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/man9/ (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/examples/drivers/make_device_driver.sh ============================================================================== --- stable/8/share/examples/drivers/make_device_driver.sh Fri Nov 25 17:07:27 2011 (r227977) +++ stable/8/share/examples/drivers/make_device_driver.sh Fri Nov 25 17:08:33 2011 (r227978) @@ -261,7 +261,7 @@ static device_method_t ${1}_methods[] = DEVMETHOD(device_probe, ${1}_isa_probe), DEVMETHOD(device_attach, ${1}_isa_attach), DEVMETHOD(device_detach, ${1}_isa_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ${1}_isa_driver = { Modified: stable/8/share/man/man9/driver.9 ============================================================================== --- stable/8/share/man/man9/driver.9 Fri Nov 25 17:07:27 2011 (r227977) +++ stable/8/share/man/man9/driver.9 Fri Nov 25 17:08:33 2011 (r227978) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2010 +.Dd November 22, 2011 .Dt DRIVER 9 .Os .Sh NAME @@ -58,7 +58,7 @@ static device_method_t foo_methods[] = { DEVMETHOD(bogo_twiddle, foo_twiddle), /* Terminate method list */ - { 0, 0 } + DEVMETHOD_END }; static driver_t foo_driver = { Modified: stable/8/sys/sys/bus.h ============================================================================== --- stable/8/sys/sys/bus.h Fri Nov 25 17:07:27 2011 (r227977) +++ stable/8/sys/sys/bus.h Fri Nov 25 17:08:33 2011 (r227978) @@ -549,9 +549,10 @@ extern int bus_current_pass; void bus_set_pass(int pass); /** - * Shorthand for constructing method tables. + * Shorthands for constructing method tables. */ #define DEVMETHOD KOBJMETHOD +#define DEVMETHOD_END KOBJMETHOD_END /* * Some common device interfaces. From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 17:08: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 33FC9106588F; Fri, 25 Nov 2011 17:08: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 A61E88FC0A; Fri, 25 Nov 2011 17:08:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPH8dxP052277; Fri, 25 Nov 2011 17:08:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPH8dAM052273; Fri, 25 Nov 2011 17:08:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111251708.pAPH8dAM052273@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Nov 2011 17:08: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: r227979 - in stable/7: share/examples/drivers share/man/man9 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: Fri, 25 Nov 2011 17:08:40 -0000 Author: marius Date: Fri Nov 25 17:08:39 2011 New Revision: 227979 URL: http://svn.freebsd.org/changeset/base/227979 Log: MFC: r227829, r227844 - Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t' and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from device drivers. - Update the device driver examples to use DEVMETHOD_END. Submitted by: jhb Modified: stable/7/share/examples/drivers/make_device_driver.sh stable/7/share/man/man9/driver.9 stable/7/sys/sys/bus.h Directory Properties: stable/7/share/examples/ (props changed) stable/7/share/man/man9/ (props changed) 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/share/examples/drivers/make_device_driver.sh ============================================================================== --- stable/7/share/examples/drivers/make_device_driver.sh Fri Nov 25 17:08:33 2011 (r227978) +++ stable/7/share/examples/drivers/make_device_driver.sh Fri Nov 25 17:08:39 2011 (r227979) @@ -261,7 +261,7 @@ static device_method_t ${1}_methods[] = DEVMETHOD(device_probe, ${1}_isa_probe), DEVMETHOD(device_attach, ${1}_isa_attach), DEVMETHOD(device_detach, ${1}_isa_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ${1}_isa_driver = { Modified: stable/7/share/man/man9/driver.9 ============================================================================== --- stable/7/share/man/man9/driver.9 Fri Nov 25 17:08:33 2011 (r227978) +++ stable/7/share/man/man9/driver.9 Fri Nov 25 17:08:39 2011 (r227979) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2010 +.Dd November 22, 2011 .Dt DRIVER 9 .Os .Sh NAME @@ -58,7 +58,7 @@ static device_method_t foo_methods[] = { DEVMETHOD(bogo_twiddle, foo_twiddle), /* Terminate method list */ - { 0, 0 } + DEVMETHOD_END }; static driver_t foo_driver = { Modified: stable/7/sys/sys/bus.h ============================================================================== --- stable/7/sys/sys/bus.h Fri Nov 25 17:08:33 2011 (r227978) +++ stable/7/sys/sys/bus.h Fri Nov 25 17:08:39 2011 (r227979) @@ -521,9 +521,10 @@ void bus_data_generation_update(void); #define BUS_PROBE_NOWILDCARD (-2000000000) /* No wildcard device matches */ /** - * Shorthand for constructing method tables. + * Shorthands for constructing method tables. */ #define DEVMETHOD KOBJMETHOD +#define DEVMETHOD_END KOBJMETHOD_END /* * Some common device interfaces. From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 17:40: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 11ECB106566C; Fri, 25 Nov 2011 17:40: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 EE2408FC14; Fri, 25 Nov 2011 17:40:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPHe19s053234; Fri, 25 Nov 2011 17:40:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPHe1PO053233; Fri, 25 Nov 2011 17:40:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111251740.pAPHe1PO053233@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Nov 2011 17:40: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: r227980 - head/sys/sparc64/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, 25 Nov 2011 17:40:02 -0000 Author: marius Date: Fri Nov 25 17:40:01 2011 New Revision: 227980 URL: http://svn.freebsd.org/changeset/base/227980 Log: Move to SCHED_ULE by default. Since r226057 SCHED_ULE and sparc64 are compatible with each other and since r227539 the last issue seen when using SCHED_ULE is fixed. At least on UP and 2-way machines SCHED_4BSD still performs better than SCHED_ULE, however, the optimizations done in r225889 pretty much compensate that so there's at least no net regression. Thanks go to Peter Jeremy for extensive testing. Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Nov 25 17:08:39 2011 (r227979) +++ head/sys/sparc64/conf/GENERIC Fri Nov 25 17:40:01 2011 (r227980) @@ -26,7 +26,7 @@ makeoptions DEBUG=-g # Build kernel wit # Platforms supported # At this time all platforms are supported, as-is. -options SCHED_4BSD # 4BSD scheduler +options SCHED_ULE # ULE scheduler #options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 17:41: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 8B2A8106567B; Fri, 25 Nov 2011 17:41:12 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ADA38FC24; Fri, 25 Nov 2011 17:41:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPHfCYE053305; Fri, 25 Nov 2011 17:41:12 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPHfCjM053303; Fri, 25 Nov 2011 17:41:12 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201111251741.pAPHfCjM053303@svn.freebsd.org> From: Warren Block Date: Fri, 25 Nov 2011 17: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: r227981 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 17:41:12 -0000 Author: wblock (doc committer) Date: Fri Nov 25 17:41:12 2011 New Revision: 227981 URL: http://svn.freebsd.org/changeset/base/227981 Log: Point out that @reboot runs at every cron startup, not just system startup. Discussed on: hackers@ Approved by: gjb (mentor) MFC after: 1 week Modified: head/usr.sbin/cron/crontab/crontab.5 Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Fri Nov 25 17:40:01 2011 (r227980) +++ head/usr.sbin/cron/crontab/crontab.5 Fri Nov 25 17:41:12 2011 (r227981) @@ -224,7 +224,7 @@ one of eight special strings may appear: .Bd -literal -offset indent string meaning ------ ------- -@reboot Run once, at startup. +@reboot Run once, at startup of cron. @yearly Run once a year, "0 0 1 1 *". @annually (same as @yearly) @monthly Run once a month, "0 0 1 * *". From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 19:29: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 30904106564A; Fri, 25 Nov 2011 19:29:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E33A8FC14; Fri, 25 Nov 2011 19:29:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPJTMMN056539; Fri, 25 Nov 2011 19:29:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPJTLaX056532; Fri, 25 Nov 2011 19:29:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111251929.pAPJTLaX056532@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 Nov 2011 19:29: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: r227982 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4 sys/conf sys/dev/amd sys/modules sys/modules/amd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 19:29:22 -0000 Author: marius Date: Fri Nov 25 19:29:21 2011 New Revision: 227982 URL: http://svn.freebsd.org/changeset/base/227982 Log: Deorbit the broken amd(4) (see PR 124667), which was superseded by esp(4) as of r227006. Deleted: head/share/man/man4/amd.4 head/sys/dev/amd/ head/sys/modules/amd/ Modified: head/ObsoleteFiles.inc head/release/doc/en_US.ISO8859-1/hardware/article.sgml head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Nov 25 17:41:12 2011 (r227981) +++ head/ObsoleteFiles.inc Fri Nov 25 19:29:21 2011 (r227982) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20111125: amd(4) removed +OLD_FILES+=usr/share/man/man4/amd.4.gz # 20111125: libodialog removed OLD_FILES+=usr/lib/libodialog.a OLD_FILES+=usr/lib/libodialog.so Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Fri Nov 25 17:41:12 2011 (r227981) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Fri Nov 25 19:29:21 2011 (r227982) @@ -750,8 +750,6 @@ &hwlist.aic; - &hwlist.amd; - &hwlist.amr; &hwlist.arcmsr; Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Nov 25 17:41:12 2011 (r227981) +++ head/share/man/man4/Makefile Fri Nov 25 19:29:21 2011 (r227982) @@ -32,7 +32,6 @@ MAN= aac.4 \ ale.4 \ alpm.4 \ altq.4 \ - amd.4 \ amdpm.4 \ ${_amdsbwd.4} \ ${_amdsmb.4} \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Nov 25 17:41:12 2011 (r227981) +++ head/sys/conf/NOTES Fri Nov 25 19:29:21 2011 (r227982) @@ -1471,8 +1471,6 @@ options TEKEN_UTF8 # UTF-8 output hand # 19160x/29160x, aic7770/aic78xx # ahd: Adaptec 29320/39320 Controllers. # aic: Adaptec 6260/6360, APA-1460 (PC Card), NEC PC9801-100 (C-BUS) -# amd: Support for the AMD 53C974 SCSI host adapter chip as found on devices -# such as the Tekram DC-390(T). # bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x, # BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F # esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 25 17:41:12 2011 (r227981) +++ head/sys/conf/files Fri Nov 25 19:29:21 2011 (r227982) @@ -517,7 +517,6 @@ dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci -dev/amd/amd.c optional amd dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr dev/amr/amr_disk.c optional amr Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Nov 25 17:41:12 2011 (r227981) +++ head/sys/modules/Makefile Fri Nov 25 19:29:21 2011 (r227982) @@ -22,7 +22,6 @@ SUBDIR= ${_3dfx} \ alc \ ale \ alq \ - ${_amd} \ ${_amdsbwd} \ ${_amdtemp} \ amr \ @@ -405,7 +404,6 @@ _3dfx= 3dfx _3dfx_linux= 3dfx_linux _agp= agp _aic= aic -_amd= amd _an= an _aout= aout _apm= apm From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 20:59: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 6D4E4106564A; Fri, 25 Nov 2011 20:59:05 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 583688FC17; Fri, 25 Nov 2011 20:59:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPKx5ei059286; Fri, 25 Nov 2011 20:59:05 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPKx56G059281; Fri, 25 Nov 2011 20:59:05 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111252059.pAPKx56G059281@svn.freebsd.org> From: David Chisnall Date: Fri, 25 Nov 2011 20:59: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: r227983 - in head: . contrib/libc++ contrib/libc++/include contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/support contrib/libcxxrt etc/mtree lib lib/libc++ lib/libcxxr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Nov 2011 20:59:05 -0000 Author: theraven Date: Fri Nov 25 20:59:04 2011 New Revision: 227983 URL: http://svn.freebsd.org/changeset/base/227983 Log: Import libc++ / libcxxrt into base. Not build by default yet (use MK_LIBCPLUSPLUS=yes to enable). This is a work-in-progress. It works for me, but is not guaranteed to work for anyone else and may eat your dog. To build C++ using libc++, add -stdlib=libc++ to your CXX and LD flags. Bug reports welcome, bug fixes even more welcome... Approved by: dim (mentor) Added: head/contrib/libc++/ head/contrib/libc++/FREEBSD-upgrade head/contrib/libc++/include/ head/contrib/libc++/include/__bit_reference - copied unchanged from r227828, vendor/libc++/dist/include/__bit_reference head/contrib/libc++/include/__config - copied unchanged from r227828, vendor/libc++/dist/include/__config head/contrib/libc++/include/__debug - copied unchanged from r227828, vendor/libc++/dist/include/__debug head/contrib/libc++/include/__functional_03 - copied unchanged from r227828, vendor/libc++/dist/include/__functional_03 head/contrib/libc++/include/__functional_base - copied unchanged from r227828, vendor/libc++/dist/include/__functional_base head/contrib/libc++/include/__functional_base_03 - copied unchanged from r227828, vendor/libc++/dist/include/__functional_base_03 head/contrib/libc++/include/__hash_table - copied unchanged from r227828, vendor/libc++/dist/include/__hash_table head/contrib/libc++/include/__locale - copied unchanged from r227828, vendor/libc++/dist/include/__locale head/contrib/libc++/include/__mutex_base - copied unchanged from r227828, vendor/libc++/dist/include/__mutex_base head/contrib/libc++/include/__split_buffer - copied unchanged from r227828, vendor/libc++/dist/include/__split_buffer head/contrib/libc++/include/__sso_allocator - copied unchanged from r227828, vendor/libc++/dist/include/__sso_allocator head/contrib/libc++/include/__std_stream - copied unchanged from r227828, vendor/libc++/dist/include/__std_stream head/contrib/libc++/include/__tree - copied unchanged from r227828, vendor/libc++/dist/include/__tree head/contrib/libc++/include/__tuple - copied unchanged from r227828, vendor/libc++/dist/include/__tuple head/contrib/libc++/include/__tuple_03 - copied unchanged from r227828, vendor/libc++/dist/include/__tuple_03 head/contrib/libc++/include/algorithm - copied unchanged from r227828, vendor/libc++/dist/include/algorithm head/contrib/libc++/include/array - copied unchanged from r227828, vendor/libc++/dist/include/array head/contrib/libc++/include/atomic - copied unchanged from r227828, vendor/libc++/dist/include/atomic head/contrib/libc++/include/bitset - copied unchanged from r227828, vendor/libc++/dist/include/bitset head/contrib/libc++/include/cassert - copied unchanged from r227828, vendor/libc++/dist/include/cassert head/contrib/libc++/include/ccomplex - copied unchanged from r227828, vendor/libc++/dist/include/ccomplex head/contrib/libc++/include/cctype - copied unchanged from r227828, vendor/libc++/dist/include/cctype head/contrib/libc++/include/cerrno - copied unchanged from r227828, vendor/libc++/dist/include/cerrno head/contrib/libc++/include/cfenv - copied unchanged from r227828, vendor/libc++/dist/include/cfenv head/contrib/libc++/include/cfloat - copied unchanged from r227828, vendor/libc++/dist/include/cfloat head/contrib/libc++/include/chrono - copied unchanged from r227828, vendor/libc++/dist/include/chrono head/contrib/libc++/include/cinttypes - copied unchanged from r227828, vendor/libc++/dist/include/cinttypes head/contrib/libc++/include/ciso646 - copied unchanged from r227828, vendor/libc++/dist/include/ciso646 head/contrib/libc++/include/climits - copied unchanged from r227828, vendor/libc++/dist/include/climits head/contrib/libc++/include/clocale - copied unchanged from r227828, vendor/libc++/dist/include/clocale head/contrib/libc++/include/cmath - copied unchanged from r227828, vendor/libc++/dist/include/cmath head/contrib/libc++/include/codecvt - copied unchanged from r227828, vendor/libc++/dist/include/codecvt head/contrib/libc++/include/complex - copied unchanged from r227828, vendor/libc++/dist/include/complex head/contrib/libc++/include/complex.h - copied unchanged from r227828, vendor/libc++/dist/include/complex.h head/contrib/libc++/include/condition_variable - copied unchanged from r227828, vendor/libc++/dist/include/condition_variable head/contrib/libc++/include/csetjmp - copied unchanged from r227828, vendor/libc++/dist/include/csetjmp head/contrib/libc++/include/csignal - copied unchanged from r227828, vendor/libc++/dist/include/csignal head/contrib/libc++/include/cstdarg - copied unchanged from r227828, vendor/libc++/dist/include/cstdarg head/contrib/libc++/include/cstdbool - copied unchanged from r227828, vendor/libc++/dist/include/cstdbool head/contrib/libc++/include/cstddef - copied unchanged from r227828, vendor/libc++/dist/include/cstddef head/contrib/libc++/include/cstdint - copied unchanged from r227828, vendor/libc++/dist/include/cstdint head/contrib/libc++/include/cstdio - copied unchanged from r227828, vendor/libc++/dist/include/cstdio head/contrib/libc++/include/cstdlib - copied unchanged from r227828, vendor/libc++/dist/include/cstdlib head/contrib/libc++/include/cstring - copied unchanged from r227828, vendor/libc++/dist/include/cstring head/contrib/libc++/include/ctgmath - copied unchanged from r227828, vendor/libc++/dist/include/ctgmath head/contrib/libc++/include/ctime - copied unchanged from r227828, vendor/libc++/dist/include/ctime head/contrib/libc++/include/cwchar - copied unchanged from r227828, vendor/libc++/dist/include/cwchar head/contrib/libc++/include/cwctype - copied unchanged from r227828, vendor/libc++/dist/include/cwctype head/contrib/libc++/include/deque - copied unchanged from r227828, vendor/libc++/dist/include/deque head/contrib/libc++/include/exception - copied unchanged from r227828, vendor/libc++/dist/include/exception head/contrib/libc++/include/ext/ - copied from r227828, vendor/libc++/dist/include/ext/ head/contrib/libc++/include/forward_list - copied unchanged from r227828, vendor/libc++/dist/include/forward_list head/contrib/libc++/include/fstream - copied unchanged from r227828, vendor/libc++/dist/include/fstream head/contrib/libc++/include/functional - copied unchanged from r227828, vendor/libc++/dist/include/functional head/contrib/libc++/include/future - copied unchanged from r227828, vendor/libc++/dist/include/future head/contrib/libc++/include/initializer_list - copied unchanged from r227828, vendor/libc++/dist/include/initializer_list head/contrib/libc++/include/iomanip - copied unchanged from r227828, vendor/libc++/dist/include/iomanip head/contrib/libc++/include/ios - copied unchanged from r227828, vendor/libc++/dist/include/ios head/contrib/libc++/include/iosfwd - copied unchanged from r227828, vendor/libc++/dist/include/iosfwd head/contrib/libc++/include/iostream - copied unchanged from r227828, vendor/libc++/dist/include/iostream head/contrib/libc++/include/istream - copied unchanged from r227828, vendor/libc++/dist/include/istream head/contrib/libc++/include/iterator - copied unchanged from r227828, vendor/libc++/dist/include/iterator head/contrib/libc++/include/limits - copied unchanged from r227828, vendor/libc++/dist/include/limits head/contrib/libc++/include/list - copied unchanged from r227828, vendor/libc++/dist/include/list head/contrib/libc++/include/locale - copied unchanged from r227828, vendor/libc++/dist/include/locale head/contrib/libc++/include/map - copied unchanged from r227828, vendor/libc++/dist/include/map head/contrib/libc++/include/memory - copied unchanged from r227828, vendor/libc++/dist/include/memory head/contrib/libc++/include/mutex - copied unchanged from r227828, vendor/libc++/dist/include/mutex head/contrib/libc++/include/new - copied unchanged from r227828, vendor/libc++/dist/include/new head/contrib/libc++/include/numeric - copied unchanged from r227828, vendor/libc++/dist/include/numeric head/contrib/libc++/include/ostream - copied unchanged from r227828, vendor/libc++/dist/include/ostream head/contrib/libc++/include/queue - copied unchanged from r227828, vendor/libc++/dist/include/queue head/contrib/libc++/include/random - copied unchanged from r227828, vendor/libc++/dist/include/random head/contrib/libc++/include/ratio - copied unchanged from r227828, vendor/libc++/dist/include/ratio head/contrib/libc++/include/regex - copied unchanged from r227828, vendor/libc++/dist/include/regex head/contrib/libc++/include/scoped_allocator - copied unchanged from r227828, vendor/libc++/dist/include/scoped_allocator head/contrib/libc++/include/set - copied unchanged from r227828, vendor/libc++/dist/include/set head/contrib/libc++/include/sstream - copied unchanged from r227828, vendor/libc++/dist/include/sstream head/contrib/libc++/include/stack - copied unchanged from r227828, vendor/libc++/dist/include/stack head/contrib/libc++/include/stdexcept - copied unchanged from r227828, vendor/libc++/dist/include/stdexcept head/contrib/libc++/include/streambuf - copied unchanged from r227828, vendor/libc++/dist/include/streambuf head/contrib/libc++/include/string - copied unchanged from r227828, vendor/libc++/dist/include/string head/contrib/libc++/include/strstream - copied unchanged from r227828, vendor/libc++/dist/include/strstream head/contrib/libc++/include/system_error - copied unchanged from r227828, vendor/libc++/dist/include/system_error head/contrib/libc++/include/tgmath.h - copied unchanged from r227828, vendor/libc++/dist/include/tgmath.h head/contrib/libc++/include/thread - copied unchanged from r227828, vendor/libc++/dist/include/thread head/contrib/libc++/include/tuple - copied unchanged from r227828, vendor/libc++/dist/include/tuple head/contrib/libc++/include/type_traits - copied unchanged from r227828, vendor/libc++/dist/include/type_traits head/contrib/libc++/include/typeindex - copied unchanged from r227828, vendor/libc++/dist/include/typeindex head/contrib/libc++/include/typeinfo - copied unchanged from r227828, vendor/libc++/dist/include/typeinfo head/contrib/libc++/include/unordered_map - copied unchanged from r227828, vendor/libc++/dist/include/unordered_map head/contrib/libc++/include/unordered_set - copied unchanged from r227828, vendor/libc++/dist/include/unordered_set head/contrib/libc++/include/utility - copied unchanged from r227828, vendor/libc++/dist/include/utility head/contrib/libc++/include/valarray - copied unchanged from r227828, vendor/libc++/dist/include/valarray head/contrib/libc++/include/vector - copied unchanged from r227828, vendor/libc++/dist/include/vector head/contrib/libc++/src/ head/contrib/libc++/src/algorithm.cpp - copied unchanged from r227828, vendor/libc++/dist/src/algorithm.cpp head/contrib/libc++/src/bind.cpp - copied unchanged from r227828, vendor/libc++/dist/src/bind.cpp head/contrib/libc++/src/chrono.cpp - copied unchanged from r227828, vendor/libc++/dist/src/chrono.cpp head/contrib/libc++/src/condition_variable.cpp - copied unchanged from r227828, vendor/libc++/dist/src/condition_variable.cpp head/contrib/libc++/src/debug.cpp - copied unchanged from r227828, vendor/libc++/dist/src/debug.cpp head/contrib/libc++/src/exception.cpp - copied unchanged from r227828, vendor/libc++/dist/src/exception.cpp head/contrib/libc++/src/future.cpp - copied unchanged from r227828, vendor/libc++/dist/src/future.cpp head/contrib/libc++/src/hash.cpp - copied unchanged from r227828, vendor/libc++/dist/src/hash.cpp head/contrib/libc++/src/ios.cpp - copied unchanged from r227828, vendor/libc++/dist/src/ios.cpp head/contrib/libc++/src/iostream.cpp - copied unchanged from r227828, vendor/libc++/dist/src/iostream.cpp head/contrib/libc++/src/locale.cpp - copied unchanged from r227828, vendor/libc++/dist/src/locale.cpp head/contrib/libc++/src/memory.cpp - copied unchanged from r227828, vendor/libc++/dist/src/memory.cpp head/contrib/libc++/src/mutex.cpp - copied unchanged from r227828, vendor/libc++/dist/src/mutex.cpp head/contrib/libc++/src/new.cpp - copied unchanged from r227828, vendor/libc++/dist/src/new.cpp head/contrib/libc++/src/random.cpp - copied unchanged from r227828, vendor/libc++/dist/src/random.cpp head/contrib/libc++/src/regex.cpp - copied unchanged from r227828, vendor/libc++/dist/src/regex.cpp head/contrib/libc++/src/stdexcept.cpp - copied unchanged from r227828, vendor/libc++/dist/src/stdexcept.cpp head/contrib/libc++/src/string.cpp - copied unchanged from r227828, vendor/libc++/dist/src/string.cpp head/contrib/libc++/src/strstream.cpp - copied unchanged from r227828, vendor/libc++/dist/src/strstream.cpp head/contrib/libc++/src/support/ - copied from r227828, vendor/libc++/dist/src/support/ head/contrib/libc++/src/system_error.cpp - copied unchanged from r227828, vendor/libc++/dist/src/system_error.cpp head/contrib/libc++/src/thread.cpp - copied unchanged from r227828, vendor/libc++/dist/src/thread.cpp head/contrib/libc++/src/typeinfo.cpp - copied unchanged from r227828, vendor/libc++/dist/src/typeinfo.cpp head/contrib/libc++/src/utility.cpp - copied unchanged from r227828, vendor/libc++/dist/src/utility.cpp head/contrib/libc++/src/valarray.cpp - copied unchanged from r227828, vendor/libc++/dist/src/valarray.cpp head/contrib/libcxxrt/ head/contrib/libcxxrt/FREEBSD-upgrade head/contrib/libcxxrt/abi_namespace.h - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/abi_namespace.h head/contrib/libcxxrt/auxhelper.cc - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/auxhelper.cc head/contrib/libcxxrt/cxxabi.h - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/cxxabi.h head/contrib/libcxxrt/dwarf_eh.h - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/dwarf_eh.h head/contrib/libcxxrt/dynamic_cast.cc - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/dynamic_cast.cc head/contrib/libcxxrt/exception.cc - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/exception.cc head/contrib/libcxxrt/guard.cc - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/guard.cc head/contrib/libcxxrt/libelftc_dem_gnu3.c - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/libelftc_dem_gnu3.c head/contrib/libcxxrt/memory.cc - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/memory.cc head/contrib/libcxxrt/stdexcept.cc - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/stdexcept.cc head/contrib/libcxxrt/stdexcept.h - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/stdexcept.h head/contrib/libcxxrt/terminate.cc - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/terminate.cc head/contrib/libcxxrt/typeinfo - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/typeinfo head/contrib/libcxxrt/typeinfo.cc - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/typeinfo.cc head/contrib/libcxxrt/typeinfo.h - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/typeinfo.h head/contrib/libcxxrt/unwind-arm.h - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/unwind-arm.h head/contrib/libcxxrt/unwind-itanium.h - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/unwind-itanium.h head/contrib/libcxxrt/unwind.h - copied unchanged from r227973, vendor/libcxxrt/1be67aa8295314fb794c4e933d9bb7c7c33e0ca4/unwind.h head/lib/libc++/ head/lib/libc++/Makefile (contents, props changed) head/lib/libcxxrt/ head/lib/libcxxrt/Makefile (contents, props changed) Modified: head/Makefile.inc1 head/etc/mtree/BSD.include.dist head/lib/Makefile head/share/mk/bsd.libnames.mk head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 25 19:29:21 2011 (r227982) +++ head/Makefile.inc1 Fri Nov 25 20:59:04 2011 (r227983) @@ -1218,6 +1218,9 @@ _startup_libs+= lib/csu/${MACHINE_CPUARC _startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libc +.if defined(MK_LIBCPLUSPLUS) +_startup_libs+= lib/libcxxrt +.endif gnu/lib/libgcc__L: lib/libc__L Added: head/contrib/libc++/FREEBSD-upgrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libc++/FREEBSD-upgrade Fri Nov 25 20:59:04 2011 (r227983) @@ -0,0 +1,8 @@ +$FreeBSD$ + +The FreeBSD copy of libc++. This contains everything from the include and +source directories upstream, with the exception of the support/win32 directory, +which is only required for building on Windows (FreeBSD is not Windows). + +To update, bring in anything new in source or include that is not +platform-dependent (unless the platform in question is FreeBSD, obviously). Copied: head/contrib/libc++/include/__bit_reference (from r227828, vendor/libc++/dist/include/__bit_reference) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libc++/include/__bit_reference Fri Nov 25 20:59:04 2011 (r227983, copy of r227828, vendor/libc++/dist/include/__bit_reference) @@ -0,0 +1,1247 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___BIT_REFERENCE +#define _LIBCPP___BIT_REFERENCE + +#include <__config> +#include + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template class __bit_iterator; +template class __bit_const_reference; + +template +struct __has_storage_type +{ + static const bool value = false; +}; + +template ::value> +class __bit_reference +{ + typedef typename _C::__storage_type __storage_type; + typedef typename _C::__storage_pointer __storage_pointer; + + __storage_pointer __seg_; + __storage_type __mask_; + +#if defined(__clang__) + friend typename _C::__self; +#else + friend class _C::__self; +#endif + friend class __bit_const_reference<_C>; + friend class __bit_iterator<_C, false>; +public: + _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT + {return static_cast(*__seg_ & __mask_);} + _LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT + {return !static_cast(*this);} + + _LIBCPP_INLINE_VISIBILITY + __bit_reference& operator=(bool __x) _NOEXCEPT + { + if (__x) + *__seg_ |= __mask_; + else + *__seg_ &= ~__mask_; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + __bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT + {return operator=(static_cast(__x));} + + _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;} + _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const _NOEXCEPT + {return __bit_iterator<_C, false>(__seg_, static_cast(__ctz(__mask_)));} +private: + _LIBCPP_INLINE_VISIBILITY + __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT + : __seg_(__s), __mask_(__m) {} +}; + +template +class __bit_reference<_C, false> +{ +}; + +template +_LIBCPP_INLINE_VISIBILITY inline +void +swap(__bit_reference<_C> __x, __bit_reference<_D> __y) _NOEXCEPT +{ + bool __t = __x; + __x = __y; + __y = __t; +} + +template +_LIBCPP_INLINE_VISIBILITY inline +void +swap(__bit_reference<_C> __x, bool& __y) _NOEXCEPT +{ + bool __t = __x; + __x = __y; + __y = __t; +} + +template +_LIBCPP_INLINE_VISIBILITY inline +void +swap(bool& __x, __bit_reference<_C> __y) _NOEXCEPT +{ + bool __t = __x; + __x = __y; + __y = __t; +} + +template +class __bit_const_reference +{ + typedef typename _C::__storage_type __storage_type; + typedef typename _C::__const_storage_pointer __storage_pointer; + + __storage_pointer __seg_; + __storage_type __mask_; + +#if defined(__clang__) + friend typename _C::__self; +#else + friend class _C::__self; +#endif + friend class __bit_iterator<_C, true>; +public: + _LIBCPP_INLINE_VISIBILITY + __bit_const_reference(const __bit_reference<_C>& __x) _NOEXCEPT + : __seg_(__x.__seg_), __mask_(__x.__mask_) {} + + _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT + {return static_cast(*__seg_ & __mask_);} + + _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const _NOEXCEPT + {return __bit_iterator<_C, true>(__seg_, static_cast(__ctz(__mask_)));} +private: + _LIBCPP_INLINE_VISIBILITY + __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT + : __seg_(__s), __mask_(__m) {} + + __bit_const_reference& operator=(const __bit_const_reference& __x); +}; + +// find + +template +__bit_iterator<_C, false> +__find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b = *__first.__seg_ & __m; + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) + if (*__first.__seg_) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(*__first.__seg_))); + // do last partial word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = *__first.__seg_ & __m; + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + } + return _It(__first.__seg_, static_cast(__n)); +} + +template +__bit_iterator<_C, false> +__find_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b = ~(*__first.__seg_ & __m); + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) + { + __storage_type __b = ~*__first.__seg_; + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + } + // do last partial word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = ~(*__first.__seg_ & __m); + if (__b) + return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); + } + return _It(__first.__seg_, static_cast(__n)); +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +find(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value_) +{ + if (static_cast(__value_)) + return __find_bool_true(__first, static_cast(__last - __first)); + return __find_bool_false(__first, static_cast(__last - __first)); +} + +// count + +template +typename __bit_iterator<_C, false>::difference_type +__count_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + typedef typename _It::difference_type difference_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + difference_type __r = 0; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __r = _VSTD::__pop_count(*__first.__seg_ & __m); + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) + __r += _VSTD::__pop_count(*__first.__seg_); + // do last partial word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __r += _VSTD::__pop_count(*__first.__seg_ & __m); + } + return __r; +} + +template +typename __bit_iterator<_C, false>::difference_type +__count_bool_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + typedef typename _It::difference_type difference_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + difference_type __r = 0; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __r = _VSTD::__pop_count(~(*__first.__seg_ & __m)); + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word) + __r += _VSTD::__pop_count(~*__first.__seg_); + // do last partial word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __r += _VSTD::__pop_count(~(*__first.__seg_ & __m)); + } + return __r; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +typename __bit_iterator<_C, false>::difference_type +count(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, const _Tp& __value_) +{ + if (static_cast(__value_)) + return __count_bool_true(__first, static_cast(__last - __first)); + return __count_bool_false(__first, static_cast(__last - __first)); +} + +// fill_n + +template +void +__fill_n_false(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + *__first.__seg_ &= ~__m; + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + __storage_type __nw = __n / __bits_per_word; + _VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type)); + __n -= __nw * __bits_per_word; + // do last partial word + if (__n > 0) + { + __first.__seg_ += __nw; + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + *__first.__seg_ &= ~__m; + } +} + +template +void +__fill_n_true(__bit_iterator<_C, false> __first, typename _C::size_type __n) +{ + typedef __bit_iterator<_C, false> _It; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + // do first partial word + if (__first.__ctz_ != 0) + { + __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); + __storage_type __dn = _VSTD::min(__clz_f, __n); + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + *__first.__seg_ |= __m; + __n -= __dn; + ++__first.__seg_; + } + // do middle whole words + __storage_type __nw = __n / __bits_per_word; + _VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type)); + __n -= __nw * __bits_per_word; + // do last partial word + if (__n > 0) + { + __first.__seg_ += __nw; + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + *__first.__seg_ |= __m; + } +} + +template +_LIBCPP_INLINE_VISIBILITY inline +void +fill_n(__bit_iterator<_C, false> __first, typename _C::size_type __n, bool __value_) +{ + if (__n > 0) + { + if (__value_) + __fill_n_true(__first, __n); + else + __fill_n_false(__first, __n); + } +} + +// fill + +template +inline _LIBCPP_INLINE_VISIBILITY +void +fill(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __last, bool __value_) +{ + _VSTD::fill_n(__first, static_cast(__last - __first), __value_); +} + +// copy + +template +__bit_iterator<_C, false> +__copy_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, + __bit_iterator<_C, false> __result) +{ + typedef __bit_iterator<_C, _IsConst> _In; + typedef typename _In::difference_type difference_type; + typedef typename _In::__storage_type __storage_type; + static const unsigned __bits_per_word = _In::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__first.__ctz_ != 0) + { + unsigned __clz = __bits_per_word - __first.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn)); + __storage_type __b = *__first.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b; + __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__dn + __result.__ctz_) % __bits_per_word); + ++__first.__seg_; + // __first.__ctz_ = 0; + } + // __first.__ctz_ == 0; + // do middle words + __storage_type __nw = __n / __bits_per_word; + _VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type)); + __n -= __nw * __bits_per_word; + __result.__seg_ += __nw; + // do last word + if (__n > 0) + { + __first.__seg_ += __nw; + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = *__first.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b; + __result.__ctz_ = static_cast(__n); + } + } + return __result; +} + +template +__bit_iterator<_C, false> +__copy_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, + __bit_iterator<_C, false> __result) +{ + typedef __bit_iterator<_C, _IsConst> _In; + typedef typename _In::difference_type difference_type; + typedef typename _In::__storage_type __storage_type; + static const unsigned __bits_per_word = _In::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__first.__ctz_ != 0) + { + unsigned __clz_f = __bits_per_word - __first.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz_f), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b = *__first.__seg_ & __m; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r); + __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn)); + *__result.__seg_ &= ~__m; + if (__result.__ctz_ > __first.__ctz_) + *__result.__seg_ |= __b << (__result.__ctz_ - __first.__ctz_); + else + *__result.__seg_ |= __b >> (__first.__ctz_ - __result.__ctz_); + __result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__ddn + __result.__ctz_) % __bits_per_word); + __dn -= __ddn; + if (__dn > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __dn); + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b >> (__first.__ctz_ + __ddn); + __result.__ctz_ = static_cast(__dn); + } + ++__first.__seg_; + // __first.__ctz_ = 0; + } + // __first.__ctz_ == 0; + // do middle words + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __m = ~__storage_type(0) << __result.__ctz_; + for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_) + { + __storage_type __b = *__first.__seg_; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b << __result.__ctz_; + ++__result.__seg_; + *__result.__seg_ &= __m; + *__result.__seg_ |= __b >> __clz_r; + } + // do last word + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b = *__first.__seg_ & __m; + __storage_type __dn = _VSTD::min(__n, static_cast(__clz_r)); + __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn)); + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b << __result.__ctz_; + __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__dn + __result.__ctz_) % __bits_per_word); + __n -= __dn; + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b >> __dn; + __result.__ctz_ = static_cast(__n); + } + } + } + return __result; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +copy(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +{ + if (__first.__ctz_ == __result.__ctz_) + return __copy_aligned(__first, __last, __result); + return __copy_unaligned(__first, __last, __result); +} + +// copy_backward + +template +__bit_iterator<_C, false> +__copy_backward_aligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, + __bit_iterator<_C, false> __result) +{ + typedef __bit_iterator<_C, _IsConst> _In; + typedef typename _In::difference_type difference_type; + typedef typename _In::__storage_type __storage_type; + static const unsigned __bits_per_word = _In::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__last.__ctz_ != 0) + { + difference_type __dn = _VSTD::min(static_cast(__last.__ctz_), __n); + __n -= __dn; + unsigned __clz = __bits_per_word - __last.__ctz_; + __storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz); + __storage_type __b = *__last.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b; + __result.__ctz_ = static_cast(((-__dn & (__bits_per_word - 1)) + + __result.__ctz_) % __bits_per_word); + // __last.__ctz_ = 0 + } + // __last.__ctz_ == 0 || __n == 0 + // __result.__ctz_ == 0 || __n == 0 + // do middle words + __storage_type __nw = __n / __bits_per_word; + __result.__seg_ -= __nw; + __last.__seg_ -= __nw; + _VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type)); + __n -= __nw * __bits_per_word; + // do last word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) << (__bits_per_word - __n); + __storage_type __b = *--__last.__seg_ & __m; + *--__result.__seg_ &= ~__m; + *__result.__seg_ |= __b; + __result.__ctz_ = static_cast(-__n & (__bits_per_word - 1)); + } + } + return __result; +} + +template +__bit_iterator<_C, false> +__copy_backward_unaligned(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, + __bit_iterator<_C, false> __result) +{ + typedef __bit_iterator<_C, _IsConst> _In; + typedef typename _In::difference_type difference_type; + typedef typename _In::__storage_type __storage_type; + static const unsigned __bits_per_word = _In::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__last.__ctz_ != 0) + { + difference_type __dn = _VSTD::min(static_cast(__last.__ctz_), __n); + __n -= __dn; + unsigned __clz_l = __bits_per_word - __last.__ctz_; + __storage_type __m = (~__storage_type(0) << (__last.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_l); + __storage_type __b = *__last.__seg_ & __m; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __ddn = _VSTD::min(__dn, static_cast(__result.__ctz_)); + if (__ddn > 0) + { + __m = (~__storage_type(0) << (__result.__ctz_ - __ddn)) & (~__storage_type(0) >> __clz_r); + *__result.__seg_ &= ~__m; + if (__result.__ctz_ > __last.__ctz_) + *__result.__seg_ |= __b << (__result.__ctz_ - __last.__ctz_); + else + *__result.__seg_ |= __b >> (__last.__ctz_ - __result.__ctz_); + __result.__ctz_ = static_cast(((-__ddn & (__bits_per_word - 1)) + + __result.__ctz_) % __bits_per_word); + __dn -= __ddn; + } + if (__dn > 0) + { + // __result.__ctz_ == 0 + --__result.__seg_; + __result.__ctz_ = static_cast(-__dn & (__bits_per_word - 1)); + __m = ~__storage_type(0) << __result.__ctz_; + *__result.__seg_ &= ~__m; + __last.__ctz_ -= __dn + __ddn; + *__result.__seg_ |= __b << (__result.__ctz_ - __last.__ctz_); + } + // __last.__ctz_ = 0 + } + // __last.__ctz_ == 0 || __n == 0 + // __result.__ctz_ != 0 || __n == 0 + // do middle words + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __m = ~__storage_type(0) >> __clz_r; + for (; __n >= __bits_per_word; __n -= __bits_per_word) + { + __storage_type __b = *--__last.__seg_; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b >> __clz_r; + *--__result.__seg_ &= __m; + *__result.__seg_ |= __b << __result.__ctz_; + } + // do last word + if (__n > 0) + { + __m = ~__storage_type(0) << (__bits_per_word - __n); + __storage_type __b = *--__last.__seg_ & __m; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __dn = _VSTD::min(__n, static_cast(__result.__ctz_)); + __m = (~__storage_type(0) << (__result.__ctz_ - __dn)) & (~__storage_type(0) >> __clz_r); + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b >> (__bits_per_word - __result.__ctz_); + __result.__ctz_ = static_cast(((-__dn & (__bits_per_word - 1)) + + __result.__ctz_) % __bits_per_word); + __n -= __dn; + if (__n > 0) + { + // __result.__ctz_ == 0 + --__result.__seg_; + __result.__ctz_ = static_cast(-__n & (__bits_per_word - 1)); + __m = ~__storage_type(0) << __result.__ctz_; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b << (__result.__ctz_ - (__bits_per_word - __n - __dn)); + } + } + } + return __result; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +copy_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +{ + if (__last.__ctz_ == __result.__ctz_) + return __copy_backward_aligned(__first, __last, __result); + return __copy_backward_unaligned(__first, __last, __result); +} + +// move + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +move(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +{ + return _VSTD::copy(__first, __last, __result); +} + +// move_backward + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<_C, false> +move_backward(__bit_iterator<_C, _IsConst> __first, __bit_iterator<_C, _IsConst> __last, __bit_iterator<_C, false> __result) +{ + return _VSTD::copy(__first, __last, __result); +} + +// swap_ranges + +template +__bit_iterator<__C2, false> +__swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last, + __bit_iterator<__C2, false> __result) +{ + typedef __bit_iterator<__C1, false> _I1; + typedef typename _I1::difference_type difference_type; + typedef typename _I1::__storage_type __storage_type; + static const unsigned __bits_per_word = _I1::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__first.__ctz_ != 0) + { + unsigned __clz = __bits_per_word - __first.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz - __dn)); + __storage_type __b1 = *__first.__seg_ & __m; + *__first.__seg_ &= ~__m; + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1; + *__first.__seg_ |= __b2; + __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__dn + __result.__ctz_) % __bits_per_word); + ++__first.__seg_; + // __first.__ctz_ = 0; + } + // __first.__ctz_ == 0; + // do middle words + for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_, ++__result.__seg_) + swap(*__first.__seg_, *__result.__seg_); + // do last word + if (__n > 0) + { + __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b1 = *__first.__seg_ & __m; + *__first.__seg_ &= ~__m; + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1; + *__first.__seg_ |= __b2; + __result.__ctz_ = static_cast(__n); + } + } + return __result; +} + +template +__bit_iterator<__C2, false> +__swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last, + __bit_iterator<__C2, false> __result) +{ + typedef __bit_iterator<__C1, false> _I1; + typedef typename _I1::difference_type difference_type; + typedef typename _I1::__storage_type __storage_type; + static const unsigned __bits_per_word = _I1::__bits_per_word; + difference_type __n = __last - __first; + if (__n > 0) + { + // do first word + if (__first.__ctz_ != 0) + { + unsigned __clz_f = __bits_per_word - __first.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz_f), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b1 = *__first.__seg_ & __m; + *__first.__seg_ &= ~__m; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r); + __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn)); + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + if (__result.__ctz_ > __first.__ctz_) + { + unsigned __s = __result.__ctz_ - __first.__ctz_; + *__result.__seg_ |= __b1 << __s; + *__first.__seg_ |= __b2 >> __s; + } + else + { + unsigned __s = __first.__ctz_ - __result.__ctz_; + *__result.__seg_ |= __b1 >> __s; + *__first.__seg_ |= __b2 << __s; + } + __result.__seg_ += (__ddn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__ddn + __result.__ctz_) % __bits_per_word); + __dn -= __ddn; + if (__dn > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __dn); + __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + unsigned __s = __first.__ctz_ + __ddn; + *__result.__seg_ |= __b1 >> __s; + *__first.__seg_ |= __b2 << __s; + __result.__ctz_ = static_cast(__dn); + } + ++__first.__seg_; + // __first.__ctz_ = 0; + } + // __first.__ctz_ == 0; + // do middle words + __storage_type __m = ~__storage_type(0) << __result.__ctz_; + unsigned __clz_r = __bits_per_word - __result.__ctz_; + for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first.__seg_) + { + __storage_type __b1 = *__first.__seg_; + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1 << __result.__ctz_; + *__first.__seg_ = __b2 >> __result.__ctz_; + ++__result.__seg_; + __b2 = *__result.__seg_ & ~__m; + *__result.__seg_ &= __m; + *__result.__seg_ |= __b1 >> __clz_r; + *__first.__seg_ |= __b2 << __clz_r; + } + // do last word + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + __storage_type __b1 = *__first.__seg_ & __m; + *__first.__seg_ &= ~__m; + __storage_type __dn = _VSTD::min<__storage_type>(__n, __clz_r); + __m = (~__storage_type(0) << __result.__ctz_) & (~__storage_type(0) >> (__clz_r - __dn)); + __storage_type __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1 << __result.__ctz_; + *__first.__seg_ |= __b2 >> __result.__ctz_; + __result.__seg_ += (__dn + __result.__ctz_) / __bits_per_word; + __result.__ctz_ = static_cast((__dn + __result.__ctz_) % __bits_per_word); + __n -= __dn; + if (__n > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __n); + __b2 = *__result.__seg_ & __m; + *__result.__seg_ &= ~__m; + *__result.__seg_ |= __b1 >> __dn; + *__first.__seg_ |= __b2 << __dn; + __result.__ctz_ = static_cast(__n); + } + } + } + return __result; +} + +template +inline _LIBCPP_INLINE_VISIBILITY +__bit_iterator<__C2, false> +swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __last1, + __bit_iterator<__C2, false> __first2) +{ + if (__first1.__ctz_ == __first2.__ctz_) + return __swap_ranges_aligned(__first1, __last1, __first2); + return __swap_ranges_unaligned(__first1, __last1, __first2); +} + +// rotate + +template +struct __bit_array +{ + typedef typename _C::difference_type difference_type; + typedef typename _C::__storage_type __storage_type; + typedef typename _C::iterator iterator; + static const unsigned __bits_per_word = _C::__bits_per_word; + static const unsigned _N = 4; + + difference_type __size_; + __storage_type __word_[_N]; + + _LIBCPP_INLINE_VISIBILITY static difference_type capacity() + {return static_cast(_N * __bits_per_word);} + _LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {} + _LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);} + _LIBCPP_INLINE_VISIBILITY iterator end() {return iterator(__word_ + __size_ / __bits_per_word, + static_cast(__size_ % __bits_per_word));} +}; + +template +__bit_iterator<_C, false> +rotate(__bit_iterator<_C, false> __first, __bit_iterator<_C, false> __middle, __bit_iterator<_C, false> __last) +{ + typedef __bit_iterator<_C, false> _I1; + typedef typename _I1::difference_type difference_type; + typedef typename _I1::__storage_type __storage_type; + static const unsigned __bits_per_word = _I1::__bits_per_word; + difference_type __d1 = __middle - __first; + difference_type __d2 = __last - __middle; + _I1 __r = __first + __d2; + while (__d1 != 0 && __d2 != 0) + { + if (__d1 <= __d2) + { + if (__d1 <= __bit_array<_C>::capacity()) + { + __bit_array<_C> __b(__d1); + _VSTD::copy(__first, __middle, __b.begin()); + _VSTD::copy(__b.begin(), __b.end(), _VSTD::copy(__middle, __last, __first)); + break; + } + else + { + __bit_iterator<_C, false> __mp = _VSTD::swap_ranges(__first, __middle, __middle); + __first = __middle; + __middle = __mp; + __d2 -= __d1; + } + } + else + { + if (__d2 <= __bit_array<_C>::capacity()) + { + __bit_array<_C> __b(__d2); + _VSTD::copy(__middle, __last, __b.begin()); + _VSTD::copy_backward(__b.begin(), __b.end(), _VSTD::copy_backward(__first, __middle, __last)); + break; + } + else + { + __bit_iterator<_C, false> __mp = __first + __d2; + _VSTD::swap_ranges(__first, __mp, __middle); + __first = __mp; + __d1 -= __d2; + } + } + } + return __r; +} + +// equal + +template +bool +__equal_unaligned(__bit_iterator<_C, true> __first1, __bit_iterator<_C, true> __last1, + __bit_iterator<_C, true> __first2) +{ + typedef __bit_iterator<_C, true> _It; + typedef typename _It::difference_type difference_type; + typedef typename _It::__storage_type __storage_type; + static const unsigned __bits_per_word = _It::__bits_per_word; + difference_type __n = __last1 - __first1; + if (__n > 0) + { + // do first word + if (__first1.__ctz_ != 0) + { + unsigned __clz_f = __bits_per_word - __first1.__ctz_; + difference_type __dn = _VSTD::min(static_cast(__clz_f), __n); + __n -= __dn; + __storage_type __m = (~__storage_type(0) << __first1.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); + __storage_type __b = *__first1.__seg_ & __m; + unsigned __clz_r = __bits_per_word - __first2.__ctz_; + __storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r); + __m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn)); + if (__first2.__ctz_ > __first1.__ctz_) + if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_))) + return false; + else + if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ - __first2.__ctz_))) + return false; + __first2.__seg_ += (__ddn + __first2.__ctz_) / __bits_per_word; + __first2.__ctz_ = static_cast((__ddn + __first2.__ctz_) % __bits_per_word); + __dn -= __ddn; + if (__dn > 0) + { + __m = ~__storage_type(0) >> (__bits_per_word - __dn); + if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ + __ddn))) + return false; + __first2.__ctz_ = static_cast(__dn); + } + ++__first1.__seg_; + // __first1.__ctz_ = 0; + } + // __first1.__ctz_ == 0; + // do middle words + unsigned __clz_r = __bits_per_word - __first2.__ctz_; + __storage_type __m = ~__storage_type(0) << __first2.__ctz_; + for (; __n >= __bits_per_word; __n -= __bits_per_word, ++__first1.__seg_) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 25 23:45: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 B9682106564A; Fri, 25 Nov 2011 23:45:29 +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 A99D28FC08; Fri, 25 Nov 2011 23:45:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPNjTqi064300; Fri, 25 Nov 2011 23:45:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAPNjTGJ064298; Fri, 25 Nov 2011 23:45:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201111252345.pAPNjTGJ064298@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 25 Nov 2011 23:45: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: r227984 - head/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: Fri, 25 Nov 2011 23:45:29 -0000 Author: jilles Date: Fri Nov 25 23:45:29 2011 New Revision: 227984 URL: http://svn.freebsd.org/changeset/base/227984 Log: test: Reduce code size of ops table. Modified: head/bin/test/test.c Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Fri Nov 25 20:59:04 2011 (r227983) +++ head/bin/test/test.c Fri Nov 25 23:45:29 2011 (r227984) @@ -119,7 +119,7 @@ enum token_types { }; static struct t_op { - const char *op_text; + char op_text[4]; short op_num, op_type; } const ops [] = { {"-r", FILRD, UNOP}, @@ -162,7 +162,7 @@ static struct t_op { {"-o", BOR, BBINOP}, {"(", LPAREN, PAREN}, {")", RPAREN, PAREN}, - {0, 0, 0} + {"", 0, 0} }; static struct t_op const *t_wp_op; @@ -427,7 +427,7 @@ t_lex(char *s) t_wp_op = NULL; return EOI; } - while (op->op_text) { + while (*op->op_text) { if (strcmp(s, op->op_text) == 0) { if (((op->op_type == UNOP || op->op_type == BUNOP) && isunopoperand()) || @@ -456,7 +456,7 @@ isunopoperand(void) if (nargc == 2) return parenlevel == 1 && strcmp(s, ")") == 0; t = *(t_wp + 2); - while (op->op_text) { + while (*op->op_text) { if (strcmp(s, op->op_text) == 0) return op->op_type == BINOP && (parenlevel == 0 || t[0] != ')' || t[1] != '\0'); @@ -478,7 +478,7 @@ islparenoperand(void) return parenlevel == 1 && strcmp(s, ")") == 0; if (nargc != 3) return 0; - while (op->op_text) { + while (*op->op_text) { if (strcmp(s, op->op_text) == 0) return op->op_type == BINOP; op++; From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 00:30: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 2235F106566C; Sat, 26 Nov 2011 00:30:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 129E78FC08; Sat, 26 Nov 2011 00:30:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQ0UdwD066094; Sat, 26 Nov 2011 00:30:39 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQ0Ud5M066092; Sat, 26 Nov 2011 00:30:39 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201111260030.pAQ0Ud5M066092@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 26 Nov 2011 00:30: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: r227985 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 00:30:40 -0000 Author: gonzo Date: Sat Nov 26 00:30:39 2011 New Revision: 227985 URL: http://svn.freebsd.org/changeset/base/227985 Log: Provide proper error message when trying to build xdev, xdev-build or xdev-install targets without either XDEV or XDEV_ARCH defined. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 25 23:45:29 2011 (r227984) +++ head/Makefile.inc1 Sat Nov 26 00:30:39 2011 (r227985) @@ -1639,4 +1639,7 @@ _xi-links: ln -sf ../../${XDTP}/usr/bin/$$i \ ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ done +.else +xdev xdev-buil xdev-install: + @echo "*** Error: Both XDEV and XDEV_ARCH must be defined for \"${.TARGET}\" target" .endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 01:44: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 473B5106566C; Sat, 26 Nov 2011 01:44:38 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37A508FC17; Sat, 26 Nov 2011 01:44:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQ1icpN068415; Sat, 26 Nov 2011 01:44:38 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQ1icT6068413; Sat, 26 Nov 2011 01:44:38 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111260144.pAQ1icT6068413@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 26 Nov 2011 01:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227986 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 01:44:38 -0000 Author: lstewart Date: Sat Nov 26 01:44:37 2011 New Revision: 227986 URL: http://svn.freebsd.org/changeset/base/227986 Log: Export the "ffclock" feature for kernels compiled with feed-forward clock support. Suggested by: netchild Reviewed by: netchild Modified: head/sys/kern/kern_ffclock.c Modified: head/sys/kern/kern_ffclock.c ============================================================================== --- head/sys/kern/kern_ffclock.c Sat Nov 26 00:30:39 2011 (r227985) +++ head/sys/kern/kern_ffclock.c Sat Nov 26 01:44:37 2011 (r227986) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #ifdef FFCLOCK +FEATURE(ffclock, "Feed-forward clock support"); + extern struct ffclock_estimate ffclock_estimate; extern struct bintime ffclock_boottime; extern int8_t ffclock_updated; From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 03:26: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 7C7881065690; Sat, 26 Nov 2011 03:26:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 531398FC13; Sat, 26 Nov 2011 03:26:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQ3Q7OA071786; Sat, 26 Nov 2011 03:26:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQ3Q7Qw071782; Sat, 26 Nov 2011 03:26:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111260326.pAQ3Q7Qw071782@svn.freebsd.org> From: Dimitry Andric Date: Sat, 26 Nov 2011 03:26: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: r227987 - in head: . lib 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: Sat, 26 Nov 2011 03:26:07 -0000 Author: dim Date: Sat Nov 26 03:26:06 2011 New Revision: 227987 URL: http://svn.freebsd.org/changeset/base/227987 Log: Fix breakage after r227983; lib/libcxxrt still got built, because it was not disabled in the usual way (by adding it to __DEFAULT_NO_OPTIONS in share/mk/bsd.own.mk), and because the test for MK_LIBCPLUSPLUS in Makefile.inc1 was incorrect. Pointy hat to: dim Modified: head/Makefile.inc1 head/lib/Makefile head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Nov 26 01:44:37 2011 (r227986) +++ head/Makefile.inc1 Sat Nov 26 03:26:06 2011 (r227987) @@ -1218,7 +1218,7 @@ _startup_libs+= lib/csu/${MACHINE_CPUARC _startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libc -.if defined(MK_LIBCPLUSPLUS) +.if ${MK_LIBCPLUSPLUS} != "no" _startup_libs+= lib/libcxxrt .endif Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Nov 26 01:44:37 2011 (r227986) +++ head/lib/Makefile Sat Nov 26 03:26:06 2011 (r227987) @@ -48,13 +48,9 @@ SUBDIR_ORDERED= ${_csu} \ libsbuf \ libtacplus \ libutil \ - ${_libypclnt} - -.if ${MK_LIBCPLUSPLUS} != "no" -SUBDIR_ORDERED+=libcxxrt\ - libc++ -.endif - + ${_libypclnt} \ + ${_libcxxrt} \ + ${_libcplusplus} SUBDIR= ${SUBDIR_ORDERED} \ libalias \ @@ -209,6 +205,11 @@ _libsmb= libsmb _libmp= libmp .endif +.if ${MK_LIBCPLUSPLUS} != "no" +_libcxxrt= libcxxrt +_libcplusplus= libc++ +.endif + .if ${MK_PMC} != "no" _libpmc= libpmc .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Nov 26 01:44:37 2011 (r227986) +++ head/share/mk/bsd.own.mk Sat Nov 26 03:26:06 2011 (r227987) @@ -413,6 +413,7 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ ICONV \ IDEA \ + LIBCPLUSPLUS \ OFED # @@ -553,8 +554,6 @@ MK_GCC:= no MK_GDB:= no .endif -MK_LIBCPLUSPLUS?= no - # # Set defaults for the MK_*_SUPPORT variables. # From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 03:28: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 B6085106564A; Sat, 26 Nov 2011 03:28:09 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4188C8FC0C; Sat, 26 Nov 2011 03:28:08 +0000 (UTC) Received: by ywp17 with SMTP id 17so3480378ywp.13 for ; Fri, 25 Nov 2011 19:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Hi72KyAnChS00B8RKYPouyEm86Ue+nclAuozcbRahrk=; b=YrTlQaSW24x+ppRKVN/4oZdtDIRnQPI2KuBMgF2X9WgyCATkAg+O/sWOvzP2Jez/lF PC3FYoDWWg7rLw3qf7VQO2HY5saWqcFjrpOMoCOgX8DES6oNsveNqyCy1a2Mv9vPh870 kTEo13h9xNbtO2IHSzdovaSpksOxslTBTJyfQ= MIME-Version: 1.0 Received: by 10.182.149.33 with SMTP id tx1mr2857978obb.62.1322278088456; Fri, 25 Nov 2011 19:28:08 -0800 (PST) Received: by 10.182.62.227 with HTTP; Fri, 25 Nov 2011 19:28:08 -0800 (PST) In-Reply-To: <201111260326.pAQ3Q7Qw071782@svn.freebsd.org> References: <201111260326.pAQ3Q7Qw071782@svn.freebsd.org> Date: Fri, 25 Nov 2011 19:28:08 -0800 Message-ID: From: Garrett Cooper To: Dimitry Andric 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: r227987 - in head: . lib 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: Sat, 26 Nov 2011 03:28:09 -0000 On Fri, Nov 25, 2011 at 7:26 PM, Dimitry Andric wrote: > Author: dim > Date: Sat Nov 26 03:26:06 2011 > New Revision: 227987 > URL: http://svn.freebsd.org/changeset/base/227987 > > Log: > =A0Fix breakage after r227983; lib/libcxxrt still got built, because it w= as > =A0not disabled in the usual way (by adding it to __DEFAULT_NO_OPTIONS in > =A0share/mk/bsd.own.mk), and because the test for MK_LIBCPLUSPLUS in > =A0Makefile.inc1 was incorrect. Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 08:22: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 0C6D9106564A; Sat, 26 Nov 2011 08:22:12 +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 F01528FC15; Sat, 26 Nov 2011 08:22:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQ8MB3Q080907; Sat, 26 Nov 2011 08:22:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQ8MBEM080905; Sat, 26 Nov 2011 08:22:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111260822.pAQ8MBEM080905@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 Nov 2011 08:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227990 - releng/9.0/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 08:22:12 -0000 Author: kib Date: Sat Nov 26 08:22:11 2011 New Revision: 227990 URL: http://svn.freebsd.org/changeset/base/227990 Log: MFC r227660: Fix fd leak. Approved by: re (bz) Modified: releng/9.0/libexec/rtld-elf/rtld.c Directory Properties: releng/9.0/libexec/rtld-elf/ (props changed) Modified: releng/9.0/libexec/rtld-elf/rtld.c ============================================================================== --- releng/9.0/libexec/rtld-elf/rtld.c Sat Nov 26 06:50:11 2011 (r227989) +++ releng/9.0/libexec/rtld-elf/rtld.c Sat Nov 26 08:22:11 2011 (r227990) @@ -1657,6 +1657,7 @@ load_object(const char *name, const Obj_ } if (flags & RTLD_LO_NOLOAD) { free(path); + close(fd); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 08:23: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 AE3921065670; Sat, 26 Nov 2011 08:23:25 +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 9DB948FC08; Sat, 26 Nov 2011 08:23:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQ8NPAl080987; Sat, 26 Nov 2011 08:23:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQ8NPXq080985; Sat, 26 Nov 2011 08:23:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111260823.pAQ8NPXq080985@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 Nov 2011 08:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227991 - releng/9.0/lib/librt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 08:23:25 -0000 Author: kib Date: Sat Nov 26 08:23:25 2011 New Revision: 227991 URL: http://svn.freebsd.org/changeset/base/227991 Log: MFC r227661: Free unused allocation on error. Approved by: re (bz) Modified: releng/9.0/lib/librt/timer.c Directory Properties: releng/9.0/lib/librt/ (props changed) Modified: releng/9.0/lib/librt/timer.c ============================================================================== --- releng/9.0/lib/librt/timer.c Sat Nov 26 08:22:11 2011 (r227990) +++ releng/9.0/lib/librt/timer.c Sat Nov 26 08:23:25 2011 (r227991) @@ -102,12 +102,14 @@ __timer_create(clockid_t clockid, struct } if (__sigev_check_init()) { + free(timer); errno = EINVAL; return (-1); } sn = __sigev_alloc(SI_TIMER, evp, NULL, 0); if (sn == NULL) { + free(timer); errno = EAGAIN; return (-1); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 13: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 923F4106566B; Sat, 26 Nov 2011 13:43:51 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8184F8FC1D; Sat, 26 Nov 2011 13:43:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQDhpNc093433; Sat, 26 Nov 2011 13:43:51 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQDhp9a093431; Sat, 26 Nov 2011 13:43:51 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201111261343.pAQDhp9a093431@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 26 Nov 2011 13: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: r227992 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 13:43:51 -0000 Author: dumbbell Date: Sat Nov 26 13:43:50 2011 New Revision: 227992 URL: http://svn.freebsd.org/changeset/base/227992 Log: Prevent a division by zero with some broken batteries This problem was seen on a laptop with a dead battery. Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Sat Nov 26 08:23:25 2011 (r227991) +++ head/sys/dev/acpica/acpi_battery.c Sat Nov 26 13:43:50 2011 (r227992) @@ -205,6 +205,14 @@ acpi_battery_get_battinfo(device_t dev, bif->lfcap = (bif->lfcap * bif->dvol) / 1000; } + /* + * The calculation above may set bif->lfcap to zero. This was + * seen on a laptop with a broken battery. The result of the + * division was rounded to zero. + */ + if (!acpi_battery_bif_valid(bif)) + continue; + /* Calculate percent capacity remaining. */ bi[i].cap = (100 * bst[i].cap) / bif->lfcap; From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 14:17: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 3D456106564A; Sat, 26 Nov 2011 14:17:59 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BAEB8FC0A; Sat, 26 Nov 2011 14:17:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQEHxj7094639; Sat, 26 Nov 2011 14:17:59 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQEHwfK094637; Sat, 26 Nov 2011 14:17:58 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201111261417.pAQEHwfK094637@svn.freebsd.org> From: Warren Block Date: Sat, 26 Nov 2011 14:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227994 - stable/9/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, 26 Nov 2011 14:17:59 -0000 Author: wblock (doc committer) Date: Sat Nov 26 14:17:58 2011 New Revision: 227994 URL: http://svn.freebsd.org/changeset/base/227994 Log: MFC 225861: Fix a confusing sentence. Other wording tweaks. Approved by: gjb (mentor) Approved by: re@ (kostikbel) Modified: stable/9/etc/devd.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/devd.conf ============================================================================== --- stable/9/etc/devd.conf Sat Nov 26 13:54:55 2011 (r227993) +++ stable/9/etc/devd.conf Sat Nov 26 14:17:58 2011 (r227994) @@ -8,10 +8,10 @@ # NB: device-name is shorthand for 'match device-name' options { - # Each directory directive adds a directory the list of directories - # that we scan for files. Files are read-in in the order that they - # are returned from readdir(3). The rule-sets are combined to - # create a DFA that's used to match events to actions. + # Each "directory" directive adds a directory to the list of + # directories that we scan for files. Files are loaded in the order + # that they are returned from readdir(3). The rule-sets are combined + # to create a DFA that's used to match events to actions. directory "/etc/devd"; directory "/usr/local/etc/devd"; pid-file "/var/run/devd.pid"; @@ -32,8 +32,8 @@ options { # script is called pccard_ether. # # NB: DETACH events are ignored; the kernel should handle all cleanup -# (routes, arp cache) if you need to do something beware of races -# against immediate create of a device w/ the same name; e.g. +# (routes, arp cache). Beware of races against immediate create +# of a device with the same name; e.g. # ifconfig bridge0 destroy; ifconfig bridge0 create # notify 0 { @@ -43,7 +43,7 @@ notify 0 { }; # -# Try to start dhclient on Ethernet like interfaces when the link comes +# Try to start dhclient on Ethernet-like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually # run it. No link down rule exists because dhclient automatically exits # when the link goes down. @@ -87,7 +87,7 @@ detach 100 { device-name "ed50"; }; -# When a USB Bluetooth dongle appears activate it +# When a USB Bluetooth dongle appears, activate it attach 100 { device-name "ubt[0-9]+"; action "/etc/rc.d/bluetooth quietstart $device-name"; @@ -125,7 +125,7 @@ detach 100 { }; # Firmware download into the ActiveWire board. After the firmware download is -# done the device detaches and reappears as something new and shiny +# done, the device detaches and reappears as something new and shiny # automatically. attach 100 { match "vendor" "0x0854"; @@ -265,12 +265,11 @@ notify 10 { /* EXAMPLES TO END OF FILE -# The following might be an example of something that a vendor might -# install if you were to add their device. This might reside in -# /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical -# example, a pccard ethernet-like device. Students of history may -# know other devices by this name, and will get the in-jokes in this -# entry. +# An example of something that a vendor might install if you were to +# add their device. This might reside in /usr/local/etc/devd/deqna.conf. +# A deqna is, in this hypothetical example, a pccard ethernet-like device. +# Students of history may know other devices by this name, and will get +# the in-jokes in this entry. nomatch 10 { match "bus" "pccard[0-9]+"; match "manufacturer" "0x1234"; @@ -288,7 +287,7 @@ detach 10 { # Examples of notify hooks. A notify is a generic way for a kernel # subsystem to send event notification to userland. -# + # Here are some examples of ACPI notify handlers. ACPI subsystems that # generate notifies include the AC adapter, power/sleep buttons, # control method batteries, lid switch, and thermal zones. @@ -316,7 +315,7 @@ notify 10 { }; # This example works around a memory leak in PostgreSQL, restarting -# it when "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered. +# it when the "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered. notify 0 { match "system" "RCTL"; match "rule" "user:70:swap:.*"; From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 14:18: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 24E6B106575B; Sat, 26 Nov 2011 14:18:40 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131778FC1B; Sat, 26 Nov 2011 14:18:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQEIdM7094700; Sat, 26 Nov 2011 14:18:39 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQEIdAB094697; Sat, 26 Nov 2011 14:18:39 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111261418.pAQEIdAB094697@svn.freebsd.org> From: David Chisnall Date: Sat, 26 Nov 2011 14:18:39 +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: r227995 - vendor/libcxxrt/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: Sat, 26 Nov 2011 14:18:40 -0000 Author: theraven Date: Sat Nov 26 14:18:39 2011 New Revision: 227995 URL: http://svn.freebsd.org/changeset/base/227995 Log: Imported the latest version of libcxxrt. Approved by: dim (mentor) Added: vendor/libcxxrt/dist/LICENSE Modified: vendor/libcxxrt/dist/exception.cc vendor/libcxxrt/dist/memory.cc Added: vendor/libcxxrt/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/dist/LICENSE Sat Nov 26 14:18:39 2011 (r227995) @@ -0,0 +1,14 @@ +The BSD License + +Copyright 2010-2011 PathScale, 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. + +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of PathScale, Inc. Modified: vendor/libcxxrt/dist/exception.cc ============================================================================== --- vendor/libcxxrt/dist/exception.cc Sat Nov 26 14:17:58 2011 (r227994) +++ vendor/libcxxrt/dist/exception.cc Sat Nov 26 14:18:39 2011 (r227995) @@ -8,6 +8,17 @@ #include "dwarf_eh.h" #include "cxxabi.h" +#pragma weak pthread_key_create +#pragma weak pthread_setspecific +#pragma weak pthread_getspecific +#pragma weak pthread_once +#pragma weak pthread_once +#pragma weak pthread_cond_signal +#pragma weak pthread_cond_wait +#pragma weak pthread_mutex_lock +#pragma weak pthread_mutex_unlock + + using namespace ABI_NAMESPACE; /** @@ -289,11 +300,31 @@ static void thread_cleanup(void* thread_ static pthread_once_t once_control = PTHREAD_ONCE_INIT; /** + * We may not be linked against a full pthread implementation. If we're not, + * then we need to fake the thread-local storage by storing 'thread-local' + * things in a global. + */ +static bool fakeTLS; +/** + * Thread-local storage for a single-threaded program. + */ +static __cxa_thread_info singleThreadInfo; +/** * Initialise eh_key. */ static void init_key(void) { + if ((0 == pthread_key_create) || + (0 == pthread_setspecific) || + (0 == pthread_getspecific)) + { + fakeTLS = true; + return; + } pthread_key_create(&eh_key, thread_cleanup); + pthread_setspecific(eh_key, (void*)0x42); + fakeTLS = (pthread_getspecific(eh_key) != (void*)0x42); + pthread_setspecific(eh_key, 0); } /** @@ -301,7 +332,11 @@ static void init_key(void) */ static __cxa_thread_info *thread_info() { - pthread_once(&once_control, init_key); + if ((0 == pthread_once) || pthread_once(&once_control, init_key)) + { + fakeTLS = true; + } + if (fakeTLS) { return &singleThreadInfo; } __cxa_thread_info *info = (__cxa_thread_info*)pthread_getspecific(eh_key); if (0 == info) { @@ -316,6 +351,7 @@ static __cxa_thread_info *thread_info() */ static __cxa_thread_info *thread_info_fast() { + if (fakeTLS) { return &singleThreadInfo; } return (__cxa_thread_info*)pthread_getspecific(eh_key); } /** @@ -367,7 +403,10 @@ static char *emergency_malloc(size_t siz // Only 4 emergency buffers allowed per thread! if (info->emergencyBuffersHeld > 3) { return 0; } - pthread_mutex_lock(&emergency_malloc_lock); + if (pthread_mutex_lock) + { + pthread_mutex_lock(&emergency_malloc_lock); + } int buffer = -1; while (buffer < 0) { @@ -378,7 +417,10 @@ static char *emergency_malloc(size_t siz void *m = calloc(1, size); if (0 != m) { - pthread_mutex_unlock(&emergency_malloc_lock); + if (pthread_mutex_unlock) + { + pthread_mutex_unlock(&emergency_malloc_lock); + } return (char*)m; } for (int i=0 ; i<16 ; i++) @@ -395,10 +437,24 @@ static char *emergency_malloc(size_t siz // of the emergency buffers. if (buffer < 0) { + // If we don't have pthread_cond_wait, then there is only one + // thread and it's already used all of the emergency buffers, so we + // have no alternative but to die. Calling abort() instead of + // terminate, because terminate can throw exceptions, which can + // bring us back here and infinite loop. + if (!pthread_cond_wait) + { + fputs("Terminating while out of memory trying to throw an exception", + stderr); + abort(); + } pthread_cond_wait(&emergency_malloc_wait, &emergency_malloc_lock); } } - pthread_mutex_unlock(&emergency_malloc_lock); + if (pthread_mutex_unlock) + { + pthread_mutex_unlock(&emergency_malloc_lock); + } info->emergencyBuffersHeld++; return emergency_buffer + (1024 * buffer); } @@ -431,13 +487,19 @@ static void emergency_malloc_free(char * memset((void*)ptr, 0, 1024); // Signal the condition variable to wake up any threads that are blocking // waiting for some space in the emergency buffer - pthread_mutex_lock(&emergency_malloc_lock); + if (pthread_mutex_lock) + { + pthread_mutex_lock(&emergency_malloc_lock); + } // In theory, we don't need to do this with the lock held. In practice, // our array of bools will probably be updated using 32-bit or 64-bit // memory operations, so this update may clobber adjacent values. buffer_allocated[buffer] = false; - pthread_cond_signal(&emergency_malloc_wait); - pthread_mutex_unlock(&emergency_malloc_lock); + if (pthread_cond_signal && pthread_mutex_unlock) + { + pthread_cond_signal(&emergency_malloc_wait); + pthread_mutex_unlock(&emergency_malloc_lock); + } } static char *alloc_or_die(size_t size) Modified: vendor/libcxxrt/dist/memory.cc ============================================================================== --- vendor/libcxxrt/dist/memory.cc Sat Nov 26 14:17:58 2011 (r227994) +++ vendor/libcxxrt/dist/memory.cc Sat Nov 26 14:18:39 2011 (r227995) @@ -11,6 +11,10 @@ #include #include "stdexcept.h" +#if !__has_builtin(__sync_swap) +#define __sync_swap __sync_lock_test_and_set +#endif + namespace std { struct nothrow_t {}; @@ -33,7 +37,7 @@ namespace std __attribute__((weak)) new_handler set_new_handler(new_handler handler) { - return __sync_lock_test_and_set(&new_handl, handler); + return __sync_swap(&new_handl, handler); } } @@ -103,7 +107,7 @@ void * operator new[](size_t size) __attribute__((weak)) -void operator delete[](void * ptr) +void operator delete[](void * ptr) throw() { ::operator delete(ptr); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 14:19: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 07E22106566C; Sat, 26 Nov 2011 14:19:09 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0DDB8FC20; Sat, 26 Nov 2011 14:19:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQEJ8Th094749; Sat, 26 Nov 2011 14:19:08 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQEJ8pe094747; Sat, 26 Nov 2011 14:19:08 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201111261419.pAQEJ8pe094747@svn.freebsd.org> From: Warren Block Date: Sat, 26 Nov 2011 14:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227996 - releng/9.0/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, 26 Nov 2011 14:19:09 -0000 Author: wblock (doc committer) Date: Sat Nov 26 14:19:08 2011 New Revision: 227996 URL: http://svn.freebsd.org/changeset/base/227996 Log: MFC 225861: Fix a confusing sentence. Other wording tweaks. Approved by: gjb (mentor) Approved by: re@ (kostikbel) Modified: releng/9.0/etc/devd.conf Directory Properties: releng/9.0/etc/ (props changed) Modified: releng/9.0/etc/devd.conf ============================================================================== --- releng/9.0/etc/devd.conf Sat Nov 26 14:18:39 2011 (r227995) +++ releng/9.0/etc/devd.conf Sat Nov 26 14:19:08 2011 (r227996) @@ -8,10 +8,10 @@ # NB: device-name is shorthand for 'match device-name' options { - # Each directory directive adds a directory the list of directories - # that we scan for files. Files are read-in in the order that they - # are returned from readdir(3). The rule-sets are combined to - # create a DFA that's used to match events to actions. + # Each "directory" directive adds a directory to the list of + # directories that we scan for files. Files are loaded in the order + # that they are returned from readdir(3). The rule-sets are combined + # to create a DFA that's used to match events to actions. directory "/etc/devd"; directory "/usr/local/etc/devd"; pid-file "/var/run/devd.pid"; @@ -32,8 +32,8 @@ options { # script is called pccard_ether. # # NB: DETACH events are ignored; the kernel should handle all cleanup -# (routes, arp cache) if you need to do something beware of races -# against immediate create of a device w/ the same name; e.g. +# (routes, arp cache). Beware of races against immediate create +# of a device with the same name; e.g. # ifconfig bridge0 destroy; ifconfig bridge0 create # notify 0 { @@ -43,7 +43,7 @@ notify 0 { }; # -# Try to start dhclient on Ethernet like interfaces when the link comes +# Try to start dhclient on Ethernet-like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually # run it. No link down rule exists because dhclient automatically exits # when the link goes down. @@ -87,7 +87,7 @@ detach 100 { device-name "ed50"; }; -# When a USB Bluetooth dongle appears activate it +# When a USB Bluetooth dongle appears, activate it attach 100 { device-name "ubt[0-9]+"; action "/etc/rc.d/bluetooth quietstart $device-name"; @@ -125,7 +125,7 @@ detach 100 { }; # Firmware download into the ActiveWire board. After the firmware download is -# done the device detaches and reappears as something new and shiny +# done, the device detaches and reappears as something new and shiny # automatically. attach 100 { match "vendor" "0x0854"; @@ -265,12 +265,11 @@ notify 10 { /* EXAMPLES TO END OF FILE -# The following might be an example of something that a vendor might -# install if you were to add their device. This might reside in -# /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical -# example, a pccard ethernet-like device. Students of history may -# know other devices by this name, and will get the in-jokes in this -# entry. +# An example of something that a vendor might install if you were to +# add their device. This might reside in /usr/local/etc/devd/deqna.conf. +# A deqna is, in this hypothetical example, a pccard ethernet-like device. +# Students of history may know other devices by this name, and will get +# the in-jokes in this entry. nomatch 10 { match "bus" "pccard[0-9]+"; match "manufacturer" "0x1234"; @@ -288,7 +287,7 @@ detach 10 { # Examples of notify hooks. A notify is a generic way for a kernel # subsystem to send event notification to userland. -# + # Here are some examples of ACPI notify handlers. ACPI subsystems that # generate notifies include the AC adapter, power/sleep buttons, # control method batteries, lid switch, and thermal zones. @@ -316,7 +315,7 @@ notify 10 { }; # This example works around a memory leak in PostgreSQL, restarting -# it when "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered. +# it when the "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered. notify 0 { match "system" "RCTL"; match "rule" "user:70:swap:.*"; From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 14:20: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 5D210106564A; Sat, 26 Nov 2011 14:20:35 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 331A48FC0A; Sat, 26 Nov 2011 14:20:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQEKZh0094829; Sat, 26 Nov 2011 14:20:35 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQEKYKu094828; Sat, 26 Nov 2011 14:20:34 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111261420.pAQEKYKu094828@svn.freebsd.org> From: David Chisnall Date: Sat, 26 Nov 2011 14:20:34 +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: r227997 - vendor/libcxxrt/8931d9e5180830a5433d16ae6b3ad8dd9e629512 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 14:20:35 -0000 Author: theraven Date: Sat Nov 26 14:20:34 2011 New Revision: 227997 URL: http://svn.freebsd.org/changeset/base/227997 Log: Versioned snapshot for libcxxrt Approved by: dim (mentor) Added: vendor/libcxxrt/8931d9e5180830a5433d16ae6b3ad8dd9e629512/ - copied from r227996, vendor/libcxxrt/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 15:18: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 7E9401065670; Sat, 26 Nov 2011 15:18:44 +0000 (UTC) (envelope-from yanegomi@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 0617B8FC0A; Sat, 26 Nov 2011 15:18:43 +0000 (UTC) Received: by ggnk5 with SMTP id k5so5948364ggn.13 for ; Sat, 26 Nov 2011 07:18:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=yA8gU2v9uB4/d+JzMdynrreh56TJCmCVd/Taj6m1698=; b=QzWjaJvZZGvBnpf8XQY8M+RTZDkT+3b+gR5NGSAHkByhb65Gn3dWTGNC4S01sDrdNl s8fedV4Cbt3zGQWXkXKU9RHsBs8DYMUIoFEv1MSfwLCWtKS5v1hMiVynH/Zm/ejN+ZkS Tg0TNYsvzsbngo0P7XWGdH3MRR4IJcKCZEDHY= MIME-Version: 1.0 Received: by 10.182.172.41 with SMTP id az9mr11165607obc.42.1322320723228; Sat, 26 Nov 2011 07:18:43 -0800 (PST) Received: by 10.182.62.227 with HTTP; Sat, 26 Nov 2011 07:18:43 -0800 (PST) In-Reply-To: <201111251929.pAPJTLaX056532@svn.freebsd.org> References: <201111251929.pAPJTLaX056532@svn.freebsd.org> Date: Sat, 26 Nov 2011 07:18:43 -0800 Message-ID: From: Garrett Cooper To: Marius Strobl 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: r227982 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4 sys/conf sys/dev/amd sys/modules sys/modules/amd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 15:18:44 -0000 On Fri, Nov 25, 2011 at 11:29 AM, Marius Strobl wrote: > Author: marius > Date: Fri Nov 25 19:29:21 2011 > New Revision: 227982 > URL: http://svn.freebsd.org/changeset/base/227982 > > Log: > =A0Deorbit the broken amd(4) (see PR 124667), which was superseded by esp= (4) > =A0as of r227006. This commit broke tinderbox on i386/PAE and MIPS/OCTEON1. The following change should unbreak things if the driver compiles properly: Thanks, -Garrett $ svn diff `ls sys/*/conf/* | grep -v BAYONETTA` Index: sys/i386/conf/PAE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/i386/conf/PAE (revision 227998) +++ sys/i386/conf/PAE (working copy) @@ -24,7 +24,6 @@ # than 4 gigabytes of memory. nodevice ahb -nodevice amd nodevice sym nodevice trm Index: sys/mips/conf/OCTEON1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/mips/conf/OCTEON1 (revision 227998) +++ sys/mips/conf/OCTEON1 (working copy) @@ -114,7 +114,7 @@ device ahd # AHA39320/29320 and onboard AIC79xx device= s options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device amd # AMD 53C974 (Tekram DC-390(T)) +device esp # AMD Am53C974 (Tekram DC-390(T)) device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 15:57: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 36D85106564A; Sat, 26 Nov 2011 15:57:10 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CAA88FC0A; Sat, 26 Nov 2011 15:57:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQFv9Br097895; Sat, 26 Nov 2011 15:57:09 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQFv9s1097893; Sat, 26 Nov 2011 15:57:09 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111261557.pAQFv9s1097893@svn.freebsd.org> From: David Chisnall Date: Sat, 26 Nov 2011 15:57: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: r227999 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 15:57:10 -0000 Author: theraven Date: Sat Nov 26 15:57:09 2011 New Revision: 227999 URL: http://svn.freebsd.org/changeset/base/227999 Log: Return not-implemented from pthread_once and pthread_key_create, rather than silently failing and returning success. Without this, code calls pthread_once(), receives a return value of success, and thinks that the passed function has been called. Approved by: dim (mentor) Modified: head/lib/libc/gen/_pthread_stubs.c Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Sat Nov 26 14:26:37 2011 (r227998) +++ head/lib/libc/gen/_pthread_stubs.c Sat Nov 26 15:57:09 2011 (r227999) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" @@ -53,6 +54,7 @@ static int stub_main(void); static void *stub_null(void); static struct pthread *stub_self(void); static int stub_zero(void); +static int stub_fail(void); static int stub_true(void); static void stub_exit(void); @@ -93,7 +95,7 @@ pthread_func_entry_t __thr_jtable[PJT_MA {PJT_DUAL_ENTRY(stub_exit)}, /* PJT_EXIT */ {PJT_DUAL_ENTRY(stub_null)}, /* PJT_GETSPECIFIC */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_JOIN */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KEY_CREATE */ + {PJT_DUAL_ENTRY(stub_fail)}, /* PJT_KEY_CREATE */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KEY_DELETE */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_KILL */ {PJT_DUAL_ENTRY(stub_main)}, /* PJT_MAIN_NP */ @@ -105,7 +107,7 @@ pthread_func_entry_t __thr_jtable[PJT_MA {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_LOCK */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_TRYLOCK */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_UNLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ONCE */ + {PJT_DUAL_ENTRY(stub_fail)}, /* PJT_ONCE */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_DESTROY */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_INIT */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_RDLOCK */ @@ -293,6 +295,12 @@ stub_self(void) } static int +stub_fail(void) +{ + return ENOSYS; +} + +static int stub_main(void) { return (-1); From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 16:38: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 AC85C1065672; Sat, 26 Nov 2011 16:38:16 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0128FC0C; Sat, 26 Nov 2011 16:38:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQGcG08000276; Sat, 26 Nov 2011 16:38:16 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQGcGmK000274; Sat, 26 Nov 2011 16:38:16 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201111261638.pAQGcGmK000274@svn.freebsd.org> From: Warren Block Date: Sat, 26 Nov 2011 16:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228000 - stable/8/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, 26 Nov 2011 16:38:16 -0000 Author: wblock (doc committer) Date: Sat Nov 26 16:38:16 2011 New Revision: 228000 URL: http://svn.freebsd.org/changeset/base/228000 Log: MFC r225861: Fix a confusing sentence. Other wording tweaks. Approved by: gjb (mentor) Modified: stable/8/etc/devd.conf Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/devd.conf ============================================================================== --- stable/8/etc/devd.conf Sat Nov 26 15:57:09 2011 (r227999) +++ stable/8/etc/devd.conf Sat Nov 26 16:38:16 2011 (r228000) @@ -8,10 +8,10 @@ # NB: device-name is shorthand for 'match device-name' options { - # Each directory directive adds a directory the list of directories - # that we scan for files. Files are read-in in the order that they - # are returned from readdir(3). The rule-sets are combined to - # create a DFA that's used to match events to actions. + # Each "directory" directive adds a directory to the list of + # directories that we scan for files. Files are loaded in the order + # that they are returned from readdir(3). The rule-sets are combined + # to create a DFA that's used to match events to actions. directory "/etc/devd"; directory "/usr/local/etc/devd"; pid-file "/var/run/devd.pid"; @@ -32,8 +32,8 @@ options { # script is called pccard_ether. # # NB: DETACH events are ignored; the kernel should handle all cleanup -# (routes, arp cache) if you need to do something beware of races -# against immediate create of a device w/ the same name; e.g. +# (routes, arp cache). Beware of races against immediate create +# of a device with the same name; e.g. # ifconfig bridge0 destroy; ifconfig bridge0 create # notify 0 { @@ -43,7 +43,7 @@ notify 0 { }; # -# Try to start dhclient on Ethernet like interfaces when the link comes +# Try to start dhclient on Ethernet-like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually # run it. No link down rule exists because dhclient automatically exits # when the link goes down. @@ -87,7 +87,7 @@ detach 100 { device-name "ed50"; }; -# When a USB Bluetooth dongle appears activate it +# When a USB Bluetooth dongle appears, activate it attach 100 { device-name "ubt[0-9]+"; action "/etc/rc.d/bluetooth quietstart $device-name"; @@ -125,7 +125,7 @@ detach 100 { }; # Firmware download into the ActiveWire board. After the firmware download is -# done the device detaches and reappears as something new and shiny +# done, the device detaches and reappears as something new and shiny # automatically. attach 100 { match "vendor" "0x0854"; @@ -265,12 +265,11 @@ notify 10 { /* EXAMPLES TO END OF FILE -# The following might be an example of something that a vendor might -# install if you were to add their device. This might reside in -# /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical -# example, a pccard ethernet-like device. Students of history may -# know other devices by this name, and will get the in-jokes in this -# entry. +# An example of something that a vendor might install if you were to +# add their device. This might reside in /usr/local/etc/devd/deqna.conf. +# A deqna is, in this hypothetical example, a pccard ethernet-like device. +# Students of history may know other devices by this name, and will get +# the in-jokes in this entry. nomatch 10 { match "bus" "pccard[0-9]+"; match "manufacturer" "0x1234"; @@ -288,7 +287,7 @@ detach 10 { # Examples of notify hooks. A notify is a generic way for a kernel # subsystem to send event notification to userland. -# + # Here are some examples of ACPI notify handlers. ACPI subsystems that # generate notifies include the AC adapter, power/sleep buttons, # control method batteries, lid switch, and thermal zones. From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 16:38: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 9BAE9106566B; Sat, 26 Nov 2011 16:38:49 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 815328FC21; Sat, 26 Nov 2011 16:38:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQGcnXe000329; Sat, 26 Nov 2011 16:38:49 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQGcn3p000327; Sat, 26 Nov 2011 16:38:49 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201111261638.pAQGcn3p000327@svn.freebsd.org> From: Warren Block Date: Sat, 26 Nov 2011 16:38:49 +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: r228001 - 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: Sat, 26 Nov 2011 16:38:49 -0000 Author: wblock (doc committer) Date: Sat Nov 26 16:38:49 2011 New Revision: 228001 URL: http://svn.freebsd.org/changeset/base/228001 Log: MFC r225861: Fix a confusing sentence. Other wording tweaks. Approved by: gjb (mentor) Modified: stable/7/etc/devd.conf Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/devd.conf ============================================================================== --- stable/7/etc/devd.conf Sat Nov 26 16:38:16 2011 (r228000) +++ stable/7/etc/devd.conf Sat Nov 26 16:38:49 2011 (r228001) @@ -8,10 +8,10 @@ # NB: device-name is shorthand for 'match device-name' options { - # Each directory directive adds a directory the list of directories - # that we scan for files. Files are read-in in the order that they - # are returned from readdir(3). The rule-sets are combined to - # create a DFA that's used to match events to actions. + # Each "directory" directive adds a directory to the list of + # directories that we scan for files. Files are loaded in the order + # that they are returned from readdir(3). The rule-sets are combined + # to create a DFA that's used to match events to actions. directory "/etc/devd"; directory "/usr/local/etc/devd"; pid-file "/var/run/devd.pid"; @@ -44,7 +44,7 @@ notify 0 { }; # -# Try to start dhclient on Ethernet like interfaces when the link comes +# Try to start dhclient on Ethernet-like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually # run it. No link down rule exists because dhclient automatically exits # when the link goes down. @@ -88,7 +88,7 @@ detach 100 { device-name "ed50"; }; -# When a USB Bluetooth dongle appears activate it +# When a USB Bluetooth dongle appears, activate it attach 100 { device-name "ubt[0-9]+"; action "/etc/rc.d/bluetooth quietstart $device-name"; @@ -116,7 +116,7 @@ attach 100 { }; # Firmware download into the ActiveWire board. After the firmware download is -# done the device detaches and reappears as something new and shiny +# done, the device detaches and reappears as something new and shiny # automatically. attach 100 { match "vendor" "0x0854"; @@ -276,12 +276,11 @@ notify 0 { /* EXAMPLES TO END OF FILE -# The following might be an example of something that a vendor might -# install if you were to add their device. This might reside in -# /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical -# example, a pccard ethernet-like device. Students of history may -# know other devices by this name, and will get the in-jokes in this -# entry. +# An example of something that a vendor might install if you were to +# add their device. This might reside in /usr/local/etc/devd/deqna.conf. +# A deqna is, in this hypothetical example, a pccard ethernet-like device. +# Students of history may know other devices by this name, and will get +# the in-jokes in this entry. nomatch 10 { match "bus" "pccard[0-9]+"; match "manufacturer" "0x1234"; @@ -299,7 +298,7 @@ detach 10 { # Examples of notify hooks. A notify is a generic way for a kernel # subsystem to send event notification to userland. -# + # Here are some examples of ACPI notify handlers. ACPI subsystems that # generate notifies include the AC adapter, power/sleep buttons, # control method batteries, lid switch, and thermal zones. From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 16:43: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 D15D7106564A; Sat, 26 Nov 2011 16:43:08 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 711B18FC08; Sat, 26 Nov 2011 16:43:07 +0000 (UTC) Received: by eaai12 with SMTP id i12so1945044eaa.13 for ; Sat, 26 Nov 2011 08:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=RzVnOY46P+RXIzuSi5GjrAqvQUPzrxfpkec+XDjv6H4=; b=jj0TrUZzb7qs0HxSdoZrVU8qCjKAL5MNzxf3ga/hFIBiC4xEltPQT9RuVsCYJTcPn8 V3qFsUDowqK/UqS7mLHsIBVanbwayj6v4Uj51G0aSZq9nNtrnzF1RIlwfmMxXHI2xuEv V1V7V1kyTWcOZX3zH69NuPdz4EkAGnMWsMBF0= Received: by 10.213.21.2 with SMTP id h2mr230339ebb.81.1322325786352; Sat, 26 Nov 2011 08:43:06 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id e6sm2640256fah.0.2011.11.26.08.43.03 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Nov 2011 08:43:04 -0800 (PST) From: Mikolaj Golub To: mdf@FreeBSD.org References: <201111230734.pAN7YA78032998@svn.freebsd.org> <86ipmaq9i4.fsf@in138.ua3> X-Comment-To: Mikolaj Golub Sender: Mikolaj Golub Date: Sat, 26 Nov 2011 18:43:01 +0200 In-Reply-To: <86ipmaq9i4.fsf@in138.ua3> (Mikolaj Golub's message of "Thu, 24 Nov 2011 09:12:35 +0200") Message-ID: <86vcq6n8bu.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@freebsd.org, Robert Watson , svn-src-all@freebsd.org, src-committers@freebsd.org, Kostik Belousov Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 16:43:09 -0000 --=-=-= Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit On Thu, 24 Nov 2011 09:12:35 +0200 Mikolaj Golub wrote: MG> On Wed, 23 Nov 2011 11:10:47 -0800 mdf@FreeBSD.org wrote: >>> š š š š š š š š š š š šprintf(" AT_IGNORE=0x%lu", >>> - š š š š š š š š š š š š š (unsigned long)aux->a_un.a_val); >>> + š š š š š š š š š š š š š (unsigned long)auxv[i].a_un.a_val); m>> I didn't see this before, but this gives very misleading output. The m>> 0x prefix implies the output will be hex, but it's printed as decimal, m>> here and below. MG> Oh. Thanks! Will fix. m>> I don't know if there's a style preference for 0x%lx versus %#lx, m>> though, or a preference for a different type for the print (uintmax_t, m>> for example). There is probably a preference for using u_long rather m>> than unsigned long, since it's shorter. MG> It looks like both 0x%lx and %#lx are widely spread in our source, I like %#lx MG> a little more. It looks for me that (u_long) will be ok for now, so the chage MG> for the printf above would be: MG> printf(" AT_IGNORE=%#lx", (u_long)auxv[i].a_un.a_val); MG> Anyway, printing all values in the same format was considered by me as a MG> temporary solution. I am going to have format depending on a_type, so e.g. MG> AT_PAGESZ will be 4096, not 0x1000. MG> Also, now they are printed as one string for a process: MG> PID COMM AUXV MG> 2520 firefox-bin AT_PHDR=0x400040 AT_PHENT=0x38 AT_PHNUM=0x7 AT_PAGESZ=0x1000 ... MG> I am considering changing this too, to something like below: MG> PID COMM AUXV VALUE MG> 2520 firefox-bin AT_PHDR 0x400040 MG> 2520 firefox-bin AT_PHENT 56 MG> 2520 firefox-bin AT_PHNUM 7 MG> ... I am going to commit this patch if nobody has any other suggestions. The typical output: in138:~% procstat -x 2008 PID COMM AUXV VALUE 2008 nginx AT_PHDR 0x400040 2008 nginx AT_PHENT 56 2008 nginx AT_PHNUM 8 2008 nginx AT_PAGESZ 4096 2008 nginx AT_FLAGS 0 2008 nginx AT_ENTRY 0x40de00 2008 nginx AT_BASE 0x800689000 2008 nginx AT_EXECPATH 0x7fffffffefca 2008 nginx AT_OSRELDATE 1000001 2008 nginx AT_CANARY 0x7fffffffef8a 2008 nginx AT_CANARYLEN 64 2008 nginx AT_NCPUS 2 2008 nginx AT_PAGESIZES 0x7fffffffef72 2008 nginx AT_PAGESIZESLEN 24 2008 nginx AT_STACKPROT VM_PROT_ALL -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=procstat_auxv.c.patch Index: usr.bin/procstat/procstat_auxv.c =================================================================== --- usr.bin/procstat/procstat_auxv.c (revision 227989) +++ usr.bin/procstat/procstat_auxv.c (working copy) @@ -27,9 +27,12 @@ */ #include +#include #include #include +#include + #include #include #include @@ -38,12 +41,79 @@ #include #include -#include - #include "procstat.h" static Elf_Auxinfo auxv[256]; +static char prefix[256]; +#define PRINT(name, spec, val) \ + printf("%s %-16s " #spec "\n", prefix, #name, (val)) +#define PRINT_UNKNOWN(type, val) \ + printf("%s %16ld %#lx\n", prefix, (long)type, (u_long)(val)) + +static const char* +stack_protection(u_long protection) +{ + size_t size; + int n; + char *p; + const char *delimiter; + static char buf[256]; + + buf[0] = '\0'; + + if (protection == VM_PROT_NONE) { + snprintf(buf, sizeof(buf), "%s", "VM_PROT_NONE"); + } else if (protection == VM_PROT_ALL) { + snprintf(buf, sizeof(buf), "%s", "VM_PROT_ALL"); + } else if (protection == VM_PROT_RW) { + snprintf(buf, sizeof(buf), "%s", "VM_PROT_RW"); + } else { + size = sizeof(buf); + p = buf; + delimiter = ""; + + if (size > 0 && (protection & VM_PROT_READ) != 0) { + n = snprintf(p, size, "%s%s", delimiter, + "VM_PROT_READ"); + protection &= ~VM_PROT_READ; + delimiter = " | "; + p += n; + size -= n; + } + if (size > 0 && (protection & VM_PROT_WRITE) != 0) { + n = snprintf(p, size, "%s%s", delimiter, + "VM_PROT_WRITE"); + protection &= ~VM_PROT_WRITE; + delimiter = " | "; + p += n; + size -= n; + } + if (size > 0 && (protection & VM_PROT_EXECUTE) != 0) { + n = snprintf(p, size, "%s%s", delimiter, + "VM_PROT_EXECUTE"); + protection &= ~VM_PROT_EXECUTE; + delimiter = " | "; + p += n; + size -= n; + } + if (size > 0 && (protection & VM_PROT_COPY) != 0) { + n = snprintf(p, size, "%s%s", delimiter, + "VM_PROT_COPY"); + protection &= ~VM_PROT_COPY; + delimiter = " | "; + p += n; + size -= n; + } + if (size > 0 && protection != VM_PROT_NONE) { + n = snprintf(p, size, "%s%#lx", delimiter, + protection); + } + } + + return buf; +} + void procstat_auxv(struct kinfo_proc *kipp) { @@ -51,7 +121,7 @@ size_t len, i; if (!hflag) - printf("%5s %-16s %-53s\n", "PID", "COMM", "AUXV"); + printf("%5s %-16s %-16s %-16s\n", "PID", "COMM", "AUXV", "VALUE"); name[0] = CTL_KERN; name[1] = KERN_PROC; @@ -63,124 +133,99 @@ warn("sysctl: kern.proc.auxv: %d: %d", kipp->ki_pid, errno); return; } - if (error < 0) + if (error < 0 || len == 0) return; - printf("%5d ", kipp->ki_pid); - printf("%-16s", kipp->ki_comm); if (len == 0) { printf(" -\n"); return; } + snprintf(prefix, sizeof(prefix), "%5d %-16s", kipp->ki_pid, + kipp->ki_comm); for (i = 0; i < len; i++) { switch(auxv[i].a_type) { case AT_NULL: - printf(" (%zu)\n", i + 1); return; case AT_IGNORE: - printf(" AT_IGNORE=0x%lu", - (unsigned long)auxv[i].a_un.a_val); break; case AT_EXECFD: - printf(" AT_EXECFD=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_EXECFD, %ld, auxv[i].a_un.a_val); break; case AT_PHDR: - printf(" AT_PHDR=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_PHDR, %p, auxv[i].a_un.a_ptr); break; case AT_PHENT: - printf(" AT_PHENT=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_PHENT, %ld, auxv[i].a_un.a_val); break; case AT_PHNUM: - printf(" AT_PHNUM=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_PHNUM, %ld, auxv[i].a_un.a_val); break; case AT_PAGESZ: - printf(" AT_PAGESZ=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_PAGESZ, %ld, auxv[i].a_un.a_val); break; case AT_BASE: - printf(" AT_BASE=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_BASE, %p, auxv[i].a_un.a_ptr); break; case AT_FLAGS: - printf(" AT_FLAGS=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_FLAGS, %#lx, (u_long)auxv[i].a_un.a_val); break; case AT_ENTRY: - printf(" AT_ENTRY=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_ENTRY, %p, auxv[i].a_un.a_ptr); break; #ifdef AT_NOTELF case AT_NOTELF: - printf(" AT_NOTELF=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_NOTELF, %ld, auxv[i].a_un.a_val); break; #endif #ifdef AT_UID case AT_UID: - printf(" AT_UID=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_UID, %ld, auxv[i].a_un.a_val); break; #endif #ifdef AT_EUID case AT_EUID: - printf(" AT_EUID=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_EUID, %ld, auxv[i].a_un.a_val); break; #endif #ifdef AT_GID case AT_GID: - printf(" AT_GID=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_GID, %ld, auxv[i].a_un.a_val); break; #endif #ifdef AT_EGID case AT_EGID: - printf(" AT_EGID=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_EGID, %ld, auxv[i].a_un.a_val); break; #endif case AT_EXECPATH: - printf(" AT_EXECPATH=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_EXECPATH, %p, auxv[i].a_un.a_ptr); break; case AT_CANARY: - printf(" AT_CANARY=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_CANARY, %p, auxv[i].a_un.a_ptr); break; case AT_CANARYLEN: - printf(" AT_CANARYLEN=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_CANARYLEN, %ld, auxv[i].a_un.a_val); break; case AT_OSRELDATE: - printf(" AT_OSRELDATE=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_OSRELDATE, %ld, auxv[i].a_un.a_val); break; case AT_NCPUS: - printf(" AT_NCPUS=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_NCPUS, %ld, auxv[i].a_un.a_val); break; case AT_PAGESIZES: - printf(" AT_PAGESIZES=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_PAGESIZES, %p, auxv[i].a_un.a_ptr); break; case AT_PAGESIZESLEN: - printf(" AT_PAGESIZESLEN=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_PAGESIZESLEN, %ld, auxv[i].a_un.a_val); break; case AT_STACKPROT: - printf(" AT_STACKPROT=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_STACKPROT, %s, + stack_protection(auxv[i].a_un.a_val)); break; case AT_COUNT: - printf(" AT_COUNT=0x%lu", - (unsigned long)auxv[i].a_un.a_val); + PRINT(AT_COUNT, %ld, auxv[i].a_un.a_val); break; default: - printf(" %ld=0x%lu", (long)auxv[i].a_type, - (unsigned long)auxv[i].a_un.a_val); + PRINT_UNKNOWN(auxv[i].a_type, auxv[i].a_un.a_val); break; } } --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 16:49: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 43FF9106566C; Sat, 26 Nov 2011 16:49:26 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2168FC0A; Sat, 26 Nov 2011 16:49:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQGnPNR000680; Sat, 26 Nov 2011 16:49:25 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQGnPK9000678; Sat, 26 Nov 2011 16:49:25 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111261649.pAQGnPK9000678@svn.freebsd.org> From: David Chisnall Date: Sat, 26 Nov 2011 16:49: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: r228002 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 16:49:26 -0000 Author: theraven Date: Sat Nov 26 16:49:25 2011 New Revision: 228002 URL: http://svn.freebsd.org/changeset/base/228002 Log: style(9) fix. Approved by: dim (mentor) Modified: head/lib/libc/gen/_pthread_stubs.c Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Sat Nov 26 16:38:49 2011 (r228001) +++ head/lib/libc/gen/_pthread_stubs.c Sat Nov 26 16:49:25 2011 (r228002) @@ -297,7 +297,7 @@ stub_self(void) static int stub_fail(void) { - return ENOSYS; + return (ENOSYS); } static int From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 17:48: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 A3814106566C; Sat, 26 Nov 2011 17:48:14 +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 685B08FC0A; Sat, 26 Nov 2011 17:48:13 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAQHm9bN047440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 Nov 2011 19:48:09 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAQHm95Y061450; Sat, 26 Nov 2011 19:48:09 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAQHm99M061449; Sat, 26 Nov 2011 19:48:09 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Nov 2011 19:48:09 +0200 From: Kostik Belousov To: Mikolaj Golub Message-ID: <20111126174808.GK50300@deviant.kiev.zoral.com.ua> References: <201111230734.pAN7YA78032998@svn.freebsd.org> <86ipmaq9i4.fsf@in138.ua3> <86vcq6n8bu.fsf@kopusha.home.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xrgBBsHnjfjm6j0J" Content-Disposition: inline In-Reply-To: <86vcq6n8bu.fsf@kopusha.home.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 17:48:14 -0000 --xrgBBsHnjfjm6j0J Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 26, 2011 at 06:43:01PM +0200, Mikolaj Golub wrote: >=20 > On Thu, 24 Nov 2011 09:12:35 +0200 Mikolaj Golub wrote: >=20 > MG> On Wed, 23 Nov 2011 11:10:47 -0800 mdf@FreeBSD.org wrote: >=20 > >>> =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Aprintf(" AT_IGNORE=3D= 0x%lu", > >>> - =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A (unsigned long= )aux->a_un.a_val); > >>> + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A (unsigned long= )auxv[i].a_un.a_val); >=20 > m>> I didn't see this before, but this gives very misleading output. The > m>> 0x prefix implies the output will be hex, but it's printed as decima= l, > m>> here and below. >=20 > MG> Oh. Thanks! Will fix. >=20 > m>> I don't know if there's a style preference for 0x%lx versus %#lx, > m>> though, or a preference for a different type for the print (uintmax_= t, > m>> for example). There is probably a preference for using u_long rather > m>> than unsigned long, since it's shorter. >=20 > MG> It looks like both 0x%lx and %#lx are widely spread in our source, I= like %#lx > MG> a little more. It looks for me that (u_long) will be ok for now, so = the chage > MG> for the printf above would be: >=20 > MG> printf(" AT_IGNORE=3D%#lx", (u_long)auxv[i].a_un.a_val); >=20 > MG> Anyway, printing all values in the same format was considered by me = as a > MG> temporary solution. I am going to have format depending on a_type, s= o e.g. > MG> AT_PAGESZ will be 4096, not 0x1000. >=20 > MG> Also, now they are printed as one string for a process: >=20 > MG> PID COMM AUXV > MG> 2520 firefox-bin AT_PHDR=3D0x400040 AT_PHENT=3D0x38 AT_PHNUM= =3D0x7 AT_PAGESZ=3D0x1000 ... >=20 > MG> I am considering changing this too, to something like below: >=20 > MG> PID COMM AUXV VALUE > MG> 2520 firefox-bin AT_PHDR 0x400040 > MG> 2520 firefox-bin AT_PHENT 56 > MG> 2520 firefox-bin AT_PHNUM 7 > MG> ... >=20 > I am going to commit this patch if nobody has any other suggestions. >=20 > The typical output: >=20 > in138:~% procstat -x 2008 > PID COMM AUXV VALUE =20 > 2008 nginx AT_PHDR 0x400040 > 2008 nginx AT_PHENT 56 > 2008 nginx AT_PHNUM 8 > 2008 nginx AT_PAGESZ 4096 > 2008 nginx AT_FLAGS 0 > 2008 nginx AT_ENTRY 0x40de00 > 2008 nginx AT_BASE 0x800689000 > 2008 nginx AT_EXECPATH 0x7fffffffefca > 2008 nginx AT_OSRELDATE 1000001 > 2008 nginx AT_CANARY 0x7fffffffef8a > 2008 nginx AT_CANARYLEN 64 > 2008 nginx AT_NCPUS 2 > 2008 nginx AT_PAGESIZES 0x7fffffffef72 > 2008 nginx AT_PAGESIZESLEN 24 > 2008 nginx AT_STACKPROT VM_PROT_ALL I like this output much better. The only thing I am unsure of is the pretty-printing of AT_STACKPROT. Might be, change it to EXECUTABLE/NONEXECUTABLE printout. --xrgBBsHnjfjm6j0J Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7RJlgACgkQC3+MBN1Mb4jG9gCfRyJ3b8bqX3aCVCkv+tFJ9d4z L1IAnjxRsxeFT8FwxSJjGcBBT/s6e7kK =aB77 -----END PGP SIGNATURE----- --xrgBBsHnjfjm6j0J-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 18: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 C87F71065675; Sat, 26 Nov 2011 18:02: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 B7FB88FC14; Sat, 26 Nov 2011 18:02:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQI2dXd002898; Sat, 26 Nov 2011 18:02:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQI2dWB002895; Sat, 26 Nov 2011 18:02:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111261802.pAQI2dWB002895@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 Nov 2011 18: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: r228003 - in head/sys: conf i386/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, 26 Nov 2011 18:02:39 -0000 Author: marius Date: Sat Nov 26 18:02:39 2011 New Revision: 228003 URL: http://svn.freebsd.org/changeset/base/228003 Log: Remove some more occurrences of amd(4) missed in r227982. Modified: head/sys/conf/NOTES head/sys/i386/conf/PAE Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Nov 26 16:49:25 2011 (r228002) +++ head/sys/conf/NOTES Sat Nov 26 18:02:39 2011 (r228003) @@ -1510,7 +1510,6 @@ hint.aic.0.at="isa" device ahb device ahc device ahd -device amd device esp device iscsi_initiator device isp Modified: head/sys/i386/conf/PAE ============================================================================== --- head/sys/i386/conf/PAE Sat Nov 26 16:49:25 2011 (r228002) +++ head/sys/i386/conf/PAE Sat Nov 26 18:02:39 2011 (r228003) @@ -24,7 +24,6 @@ device ispfw # than 4 gigabytes of memory. nodevice ahb -nodevice amd nodevice sym nodevice trm From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 18:13: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 B5250106564A; Sat, 26 Nov 2011 18:13:18 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8D0F88FC0A; Sat, 26 Nov 2011 18:13:18 +0000 (UTC) Received: from [192.168.2.115] (host86-148-124-36.range86-148.btcentralplus.com [86.148.124.36]) by cyrus.watson.org (Postfix) with ESMTPSA id 1CC7846B2A; Sat, 26 Nov 2011 13:13:16 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20111126174808.GK50300@deviant.kiev.zoral.com.ua> Date: Sat, 26 Nov 2011 18:13:14 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201111230734.pAN7YA78032998@svn.freebsd.org> <86ipmaq9i4.fsf@in138.ua3> <86vcq6n8bu.fsf@kopusha.home.net> <20111126174808.GK50300@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Mailer: Apple Mail (2.1084) Cc: Mikolaj Golub , mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 18:13:18 -0000 On 26 Nov 2011, at 17:48, Kostik Belousov wrote: >> in138:~% procstat -x 2008 >> PID COMM AUXV VALUE =20 >> 2008 nginx AT_PHDR 0x400040 >> 2008 nginx AT_PHENT 56 >> 2008 nginx AT_PHNUM 8 >> 2008 nginx AT_PAGESZ 4096 >> 2008 nginx AT_FLAGS 0 >> 2008 nginx AT_ENTRY 0x40de00 >> 2008 nginx AT_BASE 0x800689000 >> 2008 nginx AT_EXECPATH 0x7fffffffefca >> 2008 nginx AT_OSRELDATE 1000001 >> 2008 nginx AT_CANARY 0x7fffffffef8a >> 2008 nginx AT_CANARYLEN 64 >> 2008 nginx AT_NCPUS 2 >> 2008 nginx AT_PAGESIZES 0x7fffffffef72 >> 2008 nginx AT_PAGESIZESLEN 24 >> 2008 nginx AT_STACKPROT VM_PROT_ALL > I like this output much better. The only thing I am unsure of is > the pretty-printing of AT_STACKPROT. Might be, change it to > EXECUTABLE/NONEXECUTABLE printout. On a related note, I wouldn't mind if we stripped AT_ and lower-cased = the rest of the field name to make it slightly easier on the eyes. :-) Robert= From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 18:16: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 7F4F81065670; Sat, 26 Nov 2011 18:16:15 +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 61C458FC0A; Sat, 26 Nov 2011 18:16:14 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAQIG79d052351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 Nov 2011 20:16:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAQIG7Yg061611; Sat, 26 Nov 2011 20:16:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAQIG7lZ061610; Sat, 26 Nov 2011 20:16:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Nov 2011 20:16:07 +0200 From: Kostik Belousov To: "Robert N. M. Watson" Message-ID: <20111126181607.GM50300@deviant.kiev.zoral.com.ua> References: <201111230734.pAN7YA78032998@svn.freebsd.org> <86ipmaq9i4.fsf@in138.ua3> <86vcq6n8bu.fsf@kopusha.home.net> <20111126174808.GK50300@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nIY7OjPOPjQB6SQv" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Mikolaj Golub , mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 18:16:15 -0000 --nIY7OjPOPjQB6SQv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 26, 2011 at 06:13:14PM +0000, Robert N. M. Watson wrote: >=20 > On 26 Nov 2011, at 17:48, Kostik Belousov wrote: >=20 > >> in138:~% procstat -x 2008 > >> PID COMM AUXV VALUE =20 > >> 2008 nginx AT_PHDR 0x400040 > >> 2008 nginx AT_PHENT 56 > >> 2008 nginx AT_PHNUM 8 > >> 2008 nginx AT_PAGESZ 4096 > >> 2008 nginx AT_FLAGS 0 > >> 2008 nginx AT_ENTRY 0x40de00 > >> 2008 nginx AT_BASE 0x800689000 > >> 2008 nginx AT_EXECPATH 0x7fffffffefca > >> 2008 nginx AT_OSRELDATE 1000001 > >> 2008 nginx AT_CANARY 0x7fffffffef8a > >> 2008 nginx AT_CANARYLEN 64 > >> 2008 nginx AT_NCPUS 2 > >> 2008 nginx AT_PAGESIZES 0x7fffffffef72 > >> 2008 nginx AT_PAGESIZESLEN 24 > >> 2008 nginx AT_STACKPROT VM_PROT_ALL > > I like this output much better. The only thing I am unsure of is > > the pretty-printing of AT_STACKPROT. Might be, change it to > > EXECUTABLE/NONEXECUTABLE printout. >=20 > On a related note, I wouldn't mind if we stripped AT_ and lower-cased the= rest of the field name to make it slightly easier on the eyes. :-) It would then need some explanation what the names mean. For my, AT_SOMETHING has a unique meaning, while something does not. --nIY7OjPOPjQB6SQv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7RLOYACgkQC3+MBN1Mb4iqYgCg6CPp4RBPsGLnxWYX7RII1kfX qcwAoI8MZZQ22eGyqxDHgf5uTcYtvR9z =NTVE -----END PGP SIGNATURE----- --nIY7OjPOPjQB6SQv-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 18:46: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 32CCA106564A; Sat, 26 Nov 2011 18:46:34 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20F5C8FC0A; Sat, 26 Nov 2011 18:46:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQIkY4R004289; Sat, 26 Nov 2011 18:46:34 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQIkXZk004285; Sat, 26 Nov 2011 18:46:33 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111261846.pAQIkXZk004285@svn.freebsd.org> From: David Chisnall Date: Sat, 26 Nov 2011 18:46: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: r228004 - in head: contrib/libcxxrt lib/libcxxrt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 18:46:34 -0000 Author: theraven Date: Sat Nov 26 18:46:33 2011 New Revision: 228004 URL: http://svn.freebsd.org/changeset/base/228004 Log: Update libcxxrt to remove the pthread dependency. Also add the license from upstream to contrib. Approved by: dim (mentor) Added: head/contrib/libcxxrt/LICENSE - copied unchanged from r227996, vendor/libcxxrt/dist/LICENSE Modified: head/contrib/libcxxrt/exception.cc head/contrib/libcxxrt/memory.cc head/lib/libcxxrt/Makefile Directory Properties: head/contrib/libcxxrt/ (props changed) Copied: head/contrib/libcxxrt/LICENSE (from r227996, vendor/libcxxrt/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libcxxrt/LICENSE Sat Nov 26 18:46:33 2011 (r228004, copy of r227996, vendor/libcxxrt/dist/LICENSE) @@ -0,0 +1,14 @@ +The BSD License + +Copyright 2010-2011 PathScale, 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. + +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of PathScale, Inc. Modified: head/contrib/libcxxrt/exception.cc ============================================================================== --- head/contrib/libcxxrt/exception.cc Sat Nov 26 18:02:39 2011 (r228003) +++ head/contrib/libcxxrt/exception.cc Sat Nov 26 18:46:33 2011 (r228004) @@ -8,6 +8,17 @@ #include "dwarf_eh.h" #include "cxxabi.h" +#pragma weak pthread_key_create +#pragma weak pthread_setspecific +#pragma weak pthread_getspecific +#pragma weak pthread_once +#pragma weak pthread_once +#pragma weak pthread_cond_signal +#pragma weak pthread_cond_wait +#pragma weak pthread_mutex_lock +#pragma weak pthread_mutex_unlock + + using namespace ABI_NAMESPACE; /** @@ -289,11 +300,31 @@ static void thread_cleanup(void* thread_ static pthread_once_t once_control = PTHREAD_ONCE_INIT; /** + * We may not be linked against a full pthread implementation. If we're not, + * then we need to fake the thread-local storage by storing 'thread-local' + * things in a global. + */ +static bool fakeTLS; +/** + * Thread-local storage for a single-threaded program. + */ +static __cxa_thread_info singleThreadInfo; +/** * Initialise eh_key. */ static void init_key(void) { + if ((0 == pthread_key_create) || + (0 == pthread_setspecific) || + (0 == pthread_getspecific)) + { + fakeTLS = true; + return; + } pthread_key_create(&eh_key, thread_cleanup); + pthread_setspecific(eh_key, (void*)0x42); + fakeTLS = (pthread_getspecific(eh_key) != (void*)0x42); + pthread_setspecific(eh_key, 0); } /** @@ -301,7 +332,11 @@ static void init_key(void) */ static __cxa_thread_info *thread_info() { - pthread_once(&once_control, init_key); + if ((0 == pthread_once) || pthread_once(&once_control, init_key)) + { + fakeTLS = true; + } + if (fakeTLS) { return &singleThreadInfo; } __cxa_thread_info *info = (__cxa_thread_info*)pthread_getspecific(eh_key); if (0 == info) { @@ -316,6 +351,7 @@ static __cxa_thread_info *thread_info() */ static __cxa_thread_info *thread_info_fast() { + if (fakeTLS) { return &singleThreadInfo; } return (__cxa_thread_info*)pthread_getspecific(eh_key); } /** @@ -367,7 +403,10 @@ static char *emergency_malloc(size_t siz // Only 4 emergency buffers allowed per thread! if (info->emergencyBuffersHeld > 3) { return 0; } - pthread_mutex_lock(&emergency_malloc_lock); + if (pthread_mutex_lock) + { + pthread_mutex_lock(&emergency_malloc_lock); + } int buffer = -1; while (buffer < 0) { @@ -378,7 +417,10 @@ static char *emergency_malloc(size_t siz void *m = calloc(1, size); if (0 != m) { - pthread_mutex_unlock(&emergency_malloc_lock); + if (pthread_mutex_unlock) + { + pthread_mutex_unlock(&emergency_malloc_lock); + } return (char*)m; } for (int i=0 ; i<16 ; i++) @@ -395,10 +437,24 @@ static char *emergency_malloc(size_t siz // of the emergency buffers. if (buffer < 0) { + // If we don't have pthread_cond_wait, then there is only one + // thread and it's already used all of the emergency buffers, so we + // have no alternative but to die. Calling abort() instead of + // terminate, because terminate can throw exceptions, which can + // bring us back here and infinite loop. + if (!pthread_cond_wait) + { + fputs("Terminating while out of memory trying to throw an exception", + stderr); + abort(); + } pthread_cond_wait(&emergency_malloc_wait, &emergency_malloc_lock); } } - pthread_mutex_unlock(&emergency_malloc_lock); + if (pthread_mutex_unlock) + { + pthread_mutex_unlock(&emergency_malloc_lock); + } info->emergencyBuffersHeld++; return emergency_buffer + (1024 * buffer); } @@ -431,13 +487,19 @@ static void emergency_malloc_free(char * memset((void*)ptr, 0, 1024); // Signal the condition variable to wake up any threads that are blocking // waiting for some space in the emergency buffer - pthread_mutex_lock(&emergency_malloc_lock); + if (pthread_mutex_lock) + { + pthread_mutex_lock(&emergency_malloc_lock); + } // In theory, we don't need to do this with the lock held. In practice, // our array of bools will probably be updated using 32-bit or 64-bit // memory operations, so this update may clobber adjacent values. buffer_allocated[buffer] = false; - pthread_cond_signal(&emergency_malloc_wait); - pthread_mutex_unlock(&emergency_malloc_lock); + if (pthread_cond_signal && pthread_mutex_unlock) + { + pthread_cond_signal(&emergency_malloc_wait); + pthread_mutex_unlock(&emergency_malloc_lock); + } } static char *alloc_or_die(size_t size) Modified: head/contrib/libcxxrt/memory.cc ============================================================================== --- head/contrib/libcxxrt/memory.cc Sat Nov 26 18:02:39 2011 (r228003) +++ head/contrib/libcxxrt/memory.cc Sat Nov 26 18:46:33 2011 (r228004) @@ -11,6 +11,10 @@ #include #include "stdexcept.h" +#if !__has_builtin(__sync_swap) +#define __sync_swap __sync_lock_test_and_set +#endif + namespace std { struct nothrow_t {}; @@ -33,7 +37,7 @@ namespace std __attribute__((weak)) new_handler set_new_handler(new_handler handler) { - return __sync_lock_test_and_set(&new_handl, handler); + return __sync_swap(&new_handl, handler); } } @@ -103,7 +107,7 @@ void * operator new[](size_t size) __attribute__((weak)) -void operator delete[](void * ptr) +void operator delete[](void * ptr) throw() { ::operator delete(ptr); } Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Sat Nov 26 18:02:39 2011 (r228003) +++ head/lib/libcxxrt/Makefile Sat Nov 26 18:46:33 2011 (r228004) @@ -21,6 +21,5 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -I${SRCDIR} -LDADD+= -pthread .include From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 18:47: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 43CD5106567C; Sat, 26 Nov 2011 18:47:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 338E78FC19; Sat, 26 Nov 2011 18:47:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQIlAcn004344; Sat, 26 Nov 2011 18:47:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQIlA2n004342; Sat, 26 Nov 2011 18:47:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111261847.pAQIlA2n004342@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 Nov 2011 18:47: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: r228005 - head/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: Sat, 26 Nov 2011 18:47:10 -0000 Author: marius Date: Sat Nov 26 18:47:09 2011 New Revision: 228005 URL: http://svn.freebsd.org/changeset/base/228005 Log: Change another instance of amd(4) to esp(4) missed in r227006. Submitted by: Garrett Cooper MFC after: 3 days Modified: head/sys/mips/conf/OCTEON1 Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sat Nov 26 18:46:33 2011 (r228004) +++ head/sys/mips/conf/OCTEON1 Sat Nov 26 18:47:09 2011 (r228005) @@ -114,7 +114,7 @@ options AHC_REG_PRETTY_PRINT # Print re device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device amd # AMD 53C974 (Tekram DC-390(T)) +device esp # AMD Am53C974 (Tekram DC-390(T)) device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 18:58: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 9FEB21065670; Sat, 26 Nov 2011 18:58:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 039538FC12; Sat, 26 Nov 2011 18:58:39 +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 A222B25D37D1; Sat, 26 Nov 2011 18:58:37 +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 C6515BD5BB7; Sat, 26 Nov 2011 18:58:36 +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 5R0wbke+Oifx; Sat, 26 Nov 2011 18:58:34 +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 1BE1EBD5BB6; Sat, 26 Nov 2011 18:58:33 +0000 (UTC) Date: Sat, 26 Nov 2011 18:58:33 +0000 (UTC) From: "Bjoern A. Zeeb" To: David Chisnall In-Reply-To: <201111261846.pAQIkXZk004285@svn.freebsd.org> Message-ID: References: <201111261846.pAQIkXZk004285@svn.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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: r228004 - in head: contrib/libcxxrt lib/libcxxrt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 18:58:39 -0000 On Sat, 26 Nov 2011, David Chisnall wrote: > Author: theraven > Date: Sat Nov 26 18:46:33 2011 > New Revision: 228004 > URL: http://svn.freebsd.org/changeset/base/228004 > > Log: > Update libcxxrt to remove the pthread dependency. > > Also add the license from upstream to contrib. Did the license really come in this format with long lines? It would be great, given it looks very close to a 2-clause BSD license to make it as close as we can get to our standard license template. > Approved by: dim (mentor) > > Added: > head/contrib/libcxxrt/LICENSE > - copied unchanged from r227996, vendor/libcxxrt/dist/LICENSE > Modified: > head/contrib/libcxxrt/exception.cc > head/contrib/libcxxrt/memory.cc > head/lib/libcxxrt/Makefile > Directory Properties: > head/contrib/libcxxrt/ (props changed) > > Copied: head/contrib/libcxxrt/LICENSE (from r227996, vendor/libcxxrt/dist/LICENSE) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/contrib/libcxxrt/LICENSE Sat Nov 26 18:46:33 2011 (r228004, copy of r227996, vendor/libcxxrt/dist/LICENSE) > @@ -0,0 +1,14 @@ > +The BSD License > + > +Copyright 2010-2011 PathScale, 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. > + > +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of PathScale, Inc. > > Modified: head/contrib/libcxxrt/exception.cc > ============================================================================== > --- head/contrib/libcxxrt/exception.cc Sat Nov 26 18:02:39 2011 (r228003) > +++ head/contrib/libcxxrt/exception.cc Sat Nov 26 18:46:33 2011 (r228004) > @@ -8,6 +8,17 @@ > #include "dwarf_eh.h" > #include "cxxabi.h" > > +#pragma weak pthread_key_create > +#pragma weak pthread_setspecific > +#pragma weak pthread_getspecific > +#pragma weak pthread_once > +#pragma weak pthread_once > +#pragma weak pthread_cond_signal > +#pragma weak pthread_cond_wait > +#pragma weak pthread_mutex_lock > +#pragma weak pthread_mutex_unlock > + > + > using namespace ABI_NAMESPACE; > > /** > @@ -289,11 +300,31 @@ static void thread_cleanup(void* thread_ > static pthread_once_t once_control = PTHREAD_ONCE_INIT; > > /** > + * We may not be linked against a full pthread implementation. If we're not, > + * then we need to fake the thread-local storage by storing 'thread-local' > + * things in a global. > + */ > +static bool fakeTLS; > +/** > + * Thread-local storage for a single-threaded program. > + */ > +static __cxa_thread_info singleThreadInfo; > +/** > * Initialise eh_key. > */ > static void init_key(void) > { > + if ((0 == pthread_key_create) || > + (0 == pthread_setspecific) || > + (0 == pthread_getspecific)) > + { > + fakeTLS = true; > + return; > + } > pthread_key_create(&eh_key, thread_cleanup); > + pthread_setspecific(eh_key, (void*)0x42); > + fakeTLS = (pthread_getspecific(eh_key) != (void*)0x42); > + pthread_setspecific(eh_key, 0); > } > > /** > @@ -301,7 +332,11 @@ static void init_key(void) > */ > static __cxa_thread_info *thread_info() > { > - pthread_once(&once_control, init_key); > + if ((0 == pthread_once) || pthread_once(&once_control, init_key)) > + { > + fakeTLS = true; > + } > + if (fakeTLS) { return &singleThreadInfo; } > __cxa_thread_info *info = (__cxa_thread_info*)pthread_getspecific(eh_key); > if (0 == info) > { > @@ -316,6 +351,7 @@ static __cxa_thread_info *thread_info() > */ > static __cxa_thread_info *thread_info_fast() > { > + if (fakeTLS) { return &singleThreadInfo; } > return (__cxa_thread_info*)pthread_getspecific(eh_key); > } > /** > @@ -367,7 +403,10 @@ static char *emergency_malloc(size_t siz > // Only 4 emergency buffers allowed per thread! > if (info->emergencyBuffersHeld > 3) { return 0; } > > - pthread_mutex_lock(&emergency_malloc_lock); > + if (pthread_mutex_lock) > + { > + pthread_mutex_lock(&emergency_malloc_lock); > + } > int buffer = -1; > while (buffer < 0) > { > @@ -378,7 +417,10 @@ static char *emergency_malloc(size_t siz > void *m = calloc(1, size); > if (0 != m) > { > - pthread_mutex_unlock(&emergency_malloc_lock); > + if (pthread_mutex_unlock) > + { > + pthread_mutex_unlock(&emergency_malloc_lock); > + } > return (char*)m; > } > for (int i=0 ; i<16 ; i++) > @@ -395,10 +437,24 @@ static char *emergency_malloc(size_t siz > // of the emergency buffers. > if (buffer < 0) > { > + // If we don't have pthread_cond_wait, then there is only one > + // thread and it's already used all of the emergency buffers, so we > + // have no alternative but to die. Calling abort() instead of > + // terminate, because terminate can throw exceptions, which can > + // bring us back here and infinite loop. > + if (!pthread_cond_wait) > + { > + fputs("Terminating while out of memory trying to throw an exception", > + stderr); > + abort(); > + } > pthread_cond_wait(&emergency_malloc_wait, &emergency_malloc_lock); > } > } > - pthread_mutex_unlock(&emergency_malloc_lock); > + if (pthread_mutex_unlock) > + { > + pthread_mutex_unlock(&emergency_malloc_lock); > + } > info->emergencyBuffersHeld++; > return emergency_buffer + (1024 * buffer); > } > @@ -431,13 +487,19 @@ static void emergency_malloc_free(char * > memset((void*)ptr, 0, 1024); > // Signal the condition variable to wake up any threads that are blocking > // waiting for some space in the emergency buffer > - pthread_mutex_lock(&emergency_malloc_lock); > + if (pthread_mutex_lock) > + { > + pthread_mutex_lock(&emergency_malloc_lock); > + } > // In theory, we don't need to do this with the lock held. In practice, > // our array of bools will probably be updated using 32-bit or 64-bit > // memory operations, so this update may clobber adjacent values. > buffer_allocated[buffer] = false; > - pthread_cond_signal(&emergency_malloc_wait); > - pthread_mutex_unlock(&emergency_malloc_lock); > + if (pthread_cond_signal && pthread_mutex_unlock) > + { > + pthread_cond_signal(&emergency_malloc_wait); > + pthread_mutex_unlock(&emergency_malloc_lock); > + } > } > > static char *alloc_or_die(size_t size) > > Modified: head/contrib/libcxxrt/memory.cc > ============================================================================== > --- head/contrib/libcxxrt/memory.cc Sat Nov 26 18:02:39 2011 (r228003) > +++ head/contrib/libcxxrt/memory.cc Sat Nov 26 18:46:33 2011 (r228004) > @@ -11,6 +11,10 @@ > #include > #include "stdexcept.h" > > +#if !__has_builtin(__sync_swap) > +#define __sync_swap __sync_lock_test_and_set > +#endif > + > namespace std > { > struct nothrow_t {}; > @@ -33,7 +37,7 @@ namespace std > __attribute__((weak)) > new_handler set_new_handler(new_handler handler) > { > - return __sync_lock_test_and_set(&new_handl, handler); > + return __sync_swap(&new_handl, handler); > } > } > > @@ -103,7 +107,7 @@ void * operator new[](size_t size) > > > __attribute__((weak)) > -void operator delete[](void * ptr) > +void operator delete[](void * ptr) throw() > { > ::operator delete(ptr); > } > > Modified: head/lib/libcxxrt/Makefile > ============================================================================== > --- head/lib/libcxxrt/Makefile Sat Nov 26 18:02:39 2011 (r228003) > +++ head/lib/libcxxrt/Makefile Sat Nov 26 18:46:33 2011 (r228004) > @@ -21,6 +21,5 @@ SRCS+= libelftc_dem_gnu3.c\ > > WARNS= 0 > CFLAGS+= -I${SRCDIR} > -LDADD+= -pthread > > .include > -- 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 Nov 26 18:59: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 CCEA21065678 for ; Sat, 26 Nov 2011 18:59:11 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob6.rzone.de (mo-p00-ob6.rzone.de [IPv6:2a01:238:20a:202:53f0::1]) by mx1.freebsd.org (Postfix) with ESMTP id 68E2E8FC0A for ; Sat, 26 Nov 2011 18:59:10 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/auYssS93kCw1vZ6c X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-2-202-78-69.web.vodafone.de [2.202.78.69]) by smtp.strato.de (klopstock mo41) (RZmta 26.10 AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id i04d82nAQGCn3K for ; Sat, 26 Nov 2011 19:58:59 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Sat, 26 Nov 2011 19:58:58 +0100 Date: Sat, 26 Nov 2011 19:58:58 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20111126185858.GA14298@britannica.bec.de> References: <201111261846.pAQIkXZk004285@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111261846.pAQIkXZk004285@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: svn commit: r228004 - in head: contrib/libcxxrt lib/libcxxrt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 18:59:11 -0000 On Sat, Nov 26, 2011 at 06:46:33PM +0000, David Chisnall wrote: > Log: > Update libcxxrt to remove the pthread dependency. This looks wrong. I think it is perfectly sensible to require libc to provide working stubs for the locking primitives. TLS support falls into the same categoriy -- it doesn't require libpthread either. Joerg From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 19:01: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 38EB91065784; Sat, 26 Nov 2011 19:01:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id DDD2B8FC13; Sat, 26 Nov 2011 19:01:07 +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 0AF2B25D389E; Sat, 26 Nov 2011 19:01:06 +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 3D136BD5BB9; Sat, 26 Nov 2011 19:01:06 +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 lw1BkIwpKW+l; Sat, 26 Nov 2011 19:01:05 +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 A20D0BD5BB7; Sat, 26 Nov 2011 19:01:04 +0000 (UTC) Date: Sat, 26 Nov 2011 19:01:04 +0000 (UTC) From: "Bjoern A. Zeeb" To: Dimitry Andric In-Reply-To: <201111260326.pAQ3Q7Qw071782@svn.freebsd.org> Message-ID: References: <201111260326.pAQ3Q7Qw071782@svn.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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: r227987 - in head: . lib 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: Sat, 26 Nov 2011 19:01:08 -0000 On Sat, 26 Nov 2011, Dimitry Andric wrote: > Author: dim > Date: Sat Nov 26 03:26:06 2011 > New Revision: 227987 > URL: http://svn.freebsd.org/changeset/base/227987 > > Log: > Fix breakage after r227983; lib/libcxxrt still got built, because it was > not disabled in the usual way (by adding it to __DEFAULT_NO_OPTIONS in > share/mk/bsd.own.mk), and because the test for MK_LIBCPLUSPLUS in > Makefile.inc1 was incorrect. > > Pointy hat to: dim Can you please also add an tools/build/options/ entry and re-gen src.conf(5)? > Modified: > head/Makefile.inc1 > head/lib/Makefile > head/share/mk/bsd.own.mk > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Sat Nov 26 01:44:37 2011 (r227986) > +++ head/Makefile.inc1 Sat Nov 26 03:26:06 2011 (r227987) > @@ -1218,7 +1218,7 @@ _startup_libs+= lib/csu/${MACHINE_CPUARC > _startup_libs+= gnu/lib/libgcc > _startup_libs+= lib/libcompiler_rt > _startup_libs+= lib/libc > -.if defined(MK_LIBCPLUSPLUS) > +.if ${MK_LIBCPLUSPLUS} != "no" > _startup_libs+= lib/libcxxrt > .endif > > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Sat Nov 26 01:44:37 2011 (r227986) > +++ head/lib/Makefile Sat Nov 26 03:26:06 2011 (r227987) > @@ -48,13 +48,9 @@ SUBDIR_ORDERED= ${_csu} \ > libsbuf \ > libtacplus \ > libutil \ > - ${_libypclnt} > - > -.if ${MK_LIBCPLUSPLUS} != "no" > -SUBDIR_ORDERED+=libcxxrt\ > - libc++ > -.endif > - > + ${_libypclnt} \ > + ${_libcxxrt} \ > + ${_libcplusplus} > > SUBDIR= ${SUBDIR_ORDERED} \ > libalias \ > @@ -209,6 +205,11 @@ _libsmb= libsmb > _libmp= libmp > .endif > > +.if ${MK_LIBCPLUSPLUS} != "no" > +_libcxxrt= libcxxrt > +_libcplusplus= libc++ > +.endif > + > .if ${MK_PMC} != "no" > _libpmc= libpmc > .endif > > Modified: head/share/mk/bsd.own.mk > ============================================================================== > --- head/share/mk/bsd.own.mk Sat Nov 26 01:44:37 2011 (r227986) > +++ head/share/mk/bsd.own.mk Sat Nov 26 03:26:06 2011 (r227987) > @@ -413,6 +413,7 @@ __DEFAULT_NO_OPTIONS = \ > HESIOD \ > ICONV \ > IDEA \ > + LIBCPLUSPLUS \ > OFED > > # > @@ -553,8 +554,6 @@ MK_GCC:= no > MK_GDB:= no > .endif > > -MK_LIBCPLUSPLUS?= no > - > # > # Set defaults for the MK_*_SUPPORT variables. > # > -- 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 Nov 26 20:12: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 9B577106564A; Sat, 26 Nov 2011 20:12:05 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A7E18FC12; Sat, 26 Nov 2011 20:12:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQKC5X4006852; Sat, 26 Nov 2011 20:12:05 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQKC5aY006850; Sat, 26 Nov 2011 20:12:05 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201111262012.pAQKC5aY006850@svn.freebsd.org> From: Peter Holm Date: Sat, 26 Nov 2011 20:12:05 +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: r228006 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 20:12:05 -0000 Author: pho Date: Sat Nov 26 20:12:05 2011 New Revision: 228006 URL: http://svn.freebsd.org/changeset/base/228006 Log: MFC: r227674 Added check for negative seconds value. Found by syscall() fuzzing. Modified: stable/8/sys/kern/kern_thr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_thr.c ============================================================================== --- stable/8/sys/kern/kern_thr.c Sat Nov 26 18:47:09 2011 (r228005) +++ stable/8/sys/kern/kern_thr.c Sat Nov 26 20:12:05 2011 (r228006) @@ -445,7 +445,8 @@ kern_thr_suspend(struct thread *td, stru int error = 0, hz = 0; if (tsp != NULL) { - if (tsp->tv_nsec < 0 || tsp->tv_nsec > 1000000000) + if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 || + tsp->tv_nsec > 1000000000) return (EINVAL); if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) return (ETIMEDOUT); From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 20:24: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 0CEC3106566B; Sat, 26 Nov 2011 20:24:17 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id C31C88FC14; Sat, 26 Nov 2011 20:24:16 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAQKOF2v048731; Sat, 26 Nov 2011 15:24:15 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAQKOFA4048730; Sat, 26 Nov 2011 15:24:15 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sat, 26 Nov 2011 15:24:14 -0500 From: David Schultz To: "Bjoern A. Zeeb" Message-ID: <20111126202413.GA48676@zim.MIT.EDU> Mail-Followup-To: "Bjoern A. Zeeb" , David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111261846.pAQIkXZk004285@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, David Chisnall Subject: Re: svn commit: r228004 - in head: contrib/libcxxrt lib/libcxxrt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 20:24:17 -0000 On Sat, Nov 26, 2011, Bjoern A. Zeeb wrote: > On Sat, 26 Nov 2011, David Chisnall wrote: > > >Author: theraven > >Date: Sat Nov 26 18:46:33 2011 > >New Revision: 228004 > >URL: http://svn.freebsd.org/changeset/base/228004 > > > >Log: > > Update libcxxrt to remove the pthread dependency. > > > > Also add the license from upstream to contrib. > > Did the license really come in this format with long lines? It would > be great, given it looks very close to a 2-clause BSD license to make > it as close as we can get to our standard license template. It looks like the license file came from the vendor branch. If it's published by the vendor that way, we shouldn't be introducing gratuitous style differences. From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 22:28: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 444AC106566B; Sat, 26 Nov 2011 22:28:26 +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 337368FC19; Sat, 26 Nov 2011 22:28:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQMSQEM010933; Sat, 26 Nov 2011 22:28:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQMSQsm010931; Sat, 26 Nov 2011 22:28:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201111262228.pAQMSQsm010931@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 26 Nov 2011 22:28: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: r228007 - 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: Sat, 26 Nov 2011 22:28:26 -0000 Author: jilles Date: Sat Nov 26 22:28:25 2011 New Revision: 228007 URL: http://svn.freebsd.org/changeset/base/228007 Log: sh: Add tests for some corner cases of 'case' exit status. These already work properly. Added: head/tools/regression/bin/sh/builtins/case11.0 (contents, props changed) head/tools/regression/bin/sh/builtins/case12.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/case11.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case11.0 Sat Nov 26 22:28:25 2011 (r228007) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +false +case x in +*) +esac Added: head/tools/regression/bin/sh/builtins/case12.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case12.0 Sat Nov 26 22:28:25 2011 (r228007) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +false +case x in +y) +esac From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 22:37: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 235611065670; Sat, 26 Nov 2011 22:37:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id BFD268FC12; Sat, 26 Nov 2011 22:37:16 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 100F04CF; Sat, 26 Nov 2011 18:12:47 +0100 (CET) Date: Sat, 26 Nov 2011 18:11:40 +0100 From: Pawel Jakub Dawidek To: mdf@FreeBSD.org Message-ID: <20111126171140.GF8794@garage.freebsd.pl> References: <201111230734.pAN7YA78032998@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bqc0IY4JZZt50bUr" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Mikolaj Golub , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227873 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Nov 2011 22:37:17 -0000 --Bqc0IY4JZZt50bUr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 23, 2011 at 11:10:47AM -0800, mdf@FreeBSD.org wrote: > I don't know if there's a style preference for 0x%lx versus %#lx, > though, or a preference for a different type for the print (uintmax_t, > for example). There is probably a preference for using u_long rather > than unsigned long, since it's shorter. u_long is preferred in kernel, in userland unsigned long is better. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --Bqc0IY4JZZt50bUr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk7RHcsACgkQForvXbEpPzQvcgCdHetVDEZBknaq+nXA5X/j4/JT +9AAoL0W/fWyn/zCC70jSJOlg5NQvq8A =jv2Y -----END PGP SIGNATURE----- --Bqc0IY4JZZt50bUr-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 23:11: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 E3824106564A; Sat, 26 Nov 2011 23:11:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D31028FC12; Sat, 26 Nov 2011 23:11:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQNBfwu012402; Sat, 26 Nov 2011 23:11:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQNBfqJ012400; Sat, 26 Nov 2011 23:11:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111262311.pAQNBfqJ012400@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Nov 2011 23:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228008 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:11:42 -0000 Author: pjd Date: Sat Nov 26 23:11:41 2011 New Revision: 228008 URL: http://svn.freebsd.org/changeset/base/228008 Log: There is no need to virtualize esp_max_ivlen. Modified: head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Nov 26 22:28:25 2011 (r228007) +++ head/sys/netipsec/xform_esp.c Sat Nov 26 23:11:41 2011 (r228008) @@ -76,6 +76,8 @@ #include #include +static int esp_max_ivlen; /* max iv length over all algorithms */ + VNET_DEFINE(int, esp_enable) = 1; VNET_DEFINE(struct espstat, espstat); @@ -85,9 +87,6 @@ SYSCTL_VNET_INT(_net_inet_esp, OID_AUTO, SYSCTL_VNET_STRUCT(_net_inet_esp, IPSECCTL_STATS, stats, CTLFLAG_RD, &VNET_NAME(espstat), espstat, ""); -static VNET_DEFINE(int, esp_max_ivlen); /* max iv length over all algorithms */ -#define V_esp_max_ivlen VNET(esp_max_ivlen) - static int esp_input_cb(struct cryptop *op); static int esp_output_cb(struct cryptop *crp); @@ -147,7 +146,7 @@ esp_hdrsiz(struct secasvar *sav) * + sizeof (next header field) * + max icv supported. */ - size = sizeof (struct newesp) + V_esp_max_ivlen + 9 + 16; + size = sizeof (struct newesp) + esp_max_ivlen + 9 + 16; } return size; } @@ -1029,8 +1028,8 @@ static void esp_attach(void) { #define MAXIV(xform) \ - if (xform.blocksize > V_esp_max_ivlen) \ - V_esp_max_ivlen = xform.blocksize \ + if (xform.blocksize > esp_max_ivlen) \ + esp_max_ivlen = xform.blocksize \ MAXIV(enc_xform_des); /* SADB_EALG_DESCBC */ MAXIV(enc_xform_3des); /* SADB_EALG_3DESCBC */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 23:13: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 8B7191065672; Sat, 26 Nov 2011 23:13: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 2C3288FC18; Sat, 26 Nov 2011 23:13:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQNDVfJ012489; Sat, 26 Nov 2011 23:13:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQNDVio012485; Sat, 26 Nov 2011 23:13:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111262313.pAQNDVio012485@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Nov 2011 23:13: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: r228009 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:13:31 -0000 Author: pjd Date: Sat Nov 26 23:13:30 2011 New Revision: 228009 URL: http://svn.freebsd.org/changeset/base/228009 Log: Simplify code a bit. Modified: head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Sat Nov 26 23:11:41 2011 (r228008) +++ head/sys/netipsec/xform_ah.c Sat Nov 26 23:13:30 2011 (r228009) @@ -770,10 +770,8 @@ ah_input_cb(struct cryptop *crp) if (sav->tdb_cryptoid != 0) sav->tdb_cryptoid = crp->crp_sid; - if (crp->crp_etype == EAGAIN) { - error = crypto_dispatch(crp); - return error; - } + if (crp->crp_etype == EAGAIN) + return (crypto_dispatch(crp)); V_ahstat.ahs_noxform++; DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); @@ -1164,8 +1162,7 @@ ah_output_cb(struct cryptop *crp) if (crp->crp_etype == EAGAIN) { IPSECREQUEST_UNLOCK(isr); - error = crypto_dispatch(crp); - return error; + return (crypto_dispatch(crp)); } V_ahstat.ahs_noxform++; Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Nov 26 23:11:41 2011 (r228008) +++ head/sys/netipsec/xform_esp.c Sat Nov 26 23:13:30 2011 (r228009) @@ -495,10 +495,8 @@ esp_input_cb(struct cryptop *crp) if (sav->tdb_cryptoid != 0) sav->tdb_cryptoid = crp->crp_sid; - if (crp->crp_etype == EAGAIN) { - error = crypto_dispatch(crp); - return error; - } + if (crp->crp_etype == EAGAIN) + return (crypto_dispatch(crp)); V_espstat.esps_noxform++; DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); @@ -947,8 +945,7 @@ esp_output_cb(struct cryptop *crp) if (crp->crp_etype == EAGAIN) { IPSECREQUEST_UNLOCK(isr); - error = crypto_dispatch(crp); - return error; + return (crypto_dispatch(crp)); } V_espstat.esps_noxform++; From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 23:15: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 4D871106566B; Sat, 26 Nov 2011 23:15:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CFAE8FC0A; Sat, 26 Nov 2011 23:15:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQNFTew012597; Sat, 26 Nov 2011 23:15:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQNFTpf012594; Sat, 26 Nov 2011 23:15:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111262315.pAQNFTpf012594@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Nov 2011 23:15: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: r228010 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:15:29 -0000 Author: pjd Date: Sat Nov 26 23:15:28 2011 New Revision: 228010 URL: http://svn.freebsd.org/changeset/base/228010 Log: Eliminate 'err' variable and just use existing 'error'. Modified: head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Sat Nov 26 23:13:30 2011 (r228009) +++ head/sys/netipsec/xform_ah.c Sat Nov 26 23:15:28 2011 (r228010) @@ -1135,7 +1135,6 @@ ah_output_cb(struct cryptop *crp) struct secasvar *sav; struct mbuf *m; caddr_t ptr; - int err; tc = (struct tdb_crypto *) crp->crp_opaque; IPSEC_ASSERT(tc != NULL, ("null opaque data area!")); @@ -1205,10 +1204,10 @@ ah_output_cb(struct cryptop *crp) #endif /* NB: m is reclaimed by ipsec_process_done. */ - err = ipsec_process_done(m, isr); + error = ipsec_process_done(m, isr); KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); - return err; + return error; bad: if (sav) KEY_FREESAV(&sav); Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Nov 26 23:13:30 2011 (r228009) +++ head/sys/netipsec/xform_esp.c Sat Nov 26 23:15:28 2011 (r228010) @@ -918,7 +918,7 @@ esp_output_cb(struct cryptop *crp) struct ipsecrequest *isr; struct secasvar *sav; struct mbuf *m; - int err, error; + int error; tc = (struct tdb_crypto *) crp->crp_opaque; IPSEC_ASSERT(tc != NULL, ("null opaque data area!")); @@ -1000,10 +1000,10 @@ esp_output_cb(struct cryptop *crp) #endif /* NB: m is reclaimed by ipsec_process_done. */ - err = ipsec_process_done(m, isr); + error = ipsec_process_done(m, isr); KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); - return err; + return error; bad: if (sav) KEY_FREESAV(&sav); From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 23:18: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 236E2106566B; Sat, 26 Nov 2011 23:18:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12FC28FC0C; Sat, 26 Nov 2011 23:18:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQNIJbW012739; Sat, 26 Nov 2011 23:18:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQNIJvG012737; Sat, 26 Nov 2011 23:18:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111262318.pAQNIJvG012737@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Nov 2011 23:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228011 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:18:20 -0000 Author: pjd Date: Sat Nov 26 23:18:19 2011 New Revision: 228011 URL: http://svn.freebsd.org/changeset/base/228011 Log: malloc(M_WAITOK) never fails, so there is no need to check for NULL. Modified: head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Nov 26 23:15:28 2011 (r228010) +++ head/sys/netipsec/xform_esp.c Sat Nov 26 23:18:19 2011 (r228011) @@ -195,10 +195,6 @@ esp_init(struct secasvar *sav, struct xf */ sav->ivlen = (txform == &enc_xform_null ? 0 : txform->blocksize); sav->iv = (caddr_t) malloc(sav->ivlen, M_XDATA, M_WAITOK); - if (sav->iv == NULL) { - DPRINTF(("%s: no memory for IV\n", __func__)); - return EINVAL; - } key_randomfill(sav->iv, sav->ivlen); /*XXX*/ /* From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 23:27: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 EA11D1065672; Sat, 26 Nov 2011 23:27:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D99808FC08; Sat, 26 Nov 2011 23:27:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQNRfPP013058; Sat, 26 Nov 2011 23:27:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQNRf4D013056; Sat, 26 Nov 2011 23:27:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111262327.pAQNRf4D013056@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Nov 2011 23:27: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: r228012 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:27:42 -0000 Author: pjd Date: Sat Nov 26 23:27:41 2011 New Revision: 228012 URL: http://svn.freebsd.org/changeset/base/228012 Log: The esp_max_ivlen global variable is not needed, we can just use EALG_MAX_BLOCK_LEN. Modified: head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Nov 26 23:18:19 2011 (r228011) +++ head/sys/netipsec/xform_esp.c Sat Nov 26 23:27:41 2011 (r228012) @@ -76,8 +76,6 @@ #include #include -static int esp_max_ivlen; /* max iv length over all algorithms */ - VNET_DEFINE(int, esp_enable) = 1; VNET_DEFINE(struct espstat, espstat); @@ -146,7 +144,7 @@ esp_hdrsiz(struct secasvar *sav) * + sizeof (next header field) * + max icv supported. */ - size = sizeof (struct newesp) + esp_max_ivlen + 9 + 16; + size = sizeof (struct newesp) + EALG_MAX_BLOCK_LEN + 9 + 16; } return size; } @@ -1020,20 +1018,7 @@ static struct xformsw esp_xformsw = { static void esp_attach(void) { -#define MAXIV(xform) \ - if (xform.blocksize > esp_max_ivlen) \ - esp_max_ivlen = xform.blocksize \ - - MAXIV(enc_xform_des); /* SADB_EALG_DESCBC */ - MAXIV(enc_xform_3des); /* SADB_EALG_3DESCBC */ - MAXIV(enc_xform_rijndael128); /* SADB_X_EALG_AES */ - MAXIV(enc_xform_blf); /* SADB_X_EALG_BLOWFISHCBC */ - MAXIV(enc_xform_cast5); /* SADB_X_EALG_CAST128CBC */ - MAXIV(enc_xform_skipjack); /* SADB_X_EALG_SKIPJACK */ - MAXIV(enc_xform_null); /* SADB_EALG_NULL */ - MAXIV(enc_xform_camellia); /* SADB_X_EALG_CAMELLIACBC */ xform_register(&esp_xformsw); -#undef MAXIV } SYSINIT(esp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, esp_attach, NULL); From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 23:28: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 1AFA31065675; Sat, 26 Nov 2011 23:28:32 +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 E51578FC08; Sat, 26 Nov 2011 23:28:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQNSVWL013119; Sat, 26 Nov 2011 23:28:31 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQNSVt5013117; Sat, 26 Nov 2011 23:28:31 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201111262328.pAQNSVt5013117@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 26 Nov 2011 23:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228013 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:28:32 -0000 Author: jilles Date: Sat Nov 26 23:28:31 2011 New Revision: 228013 URL: http://svn.freebsd.org/changeset/base/228013 Log: sh: Reduce one level of evaltree() recursion when executing 'case'. Free expanded case text before executing commands. Remove impossible evalskip checks (expanding an argument cannot set evalskip anymore since $(break) and the like are properly executed in a subshell environment). Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Nov 26 23:27:41 2011 (r228012) +++ head/bin/sh/eval.c Sat Nov 26 23:28:31 2011 (r228013) @@ -89,7 +89,7 @@ int oexitstatus; /* saved exit status * static void evalloop(union node *, int); static void evalfor(union node *, int); -static void evalcase(union node *, int); +static union node *evalcase(union node *, int); static void evalsubshell(union node *, int); static void evalredir(union node *, int); static void expredir(union node *); @@ -256,7 +256,7 @@ evaltree(union node *n, int flags) evalfor(n, flags & ~EV_EXIT); break; case NCASE: - evalcase(n, flags); + next = evalcase(n, flags); break; case NDEFUN: defun(n->narg.text, n->narg.next); @@ -370,7 +370,7 @@ out: -static void +static union node * evalcase(union node *n, int flags) { union node *cp; @@ -383,26 +383,24 @@ evalcase(union node *n, int flags) oexitstatus = exitstatus; exitstatus = 0; expandarg(n->ncase.expr, &arglist, EXP_TILDE); - for (cp = n->ncase.cases ; cp && evalskip == 0 ; cp = cp->nclist.next) { + for (cp = n->ncase.cases ; cp ; cp = cp->nclist.next) { for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) { if (casematch(patp, arglist.list->text)) { + popstackmark(&smark); while (cp->nclist.next && cp->type == NCLISTFALLTHRU) { - if (evalskip != 0) - break; evaltree(cp->nclist.body, flags & ~EV_EXIT); + if (evalskip != 0) + return (NULL); cp = cp->nclist.next; } - if (evalskip == 0) { - evaltree(cp->nclist.body, flags); - } - goto out; + return (cp->nclist.body); } } } -out: popstackmark(&smark); + return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 26 23:57:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC647106566C; Sat, 26 Nov 2011 23:57:03 +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 9BE7A8FC1B; Sat, 26 Nov 2011 23:57:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAQNv30g014005; Sat, 26 Nov 2011 23:57:03 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAQNv3YH014003; Sat, 26 Nov 2011 23:57:03 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111262357.pAQNv3YH014003@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Nov 2011 23:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228014 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 23:57:03 -0000 Author: pjd Date: Sat Nov 26 23:57:03 2011 New Revision: 228014 URL: http://svn.freebsd.org/changeset/base/228014 Log: Remove unused 'plen' variable. Modified: head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Nov 26 23:28:31 2011 (r228013) +++ head/sys/netipsec/xform_esp.c Sat Nov 26 23:57:03 2011 (r228014) @@ -669,7 +669,7 @@ esp_output( { struct enc_xform *espx; struct auth_hash *esph; - int hlen, rlen, plen, padding, blks, alen, i, roff; + int hlen, rlen, padding, blks, alen, i, roff; struct mbuf *mo = (struct mbuf *) NULL; struct tdb_crypto *tc; struct secasvar *sav; @@ -701,7 +701,6 @@ esp_output( /* XXX clamp padding length a la KAME??? */ padding = ((blks - ((rlen + 2) % blks)) % blks) + 2; - plen = rlen + padding; /* Padded payload length. */ if (esph) switch (esph->type) {