From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 00:37:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24676106566C; Sun, 4 Mar 2012 00:37:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5598FC08; Sun, 4 Mar 2012 00:37:54 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q240bias011168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 4 Mar 2012 11:37:47 +1100 Date: Sun, 4 Mar 2012 11:37:39 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <201203031858.q23IwGvG096048@svn.freebsd.org> Message-ID: <20120304102200.D942@besplex.bde.org> References: <201203031858.q23IwGvG096048@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: r232473 - in head: share/mk sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 00:37:56 -0000 On Sat, 3 Mar 2012, Dimitry Andric wrote: > After r232322, it turned out many people (and some ports) are building > kernel modules using their old installed /usr/share/mk/bsd.*.mk files, > instead of the updated ones in their source tree. This leads to errors > like: It is a bug for sys to depend on anything outside of itself for its configuration. I use multiple sys trees spanning up to 7 major FreeBSD versions on several hosts and expect them to work across 5-10 years of differences, not to break every day when someone changes the sys sources. The host's installed files of course can't be changed. I also don't want to create a separate share/mk tree and point to it using -m, though that was necessary with RELENG_4 sources on about RELENG_6 and later hosts, because of incompatibilities caused by fixing the bug that the sys makefiles referred to the bsd.kern.mk file which was outside of the sys tree. (Fixing this bug made it worse in some ways. /usr/share/mk/bsd.kern.mk was moved to sys/conf/kern.mk. The old version should have been left for compatibility. Removing it broke old sys trees on new hosts. It didn't help that it was renamed, so that -m to tree to find it it sys/conf had no chance of working.) Now there are much larger layering bugs in this area :-(. kern.pre.mk now includes bsd.own.mk (a clear layering violation), and a new MK_ feature is used without ifdefing it every other day to break kernel builds. The previous breakage was for MK_CTF. MK_* is also badly designed. A correct design would have used only simple ifdefs. Simple ifdefs are fail-safe since you have to use ifdef to use them. Kernel headers are much more carefully maintained. They started with many out-of-tree references to installed headers, but were eventually fixed, and the bugs don't seem to have come back. > "sys/conf/kmod.mk", line 111: Malformed conditional (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") > > Obviously, these errors will go away after a "make installworld", or > alternatively, by using "make buildenv" before attempting to manually > build modules. I never use these (except for performance tests). buildenv is an implementation detail that is not documented in src/Makefile. I also don't want to build or install new toolchains to build kernels. I want my kernel builds from a new sys tree to take seconds, not hours. I sometimes point to an alternative compiler using CC=. BTW, CC=clang works with my -current kernels without the new MK_* foo for clang, except for warnings about tautologous comparisons of unsigned's. -Os in CFLAGS is still horribly broken for CC=gcc, but works with CC=clang. -fno-inline-functions-called-once is necessary for debugging and profiling, but CC=clang doesn't support it. No optimization above -O1 makes a significant difference for kernels, except to waste (possibly insignificant) space (except with CC=clang, -Os actually works, so it saves space). It is sometimes necessary to build but not install a new version of config(8), but this hasn't been necessary for the last 4-5 years of sys trees. Some old sys trees need genassym. I keep genassym in ~/bin for them. Fortunately its ABI was stable, so 1 version works. The only large recent gratuitous incompatibility is that a -current gas can no longer compile 4 year old sources on i386, since it now enforces sizes for accesses to segment registers. > However, since it is apparently an expected use case to build using old > .mk files, change the way we test for clang, so it also works when the > MK_CLANG_IS_CC macro doesn't exist. That is correct. Kernel makefiles shouldn't depend on anything except sys.mk, which should rarely change (MK_CTF mistakes broke it significantly too. These are smaller now). I once tried to make kernel Makefiles completely portable and not depend on depend on sys.mk or on any BSD make feature. The FreeBSD-1 versions were careful to use $@, etc., and to not use ${.TARGET}, etc. BTW, config(8)'s generated makefiles should merge all the included .mk files so that you can actually see what is in them and so that you can edit them. Editing them is useful for removing bugs like the MK_* bugs and for making minor changes to CFLAGS. CFLAGS initialization is very convoluted and broken, so it is hard to control without editing the final CFLAGS setting. This setting is now deep in the source .mk files which are too global to edit to fix just one kernel configuration. I actually fixed the MK_* bugs first by initializing MK*_ in the environment passed to make. This is possible, unlike for CFLAGS, because the initialization is not convuluted. But I got tired of that after forgetting to type the environment change a fe times, and edited the source files. > Note the conditional expressions are becoming rather unreadable now, but > I will attempt to fix that on a followup commit. They also have style bugs (long lines). My fix is missing this bug. > Modified: head/share/mk/bsd.sys.mk > ============================================================================== > --- head/share/mk/bsd.sys.mk Sat Mar 3 18:08:57 2012 (r232472) > +++ head/share/mk/bsd.sys.mk Sat Mar 3 18:58:15 2012 (r232473) > @@ -28,7 +28,7 @@ CFLAGS += -std=${CSTD} > . if defined(WARNS) > . if ${WARNS} >= 1 > CWARNFLAGS += -Wsystem-headers > -. if !defined(NO_WERROR) && ((${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") || !defined(NO_WERROR.clang)) > +. if !defined(NO_WERROR) && ((${CC:T:Mclang} != "clang" && (!defined(MK_CLANG_IS_CC) || ${MK_CLANG_IS_CC} == "no")) || !defined(NO_WERROR.clang)) > CWARNFLAGS += -Werror > . endif > . endif bsd.sys.mk is in the same layer as bsd.own.mk, so it shouldn't need the new messes. It already had messes (long line are just the largest ones). > @@ -42,7 +42,7 @@ CWARNFLAGS += -W -Wno-unused-parameter - > . if ${WARNS} >= 4 > CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch\ > -Wshadow -Wunused-parameter > -. if !defined(NO_WCAST_ALIGN) && ((${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") || !defined(NO_WCAST_ALIGN.clang)) > +. if !defined(NO_WCAST_ALIGN) && ((${CC:T:Mclang} != "clang" && (!defined(MK_CLANG_IS_CC) || ${MK_CLANG_IS_CC} == "no")) || !defined(NO_WCAST_ALIGN.clang)) > CWARNFLAGS += -Wcast-align > . endif > . endif > @@ -59,7 +59,7 @@ CWARNFLAGS += -Wno-uninitialized > CWARNFLAGS += -Wno-pointer-sign > # Clang has more warnings enabled by default, and when using -Wall, so if WARNS > # is set to low values, these have to be disabled explicitly. > -. if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" > +. if ${CC:T:Mclang} == "clang" || (defined(MK_CLANG_IS_CC) && ${MK_CLANG_IS_CC} != "no") > . if ${WARNS} <= 3 > CWARNFLAGS += -Wno-tautological-compare -Wno-unused-value\ > -Wno-parentheses-equality -Wno-unused-function\ > @@ -84,12 +84,12 @@ WFORMAT = 1 > . if ${WFORMAT} > 0 > #CWARNFLAGS += -Wformat-nonliteral -Wformat-security -Wno-format-extra-args > CWARNFLAGS += -Wformat=2 -Wno-format-extra-args > -. if !defined(NO_WERROR) && ((${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") || !defined(NO_WERROR.clang)) > +. if !defined(NO_WERROR) && ((${CC:T:Mclang} != "clang" && (!defined(MK_CLANG_IS_CC) || ${MK_CLANG_IS_CC} == "no")) || !defined(NO_WERROR.clang)) > CWARNFLAGS += -Werror > . endif > . endif > . endif > -. if defined(NO_WFORMAT) || ((${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && defined(NO_WFORMAT.clang)) > +. if defined(NO_WFORMAT) || ((${CC:T:Mclang} == "clang" || (defined(MK_CLANG_IS_CC) && ${MK_CLANG_IS_CC} != "no")) && defined(NO_WFORMAT.clang)) > CWARNFLAGS += -Wno-format > . endif > .endif > @@ -98,7 +98,7 @@ CWARNFLAGS += -Wno-format > CWARNFLAGS += -Wno-unknown-pragmas > .endif > > -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" > +.if ${CC:T:Mclang} == "clang" || (defined(MK_CLANG_IS_CC) && ${MK_CLANG_IS_CC} != "no") > CLANG_NO_IAS = -no-integrated-as > CLANG_OPT_SMALL = -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 \ > -mllvm -enable-load-pre=false > It has many other messes. It doesn't look anything like a BSD mk file (starting with its spaces after "." and its tabs before assignments) so I try not to look at it. Old versions of it only have a few of the long lines. Some of the long lines are made longer by the excessive indentation. > Modified: head/sys/conf/kern.mk > ============================================================================== > --- head/sys/conf/kern.mk Sat Mar 3 18:08:57 2012 (r232472) > +++ head/sys/conf/kern.mk Sat Mar 3 18:58:15 2012 (r232473) > @@ -15,7 +15,7 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn > # Disable a few warnings for clang, since there are several places in the > # kernel where fixing them is more trouble than it is worth, or where there is > # a false positive. > -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" > +.if ${CC:T:Mclang} == "clang" || (defined(MK_CLANG_IS_CC) && ${MK_CLANG_IS_CC} != "no") My version just defines things if they are undefined: % Index: kern.mk % =================================================================== % RCS file: /home/ncvs/src/sys/conf/kern.mk,v % retrieving revision 1.93 % diff -u -2 -r1.93 kern.mk % --- kern.mk 29 Feb 2012 22:58:51 -0000 1.93 % +++ kern.mk 2 Mar 2012 09:17:48 -0000 % @@ -16,4 +16,7 @@ % # kernel where fixing them is more trouble than it is worth, or where there is % # a false positive. % +.if !defined(MK_CLANG_IS_CC) % +MK_CLANG_IS_CC= no % +.endif % .if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" % NO_WCONSTANT_CONVERSION= -Wno-constant-conversion % Index: kern.pre.mk % =================================================================== % RCS file: /home/ncvs/src/sys/conf/kern.pre.mk,v % retrieving revision 1.138 % diff -u -2 -r1.138 kern.pre.mk % --- kern.pre.mk 29 Feb 2012 22:58:51 -0000 1.138 % +++ kern.pre.mk 2 Mar 2012 09:21:35 -0000 % @@ -6,4 +6,8 @@ % .include % % +.if !defined(MK_CLANG_IS_CC) % +MK_CLANG_IS_CC= no % +.endif % + % # backwards compat option for older systems. % MACHINE_CPUARCH?=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} > Modified: head/sys/conf/kmod.mk I rarely use modules, so I didn't need to touch this. > ============================================================================== > --- head/sys/conf/kmod.mk Sat Mar 3 18:08:57 2012 (r232472) > +++ head/sys/conf/kmod.mk Sat Mar 3 18:58:15 2012 (r232473) > @@ -108,7 +108,7 @@ CFLAGS+= -I. -I@ > # for example. > CFLAGS+= -I@/contrib/altq > > -.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang" > +.if ${CC:T:Mclang} != "clang" && (!defined(MK_CLANG_IS_CC) || ${MK_CLANG_IS_CC} == "no") Is any change necessary here? Normally CC is not clang, so the first test should prevent evaluation of MK_LANG_IS_CC just was well as the defined() test. When CC is clang, the defined() test is strictly needed for portability, but people who set CC=clang probably actually need to use the new feature. > CFLAGS+= -finline-limit=${INLINE_LIMIT} > CFLAGS+= --param inline-unit-growth=100 > CFLAGS+= --param large-function-growth=1000 > Bruce From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 00:42:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 53131106564A; Sun, 4 Mar 2012 00:42:19 +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 3EA2A8FC0C; Sun, 4 Mar 2012 00:42: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 q240gJis007057; Sun, 4 Mar 2012 00:42:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q240gJdM007055; Sun, 4 Mar 2012 00:42:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203040042.q240gJdM007055@svn.freebsd.org> From: Dimitry Andric Date: Sun, 4 Mar 2012 00:42: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: r232477 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 00:42:19 -0000 Author: dim Date: Sun Mar 4 00:42:18 2012 New Revision: 232477 URL: http://svn.freebsd.org/changeset/base/232477 Log: In r232322, I forgot one case where a check for MK_CLANG_IS_CC was needed, in sys/conf/kern.pre.mk. Add it now. MFC after: 2 weeks Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat Mar 3 23:49:53 2012 (r232476) +++ head/sys/conf/kern.pre.mk Sun Mar 4 00:42:18 2012 (r232477) @@ -101,7 +101,7 @@ WERROR?= -Werror # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} -.if ${CC:T:Mclang} == "clang" +.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" CLANG_NO_IAS= -no-integrated-as .endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 04:17:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6655B1065670; Sun, 4 Mar 2012 04:17:52 +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 3C9A38FC08; Sun, 4 Mar 2012 04:17:52 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id E304F46B32; Sat, 3 Mar 2012 23:17:51 -0500 (EST) Received: from kavik.baldwin.cx (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6D26BB924; Sat, 3 Mar 2012 23:17:51 -0500 (EST) From: John Baldwin To: Dimitry Andric Date: Sat, 3 Mar 2012 23:17:48 -0500 User-Agent: KMail/1.13.7 (FreeBSD/9.0-BETA2; KDE/4.6.5; i386; ; ) References: <201203032349.q23NnrIb005355@svn.freebsd.org> In-Reply-To: <201203032349.q23NnrIb005355@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203032317.49346.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 03 Mar 2012 23:17:51 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232476 - in head: share/mk sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 04:17:52 -0000 On Saturday, March 03, 2012 06:49:53 PM Dimitry Andric wrote: > Author: dim > Date: Sat Mar 3 23:49:53 2012 > New Revision: 232476 > URL: http://svn.freebsd.org/changeset/base/232476 > > Log: > Revert r232473. I have been convinced by Doug Barton and Bjoern Zeeb > that it is better to error out when people attempt to build using the > wrong bsd.*.mk files, than to silently ignore the problem. > > This means, that after this commit, if you want to build kernel modules > by hand (or via a port) from a head source tree, you *must* make sure > the files in /usr/share/mk are in sync with that tree. If that isn't > possible, for example when you are running on an older FreeBSD branch, > you can: > > - Run "make buildenv" from your head source tree, to have the correct > environment setup. (It's advisable to have run "make buildworld", or > at a minimum "make toolchain" first.) > - Alternatively, set MAKESYSPATH to the share/mk directory under your > head source tree. If your build tools are too old, other problems may > still occur. > - Alternatively, use "make -m" and specify the share/mk directory under > your head source tree. Again, build tools that are too old may still > result in trouble. Or use 'make MK_CTF=no MK_CLANG_IS_CC=no' (which is what I do). However, I know the risks I take doing that, and I think your reversion above is correct. (Unfortunately I can't run HEAD on my primary desktop as I have to use it for ${DAYJOB}.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 05:19:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A510E106566C; Sun, 4 Mar 2012 05:19:56 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 949238FC08; Sun, 4 Mar 2012 05:19: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 q245JuaB015766; Sun, 4 Mar 2012 05:19:56 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q245Ju6e015764; Sun, 4 Mar 2012 05:19:56 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203040519.q245Ju6e015764@svn.freebsd.org> From: Juli Mallett Date: Sun, 4 Mar 2012 05:19: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: r232478 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 05:19:56 -0000 Author: jmallett Date: Sun Mar 4 05:19:55 2012 New Revision: 232478 URL: http://svn.freebsd.org/changeset/base/232478 Log: Fix tls base computation with COMPAT_FREEBSD32 on n64 kernels. The previous version was missing an else and would always use the n64 TP_OFFSET. Eliminate some duplication of logic here. It may be worth getting rid of some of the ifdefs and introducing gratuitous SV_ILP32 runtime checks on n64 kernels without COMPAT_FREEBSD32 and on o32 kernels, similarly to how PowerPC works. Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Sun Mar 4 00:42:18 2012 (r232477) +++ head/sys/mips/mips/vm_machdep.c Sun Mar 4 05:19:55 2012 (r232478) @@ -618,14 +618,18 @@ cpu_set_user_tls(struct thread *td, void #ifdef __mips_n64 #ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) - td->td_md.md_tls = (char*)tls_base + 0x7008; + if (!SV_PROC_FLAG(td->td_proc, SV_ILP32)) { #endif - td->td_md.md_tls = (char*)tls_base + 0x7010; -#else - td->td_md.md_tls = (char*)tls_base + 0x7008; + td->td_md.md_tls = (char*)tls_base + 0x7010; + return (0); +#ifdef COMPAT_FREEBSD32 + } #endif +#endif +#if !defined(__mips_n64) || defined(COMPAT_FREEBSD32) + td->td_md.md_tls = (char*)tls_base + 0x7008; return (0); +#endif } #ifdef DDB From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 05:49:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7260C106566B; Sun, 4 Mar 2012 05:49:40 +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 6178F8FC08; Sun, 4 Mar 2012 05:49: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 q245neBN016721; Sun, 4 Mar 2012 05:49:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q245nerb016714; Sun, 4 Mar 2012 05:49:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203040549.q245nerb016714@svn.freebsd.org> From: Adrian Chadd Date: Sun, 4 Mar 2012 05:49: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: r232479 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 05:49:40 -0000 Author: adrian Date: Sun Mar 4 05:49:39 2012 New Revision: 232479 URL: http://svn.freebsd.org/changeset/base/232479 Log: * Added IEEE80211_ACTION_CAT_MESH in ieee80211.h as specified amendment spec; * Moved old categories as specified by D4.0 to be action fields of MESH category as specified in amendment spec; * Modified functions to use MESH category and its action fields: + ieee80211_send_action_register + ieee80211_send_action + ieee80211_recv_action_register +ieee80211_recv_action; * Modified ieee80211_hwmp_init and hwmp_send_action so they uses correct action fields as specified in amendment spec; * Modified ieee80211_parse_action so that it verifies MESH frames. * Change Mesh Link Metric to use one information element as amendment spec. Draft 4.0 defined two different information elements for request and response. Submitted by: monthadar@gmail.com Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_action.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sun Mar 4 05:19:55 2012 (r232478) +++ head/sys/net80211/ieee80211.h Sun Mar 4 05:49:39 2012 (r232479) @@ -325,6 +325,7 @@ struct ieee80211_action { #define IEEE80211_ACTION_CAT_DLS 2 /* DLS */ #define IEEE80211_ACTION_CAT_BA 3 /* BA */ #define IEEE80211_ACTION_CAT_HT 7 /* HT */ +#define IEEE80211_ACTION_CAT_MESH 13 /* Mesh */ #define IEEE80211_ACTION_CAT_VENDOR 127 /* Vendor Specific */ #define IEEE80211_ACTION_HT_TXCHWIDTH 0 /* recommended xmit chan width*/ Modified: head/sys/net80211/ieee80211_action.c ============================================================================== --- head/sys/net80211/ieee80211_action.c Sun Mar 4 05:19:55 2012 (r232478) +++ head/sys/net80211/ieee80211_action.c Sun Mar 4 05:49:39 2012 (r232479) @@ -99,16 +99,20 @@ ieee80211_send_action_register(int cat, break; meshpl_send_action[act] = f; return 0; - case IEEE80211_ACTION_CAT_MESHLMETRIC: - if (act >= N(meshlm_send_action)) - break; - meshlm_send_action[act] = f; - return 0; - case IEEE80211_ACTION_CAT_MESHPATH: - if (act >= N(hwmp_send_action)) - break; - hwmp_send_action[act] = f; - return 0; + case IEEE80211_ACTION_CAT_MESH: + switch (act) { + case IEEE80211_ACTION_MESH_LMETRIC: + if (act >= N(meshlm_send_action)) + break; + meshlm_send_action[act] = f; + return 0; + case IEEE80211_ACTION_MESH_HWMP: + if (act >= N(hwmp_send_action)) + break; + hwmp_send_action[act] = f; + return 0; + } + break; case IEEE80211_ACTION_CAT_VENDOR: if (act >= N(vendor_send_action)) break; @@ -144,13 +148,17 @@ ieee80211_send_action(struct ieee80211_n if (act < N(meshpl_send_action)) f = meshpl_send_action[act]; break; - case IEEE80211_ACTION_CAT_MESHLMETRIC: - if (act < N(meshlm_send_action)) - f = meshlm_send_action[act]; - break; - case IEEE80211_ACTION_CAT_MESHPATH: - if (act < N(hwmp_send_action)) - f = hwmp_send_action[act]; + case IEEE80211_ACTION_CAT_MESH: + switch (act) { + case IEEE80211_ACTION_MESH_LMETRIC: + if (act < N(meshlm_send_action)) + f = meshlm_send_action[act]; + break; + case IEEE80211_ACTION_MESH_HWMP: + if (act < N(hwmp_send_action)) + f = hwmp_send_action[act]; + break; + } break; case IEEE80211_ACTION_CAT_VENDOR: if (act < N(vendor_send_action)) @@ -212,16 +220,20 @@ ieee80211_recv_action_register(int cat, break; meshpl_recv_action[act] = f; return 0; - case IEEE80211_ACTION_CAT_MESHLMETRIC: - if (act >= N(meshlm_recv_action)) - break; - meshlm_recv_action[act] = f; - return 0; - case IEEE80211_ACTION_CAT_MESHPATH: - if (act >= N(hwmp_recv_action)) - break; - hwmp_recv_action[act] = f; - return 0; + case IEEE80211_ACTION_CAT_MESH: + switch (act) { + case IEEE80211_ACTION_MESH_LMETRIC: + if (act >= N(meshlm_recv_action)) + break; + meshlm_recv_action[act] = f; + return 0; + case IEEE80211_ACTION_MESH_HWMP: + if (act >= N(hwmp_recv_action)) + break; + hwmp_recv_action[act] = f; + return 0; + } + break; case IEEE80211_ACTION_CAT_VENDOR: if (act >= N(vendor_recv_action)) break; @@ -261,13 +273,17 @@ ieee80211_recv_action(struct ieee80211_n if (ia->ia_action < N(meshpl_recv_action)) f = meshpl_recv_action[ia->ia_action]; break; - case IEEE80211_ACTION_CAT_MESHLMETRIC: - if (ia->ia_action < N(meshlm_recv_action)) - f = meshlm_recv_action[ia->ia_action]; - break; - case IEEE80211_ACTION_CAT_MESHPATH: - if (ia->ia_action < N(hwmp_recv_action)) - f = hwmp_recv_action[ia->ia_action]; + case IEEE80211_ACTION_CAT_MESH: + switch (ia->ia_action) { + case IEEE80211_ACTION_MESH_LMETRIC: + if (ia->ia_action < N(meshlm_recv_action)) + f = meshlm_recv_action[ia->ia_action]; + break; + case IEEE80211_ACTION_MESH_HWMP: + if (ia->ia_action < N(hwmp_recv_action)) + f = hwmp_recv_action[ia->ia_action]; + break; + } break; case IEEE80211_ACTION_CAT_VENDOR: if (ia->ia_action < N(vendor_recv_action)) Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Sun Mar 4 05:19:55 2012 (r232478) +++ head/sys/net80211/ieee80211_hwmp.c Sun Mar 4 05:49:39 2012 (r232479) @@ -220,8 +220,8 @@ ieee80211_hwmp_init(void) /* * Register action frame handler. */ - ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH, - IEEE80211_ACTION_MESHPATH_SEL, hwmp_recv_action_meshpath); + ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESH, + IEEE80211_ACTION_MESH_HWMP, hwmp_recv_action_meshpath); /* NB: default is 5 secs per spec */ mesh_proto_hwmp.mpp_inact = msecs_to_ticks(5*1000); @@ -434,8 +434,8 @@ hwmp_send_action(struct ieee80211_node * vap->iv_stats.is_tx_nobuf++; return ENOMEM; } - *frm++ = IEEE80211_ACTION_CAT_MESHPATH; - *frm++ = IEEE80211_ACTION_MESHPATH_SEL; + *frm++ = IEEE80211_ACTION_CAT_MESH; + *frm++ = IEEE80211_ACTION_MESH_HWMP; switch (*ie) { case IEEE80211_ELEMID_MESHPREQ: frm = hwmp_add_meshpreq(frm, Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Sun Mar 4 05:19:55 2012 (r232478) +++ head/sys/net80211/ieee80211_input.c Sun Mar 4 05:49:39 2012 (r232479) @@ -760,6 +760,37 @@ ieee80211_parse_action(struct ieee80211_ break; } break; + case IEEE80211_ACTION_CAT_MESH: + switch (ia->ia_action) { + case IEEE80211_ACTION_MESH_LMETRIC: + /* + * XXX: verification is true only if we are using + * Airtime link metric (default) + */ + IEEE80211_VERIFY_LENGTH(efrm - frm, + sizeof(struct ieee80211_meshlmetric_ie), + return EINVAL); + break; + case IEEE80211_ACTION_MESH_HWMP: + /* verify something */ + break; + case IEEE80211_ACTION_MESH_GANN: + case IEEE80211_ACTION_MESH_CC: + case IEEE80211_ACTION_MESH_MCCA_SREQ: + case IEEE80211_ACTION_MESH_MCCA_SREP: + case IEEE80211_ACTION_MESH_MCCA_AREQ: + case IEEE80211_ACTION_MESH_MCCA_ADVER: + case IEEE80211_ACTION_MESH_MCCA_TRDOWN: + case IEEE80211_ACTION_MESH_TBTT_REQ: + case IEEE80211_ACTION_MESH_TBTT_RES: + /* reject these early on, not implemented */ + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT, + wh, NULL, "not implemented yet, act=0x%02X", + ia->ia_action); + return EINVAL; + } + break; } return 0; } Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Sun Mar 4 05:19:55 2012 (r232478) +++ head/sys/net80211/ieee80211_mesh.c Sun Mar 4 05:49:39 2012 (r232479) @@ -122,14 +122,12 @@ static const uint8_t broadcastaddr[IEEE8 static ieee80211_recv_action_func mesh_recv_action_meshpeering_open; static ieee80211_recv_action_func mesh_recv_action_meshpeering_confirm; static ieee80211_recv_action_func mesh_recv_action_meshpeering_close; -static ieee80211_recv_action_func mesh_recv_action_meshlmetric_req; -static ieee80211_recv_action_func mesh_recv_action_meshlmetric_rep; +static ieee80211_recv_action_func mesh_recv_action_meshlmetric; static ieee80211_send_action_func mesh_send_action_meshpeering_open; static ieee80211_send_action_func mesh_send_action_meshpeering_confirm; static ieee80211_send_action_func mesh_send_action_meshpeering_close; -static ieee80211_send_action_func mesh_send_action_meshlink_request; -static ieee80211_send_action_func mesh_send_action_meshlink_reply; +static ieee80211_send_action_func mesh_send_action_meshlmetric; static const struct ieee80211_mesh_proto_metric mesh_metric_airtime = { .mpm_descr = "AIRTIME", @@ -437,10 +435,8 @@ ieee80211_mesh_init(void) ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPEERING, IEEE80211_ACTION_MESHPEERING_CLOSE, mesh_recv_action_meshpeering_close); - ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, - IEEE80211_ACTION_MESHLMETRIC_REQ, mesh_recv_action_meshlmetric_req); - ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, - IEEE80211_ACTION_MESHLMETRIC_REP, mesh_recv_action_meshlmetric_rep); + ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESH, + IEEE80211_ACTION_MESH_LMETRIC, mesh_recv_action_meshlmetric); ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, IEEE80211_ACTION_MESHPEERING_OPEN, @@ -451,12 +447,9 @@ ieee80211_mesh_init(void) ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, IEEE80211_ACTION_MESHPEERING_CLOSE, mesh_send_action_meshpeering_close); - ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, - IEEE80211_ACTION_MESHLMETRIC_REQ, - mesh_send_action_meshlink_request); - ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, - IEEE80211_ACTION_MESHLMETRIC_REP, - mesh_send_action_meshlink_reply); + ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESH, + IEEE80211_ACTION_MESH_LMETRIC, + mesh_send_action_meshlmetric); /* * Register Airtime Link Metric. @@ -1861,25 +1854,24 @@ mesh_recv_action_meshpeering_close(struc * Link Metric handling. */ static int -mesh_recv_action_meshlmetric_req(struct ieee80211_node *ni, - const struct ieee80211_frame *wh, - const uint8_t *frm, const uint8_t *efrm) -{ - uint32_t metric; - - metric = mesh_airtime_calc(ni); - ieee80211_send_action(ni, - IEEE80211_ACTION_CAT_MESHLMETRIC, - IEEE80211_ACTION_MESHLMETRIC_REP, - &metric); - return 0; -} - -static int -mesh_recv_action_meshlmetric_rep(struct ieee80211_node *ni, +mesh_recv_action_meshlmetric(struct ieee80211_node *ni, const struct ieee80211_frame *wh, const uint8_t *frm, const uint8_t *efrm) { + const struct ieee80211_meshlmetric_ie *ie = + (const struct ieee80211_meshlmetric_ie *) + (frm+2); /* action + code */ + struct ieee80211_meshlmetric_ie lm_rep; + + if (ie->lm_flags & IEEE80211_MESH_LMETRIC_FLAGS_REQ) { + lm_rep.lm_flags = 0; + lm_rep.lm_metric = mesh_airtime_calc(ni); + ieee80211_send_action(ni, + IEEE80211_ACTION_CAT_MESH, + IEEE80211_ACTION_MESH_LMETRIC, + &lm_rep); + } + /* XXX: else do nothing for now */ return 0; } @@ -2091,56 +2083,23 @@ mesh_send_action_meshpeering_close(struc } static int -mesh_send_action_meshlink_request(struct ieee80211_node *ni, +mesh_send_action_meshlmetric(struct ieee80211_node *ni, int category, int action, void *arg0) { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; + struct ieee80211_meshlmetric_ie *ie = arg0; struct mbuf *m; uint8_t *frm; - IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, - "%s", "send LINK METRIC REQUEST action"); - - IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, - "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", __func__, __LINE__, - ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); - ieee80211_ref_node(ni); - - m = ieee80211_getmgtframe(&frm, - ic->ic_headroom + sizeof(struct ieee80211_frame), - sizeof(uint16_t) /* action+category */ - ); - if (m != NULL) { - /* - * mesh link metric request - * [1] category - * [1] action - */ - *frm++ = category; - *frm++ = action; - m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - return mesh_send_action(ni, m); + if (ie->lm_flags & IEEE80211_MESH_LMETRIC_FLAGS_REQ) { + IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, + ni, "%s", "send LINK METRIC REQUEST action"); } else { - vap->iv_stats.is_tx_nobuf++; - ieee80211_free_node(ni); - return ENOMEM; + IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, + ni, "send LINK METRIC REPLY action: metric 0x%x", + ie->lm_metric); } -} - -static int -mesh_send_action_meshlink_reply(struct ieee80211_node *ni, - int category, int action, void *args0) -{ - struct ieee80211vap *vap = ni->ni_vap; - struct ieee80211com *ic = ni->ni_ic; - uint32_t *metric = args0; - struct mbuf *m; - uint8_t *frm; - - IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, - "send LINK METRIC REPLY action: metric 0x%x", *metric); - IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", __func__, __LINE__, ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); @@ -2148,19 +2107,20 @@ mesh_send_action_meshlink_reply(struct i m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), - sizeof(uint16_t) /* action+category */ - + sizeof(struct ieee80211_meshlmetric_ie) + sizeof(uint16_t) + /* action+category */ + sizeof(struct ieee80211_meshlmetric_ie) ); if (m != NULL) { /* - * mesh link metric reply + * mesh link metric * [1] category * [1] action * [tlv] mesh link metric */ *frm++ = category; *frm++ = action; - frm = ieee80211_add_meshlmetric(frm, *metric); + frm = ieee80211_add_meshlmetric(frm, + ie->lm_flags, ie->lm_metric); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); return mesh_send_action(ni, m); } else { @@ -2505,10 +2465,11 @@ mesh_airtime_calc(struct ieee80211_node * Add a Mesh Link Metric report IE to a frame. */ uint8_t * -ieee80211_add_meshlmetric(uint8_t *frm, uint32_t metric) +ieee80211_add_meshlmetric(uint8_t *frm, uint8_t flags, uint32_t metric) { *frm++ = IEEE80211_ELEMID_MESHLINK; - *frm++ = 4; + *frm++ = 5; + *frm++ = flags; ADDWORD(frm, metric); return frm; } Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Sun Mar 4 05:19:55 2012 (r232478) +++ head/sys/net80211/ieee80211_mesh.h Sun Mar 4 05:49:39 2012 (r232479) @@ -119,8 +119,14 @@ struct ieee80211_meshid_ie { /* Link Metric Report */ struct ieee80211_meshlmetric_ie { - uint8_t lm_ie; /* IEEE80211_ELEMID_MESHLINK */ + uint8_t lm_ie; /* IEEE80211_ACTION_MESH_LMETRIC */ uint8_t lm_len; + uint8_t lm_flags; +#define IEEE80211_MESH_LMETRIC_FLAGS_REQ 0x01 /* Request */ + /* + * XXX: this field should be variable in size and depend on + * the active active path selection metric identifier + */ uint32_t lm_metric; #define IEEE80211_MESHLMETRIC_INITIALVAL 0 } __packed; @@ -307,8 +313,7 @@ struct ieee80211_meshpuc_ie { * 802.11s Action Frames */ #define IEEE80211_ACTION_CAT_MESHPEERING 30 /* XXX Linux */ -#define IEEE80211_ACTION_CAT_MESHLMETRIC 13 -#define IEEE80211_ACTION_CAT_MESHPATH 32 /* XXX Linux */ +/* XXX: these need to be looked into */ #define IEEE80211_ACTION_CAT_INTERWORK 15 #define IEEE80211_ACTION_CAT_RESOURCE 16 #define IEEE80211_ACTION_CAT_PROXY 17 @@ -324,20 +329,21 @@ enum { }; /* - * Mesh Path Selection Action code. + * Mesh Action code. */ enum { - IEEE80211_ACTION_MESHPATH_SEL = 0, - /* 1-255 reserved */ -}; - -/* - * Mesh Link Metric Action codes. - */ -enum { - IEEE80211_ACTION_MESHLMETRIC_REQ = 0, /* Link Metric Request */ - IEEE80211_ACTION_MESHLMETRIC_REP = 1, /* Link Metric Report */ - /* 2-255 reserved */ + IEEE80211_ACTION_MESH_LMETRIC = 0, /* Mesh Link Metric Report */ + IEEE80211_ACTION_MESH_HWMP = 1, /* HWMP Mesh Path Selection */ + IEEE80211_ACTION_MESH_GANN = 2, /* Gate Announcement */ + IEEE80211_ACTION_MESH_CC = 3, /* Congestion Control */ + IEEE80211_ACTION_MESH_MCCA_SREQ = 4, /* MCCA Setup Request */ + IEEE80211_ACTION_MESH_MCCA_SREP = 5, /* MCCA Setup Reply */ + IEEE80211_ACTION_MESH_MCCA_AREQ = 6, /* MCCA Advertisement Req. */ + IEEE80211_ACTION_MESH_MCCA_ADVER =7, /* MCCA Advertisement */ + IEEE80211_ACTION_MESH_MCCA_TRDOWN = 8, /* MCCA Teardown */ + IEEE80211_ACTION_MESH_TBTT_REQ = 9, /* TBTT Adjustment Request */ + IEEE80211_ACTION_MESH_TBTT_RES = 10, /* TBTT Adjustment Response */ + /* 11-255 reserved */ }; /* @@ -496,7 +502,7 @@ uint8_t * ieee80211_add_meshid(uint8_t * uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshpeer(uint8_t *, uint8_t, uint16_t, uint16_t, uint16_t); -uint8_t * ieee80211_add_meshlmetric(uint8_t *, uint32_t); +uint8_t * ieee80211_add_meshlmetric(uint8_t *, uint8_t, uint32_t); void ieee80211_mesh_node_init(struct ieee80211vap *, struct ieee80211_node *); From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 05:52:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6CEA106564A; Sun, 4 Mar 2012 05:52:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 960778FC19; Sun, 4 Mar 2012 05:52: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 q245qR7d016847; Sun, 4 Mar 2012 05:52:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q245qRmA016843; Sun, 4 Mar 2012 05:52:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203040552.q245qRmA016843@svn.freebsd.org> From: Adrian Chadd Date: Sun, 4 Mar 2012 05:52: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: r232480 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 05:52:27 -0000 Author: adrian Date: Sun Mar 4 05:52:26 2012 New Revision: 232480 URL: http://svn.freebsd.org/changeset/base/232480 Log: * Introduce new flag for QoS control field; * Change in mesh_input to validate that QoS is set and Mesh Control field is present, also both bytes of the QoS are read; * Moved defragmentation in mesh_input before we try to forward packet as inferred from amendment spec, because Mesh Control field only present in first fragment; * Changed in ieee80211_encap to set QoS subtype and Mesh Control field present, only first fragment have Mesh Control field present bit equal to 1; Submitted by: monthadar@gmail.com Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sun Mar 4 05:49:39 2012 (r232479) +++ head/sys/net80211/ieee80211.h Sun Mar 4 05:52:26 2012 (r232480) @@ -199,6 +199,13 @@ struct ieee80211_qosframe_addr4 { #define IEEE80211_QOS_EOSP 0x10 /* EndOfService Period*/ #define IEEE80211_QOS_EOSP_S 4 #define IEEE80211_QOS_TID 0x0f +/* qos[1] byte used for all frames sent by mesh STAs in a mesh BSS */ +#define IEEE80211_QOS_MC 0x10 /* Mesh control */ +/* Mesh power save level*/ +#define IEEE80211_QOS_MESH_PSL 0x20 +/* Mesh Receiver Service Period Initiated */ +#define IEEE80211_QOS_RSPI 0x40 +/* bits 11 to 15 reserved */ /* does frame have QoS sequence control data */ #define IEEE80211_QOS_HAS_SEQ(wh) \ Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Sun Mar 4 05:49:39 2012 (r232479) +++ head/sys/net80211/ieee80211_mesh.c Sun Mar 4 05:52:26 2012 (r232480) @@ -1040,9 +1040,9 @@ mesh_input(struct ieee80211_node *ni, st struct ieee80211_frame *wh; const struct ieee80211_meshcntl *mc; int hdrspace, meshdrlen, need_tap; - uint8_t dir, type, subtype, qos; + uint8_t dir, type, subtype; uint32_t seq; - uint8_t *addr; + uint8_t *addr, qos[2]; ieee80211_seq rxseq; KASSERT(ni != NULL, ("null node")); @@ -1139,8 +1139,64 @@ mesh_input(struct ieee80211_node *ni, st vap->iv_stats.is_rx_wrongdir++; goto err; } - /* pull up enough to get to the mesh control */ + + /* All Mesh data frames are QoS subtype */ + if (!HAS_SEQ(type)) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, "data", "incorrect subtype 0x%x", subtype); + vap->iv_stats.is_rx_badsubtype++; + goto err; + } + + /* + * Next up, any fragmentation. + * XXX: we defrag before we even try to forward, + * Mesh Control field is not present in sub-sequent + * fragmented frames. This is in contrast to Draft 4.0. + */ hdrspace = ieee80211_hdrspace(ic, wh); + if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { + m = ieee80211_defrag(ni, m, hdrspace); + if (m == NULL) { + /* Fragment dropped or frame not complete yet */ + goto out; + } + } + wh = mtod(m, struct ieee80211_frame *); /* NB: after defrag */ + + /* + * Now we have a complete Mesh Data frame. + */ + + /* + * Only fromDStoDS data frames use 4 address qos frames + * as specified in amendment. Otherwise addr4 is located + * in the Mesh Control field and a 3 address qos frame + * is used. + */ + if (IEEE80211_IS_DSTODS(wh)) + *(uint16_t *)qos = *(uint16_t *) + ((struct ieee80211_qosframe_addr4 *)wh)->i_qos; + else + *(uint16_t *)qos = *(uint16_t *) + ((struct ieee80211_qosframe *)wh)->i_qos; + + /* + * NB: The mesh STA sets the Mesh Control Present + * subfield to 1 in the Mesh Data frame containing + * an unfragmented MSDU, an A-MSDU, or the first + * fragment of an MSDU. + * After defrag it should always be present. + */ + if (!(qos[1] & IEEE80211_QOS_MC)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_MESH, + ni->ni_macaddr, NULL, + "%s", "Mesh control field not present"); + vap->iv_stats.is_rx_elem_missing++; /* XXX: kinda */ + goto err; + } + + /* pull up enough to get to the mesh control */ if (m->m_len < hdrspace + sizeof(struct ieee80211_meshcntl) && (m = m_pullup(m, hdrspace + sizeof(struct ieee80211_meshcntl))) == NULL) { @@ -1188,27 +1244,6 @@ mesh_input(struct ieee80211_node *ni, st /* NB: fall thru to deliver mcast frames locally */ } - /* - * Save QoS bits for use below--before we strip the header. - */ - if (subtype == IEEE80211_FC0_SUBTYPE_QOS) { - qos = (dir == IEEE80211_FC1_DIR_DSTODS) ? - ((struct ieee80211_qosframe_addr4 *)wh)->i_qos[0] : - ((struct ieee80211_qosframe *)wh)->i_qos[0]; - } else - qos = 0; - /* - * Next up, any fragmentation. - */ - if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { - m = ieee80211_defrag(ni, m, hdrspace); - if (m == NULL) { - /* Fragment dropped or frame not complete yet */ - goto out; - } - } - wh = NULL; /* no longer valid, catch any uses */ - if (ieee80211_radiotap_active_vap(vap)) ieee80211_radiotap_rx(vap, m); need_tap = 0; @@ -1229,7 +1264,7 @@ mesh_input(struct ieee80211_node *ni, st IEEE80211_NODE_STAT(ni, rx_decap); goto err; } - if (qos & IEEE80211_QOS_AMSDU) { + if (qos[0] & IEEE80211_QOS_AMSDU) { m = ieee80211_decap_amsdu(ni, m); if (m == NULL) return IEEE80211_FC0_TYPE_DATA; Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Mar 4 05:49:39 2012 (r232479) +++ head/sys/net80211/ieee80211_output.c Sun Mar 4 05:52:26 2012 (r232480) @@ -1074,9 +1074,11 @@ ieee80211_encap(struct ieee80211vap *vap * ap's require all data frames to be QoS-encapsulated * once negotiated in which case we'll need to make this * configurable. + * NB: mesh data frames are QoS. */ - addqos = (ni->ni_flags & (IEEE80211_NODE_QOS|IEEE80211_NODE_HT)) && - (m->m_flags & M_EAPOL) == 0; + addqos = ((ni->ni_flags & (IEEE80211_NODE_QOS|IEEE80211_NODE_HT)) || + (vap->iv_opmode == IEEE80211_M_MBSS)) && + (m->m_flags & M_EAPOL) == 0; if (addqos) hdrsize = sizeof(struct ieee80211_qosframe); else @@ -1282,7 +1284,12 @@ ieee80211_encap(struct ieee80211vap *vap qos[0] = tid & IEEE80211_QOS_TID; if (ic->ic_wme.wme_wmeChanParams.cap_wmeParams[ac].wmep_noackPolicy) qos[0] |= IEEE80211_QOS_ACKPOLICY_NOACK; - qos[1] = 0; +#ifdef IEEE80211_SUPPORT_MESH + if (vap->iv_opmode == IEEE80211_M_MBSS) { + qos[1] |= IEEE80211_QOS_MC; + } else +#endif + qos[1] = 0; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_QOS; if ((m->m_flags & M_AMPDU_MPDU) == 0) { @@ -1407,9 +1414,20 @@ ieee80211_fragment(struct ieee80211vap * * we mark the first fragment with the MORE_FRAG bit * it automatically is propagated to each fragment; we * need only clear it on the last fragment (done below). + * NB: frag 1+ dont have Mesh Control field present. */ whf = mtod(m, struct ieee80211_frame *); memcpy(whf, wh, hdrsize); +#ifdef IEEE80211_SUPPORT_MESH + if (vap->iv_opmode == IEEE80211_M_MBSS) { + if (IEEE80211_IS_DSTODS(wh)) + ((struct ieee80211_qosframe_addr4 *) + whf)->i_qos[1] &= ~IEEE80211_QOS_MC; + else + ((struct ieee80211_qosframe *) + whf)->i_qos[1] &= ~IEEE80211_QOS_MC; + } +#endif *(uint16_t *)&whf->i_seq[0] |= htole16( (fragno & IEEE80211_SEQ_FRAG_MASK) << IEEE80211_SEQ_FRAG_SHIFT); From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 08:43:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0EB91065674; Sun, 4 Mar 2012 08:43:33 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E8518FC12; Sun, 4 Mar 2012 08:43: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 q248hXfa022389; Sun, 4 Mar 2012 08:43:33 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q248hXVf022387; Sun, 4 Mar 2012 08:43:33 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201203040843.q248hXVf022387@svn.freebsd.org> From: Andreas Tobler Date: Sun, 4 Mar 2012 08:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232482 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 08:43:33 -0000 Author: andreast Date: Sun Mar 4 08:43:33 2012 New Revision: 232482 URL: http://svn.freebsd.org/changeset/base/232482 Log: Add support for PWM controlled fans. I found these fans on my PowerMac9,1. These fans are not located under the same node as the the RPM controlled ones, So I had to adapt the current source to parse and fill the properties correctly. To control the fans we can set the PWM ratio via sysctl between 20 and 100%. Tested by: nwhitehorn MFC after: 3 weeks Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Sun Mar 4 07:29:35 2012 (r232481) +++ head/sys/powerpc/powermac/smu.c Sun Mar 4 08:43:33 2012 (r232482) @@ -74,8 +74,21 @@ struct smu_fan { device_t dev; cell_t reg; + enum { + SMU_FAN_RPM, + SMU_FAN_PWM + } type; int old_style; int setpoint; + int rpm; +}; + +/* We can read the PWM and the RPM from a PWM controlled fan. + * Offer both values via sysctl. + */ +enum { + SMU_PWM_SYSCTL_PWM = 1 << 8, + SMU_PWM_SYSCTL_RPM = 2 << 8 }; struct smu_sensor { @@ -205,6 +218,10 @@ static MALLOC_DEFINE(M_SMU, "smu", "SMU /* Command types */ #define SMU_ADC 0xd8 #define SMU_FAN 0x4a +#define SMU_RPM_STATUS 0x01 +#define SMU_RPM_SETPOINT 0x02 +#define SMU_PWM_STATUS 0x11 +#define SMU_PWM_SETPOINT 0x12 #define SMU_I2C 0x9a #define SMU_I2C_SIMPLE 0x00 #define SMU_I2C_NORMAL 0x01 @@ -303,19 +320,21 @@ smu_attach(device_t dev) EVENTHANDLER_REGISTER(cpufreq_post_change, smu_cpufreq_post_change, dev, EVENTHANDLER_PRI_ANY); + node = ofw_bus_get_node(dev); + + /* Some SMUs have RPM and PWM controlled fans which do not sit + * under the same node. So we have to attach them separately. + */ + smu_attach_fans(dev, node); + /* - * Detect and attach child devices. + * Now detect and attach the other child devices. */ - node = ofw_bus_get_node(dev); for (child = OF_child(node); child != 0; child = OF_peer(child)) { char name[32]; memset(name, 0, sizeof(name)); OF_getprop(child, "name", name, sizeof(name)); - if (strncmp(name, "rpm-fans", 9) == 0 || - strncmp(name, "fans", 5) == 0) - smu_attach_fans(dev, child); - if (strncmp(name, "sensors", 8) == 0) smu_attach_sensors(dev, child); @@ -660,7 +679,7 @@ smu_fan_set_rpm(struct smu_fan *fan, int cmd.data[1] = fan->reg; cmd.data[2] = (rpm >> 8) & 0xff; cmd.data[3] = rpm & 0xff; - + error = smu_run_cmd(smu, &cmd, 1); if (error && error != EWOULDBLOCK) fan->old_style = 1; @@ -668,7 +687,7 @@ smu_fan_set_rpm(struct smu_fan *fan, int if (fan->old_style) { cmd.len = 14; - cmd.data[0] = 0; + cmd.data[0] = 0x00; /* RPM fan. */ cmd.data[1] = 1 << fan->reg; cmd.data[2 + 2*fan->reg] = (rpm >> 8) & 0xff; cmd.data[3 + 2*fan->reg] = rpm & 0xff; @@ -704,7 +723,7 @@ smu_fan_read_rpm(struct smu_fan *fan) if (fan->old_style) { cmd.cmd = SMU_FAN; cmd.len = 1; - cmd.data[0] = 1; + cmd.data[0] = SMU_RPM_STATUS; error = smu_run_cmd(smu, &cmd, 1); if (error) @@ -715,6 +734,98 @@ smu_fan_read_rpm(struct smu_fan *fan) return (rpm); } +static int +smu_fan_set_pwm(struct smu_fan *fan, int pwm) +{ + device_t smu = fan->dev; + struct smu_cmd cmd; + int error; + + cmd.cmd = SMU_FAN; + error = EIO; + + /* Clamp to allowed range */ + pwm = max(fan->fan.min_rpm, pwm); + pwm = min(fan->fan.max_rpm, pwm); + + /* + * Apple has two fan control mechanisms. We can't distinguish + * them except by seeing if the new one fails. If the new one + * fails, use the old one. + */ + + if (!fan->old_style) { + cmd.len = 4; + cmd.data[0] = 0x30; + cmd.data[1] = fan->reg; + cmd.data[2] = (pwm >> 8) & 0xff; + cmd.data[3] = pwm & 0xff; + + error = smu_run_cmd(smu, &cmd, 1); + if (error && error != EWOULDBLOCK) + fan->old_style = 1; + } + + if (fan->old_style) { + cmd.len = 14; + cmd.data[0] = 0x10; /* PWM fan. */ + cmd.data[1] = 1 << fan->reg; + cmd.data[2 + 2*fan->reg] = (pwm >> 8) & 0xff; + cmd.data[3 + 2*fan->reg] = pwm & 0xff; + error = smu_run_cmd(smu, &cmd, 1); + } + + if (error == 0) + fan->setpoint = pwm; + + return (error); +} + +static int +smu_fan_read_pwm(struct smu_fan *fan, int *pwm, int *rpm) +{ + device_t smu = fan->dev; + struct smu_cmd cmd; + int error; + + if (!fan->old_style) { + cmd.cmd = SMU_FAN; + cmd.len = 2; + cmd.data[0] = 0x31; + cmd.data[1] = fan->reg; + + error = smu_run_cmd(smu, &cmd, 1); + if (error && error != EWOULDBLOCK) + fan->old_style = 1; + + *rpm = (cmd.data[0] << 8) | cmd.data[1]; + } + + if (fan->old_style) { + cmd.cmd = SMU_FAN; + cmd.len = 1; + cmd.data[0] = SMU_PWM_STATUS; + + error = smu_run_cmd(smu, &cmd, 1); + if (error) + return (error); + + *rpm = (cmd.data[fan->reg*2+1] << 8) | cmd.data[fan->reg*2+2]; + } + if (fan->old_style) { + cmd.cmd = SMU_FAN; + cmd.len = 14; + cmd.data[0] = SMU_PWM_SETPOINT; + cmd.data[1] = 1 << fan->reg; + + error = smu_run_cmd(smu, &cmd, 1); + if (error) + return (error); + + *pwm = cmd.data[fan->reg*2+2]; + } + return (0); +} static int smu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) @@ -722,24 +833,127 @@ smu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) device_t smu; struct smu_softc *sc; struct smu_fan *fan; - int rpm, error; + int pwm = 0, rpm, error = 0; smu = arg1; sc = device_get_softc(smu); - fan = &sc->sc_fans[arg2]; + fan = &sc->sc_fans[arg2 & 0xff]; - rpm = smu_fan_read_rpm(fan); - if (rpm < 0) - return (rpm); + if (fan->type == SMU_FAN_RPM) { + rpm = smu_fan_read_rpm(fan); + if (rpm < 0) + return (rpm); - error = sysctl_handle_int(oidp, &rpm, 0, req); + error = sysctl_handle_int(oidp, &rpm, 0, req); + } else { + error = smu_fan_read_pwm(fan, &pwm, &rpm); + if (error < 0) + return (EIO); + + switch (arg2 & 0xff00) { + case SMU_PWM_SYSCTL_PWM: + error = sysctl_handle_int(oidp, &pwm, 0, req); + break; + case SMU_PWM_SYSCTL_RPM: + error = sysctl_handle_int(oidp, &rpm, 0, req); + break; + default: + /* This should never happen */ + return (EINVAL); + }; + } + /* We can only read the RPM from a PWM controlled fan, so return. */ + if ((arg2 & 0xff00) == SMU_PWM_SYSCTL_RPM) + return (0); if (error || !req->newptr) return (error); sc->sc_lastuserchange = time_uptime; - return (smu_fan_set_rpm(fan, rpm)); + if (fan->type == SMU_FAN_RPM) + return (smu_fan_set_rpm(fan, rpm)); + else + return (smu_fan_set_pwm(fan, pwm)); +} + +static void +smu_fill_fan_prop(device_t dev, phandle_t child, int id) +{ + struct smu_fan *fan; + struct smu_softc *sc; + char type[32]; + + sc = device_get_softc(dev); + fan = &sc->sc_fans[id]; + + OF_getprop(child, "device_type", type, sizeof(type)); + /* We have either RPM or PWM controlled fans. */ + if (strcmp(type, "fan-rpm-control") == 0) + fan->type = SMU_FAN_RPM; + else + fan->type = SMU_FAN_PWM; + + fan->dev = dev; + fan->old_style = 0; + OF_getprop(child, "reg", &fan->reg, + sizeof(cell_t)); + OF_getprop(child, "min-value", &fan->fan.min_rpm, + sizeof(int)); + OF_getprop(child, "max-value", &fan->fan.max_rpm, + sizeof(int)); + OF_getprop(child, "zone", &fan->fan.zone, + sizeof(int)); + + if (OF_getprop(child, "unmanaged-value", + &fan->fan.default_rpm, + sizeof(int)) != sizeof(int)) + fan->fan.default_rpm = fan->fan.max_rpm; + + OF_getprop(child, "location", fan->fan.name, + sizeof(fan->fan.name)); + + if (fan->type == SMU_FAN_RPM) + fan->setpoint = smu_fan_read_rpm(fan); + else + smu_fan_read_pwm(fan, &fan->setpoint, &fan->rpm); +} + +/* On the first call count the number of fans. In the second call, + * after allocating the fan struct, fill the properties of the fans. + */ +static int +smu_count_fans(device_t dev) +{ + struct smu_softc *sc; + phandle_t child, node, root; + int nfans = 0; + + node = ofw_bus_get_node(dev); + sc = device_get_softc(dev); + + /* First find the fanroots and count the number of fans. */ + for (root = OF_child(node); root != 0; root = OF_peer(root)) { + char name[32]; + memset(name, 0, sizeof(name)); + OF_getprop(root, "name", name, sizeof(name)); + if (strncmp(name, "rpm-fans", 9) == 0 || + strncmp(name, "pwm-fans", 9) == 0 || + strncmp(name, "fans", 5) == 0) + for (child = OF_child(root); child != 0; + child = OF_peer(child)) { + nfans++; + /* When allocated, fill the fan properties. */ + if (sc->sc_fans != NULL) + smu_fill_fan_prop(dev, child, + nfans - 1); + } + } + if (nfans == 0) { + device_printf(dev, "WARNING: No fans detected!\n"); + return (0); + } + return (nfans); } static void @@ -749,79 +963,92 @@ smu_attach_fans(device_t dev, phandle_t struct smu_softc *sc; struct sysctl_oid *oid, *fanroot_oid; struct sysctl_ctx_list *ctx; - phandle_t child; - char type[32], sysctl_name[32]; - int i; + char sysctl_name[32]; + int i, j; sc = device_get_softc(dev); - sc->sc_nfans = 0; - for (child = OF_child(fanroot); child != 0; child = OF_peer(child)) - sc->sc_nfans++; - - if (sc->sc_nfans == 0) { - device_printf(dev, "WARNING: No fans detected!\n"); + /* Get the number of fans. */ + sc->sc_nfans = smu_count_fans(dev); + if (sc->sc_nfans == 0) return; - } + /* Now we're able to allocate memory for the fans struct. */ sc->sc_fans = malloc(sc->sc_nfans * sizeof(struct smu_fan), M_SMU, M_WAITOK | M_ZERO); - fan = sc->sc_fans; - sc->sc_nfans = 0; + /* Now fill in the properties. */ + smu_count_fans(dev); + + /* Register fans with pmac_thermal */ + for (i = 0; i < sc->sc_nfans; i++) + pmac_thermal_fan_register(&sc->sc_fans[i].fan); ctx = device_get_sysctl_ctx(dev); fanroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fans", CTLFLAG_RD, 0, "SMU Fan Information"); - for (child = OF_child(fanroot); child != 0; child = OF_peer(child)) { - OF_getprop(child, "device_type", type, sizeof(type)); - if (strcmp(type, "fan-rpm-control") != 0) - continue; + /* Add sysctls */ + for (i = 0; i < sc->sc_nfans; i++) { + fan = &sc->sc_fans[i]; + for (j = 0; j < strlen(fan->fan.name); j++) { + sysctl_name[j] = tolower(fan->fan.name[j]); + if (isspace(sysctl_name[j])) + sysctl_name[j] = '_'; + } + sysctl_name[j] = 0; + if (fan->type == SMU_FAN_RPM) { + oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(fanroot_oid), + OID_AUTO, sysctl_name, + CTLFLAG_RD, 0, "Fan Information"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "minrpm", CTLTYPE_INT | CTLFLAG_RD, + &fan->fan.min_rpm, sizeof(int), + "Minimum allowed RPM"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "maxrpm", CTLTYPE_INT | CTLFLAG_RD, + &fan->fan.max_rpm, sizeof(int), + "Maximum allowed RPM"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rpm",CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_MPSAFE, dev, i, + smu_fanrpm_sysctl, "I", "Fan RPM"); - fan->dev = dev; - fan->old_style = 0; - OF_getprop(child, "reg", &fan->reg, sizeof(cell_t)); - OF_getprop(child, "min-value", &fan->fan.min_rpm, sizeof(int)); - OF_getprop(child, "max-value", &fan->fan.max_rpm, sizeof(int)); - OF_getprop(child, "zone", &fan->fan.zone, sizeof(int)); - - if (OF_getprop(child, "unmanaged-value", &fan->fan.default_rpm, - sizeof(int)) != sizeof(int)) - fan->fan.default_rpm = fan->fan.max_rpm; + fan->fan.read = (int (*)(struct pmac_fan *))smu_fan_read_rpm; + fan->fan.set = (int (*)(struct pmac_fan *, int))smu_fan_set_rpm; - fan->setpoint = smu_fan_read_rpm(fan); + } else { + oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(fanroot_oid), + OID_AUTO, sysctl_name, + CTLFLAG_RD, 0, "Fan Information"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "minpwm", CTLTYPE_INT | CTLFLAG_RD, + &fan->fan.min_rpm, sizeof(int), + "Minimum allowed PWM in %"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "maxpwm", CTLTYPE_INT | CTLFLAG_RD, + &fan->fan.max_rpm, sizeof(int), + "Maximum allowed PWM in %"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "pwm",CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_MPSAFE, dev, + SMU_PWM_SYSCTL_PWM | i, + smu_fanrpm_sysctl, "I", "Fan PWM in %"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rpm",CTLTYPE_INT | CTLFLAG_RD | + CTLFLAG_MPSAFE, dev, + SMU_PWM_SYSCTL_RPM | i, + smu_fanrpm_sysctl, "I", "Fan RPM"); + fan->fan.read = NULL; + fan->fan.set = (int (*)(struct pmac_fan *, int))smu_fan_set_pwm; - OF_getprop(child, "location", fan->fan.name, - sizeof(fan->fan.name)); - - /* Add sysctls */ - for (i = 0; i < strlen(fan->fan.name); i++) { - sysctl_name[i] = tolower(fan->fan.name[i]); - if (isspace(sysctl_name[i])) - sysctl_name[i] = '_'; } - sysctl_name[i] = 0; - - oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid), - OID_AUTO, sysctl_name, CTLFLAG_RD, 0, "Fan Information"); - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "minrpm", - CTLTYPE_INT | CTLFLAG_RD, &fan->fan.min_rpm, sizeof(int), - "Minimum allowed RPM"); - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "maxrpm", - CTLTYPE_INT | CTLFLAG_RD, &fan->fan.max_rpm, sizeof(int), - "Maximum allowed RPM"); - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "rpm", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, - sc->sc_nfans, smu_fanrpm_sysctl, "I", "Fan RPM"); - - fan->fan.read = (int (*)(struct pmac_fan *))smu_fan_read_rpm; - fan->fan.set = (int (*)(struct pmac_fan *, int))smu_fan_set_rpm; - pmac_thermal_fan_register(&fan->fan); - - fan++; - sc->sc_nfans++; + if (bootverbose) + device_printf(dev, "Fan: %s type: %d\n", + fan->fan.name, fan->type); } } From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 09:38:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99C911065670; Sun, 4 Mar 2012 09:38:20 +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 6F2FD8FC08; Sun, 4 Mar 2012 09:38: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 q249cKui024118; Sun, 4 Mar 2012 09:38:20 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q249cKce024114; Sun, 4 Mar 2012 09:38:20 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201203040938.q249cKce024114@svn.freebsd.org> From: Kevin Lo Date: Sun, 4 Mar 2012 09:38: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: r232483 - in head/sys/fs: hpfs msdosfs ntfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 09:38:20 -0000 Author: kevlo Date: Sun Mar 4 09:38:20 2012 New Revision: 232483 URL: http://svn.freebsd.org/changeset/base/232483 Log: Clean up style(9) nits Modified: head/sys/fs/hpfs/hpfs_vfsops.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/ntfs/ntfs_vfsops.c Modified: head/sys/fs/hpfs/hpfs_vfsops.c ============================================================================== --- head/sys/fs/hpfs/hpfs_vfsops.c Sun Mar 4 08:43:33 2012 (r232482) +++ head/sys/fs/hpfs/hpfs_vfsops.c Sun Mar 4 09:38:20 2012 (r232483) @@ -283,11 +283,11 @@ hpfs_mountfs(devvp, mp, td) hpmp->hpm_devvp = devvp; hpmp->hpm_dev = devvp->v_rdev; hpmp->hpm_mp = mp; - if (1 == vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v) == 1) hpmp->hpm_uid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v) == 1) hpmp->hpm_gid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "mode", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "mode", "%d", &v) == 1) hpmp->hpm_mode = v; error = hpfs_bminit(hpmp); Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Sun Mar 4 08:43:33 2012 (r232482) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Sun Mar 4 09:38:20 2012 (r232483) @@ -149,13 +149,13 @@ update_mp(struct mount *mp, struct threa } } - if (1 == vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v) == 1) pmp->pm_gid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v) == 1) pmp->pm_uid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "mask", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "mask", "%d", &v) == 1) pmp->pm_mask = v & ALLPERMS; - if (1 == vfs_scanopt(mp->mnt_optnew, "dirmask", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "dirmask", "%d", &v) == 1) pmp->pm_dirmask = v & ALLPERMS; vfs_flagopt(mp->mnt_optnew, "shortname", &pmp->pm_flags, MSDOSFSMNT_SHORTNAME); Modified: head/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vfsops.c Sun Mar 4 08:43:33 2012 (r232482) +++ head/sys/fs/ntfs/ntfs_vfsops.c Sun Mar 4 09:38:20 2012 (r232483) @@ -345,11 +345,11 @@ ntfs_mountfs(devvp, mp, td) ntmp->ntm_mountp = mp; ntmp->ntm_devvp = devvp; - if (1 == vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "uid", "%d", &v) == 1) ntmp->ntm_uid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "gid", "%d", &v) == 1) ntmp->ntm_gid = v; - if (1 == vfs_scanopt(mp->mnt_optnew, "mode", "%d", &v)) + if (vfs_scanopt(mp->mnt_optnew, "mode", "%d", &v) == 1) ntmp->ntm_mode = v & ACCESSPERMS; vfs_flagopt(mp->mnt_optnew, "caseins", &ntmp->ntm_flag, NTFS_MFLAG_CASEINS); From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 09:45:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1DF31065670; Sun, 4 Mar 2012 09:45:43 +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 B13DB8FC0A; Sun, 4 Mar 2012 09:45: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 q249jhIP024382; Sun, 4 Mar 2012 09:45:43 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q249jhWi024380; Sun, 4 Mar 2012 09:45:43 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203040945.q249jhWi024380@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 4 Mar 2012 09:45: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: r232484 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 09:45:43 -0000 Author: glebius Date: Sun Mar 4 09:45:43 2012 New Revision: 232484 URL: http://svn.freebsd.org/changeset/base/232484 Log: Fix build w/o 'options IEEE80211_SUPPORT_MESH'. Modified: head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Sun Mar 4 09:38:20 2012 (r232483) +++ head/sys/net80211/ieee80211_input.c Sun Mar 4 09:45:43 2012 (r232484) @@ -760,6 +760,7 @@ ieee80211_parse_action(struct ieee80211_ break; } break; +#ifdef IEEE80211_SUPPORT_MESH case IEEE80211_ACTION_CAT_MESH: switch (ia->ia_action) { case IEEE80211_ACTION_MESH_LMETRIC: @@ -791,6 +792,7 @@ ieee80211_parse_action(struct ieee80211_ return EINVAL; } break; +#endif } return 0; } From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 09:48:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F11DF106566B; Sun, 4 Mar 2012 09:48:58 +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 CF7EB8FC08; Sun, 4 Mar 2012 09:48: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 q249mweg024507; Sun, 4 Mar 2012 09:48:58 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q249mwIp024505; Sun, 4 Mar 2012 09:48:58 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201203040948.q249mwIp024505@svn.freebsd.org> From: Kevin Lo Date: Sun, 4 Mar 2012 09:48: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: r232485 - head/sys/fs/cd9660 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 09:48:59 -0000 Author: kevlo Date: Sun Mar 4 09:48:58 2012 New Revision: 232485 URL: http://svn.freebsd.org/changeset/base/232485 Log: Remove unnecessary casts Modified: head/sys/fs/cd9660/cd9660_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Sun Mar 4 09:45:43 2012 (r232484) +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun Mar 4 09:48:58 2012 (r232485) @@ -484,7 +484,7 @@ out: PICKUP_GIANT(); } if (isomp) { - free((caddr_t)isomp, M_ISOFSMNT); + free(isomp, M_ISOFSMNT); mp->mnt_data = NULL; } dev_rel(dev); @@ -522,7 +522,7 @@ cd9660_unmount(mp, mntflags) PICKUP_GIANT(); vrele(isomp->im_devvp); dev_rel(isomp->im_dev); - free((caddr_t)isomp, M_ISOFSMNT); + free(isomp, M_ISOFSMNT); mp->mnt_data = NULL; MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 11:11:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0089E1065673; Sun, 4 Mar 2012 11:11:04 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45128FC12; Sun, 4 Mar 2012 11: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 q24BB3tk032099; Sun, 4 Mar 2012 11:11:03 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24BB3pe032097; Sun, 4 Mar 2012 11:11:03 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201203041111.q24BB3pe032097@svn.freebsd.org> From: Marko Zec Date: Sun, 4 Mar 2012 11: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: r232487 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 11:11:04 -0000 Author: zec Date: Sun Mar 4 11:11:03 2012 New Revision: 232487 URL: http://svn.freebsd.org/changeset/base/232487 Log: Properly restore curvnet context when returning early from ether_input_internal(). This change only affects options VIMAGE kernel builds. PR: kern/165643 Submitted by: Vijay Singh MFC after: 3 days Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sun Mar 4 10:37:26 2012 (r232486) +++ head/sys/net/if_ethersubr.c Sun Mar 4 11:11:03 2012 (r232487) @@ -661,8 +661,10 @@ ether_input_internal(struct ifnet *ifp, m = (*lagg_input_p)(ifp, m); if (m != NULL) ifp = m->m_pkthdr.rcvif; - else + else { + CURVNET_RESTORE(); return; + } } /* @@ -681,6 +683,7 @@ ether_input_internal(struct ifnet *ifp, #endif ifp->if_ierrors++; m_freem(m); + CURVNET_RESTORE(); return; } From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 11:55:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39A41106564A; Sun, 4 Mar 2012 11:55:29 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F29B8FC16; Sun, 4 Mar 2012 11:55: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 q24BtSt0033449; Sun, 4 Mar 2012 11:55:28 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24BtSZn033447; Sun, 4 Mar 2012 11:55:28 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201203041155.q24BtSZn033447@svn.freebsd.org> From: Andreas Tobler Date: Sun, 4 Mar 2012 11:55: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: r232488 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 11:55:29 -0000 Author: andreast Date: Sun Mar 4 11:55:28 2012 New Revision: 232488 URL: http://svn.freebsd.org/changeset/base/232488 Log: Restore proper dot symbol creation for assembly files in the kernel build case. Without this patch we were not able to see the assembly function. Only the function descriptor was visible. - Distinguish between user-land and kernel when creating the ENTRY() point of assembly source. - Make the ENTRY() macro more readable, replace the .align directive with the gas platform independant .p2align directive. - Create an END()macro for later use to provide traceback tables on powerpc64. Modified: head/sys/powerpc/include/asm.h Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Sun Mar 4 11:11:03 2012 (r232487) +++ head/sys/powerpc/include/asm.h Sun Mar 4 11:55:28 2012 (r232488) @@ -61,19 +61,51 @@ #define HIDENAME(asmsym) __CONCAT(.,asmsym) #endif -#define _GLOBAL(x) \ - .data; .align 2; .globl x; x: - -#ifdef __powerpc64__ -#define _ENTRY(x) \ - .text; .align 2; .globl x; .section ".opd","aw"; \ - .align 3; x: \ - .quad .L.x,.TOC.@tocbase,0; .size x,24; .previous; \ - .align 4; .type x,@function; .L.x: -#else -#define _ENTRY(x) \ - .text; .align 4; .globl x; .type x,@function; x: -#endif +#ifdef _KERNEL +#define DOT_LABEL(name) __CONCAT(.,name) +#define TYPE_ENTRY(name) .size name,24; \ + .type DOT_LABEL(name),@function; \ + .globl DOT_LABEL(name); +#define END_SIZE(name) .size DOT_LABEL(name),.-DOT_LABEL(name); +#else /* !_KERNEL */ +#define DOT_LABEL(name) __CONCAT(.L.,name) +#define TYPE_ENTRY(name) .type name,@function; +#define END_SIZE(name) .size name,.-DOT_LABEL(name); +#endif /* _KERNEL */ + +#define _GLOBAL(name) \ + .data; \ + .p2align 2; \ + .globl name; \ + name: + +#ifdef __powerpc64__ +#define _ENTRY(name) \ + .section ".text"; \ + .p2align 2; \ + .globl name; \ + .section ".opd","aw"; \ + .p2align 3; \ + name: \ + .quad DOT_LABEL(name),.TOC.@tocbase,0; \ + .previous; \ + .p2align 4; \ + TYPE_ENTRY(name) \ +DOT_LABEL(name): + +#define _END(name) \ + .long 0; \ + .byte 0,0,0,0,0,0,0,0; \ + END_SIZE(name) +#else /* !__powerpc64__ */ +#define _ENTRY(name) \ + .text; \ + .p2align 4; \ + .globl name; \ + .type name,@function; \ + name: +#define _END(name) +#endif /* __powerpc64__ */ #if defined(PROF) || (defined(_KERNEL) && defined(GPROF)) # ifdef __powerpc64__ @@ -99,6 +131,7 @@ #endif #define ASENTRY(y) _ENTRY(ASMNAME(y)); _PROF_PROLOGUE +#define END(y) _END(CNAME(y)) #define ENTRY(y) _ENTRY(CNAME(y)); _PROF_PROLOGUE #define GLOBAL(y) _GLOBAL(CNAME(y)) From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 14:00:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EED9106564A; Sun, 4 Mar 2012 14:00:33 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5908FC0A; Sun, 4 Mar 2012 14:00: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 q24E0Wvx037403; Sun, 4 Mar 2012 14:00:32 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24E0WcS037398; Sun, 4 Mar 2012 14:00:32 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203041400.q24E0WcS037398@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 4 Mar 2012 14:00: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: r232491 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 14:00:33 -0000 Author: tijl Date: Sun Mar 4 14:00:32 2012 New Revision: 232491 URL: http://svn.freebsd.org/changeset/base/232491 Log: Copy amd64 float.h to x86 and merge with i386 float.h. Replace amd64/i386/pc98 float.h with stubs. Added: head/sys/x86/include/float.h - copied, changed from r232490, head/sys/amd64/include/float.h Modified: head/sys/amd64/include/float.h head/sys/i386/include/float.h head/sys/pc98/include/float.h Modified: head/sys/amd64/include/float.h ============================================================================== --- head/sys/amd64/include/float.h Sun Mar 4 12:52:48 2012 (r232490) +++ head/sys/amd64/include/float.h Sun Mar 4 14:00:32 2012 (r232491) @@ -1,94 +1,6 @@ /*- - * Copyright (c) 1989 Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)float.h 7.1 (Berkeley) 5/8/90 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_FLOAT_H_ -#define _MACHINE_FLOAT_H_ 1 - -#include - -__BEGIN_DECLS -extern int __flt_rounds(void); -__END_DECLS - -#define FLT_RADIX 2 /* b */ -#define FLT_ROUNDS __flt_rounds() -#if __ISO_C_VISIBLE >= 1999 -#define FLT_EVAL_METHOD 0 /* no promotions */ -#define DECIMAL_DIG 21 /* max precision in decimal digits */ -#endif - -#define FLT_MANT_DIG 24 /* p */ -#define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ -#define FLT_DIG 6 /* floor((p-1)*log10(b))+(b == 10) */ -#define FLT_MIN_EXP (-125) /* emin */ -#define FLT_MIN 1.17549435E-38F /* b**(emin-1) */ -#define FLT_MIN_10_EXP (-37) /* ceil(log10(b**(emin-1))) */ -#define FLT_MAX_EXP 128 /* emax */ -#define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ -#define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ -#if __ISO_C_VISIBLE >= 2011 -#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ -#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ -#define FLT_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#define DBL_MANT_DIG 53 -#define DBL_EPSILON 2.2204460492503131E-16 -#define DBL_DIG 15 -#define DBL_MIN_EXP (-1021) -#define DBL_MIN 2.2250738585072014E-308 -#define DBL_MIN_10_EXP (-307) -#define DBL_MAX_EXP 1024 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MAX_10_EXP 308 -#if __ISO_C_VISIBLE >= 2011 -#define DBL_TRUE_MIN 4.9406564584124654E-324 -#define DBL_DECIMAL_DIG 17 -#define DBL_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#define LDBL_MANT_DIG 64 -#define LDBL_EPSILON 1.0842021724855044340E-19L -#define LDBL_DIG 18 -#define LDBL_MIN_EXP (-16381) -#define LDBL_MIN 3.3621031431120935063E-4932L -#define LDBL_MIN_10_EXP (-4931) -#define LDBL_MAX_EXP 16384 -#define LDBL_MAX 1.1897314953572317650E+4932L -#define LDBL_MAX_10_EXP 4932 -#if __ISO_C_VISIBLE >= 2011 -#define LDBL_TRUE_MIN 3.6451995318824746025E-4951L -#define LDBL_DECIMAL_DIG 21 -#define LDBL_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#endif /* _MACHINE_FLOAT_H_ */ +#include Modified: head/sys/i386/include/float.h ============================================================================== --- head/sys/i386/include/float.h Sun Mar 4 12:52:48 2012 (r232490) +++ head/sys/i386/include/float.h Sun Mar 4 14:00:32 2012 (r232491) @@ -1,94 +1,6 @@ /*- - * Copyright (c) 1989 Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)float.h 7.1 (Berkeley) 5/8/90 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_FLOAT_H_ -#define _MACHINE_FLOAT_H_ 1 - -#include - -__BEGIN_DECLS -extern int __flt_rounds(void); -__END_DECLS - -#define FLT_RADIX 2 /* b */ -#define FLT_ROUNDS __flt_rounds() -#if __ISO_C_VISIBLE >= 1999 -#define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */ -#define DECIMAL_DIG 21 /* max precision in decimal digits */ -#endif - -#define FLT_MANT_DIG 24 /* p */ -#define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ -#define FLT_DIG 6 /* floor((p-1)*log10(b))+(b == 10) */ -#define FLT_MIN_EXP (-125) /* emin */ -#define FLT_MIN 1.17549435E-38F /* b**(emin-1) */ -#define FLT_MIN_10_EXP (-37) /* ceil(log10(b**(emin-1))) */ -#define FLT_MAX_EXP 128 /* emax */ -#define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ -#define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ -#if __ISO_C_VISIBLE >= 2011 -#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ -#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ -#define FLT_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#define DBL_MANT_DIG 53 -#define DBL_EPSILON 2.2204460492503131E-16 -#define DBL_DIG 15 -#define DBL_MIN_EXP (-1021) -#define DBL_MIN 2.2250738585072014E-308 -#define DBL_MIN_10_EXP (-307) -#define DBL_MAX_EXP 1024 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MAX_10_EXP 308 -#if __ISO_C_VISIBLE >= 2011 -#define DBL_TRUE_MIN 4.9406564584124654E-324 -#define DBL_DECIMAL_DIG 17 -#define DBL_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#define LDBL_MANT_DIG 64 -#define LDBL_EPSILON 1.0842021724855044340E-19L -#define LDBL_DIG 18 -#define LDBL_MIN_EXP (-16381) -#define LDBL_MIN 3.3621031431120935063E-4932L -#define LDBL_MIN_10_EXP (-4931) -#define LDBL_MAX_EXP 16384 -#define LDBL_MAX 1.1897314953572317650E+4932L -#define LDBL_MAX_10_EXP 4932 -#if __ISO_C_VISIBLE >= 2011 -#define LDBL_TRUE_MIN 3.6451995318824746025E-4951L -#define LDBL_DECIMAL_DIG 21 -#define LDBL_HAS_SUBNORM 1 -#endif /* __ISO_C_VISIBLE >= 2011 */ - -#endif /* _MACHINE_FLOAT_H_ */ +#include Modified: head/sys/pc98/include/float.h ============================================================================== --- head/sys/pc98/include/float.h Sun Mar 4 12:52:48 2012 (r232490) +++ head/sys/pc98/include/float.h Sun Mar 4 14:00:32 2012 (r232491) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied and modified: head/sys/x86/include/float.h (from r232490, head/sys/amd64/include/float.h) ============================================================================== --- head/sys/amd64/include/float.h Sun Mar 4 12:52:48 2012 (r232490, copy source) +++ head/sys/x86/include/float.h Sun Mar 4 14:00:32 2012 (r232491) @@ -42,7 +42,11 @@ __END_DECLS #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS __flt_rounds() #if __ISO_C_VISIBLE >= 1999 +#ifdef _LP64 #define FLT_EVAL_METHOD 0 /* no promotions */ +#else +#define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */ +#endif #define DECIMAL_DIG 21 /* max precision in decimal digits */ #endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 14:12:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7269A1065674; Sun, 4 Mar 2012 14:12:58 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56C508FC12; Sun, 4 Mar 2012 14:12: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 q24ECwtA037819; Sun, 4 Mar 2012 14:12:58 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24ECw3v037814; Sun, 4 Mar 2012 14:12:58 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203041412.q24ECw3v037814@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 4 Mar 2012 14:12: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: r232492 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 14:12:58 -0000 Author: tijl Date: Sun Mar 4 14:12:57 2012 New Revision: 232492 URL: http://svn.freebsd.org/changeset/base/232492 Log: Copy amd64 trap.h to x86 and replace amd64/i386/pc98 trap.h with stubs. Added: head/sys/x86/include/trap.h - copied unchanged from r232490, head/sys/amd64/include/trap.h Modified: head/sys/amd64/include/trap.h head/sys/i386/include/trap.h head/sys/pc98/include/trap.h Modified: head/sys/amd64/include/trap.h ============================================================================== --- head/sys/amd64/include/trap.h Sun Mar 4 14:00:32 2012 (r232491) +++ head/sys/amd64/include/trap.h Sun Mar 4 14:12:57 2012 (r232492) @@ -1,95 +1,6 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)trap.h 5.4 (Berkeley) 5/9/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_TRAP_H_ -#define _MACHINE_TRAP_H_ - -/* - * Trap type values - * also known in trap.c for name strings - */ - -#define T_PRIVINFLT 1 /* privileged instruction */ -#define T_BPTFLT 3 /* breakpoint instruction */ -#define T_ARITHTRAP 6 /* arithmetic trap */ -#define T_PROTFLT 9 /* protection fault */ -#define T_TRCTRAP 10 /* debug exception (sic) */ -#define T_PAGEFLT 12 /* page fault */ -#define T_ALIGNFLT 14 /* alignment fault */ - -#define T_DIVIDE 18 /* integer divide fault */ -#define T_NMI 19 /* non-maskable trap */ -#define T_OFLOW 20 /* overflow trap */ -#define T_BOUND 21 /* bound instruction fault */ -#define T_DNA 22 /* device not available fault */ -#define T_DOUBLEFLT 23 /* double fault */ -#define T_FPOPFLT 24 /* fp coprocessor operand fetch fault */ -#define T_TSSFLT 25 /* invalid tss fault */ -#define T_SEGNPFLT 26 /* segment not present fault */ -#define T_STKFLT 27 /* stack fault */ -#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 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ - -/* XXX most of the following codes aren't used, but could be. */ - -/* definitions for */ -#define ILL_RESAD_FAULT T_RESADFLT -#define ILL_PRIVIN_FAULT T_PRIVINFLT -#define ILL_RESOP_FAULT T_RESOPFLT -#define ILL_ALIGN_FAULT T_ALIGNFLT -#define ILL_FPOP_FAULT T_FPOPFLT /* coprocessor operand fault */ - -/* old FreeBSD macros, deprecated */ -#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ -#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ -#define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ -#define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ -#define FPE_FLTUND_TRAP 0x5 /* floating underflow */ -#define FPE_FPU_NP_TRAP 0x6 /* floating point unit not present */ -#define FPE_SUBRNG_TRAP 0x7 /* subrange out of bounds */ - -/* codes for SIGBUS */ -#define BUS_PAGE_FAULT T_PAGEFLT /* page fault protection base */ -#define BUS_SEGNP_FAULT T_SEGNPFLT /* segment not present */ -#define BUS_STK_FAULT T_STKFLT /* stack segment */ -#define BUS_SEGM_FAULT T_RESERVED /* segment protection base */ - -/* Trap's coming from user mode */ -#define T_USER 0x100 - -#endif /* !_MACHINE_TRAP_H_ */ +#include Modified: head/sys/i386/include/trap.h ============================================================================== --- head/sys/i386/include/trap.h Sun Mar 4 14:00:32 2012 (r232491) +++ head/sys/i386/include/trap.h Sun Mar 4 14:12:57 2012 (r232492) @@ -1,95 +1,6 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)trap.h 5.4 (Berkeley) 5/9/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_TRAP_H_ -#define _MACHINE_TRAP_H_ - -/* - * Trap type values - * also known in trap.c for name strings - */ - -#define T_PRIVINFLT 1 /* privileged instruction */ -#define T_BPTFLT 3 /* breakpoint instruction */ -#define T_ARITHTRAP 6 /* arithmetic trap */ -#define T_PROTFLT 9 /* protection fault */ -#define T_TRCTRAP 10 /* debug exception (sic) */ -#define T_PAGEFLT 12 /* page fault */ -#define T_ALIGNFLT 14 /* alignment fault */ - -#define T_DIVIDE 18 /* integer divide fault */ -#define T_NMI 19 /* non-maskable trap */ -#define T_OFLOW 20 /* overflow trap */ -#define T_BOUND 21 /* bound instruction fault */ -#define T_DNA 22 /* device not available fault */ -#define T_DOUBLEFLT 23 /* double fault */ -#define T_FPOPFLT 24 /* fp coprocessor operand fetch fault */ -#define T_TSSFLT 25 /* invalid tss fault */ -#define T_SEGNPFLT 26 /* segment not present fault */ -#define T_STKFLT 27 /* stack fault */ -#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 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ - -/* XXX most of the following codes aren't used, but could be. */ - -/* definitions for */ -#define ILL_RESAD_FAULT T_RESADFLT -#define ILL_PRIVIN_FAULT T_PRIVINFLT -#define ILL_RESOP_FAULT T_RESOPFLT -#define ILL_ALIGN_FAULT T_ALIGNFLT -#define ILL_FPOP_FAULT T_FPOPFLT /* coprocessor operand fault */ - -/* old FreeBSD macros, deprecated */ -#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ -#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ -#define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ -#define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ -#define FPE_FLTUND_TRAP 0x5 /* floating underflow */ -#define FPE_FPU_NP_TRAP 0x6 /* floating point unit not present */ -#define FPE_SUBRNG_TRAP 0x7 /* subrange out of bounds */ - -/* codes for SIGBUS */ -#define BUS_PAGE_FAULT T_PAGEFLT /* page fault protection base */ -#define BUS_SEGNP_FAULT T_SEGNPFLT /* segment not present */ -#define BUS_STK_FAULT T_STKFLT /* stack segment */ -#define BUS_SEGM_FAULT T_RESERVED /* segment protection base */ - -/* Trap's coming from user mode */ -#define T_USER 0x100 - -#endif /* !_MACHINE_TRAP_H_ */ +#include Modified: head/sys/pc98/include/trap.h ============================================================================== --- head/sys/pc98/include/trap.h Sun Mar 4 14:00:32 2012 (r232491) +++ head/sys/pc98/include/trap.h Sun Mar 4 14:12:57 2012 (r232492) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied: head/sys/x86/include/trap.h (from r232490, head/sys/amd64/include/trap.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/trap.h Sun Mar 4 14:12:57 2012 (r232492, copy of r232490, head/sys/amd64/include/trap.h) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)trap.h 5.4 (Berkeley) 5/9/91 + * $FreeBSD$ + */ + +#ifndef _MACHINE_TRAP_H_ +#define _MACHINE_TRAP_H_ + +/* + * Trap type values + * also known in trap.c for name strings + */ + +#define T_PRIVINFLT 1 /* privileged instruction */ +#define T_BPTFLT 3 /* breakpoint instruction */ +#define T_ARITHTRAP 6 /* arithmetic trap */ +#define T_PROTFLT 9 /* protection fault */ +#define T_TRCTRAP 10 /* debug exception (sic) */ +#define T_PAGEFLT 12 /* page fault */ +#define T_ALIGNFLT 14 /* alignment fault */ + +#define T_DIVIDE 18 /* integer divide fault */ +#define T_NMI 19 /* non-maskable trap */ +#define T_OFLOW 20 /* overflow trap */ +#define T_BOUND 21 /* bound instruction fault */ +#define T_DNA 22 /* device not available fault */ +#define T_DOUBLEFLT 23 /* double fault */ +#define T_FPOPFLT 24 /* fp coprocessor operand fetch fault */ +#define T_TSSFLT 25 /* invalid tss fault */ +#define T_SEGNPFLT 26 /* segment not present fault */ +#define T_STKFLT 27 /* stack fault */ +#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 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ + +/* XXX most of the following codes aren't used, but could be. */ + +/* definitions for */ +#define ILL_RESAD_FAULT T_RESADFLT +#define ILL_PRIVIN_FAULT T_PRIVINFLT +#define ILL_RESOP_FAULT T_RESOPFLT +#define ILL_ALIGN_FAULT T_ALIGNFLT +#define ILL_FPOP_FAULT T_FPOPFLT /* coprocessor operand fault */ + +/* old FreeBSD macros, deprecated */ +#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ +#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ +#define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ +#define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ +#define FPE_FLTUND_TRAP 0x5 /* floating underflow */ +#define FPE_FPU_NP_TRAP 0x6 /* floating point unit not present */ +#define FPE_SUBRNG_TRAP 0x7 /* subrange out of bounds */ + +/* codes for SIGBUS */ +#define BUS_PAGE_FAULT T_PAGEFLT /* page fault protection base */ +#define BUS_SEGNP_FAULT T_SEGNPFLT /* segment not present */ +#define BUS_STK_FAULT T_STKFLT /* stack segment */ +#define BUS_SEGM_FAULT T_RESERVED /* segment protection base */ + +/* Trap's coming from user mode */ +#define T_USER 0x100 + +#endif /* !_MACHINE_TRAP_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 14:51:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A6AB106566B; Sun, 4 Mar 2012 14:51:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39D348FC17; Sun, 4 Mar 2012 14:51: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 q24EphLU039229; Sun, 4 Mar 2012 14:51:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24Eph4f039227; Sun, 4 Mar 2012 14:51:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203041451.q24Eph4f039227@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Mar 2012 14:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232493 - head/sys/fs/cd9660 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 14:51:43 -0000 Author: kib Date: Sun Mar 4 14:51:42 2012 New Revision: 232493 URL: http://svn.freebsd.org/changeset/base/232493 Log: Remove unneeded cast to u_int. The values as small enough to fit into int, beside the use of MIN macro which performs type promotions. Submitted by: bde MFC after: 3 weeks Modified: head/sys/fs/cd9660/cd9660_vnops.c Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Sun Mar 4 14:12:57 2012 (r232492) +++ head/sys/fs/cd9660/cd9660_vnops.c Sun Mar 4 14:51:42 2012 (r232493) @@ -318,8 +318,7 @@ cd9660_read(ap) do { lbn = lblkno(imp, uio->uio_offset); on = blkoff(imp, uio->uio_offset); - n = MIN((u_int)(imp->logical_block_size - on), - uio->uio_resid); + n = MIN(imp->logical_block_size - on, uio->uio_resid); diff = (off_t)ip->i_size - uio->uio_offset; if (diff <= 0) return (0); From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 14:55:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9444C1065670; Sun, 4 Mar 2012 14:55:38 +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 6936E8FC18; Sun, 4 Mar 2012 14:55: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 q24EtcSb039404; Sun, 4 Mar 2012 14:55:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24Etcmi039402; Sun, 4 Mar 2012 14:55:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203041455.q24Etcmi039402@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Mar 2012 14:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232494 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 14:55:38 -0000 Author: kib Date: Sun Mar 4 14:55:37 2012 New Revision: 232494 URL: http://svn.freebsd.org/changeset/base/232494 Log: Instead of incomplete handling of read(2)/write(2) return values that does not fit into registers, declare that we do not support this case using CTASSERT(), and remove endianess-unsafe code to split return value into td_retval. While there, change the style of the sysctl debug.iosize_max_clamp definition. Requested by: bde MFC after: 3 weeks Modified: head/sys/kern/sys_generic.c Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sun Mar 4 14:51:42 2012 (r232493) +++ head/sys/kern/sys_generic.c Sun Mar 4 14:55:37 2012 (r232494) @@ -75,8 +75,14 @@ __FBSDID("$FreeBSD$"); #include int iosize_max_clamp = 1; -SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW, &iosize_max_clamp, 0, - "Clamp max i/o size to INT_MAX"); +SYSCTL_INT(_debug, OID_AUTO, iosize_max_clamp, CTLFLAG_RW, + &iosize_max_clamp, 0, "Clamp max i/o size to INT_MAX"); +/* + * Assert that the return value of read(2) and write(2) syscalls fits + * into a register. If not, an architecture will need to provide the + * usermode wrappers to reconstruct the result. + */ +CTASSERT(sizeof(register_t) >= sizeof(size_t)); static MALLOC_DEFINE(M_IOCTLOPS, "ioctlops", "ioctl data buffer"); static MALLOC_DEFINE(M_SELECT, "select", "select() buffer"); @@ -338,12 +344,7 @@ dofileread(td, fd, fp, auio, offset, fla ktrgenio(fd, UIO_READ, ktruio, error); } #endif -#if SSIZE_MAX > LONG_MAX - td->td_retval[1] = cnt >> (sizeof(register_t) * CHAR_BIT); - td->td_retval[0] = cnt; -#else td->td_retval[0] = cnt; -#endif return (error); } @@ -555,12 +556,7 @@ dofilewrite(td, fd, fp, auio, offset, fl ktrgenio(fd, UIO_WRITE, ktruio, error); } #endif -#if SSIZE_MAX > LONG_MAX - td->td_retval[1] = cnt >> (sizeof(register_t) * CHAR_BIT); - td->td_retval[0] = cnt; -#else td->td_retval[0] = cnt; -#endif return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 15:09:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5495F106566C; Sun, 4 Mar 2012 15:09:02 +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 4428A8FC0C; Sun, 4 Mar 2012 15:09: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 q24F92G3039880; Sun, 4 Mar 2012 15:09:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24F92WU039878; Sun, 4 Mar 2012 15:09:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203041509.q24F92WU039878@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Mar 2012 15:09: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: r232495 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 15:09:02 -0000 Author: kib Date: Sun Mar 4 15:09:01 2012 New Revision: 232495 URL: http://svn.freebsd.org/changeset/base/232495 Log: pipe_read(): change the type of size to int, and remove signed clamp. pipe_write(): change the type of desiredsize back to int, its value fits. Requested by: bde MFC after: 3 weeks Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Sun Mar 4 14:55:37 2012 (r232494) +++ head/sys/kern/sys_pipe.c Sun Mar 4 15:09:01 2012 (r232495) @@ -647,7 +647,7 @@ pipe_read(fp, uio, active_cred, flags, t struct pipe *rpipe; int error; int nread = 0; - u_int size; + int size; rpipe = fp->f_data; PIPE_LOCK(rpipe); @@ -681,7 +681,7 @@ pipe_read(fp, uio, active_cred, flags, t if (size > rpipe->pipe_buffer.cnt) size = rpipe->pipe_buffer.cnt; if (size > uio->uio_resid) - size = (u_int) uio->uio_resid; + size = uio->uio_resid; PIPE_UNLOCK(rpipe); error = uiomove( @@ -1023,8 +1023,9 @@ pipe_write(fp, uio, active_cred, flags, struct thread *td; int flags; { - int error; - size_t desiredsize, orig_resid; + int error = 0; + int desiredsize; + ssize_t orig_resid; struct pipe *wpipe, *rpipe; rpipe = fp->f_data; From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 15:22:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50F8C106564A; Sun, 4 Mar 2012 15:22:04 +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 3FB6E8FC15; Sun, 4 Mar 2012 15:22: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 q24FM4lU040521; Sun, 4 Mar 2012 15:22:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24FM4sB040519; Sun, 4 Mar 2012 15:22:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041522.q24FM4sB040519@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 15:22: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: r232496 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 15:22:04 -0000 Author: eadler Date: Sun Mar 4 15:22:03 2012 New Revision: 232496 URL: http://svn.freebsd.org/changeset/base/232496 Log: PR: docs/158813 Submitted by: Ben Kaduk Approved by: bcr MFC after: 1 week Modified: head/share/man/man4/jme.4 Modified: head/share/man/man4/jme.4 ============================================================================== --- head/share/man/man4/jme.4 Sun Mar 4 15:09:01 2012 (r232495) +++ head/share/man/man4/jme.4 Sun Mar 4 15:22:03 2012 (r232496) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 29, 2011 +.Dd March 4, 2012 .Dt JME 4 .Os .Sh NAME @@ -130,23 +130,26 @@ variables and tunables: .Bl -tag -width "xxxxxx" .It Va dev.jme.%d.tx_coal_to -Maximum amount of time to delay for Tx completion interrupt in -units of 1us. -The accepted range is 1 to 65535, the default is 100 (100us). +This variable sets the maximum amount of time to delay +before sending a Tx completion interrupt, in microseconds. +The accepted range is 1 to 65535; the default is 100 (100us). .It Va dev.jme.%d.tx_coal_pkt -Maximum number of packets to fire Tx completion interrupt. -The accepted range is 1 to 255, the default is 8. +This variable sets the maximum number of outgoing packets which may be +coalesced together into a single Tx completion interrupt. +The accepted range is 1 to 255; the default is 8. .It Va dev.jme.%d.rx_coal_to -Maximum amount of time to delay for Rx completion interrupt in -units of 1us. -The accepted range is 1 to 65535, the default is 100 (100us). +This variable sets the maximum amount of time to wait for +additional packets to arrive (for possible packet coalescing) +before firing an Rx completion interrupt, in microseconds. +The accepted range is 1 to 65535; the default is 100 (100us). .It Va dev.jme.%d.rx_coal_pkt -Maximum number of packets to fire Rx completion interrupt. -The accepted range is 1 to 255, the default is 2. +This variable sets the maximum number of incoming packets which may be +coalesced into a single Rx completion interrupt. +The accepted range is 1 to 255; the default is 2. .It Va dev.jme.%d.process_limit -Maximum amount of Rx events to be processed in the event loop before -rescheduling a taskqueue. -The accepted range is 10 to 255, the default value is 128 events. +This variable sets the maximum number of events that will be processed +in a single batch before the handler is requeued into a taskqueue. +The accepted range is 10 to 255; the default value is 128 events. The interface does not need to be brought down and up again before a change takes effect. .El @@ -173,22 +176,22 @@ driver tries to avoid unnecessary statio controllers that use eFuse to store station address. The number of times that eFuse can be safely reprogrammed is 16 at most. -In addition, there is no way to restore factory default station -address once station address is reprogrammed via eFuse. -It is highly recommended not to reprogram station address and -it is responsibility of administrator to store original station -address into a safe place when station address should be changed. +In addition, there is no way to restore the factory default station +address once the station address has been reprogrammed via eFuse. +It is highly recommended not to reprogram the station address and +it is the responsibility of the administrator to store the original station +address in a safe place when station address is changed. .Pp There are two known 1000baseT link establishment issues with JMC25x. If the full mask revision number of JMC25x controller is less than -or equal to 4 and link partner enabled IEEE 802.3az Energy Efficient -Ethernet feature, the controller would not be able to establish a +or equal to 4 and the link partner enabled the IEEE 802.3az Energy Efficient +Ethernet feature, the controller will not be able to establish a 1000baseT link. -Also if the length of cable is longer than 120 meters, controller +Also, if the length of the cable is longer than 120 meters, the controller can not establish a 1000baseT link. -The known workaround for the issue is to force manual link +The known workaround for these issues is to force manual link configuration with 100baseTX instead of relying on auto-negotiation. -The full mask revision number of controller could be checked with +The full mask revision number of controller can be checked with the verbose kernel boot option. -Use lower nibble of chip revision number to get full mask revision of -the controller. +Use the lower nibble of the chip revision number to get the +full mask revision of the controller. From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 15:24:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26D7E1065672 for ; Sun, 4 Mar 2012 15:24:05 +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 971068FC1B for ; Sun, 4 Mar 2012 15:24:04 +0000 (UTC) Received: by wgbds12 with SMTP id ds12so2659408wgb.31 for ; Sun, 04 Mar 2012 07:24:03 -0800 (PST) Received-SPF: pass (google.com: domain of lists@eitanadler.com designates 10.216.136.68 as permitted sender) client-ip=10.216.136.68; Authentication-Results: mr.google.com; spf=pass (google.com: domain of lists@eitanadler.com designates 10.216.136.68 as permitted sender) smtp.mail=lists@eitanadler.com; dkim=pass header.i=lists@eitanadler.com Received: from mr.google.com ([10.216.136.68]) by 10.216.136.68 with SMTP id v46mr4666412wei.31.1330874643713 (num_hops = 1); Sun, 04 Mar 2012 07:24:03 -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:content-type :content-transfer-encoding; bh=u7FRdu/vmOvMzUth0/UNXv1/+l1UE89QdmBr1fEQtdU=; b=bqpDeO3C9GUx1ADQGdpH1kN823DEXdG40UmDORV/rQYvfKWdWgV8DonFcusj2A1lGh ebYkzI8Pac/mKQRPgd8eao+QZjDZClXaEOUpfGU7p9LDNmjGj3HfVlw+eaLKCxyW63nZ sZEIbFYrn3zBua5Pv44OTfAl75pnulKmcUimg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding:x-gm-message-state; bh=u7FRdu/vmOvMzUth0/UNXv1/+l1UE89QdmBr1fEQtdU=; b=SB9uQLjwY4TrXdw9xP4chQZE9OFxWcuUBCN7CHJvRQrdk9eoHgUkuoYnv2QShKaFU5 gc1JHnPzIxkDO6t26fKGjB6LAQT7ZlNysGh64RvLKp1jen14fwuORsSTTQBTTPm6upa8 XKqAlbGR/Rm+ZATkLmygYGuATXxpCC9eNfx8xMpnUimKFC+wYg7NYo8baB8hT4onMSTI I4aEdRYaXJvqd5TzsUj5UcpMYS3JRr2d1UR2ZngRTQBIEl/D/yqnFbfnnu6DpfB7B5tB WIAIKra+/UhO1EMJzhNhCTI7uESC2P+SSF+Vlz01xJnssRtIGq8ZTcYxuU5ZrY0XwVCH NIPQ== Received: by 10.216.136.68 with SMTP id v46mr3747926wei.31.1330874643595; Sun, 04 Mar 2012 07:24:03 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.15.90 with HTTP; Sun, 4 Mar 2012 07:23:33 -0800 (PST) In-Reply-To: <201203041522.q24FM4sB040519@svn.freebsd.org> References: <201203041522.q24FM4sB040519@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 10:23:33 -0500 X-Google-Sender-Auth: GRMGFTs80ADbK2gCa3doXvEHCKs Message-ID: To: 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 X-Gm-Message-State: ALoCoQns6kjYd7AL8p0W/qJ7lN1bc8309+ozeKhYoqKaANHuHGXU+3okO4qx5qBkwRzBmCkl5V10 Cc: Subject: Re: svn commit: r232496 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 15:24:05 -0000 On Sun, Mar 4, 2012 at 10:22 AM, Eitan Adler wrote: > Author: eadler > Date: Sun Mar =C2=A04 15:22:03 2012 > New Revision: 232496 > URL: http://svn.freebsd.org/changeset/base/232496 > > Log: > =C2=A0PR: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 docs/158813 > =C2=A0Submitted by: Ben Kaduk > =C2=A0Approved by: =C2=A0bcr > =C2=A0MFC after: =C2=A0 =C2=A01 week Forgot the actual log message. :( "Fix a variety of English language grammar issues and style nits" --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 15:25:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE400106564A; Sun, 4 Mar 2012 15:25:11 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B47A38FC08; Sun, 4 Mar 2012 15:25: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 q24FPBWO040648; Sun, 4 Mar 2012 15:25:11 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24FPBMm040646; Sun, 4 Mar 2012 15:25:11 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201203041525.q24FPBMm040646@svn.freebsd.org> From: Olivier Houchard Date: Sun, 4 Mar 2012 15:25: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: r232497 - head/lib/libc/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 15:25:12 -0000 Author: cognet Date: Sun Mar 4 15:25:11 2012 New Revision: 232497 URL: http://svn.freebsd.org/changeset/base/232497 Log: Add __aeabi_read_tp to the symbol list. Modified: head/lib/libc/arm/Symbol.map Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Sun Mar 4 15:22:03 2012 (r232496) +++ head/lib/libc/arm/Symbol.map Sun Mar 4 15:25:11 2012 (r232497) @@ -40,6 +40,7 @@ FBSDprivate_1.0 { __sys_exit; _set_tp; + __aeabi_read_tp; ___longjmp; __umodsi3; __modsi3; From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 15:31:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10EDA106566C; Sun, 4 Mar 2012 15:31:14 +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 F1D438FC08; Sun, 4 Mar 2012 15:31: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 q24FVDdb040916; Sun, 4 Mar 2012 15:31:13 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24FVDm5040897; Sun, 4 Mar 2012 15:31:13 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201203041531.q24FVDm5040897@svn.freebsd.org> From: David Chisnall Date: Sun, 4 Mar 2012 15:31: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: r232498 - in head: etc/mtree include include/xlocale lib/libc/locale sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 15:31:14 -0000 Author: theraven Date: Sun Mar 4 15:31:13 2012 New Revision: 232498 URL: http://svn.freebsd.org/changeset/base/232498 Log: Reapply 227753 (xlocale cleanup), plus some fixes so that it passes build universe with gcc. Approved by: dim (mentor) Added: head/include/xlocale/ - copied from r231713, head/include/xlocale/ Deleted: head/include/_xlocale_ctype.h Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/include/ctype.h head/include/langinfo.h head/include/locale.h head/include/runetype.h head/include/string.h head/include/time.h head/include/wchar.h head/include/wctype.h head/include/xlocale.h head/include/xlocale/_ctype.h head/lib/libc/locale/Symbol.map head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/table.c head/lib/libc/locale/xlocale.c head/lib/libc/locale/xlocale_private.h head/sys/sys/cdefs.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Mar 4 15:25:11 2012 (r232497) +++ head/etc/mtree/BSD.include.dist Sun Mar 4 15:31:13 2012 (r232498) @@ -329,4 +329,6 @@ .. vm .. + xlocale + .. .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/Makefile Sun Mar 4 15:31:13 2012 (r232498) @@ -6,7 +6,7 @@ .include CLEANFILES= osreldate.h version vers.c -SUBDIR= arpa gssapi protocols rpcsvc rpc +SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ db.h \ dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ @@ -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 xlocale.h _xlocale_ctype.h + wchar.h wctype.h wordexp.h xlocale.h MHDRS= float.h floatingpoint.h stdarg.h Modified: head/include/ctype.h ============================================================================== --- head/include/ctype.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/ctype.h Sun Mar 4 15:31:13 2012 (r232498) @@ -78,6 +78,10 @@ int isphonogram(int); int isrune(int); int isspecial(int); #endif + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #ifndef __cplusplus Modified: head/include/langinfo.h ============================================================================== --- head/include/langinfo.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/langinfo.h Sun Mar 4 15:31:13 2012 (r232498) @@ -130,6 +130,10 @@ typedef __nl_item nl_item; __BEGIN_DECLS char *nl_langinfo(nl_item); + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #endif /* !_LANGINFO_H_ */ Modified: head/include/locale.h ============================================================================== --- head/include/locale.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/locale.h Sun Mar 4 15:31:13 2012 (r232498) @@ -77,54 +77,11 @@ struct lconv { __BEGIN_DECLS 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); - +#include +#endif __END_DECLS -#endif /* __POSIX_VISIBLE >= 200809 */ - #endif /* _LOCALE_H_ */ Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/runetype.h Sun Mar 4 15:31:13 2012 (r232498) @@ -85,11 +85,21 @@ typedef struct { #define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */ __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); +extern const _RuneLocale *_CurrentRuneLocale; +#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) +extern const _RuneLocale *__getCurrentRuneLocale(void); +#else +extern _Thread_local const _RuneLocale *_ThreadRuneLocale; +static inline const _RuneLocale *__getCurrentRuneLocale(void) +{ + + if (_ThreadRuneLocale) + return _ThreadRuneLocale; + if (_CurrentRuneLocale) + return _CurrentRuneLocale; + return &_DefaultRuneLocale; +} +#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ #define _CurrentRuneLocale (__getCurrentRuneLocale()) __END_DECLS Modified: head/include/string.h ============================================================================== --- head/include/string.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/string.h Sun Mar 4 15:31:13 2012 (r232498) @@ -132,6 +132,10 @@ void swab(const void * __restrict, void #endif /* _SWAB_DECLARED */ #endif /* __BSD_VISIBLE */ + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #endif /* _STRING_H_ */ Modified: head/include/time.h ============================================================================== --- head/include/time.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/time.h Sun Mar 4 15:31:13 2012 (r232498) @@ -183,6 +183,10 @@ void tzsetwall(void); time_t timelocal(struct tm * const); time_t timegm(struct tm * const); #endif /* __BSD_VISIBLE */ + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #endif /* !_TIME_H_ */ Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/wchar.h Sun Mar 4 15:31:13 2012 (r232498) @@ -224,6 +224,10 @@ wchar_t *fgetwln(FILE * __restrict, size size_t wcslcat(wchar_t *, const wchar_t *, size_t); size_t wcslcpy(wchar_t *, const wchar_t *, size_t); #endif + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #endif /* !_WCHAR_H_ */ Modified: head/include/wctype.h ============================================================================== --- head/include/wctype.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/wctype.h Sun Mar 4 15:31:13 2012 (r232498) @@ -87,6 +87,11 @@ wint_t iswrune(wint_t); wint_t iswspecial(wint_t); wint_t nextwctype(wint_t, wctype_t); #endif + +#if __POSIX_VISIBLE >= 200809 +#define _XLOCALE_WCTYPES 1 +#include +#endif /* __POSIX_VISIBLE >= 200809 */ __END_DECLS #ifndef __cplusplus Modified: head/include/xlocale.h ============================================================================== --- head/include/xlocale.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/include/xlocale.h Sun Mar 4 15:31:13 2012 (r232498) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * * This software was developed by David Chisnall under sponsorship from @@ -8,16 +8,16 @@ * 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. + * 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 + * 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) @@ -33,225 +33,52 @@ #define _XLOCALE_H_ #include - __BEGIN_DECLS +#include -/* - * 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); +#include #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); +#include #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 - ; +#include #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)) - +#include #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); +#include #endif + #ifdef _LANGINFO_H_ -char *nl_langinfo_l(nl_item, locale_t); +#include #endif + #ifdef _CTYPE_H_ -#include <_xlocale_ctype.h> +#include #endif + #ifdef _WCTYPE_H_ -#define XLOCALE_WCTYPES 1 -#include <_xlocale_ctype.h> +#define _XLOCALE_WCTYPES 1 +#include #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); +#include #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); +#ifdef _WCHAR_H_ +#include #endif + + struct lconv *localeconv_l(locale_t); __END_DECLS Modified: head/include/xlocale/_ctype.h ============================================================================== --- head/include/xlocale/_ctype.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/xlocale/_ctype.h Sun Mar 4 15:31:13 2012 (r232498) @@ -44,7 +44,8 @@ typedef struct _xlocale *locale_t; #endif -#ifndef _XLOCALE_CTYPE_H_ +#ifndef _XLOCALE_RUN_FUNCTIONS_DEFINED +#define _XLOCALE_RUN_FUNCTIONS_DEFINED 1 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; @@ -83,8 +84,9 @@ __istype_l(__ct_rune_t _c, unsigned long } #define XLOCALE_ISCTYPE(fname, cat) \ - _XLOCALE_INLINE int isw##fname##_l(int c, locale_t l)\ - { return __istype_l(c, cat, l); } + _XLOCALE_INLINE int isw##fname##_l(int, locale_t);\ + _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) @@ -102,6 +104,7 @@ __sbistype_l(__ct_rune_t _c, unsigned lo } #define XLOCALE_ISCTYPE(fname, cat) \ + _XLOCALE_INLINE int is##fname##_l(int c, locale_t l); \ _XLOCALE_INLINE int is##fname##_l(int c, locale_t l)\ { return __sbistype_l(c, cat, l); } #endif @@ -127,55 +130,63 @@ XLOCALE_ISCTYPE(xdigit, _CTYPE_X) #undef XLOCALE_ISCTYPE #ifdef _XLOCALE_WCTYPES -_XLOCALE_INLINE int towlower_l(int c, locale_t locale) +_XLOCALE_INLINE int towlower_l(int, locale_t); +_XLOCALE_INLINE int __wcwidth_l(__ct_rune_t, locale_t); +_XLOCALE_INLINE int towupper_l(int, locale_t); + +_XLOCALE_INLINE int towlower_l(int __c, locale_t __l) { 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]; + _RuneLocale *__runes = __runes_for_locale(__l, &mb_sb_limit); + return (__c < 0 || __c >= _CACHED_RUNES) ? ___tolower_l(__c, __l) : + __runes->__maplower[__c]; } -_XLOCALE_INLINE int towupper_l(int c, locale_t locale) +_XLOCALE_INLINE int towupper_l(int __c, locale_t __l) { 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]; + _RuneLocale *__runes = __runes_for_locale(__l, &mb_sb_limit); + return (__c < 0 || __c >= _CACHED_RUNES) ? ___toupper_l(__c, __l) : + __runes->__mapupper[__c]; } _XLOCALE_INLINE int -__wcwidth_l(__ct_rune_t _c, locale_t locale) +__wcwidth_l(__ct_rune_t _c, locale_t __l) { unsigned int _x; if (_c == 0) return (0); - _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, locale); + _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, __l); 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); +int iswctype_l(wint_t __wc, wctype_t __charclass, locale_t __l); +wctype_t wctype_l(const char *property, locale_t __l); +wint_t towctrans_l(wint_t __wc, wctrans_t desc, locale_t __l); +wint_t nextwctype_l(wint_t __wc, wctype_t wct, locale_t __l); +wctrans_t wctrans_l(const char *__charclass, locale_t __l); #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]; +_XLOCALE_INLINE int digittoint_l(int, locale_t); +_XLOCALE_INLINE int tolower_l(int, locale_t); +_XLOCALE_INLINE int toupper_l(int, locale_t); + +_XLOCALE_INLINE int digittoint_l(int __c, locale_t __l) +{ return __sbmaskrune_l((__c), 0xFF, __l); } + +_XLOCALE_INLINE int tolower_l(int __c, locale_t __l) +{ + int __limit; + _RuneLocale *__runes = __runes_for_locale(__l, &__limit); + return (__c < 0 || __c >= __limit) ? __c : + __runes->__maplower[__c]; +} +_XLOCALE_INLINE int toupper_l(int __c, locale_t __l) +{ + int __limit; + _RuneLocale *__runes = __runes_for_locale(__l, &__limit); + return (__c < 0 || __c >= __limit) ? __c : + __runes->__mapupper[__c]; } #endif #endif /* (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \ Modified: head/lib/libc/locale/Symbol.map ============================================================================== --- head/lib/libc/locale/Symbol.map Sun Mar 4 15:25:11 2012 (r232497) +++ head/lib/libc/locale/Symbol.map Sun Mar 4 15:31:13 2012 (r232498) @@ -194,6 +194,7 @@ FBSD_1.3 { wcstoull_l; wcstoumax_l; __runes_for_locale; + _ThreadRuneLocale; }; FBSDprivate_1.0 { Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Sun Mar 4 15:25:11 2012 (r232497) +++ head/lib/libc/locale/setrunelocale.c Sun Mar 4 15:31:13 2012 (r232498) @@ -38,6 +38,8 @@ #include __FBSDID("$FreeBSD$"); +#define __RUNETYPE_INTERNAL 1 + #include #include #include @@ -50,6 +52,15 @@ __FBSDID("$FreeBSD$"); #include "mblocal.h" #include "setlocale.h" +#undef _CurrentRuneLocale +extern _RuneLocale const *_CurrentRuneLocale; +#ifndef __NO_TLS +/* + * A cached version of the runes for this thread. Used by ctype.h + */ +_Thread_local const _RuneLocale *_ThreadRuneLocale; +#endif + extern int __mb_sb_limit; extern _RuneLocale *_Read_RuneMagi(FILE *); @@ -72,7 +83,8 @@ static void destruct_ctype(void *v) free(l->runes); free(l); } -_RuneLocale *__getCurrentRuneLocale(void) + +const _RuneLocale *__getCurrentRuneLocale(void) { return XLOCALE_CTYPE(__get_locale())->runes; } @@ -168,9 +180,24 @@ __wrap_setrunelocale(const char *locale) } __mb_cur_max = __xlocale_global_ctype.__mb_cur_max; __mb_sb_limit = __xlocale_global_ctype.__mb_sb_limit; + _CurrentRuneLocale = __xlocale_global_ctype.runes; return (_LDP_LOADED); } -void *__ctype_load(const char *locale, locale_t unused) + +#ifndef __NO_TLS +void +__set_thread_rune_locale(locale_t loc) { + + if (loc == NULL) { + _ThreadRuneLocale = &_DefaultRuneLocale; + } else { + _ThreadRuneLocale = XLOCALE_CTYPE(loc)->runes; + } +} +#endif + +void * +__ctype_load(const char *locale, locale_t unused) { struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1); l->header.header.destructor = destruct_ctype; Modified: head/lib/libc/locale/table.c ============================================================================== --- head/lib/libc/locale/table.c Sun Mar 4 15:25:11 2012 (r232497) +++ head/lib/libc/locale/table.c Sun Mar 4 15:31:13 2012 (r232498) @@ -251,7 +251,7 @@ const _RuneLocale _DefaultRuneLocale = { }; #undef _CurrentRuneLocale -_RuneLocale *_CurrentRuneLocale = (_RuneLocale*)&_DefaultRuneLocale; +const _RuneLocale *_CurrentRuneLocale = &_DefaultRuneLocale; _RuneLocale * __runes_for_locale(locale_t locale, int *mb_sb_limit) Modified: head/lib/libc/locale/xlocale.c ============================================================================== --- head/lib/libc/locale/xlocale.c Sun Mar 4 15:25:11 2012 (r232497) +++ head/lib/libc/locale/xlocale.c Sun Mar 4 15:31:13 2012 (r232498) @@ -6,17 +6,18 @@ * 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. + * 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 + * 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) @@ -31,6 +32,7 @@ #include #include #include +#include #include "libc_private.h" #include "xlocale_private.h" @@ -50,6 +52,17 @@ extern struct xlocale_component __xlocal */ extern struct xlocale_component __xlocale_C_collate; extern struct xlocale_component __xlocale_C_ctype; + +#ifndef __NO_TLS +/* + * The locale for this thread. + */ +_Thread_local locale_t __thread_locale; +#endif +/* + * Flag indicating that one or more per-thread locales exist. + */ +int __has_thread_locale; /* * Private functions in setlocale.c. */ @@ -103,6 +116,7 @@ static locale_t thread_local_locale; static void init_key(void) { + pthread_key_create(&locale_info_key, xlocale_release); pthread_setspecific(locale_info_key, (void*)42); if (pthread_getspecific(locale_info_key) == (void*)42) { @@ -110,6 +124,8 @@ static void init_key(void) } else { fake_tls = 1; } + /* At least one per-thread locale has now been set. */ + __has_thread_locale = 1; __detect_path_locale(); } @@ -118,12 +134,14 @@ static pthread_once_t once_control = PTH static locale_t get_thread_locale(void) { + _once(&once_control, init_key); return (fake_tls ? thread_local_locale : pthread_getspecific(locale_info_key)); } +#ifdef __NO_TLS locale_t __get_locale(void) { @@ -131,11 +149,13 @@ __get_locale(void) return (l ? l : &__xlocale_global_locale); } +#endif static void set_thread_locale(locale_t loc) { - pthread_once(&once_control, init_key); + + _once(&once_control, init_key); if (NULL != loc) { xlocale_retain((struct xlocale_refcounted*)loc); @@ -149,6 +169,10 @@ set_thread_locale(locale_t loc) } else { pthread_setspecific(locale_info_key, loc); } +#ifndef __NO_TLS + __thread_locale = loc; + __set_thread_rune_locale(loc); +#endif } /** @@ -159,6 +183,7 @@ static void destruct_locale(void *l) { locale_t loc = l; + for (int type=0 ; typecomponents[type]) { xlocale_release(loc->components[type]); @@ -177,6 +202,7 @@ static locale_t alloc_locale(void) { locale_t new = calloc(sizeof(struct _xlocale), 1); + new->header.destructor = destruct_locale; new->monetary_locale_changed = 1; new->numeric_locale_changed = 1; @@ -193,19 +219,23 @@ copyflags(locale_t new, locale_t old) static int dupcomponent(int type, locale_t base, locale_t new) { - /* Always copy from the global locale, since it has mutable components. */ + /* Always copy from the global locale, since it has mutable components. + */ struct xlocale_component *src = base->components[type]; + if (&__xlocale_global_locale == base) { new->components[type] = constructors[type](src->locale, new); if (new->components[type]) { - strncpy(new->components[type]->locale, src->locale, ENCODING_LEN); + strncpy(new->components[type]->locale, src->locale, + ENCODING_LEN); } } 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. */ + /* 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]); @@ -244,9 +274,11 @@ locale_t newlocale(int mask, const char if (useenv) { realLocale = __get_locale_env(type); } - new->components[type] = constructors[type](realLocale, new); + new->components[type] = + constructors[type](realLocale, new); if (new->components[type]) { - strncpy(new->components[type]->locale, realLocale, ENCODING_LEN); + strncpy(new->components[type]->locale, + realLocale, ENCODING_LEN); } else { success = 0; break; @@ -319,7 +351,7 @@ const char *querylocale(int mask, locale return (NULL); if (loc->components[type]) return (loc->components[type]->locale); - return "C"; + return ("C"); } /* Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/lib/libc/locale/xlocale_private.h Sun Mar 4 15:31:13 2012 (r232498) @@ -8,16 +8,16 @@ * 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. + * 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 + * 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) @@ -85,14 +85,14 @@ struct _xlocale { struct xlocale_refcounted header; /** Components for the locale. */ struct xlocale_component *components[XLC_LAST]; - /** Flag indicating if components[XLC_MONETARY] has changed since the last - * call to localeconv_l() with this locale. */ + /** Flag indicating if components[XLC_MONETARY] has changed since the + * last call to localeconv_l() with this locale. */ int monetary_locale_changed; /** Flag indicating whether this locale is actually using a locale for * LC_MONETARY (1), or if it should use the C default instead (0). */ int using_monetary_locale; - /** Flag indicating if components[XLC_NUMERIC] has changed since the last - * call to localeconv_l() with this locale. */ + /** Flag indicating if components[XLC_NUMERIC] has changed since the + * last call to localeconv_l() with this locale. */ int numeric_locale_changed; /** Flag indicating whether this locale is actually using a locale for * LC_NUMERIC (1), or if it should use the C default instead (0). */ @@ -170,12 +170,38 @@ extern struct _xlocale __xlocale_global_ extern struct _xlocale __xlocale_C_locale; /** + * Caches the rune table in TLS for fast access. + */ +void __set_thread_rune_locale(locale_t loc); +/** + * Flag indicating whether a per-thread locale has been set. If no per-thread + * locale has ever been set, then we always use the global locale. + */ +extern int __has_thread_locale; +#ifndef __NO_TLS +/** + * The per-thread locale. Avoids the need to use pthread lookup functions when + * getting the per-thread locale. + */ +extern _Thread_local locale_t __thread_locale; + +/** * Returns the current locale for this thread, or the global locale if none is * set. The caller does not have to free the locale. The return value from * this call is not guaranteed to remain valid after the locale changes. As * such, this should only be called within libc functions. */ +inline locale_t __get_locale(void) +{ + + if (!__has_thread_locale) { + return (&__xlocale_global_locale); + } + return (__thread_locale ? __thread_locale : &__xlocale_global_locale); +} +#else locale_t __get_locale(void); +#endif /** * Two magic values are allowed for locale_t objects. NULL and -1. This Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Mar 4 15:25:11 2012 (r232497) +++ head/sys/sys/cdefs.h Sun Mar 4 15:31:13 2012 (r232498) @@ -230,7 +230,8 @@ #define _Alignof(e) alignof(e) #define _Noreturn [[noreturn]] #define _Static_assert(e, s) static_assert(e, s) -#define _Thread_local thread_local +/* FIXME: change this to thread_local when clang in base supports it */ +#define _Thread_local __thread #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L /* Do nothing. They are language keywords. */ #else @@ -400,12 +401,18 @@ #define __printflike(fmtarg, firstvararg) #define __scanflike(fmtarg, firstvararg) #define __format_arg(fmtarg) +#define __strfmonlike(fmtarg, firstvararg) +#define __strftimelike(fmtarg, firstvararg) #else #define __printflike(fmtarg, firstvararg) \ __attribute__((__format__ (__printf__, fmtarg, firstvararg))) #define __scanflike(fmtarg, firstvararg) \ __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) #define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg))) +#define __strfmonlike(fmtarg, firstvararg) \ + __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) +#define __strftimelike(fmtarg, firstvararg) \ + __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) #endif /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ @@ -650,4 +657,8 @@ #define __has_builtin(x) 0 #endif +#if defined(__mips) || defined(__powerpc64__) +#define __NO_TLS 1 +#endif + #endif /* !_SYS_CDEFS_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 16:26:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1E7C106566C; Sun, 4 Mar 2012 16:26:49 +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 C164C8FC0A; Sun, 4 Mar 2012 16:26: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 q24GQnKj042950; Sun, 4 Mar 2012 16:26:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24GQnV5042948; Sun, 4 Mar 2012 16:26:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041626.q24GQnV5042948@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 16:26: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: r232501 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 16:26:49 -0000 Author: eadler Date: Sun Mar 4 16:26:49 2012 New Revision: 232501 URL: http://svn.freebsd.org/changeset/base/232501 Log: ehci tunables are only available when kernel is compiled with USB_DEBUG PR: docs/163646 Reported by: Momchil Ivanov Submitted by: Benjamin Kaduk Approved by: cperciva MFC after: 1 week Modified: head/share/man/man4/ehci.4 Modified: head/share/man/man4/ehci.4 ============================================================================== --- head/share/man/man4/ehci.4 Sun Mar 4 16:24:58 2012 (r232500) +++ head/share/man/man4/ehci.4 Sun Mar 4 16:26:49 2012 (r232501) @@ -80,7 +80,11 @@ The device driver first appeared in .Fx 5.1 . .Sh LOADER TUNABLES -Tunables can be set at the +When the kernel has been compiled with +.Cd options USB_DEBUG , +some tunables become available that affect the behavior of +.Nm . +These tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 16:37:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 62B201065673; Sun, 4 Mar 2012 16:37:45 +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 5071D8FC14; Sun, 4 Mar 2012 16:37: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 q24GbjBf043311; Sun, 4 Mar 2012 16:37:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24Gbjcj043308; Sun, 4 Mar 2012 16:37:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041637.q24Gbjcj043308@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 16:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232502 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 16:37:45 -0000 Author: eadler Date: Sun Mar 4 16:37:44 2012 New Revision: 232502 URL: http://svn.freebsd.org/changeset/base/232502 Log: Fix a variety of grammar issues and style nits. PR: docs/165668 Submitted by: Robert Simmons Reviewed by: kaduk@mit.edu Approved by: cperciva MFC after: 1 week Modified: head/sbin/geom/class/eli/geli.8 Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Sun Mar 4 16:26:49 2012 (r232501) +++ head/sbin/geom/class/eli/geli.8 Sun Mar 4 16:37:44 2012 (r232502) @@ -24,29 +24,29 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2011 +.Dd March 4, 2012 .Dt GELI 8 .Os .Sh NAME .Nm geli -.Nd "control utility for cryptographic GEOM class" +.Nd "control utility for the cryptographic GEOM class" .Sh SYNOPSIS -To compile GEOM_ELI into your kernel, place the following lines in your kernel +To compile GEOM_ELI into your kernel, add the following lines to your kernel configuration file: .Bd -ragged -offset indent .Cd "device crypto" .Cd "options GEOM_ELI" .Ed .Pp -Alternately, to load the GEOM_ELI module at boot time, place the following line -in your +Alternatively, to load the GEOM_ELI module at boot time, add the following line +to your .Xr loader.conf 5 : .Bd -literal -offset indent geom_eli_load="YES" .Ed .Pp Usage of the -.Xr geli 8 +.Nm utility: .Pp .Nm @@ -189,7 +189,8 @@ or Can create a key from a couple of components (user entered passphrase, random bits from a file, etc.). .It -Allows to encrypt the root partition - the user will be asked for the +Allows encryption of the root partition. +The user will be asked for the passphrase before the root file system is mounted. .It The passphrase of the user is strengthened with: @@ -200,29 +201,30 @@ The passphrase of the user is strengthen .%N 2898 .Re .It -Allows to use two independent keys (e.g. +Allows the use of two independent keys (e.g., a .Qq "user key" -and +and a .Qq "company key" ) . .It It is fast - .Nm performs simple sector-to-sector encryption. .It -Allows to backup/restore Master Keys, so when a user has to quickly -destroy his keys, -it is possible to get the data back by restoring keys from the backup. +Allows Master Keys to be backed up and restored, +so that if a user has to quickly destroy his keys, +it is possible to get the data back by restoring keys from +backup. .It Providers can be configured to automatically detach on last close (so users do not have to remember to detach providers after unmounting the file systems). .It -Allows to attach a provider with a random, one-time key - useful for swap +Allows attaching a provider with a random, one-time key - useful for swap partitions and temporary file systems. .It -Allows to verify data integrity (data authentication). +Allows verification of data integrity (data authentication). .It -Allows to suspend and resume encrypted devices. +Allows suspending and resuming encrypted devices. .El .Pp The first argument to @@ -230,12 +232,12 @@ The first argument to indicates an action to be performed: .Bl -tag -width ".Cm configure" .It Cm init -Initialize provider which needs to be encrypted. +Initialize the provider which needs to be encrypted. Here you can set up the cryptographic algorithm to use, key length, etc. -The last provider's sector is used to store metadata. +The last sector of the provider is used to store metadata. The .Cm init -subcommand also automatically backups metadata in +subcommand also automatically writes metadata backups to .Pa /var/backups/.eli file. The metadata can be recovered with the @@ -246,7 +248,7 @@ Additional options include: .Bl -tag -width ".Fl J Ar newpassfile" .It Fl a Ar aalgo Enable data integrity verification (authentication) using the given algorithm. -This will reduce size of available storage and also reduce speed. +This will reduce the size of storage available and also reduce speed. For example, when using 4096 bytes sector and .Nm HMAC/SHA256 algorithm, 89% of the original provider storage will be available for use. @@ -320,9 +322,9 @@ and 192 for Do not use passphrase as the key component. .It Fl s Ar sectorsize Change decrypted provider's sector size. -Increasing sector size allows to increase performance, because we need to -generate an IV and do encrypt/decrypt for every single sector - less number -of sectors means less work to do. +Increasing the sector size allows increased performance, +because encryption/decryption which requires an initialization vector +is done per sector; fewer sectors means less computational work. .It Fl V Ar version Metadata version to use. This option is helpful when creating provider that may be used by older @@ -345,7 +347,7 @@ Additional options include: .Bl -tag -width ".Fl j Ar passfile" .It Fl d If specified, a decrypted provider will be detached automatically on last close. -This can help with short memory - user does not have to remember to detach the +This can help with scarce memory so the user does not have to remember to detach the provider after unmounting the file system. It only works when the provider was opened for writing, so it will not work if the file system on the provider is mounted read-only. @@ -385,9 +387,8 @@ Force detach - detach even if the provid .It Fl l Mark provider to detach on last close. If this option is specified, the provider will not be detached -until it is open, but when it will be closed last time, it will -be automatically detached (even -if it was only opened for reading). +while it is open, but will be automatically detached when it is closed for the +last time even if it was only opened for reading. .El .It Cm onetime Attach the given providers with random, one-time keys. @@ -407,7 +408,7 @@ For more information, see the descriptio subcommand. .It Fl d Detach on last close. -Note, the option is not usable for temporary file systems as the provider will +Note: this option is not usable for temporary file systems as the provider will be detached after creating the file system on it. It still can (and should be) used for swap partitions. For more information, see the description of the @@ -444,7 +445,7 @@ With the .Cm init subcommand, only key number 0 is initialized. The key can always be changed: for an attached provider, -for a detached provider or on the backup file. +for a detached provider, or on the backup file. When a provider is attached, the user does not have to provide an old passphrase/keyfile. .Pp @@ -453,9 +454,9 @@ Additional options include: .It Fl i Ar iterations Number of iterations to use with PKCS#5v2. If 0 is given, PKCS#5v2 will not be used. -To be able to use this option with +To be able to use this option with the .Cm setkey -subcommand, only one key have to be defined and this key has to be changed. +subcommand, only one key has to be defined and this key must be changed. .It Fl j Ar passfile Specifies a file which contains the old passphrase or its part. .It Fl J Ar newpassfile @@ -479,8 +480,8 @@ Do not use passphrase as the new key com .It Cm delkey Destroy (overwrite with random data) the selected key. If one is destroying keys for an attached provider, the provider -will not be detached even if all keys will be destroyed. -It can be even rescued with the +will not be detached even if all keys are destroyed. +It can even be rescued with the .Cm setkey subcommand. .Pp @@ -501,8 +502,8 @@ If provider is detached (or we are opera has to be given. .El .It Cm kill -This command should be used in emergency situations. -It will destroy all keys on the given provider and will detach it forcibly +This command should be used only in emergency situations. +It will destroy all the keys on a given provider and will detach it forcibly (if it is attached). This is absolutely a one-way command - if you do not have a metadata backup, your data is gone for good. @@ -540,29 +541,30 @@ and .Cm restore . .El .It Cm suspend -Suspend device by waiting for all inflight request to finish, clearing all -sensitive informations (like keys) from the kernel memory and blocking all +Suspend device by waiting for all inflight requests to finish, clearing all +sensitive information (like keys) from kernel memory, and blocking all further I/O requests until the .Cm resume subcommand is executed. -This functionality is useful for eg. laptops - when one wants to suspend a -laptop, one does not want to leave encrypted device attached. -Instead of closing all files and directories opened from a file system placed -on an encrypted device, unmounting the file system and detaching the device, +This functionality is useful for laptops: when one wants to suspend a +laptop, one does not want to leave an encrypted device attached. +Instead of closing all files and directories opened from a file system located +on an encrypted device, unmounting the file system, and detaching the device, the .Cm suspend subcommand can be used. Any access to the encrypted device will be blocked until the keys are -recovered through +recovered through the .Cm resume -subcommand, thus there is no need to close nor unmount anything. +subcommand. +Thus there is no need to close nor unmount anything. The .Cm suspend subcommand does not work with devices created with the .Cm onetime subcommand. Please note that sensitive data might still be present in memory after -suspending encrypted device, because of file system cache, etc. +suspending an encrypted device due to the file system cache, etc. .Pp Additional options include: .Bl -tag -width ".Fl a" @@ -573,9 +575,9 @@ devices. .El .It Cm resume Resume previously suspended device. -The caller must ensure that executing this subcommand won't try to access -suspended device, which will lead to a deadlock. -For example suspending device, which contains file system where the +The caller must ensure that executing this subcommand doesn't access the +suspended device, leading to a deadlock. +For example suspending a device which contains the file system where the .Nm utility is stored is bad idea. .Pp @@ -669,7 +671,7 @@ If set to 3, the maximum amount of debug information is printed. .It Va kern.geom.eli.tries : No 3 Number of times a user is asked for the passphrase. -This is only used for providers which should be attached on boot +This is only used for providers which are attached on boot (before the root file system is mounted). If set to 0, attaching providers on boot will be disabled. This variable should be set in @@ -681,7 +683,7 @@ After this operation it is filled with z .It Va kern.geom.eli.visible_passphrase : No 0 If set to 1, the passphrase entered on boot (before the root file system is mounted) will be visible. -This possibility should be used with caution as the entered +This alternative should be used with caution as the entered passphrase can be logged and exposed via .Xr dmesg 8 . This variable should be set in @@ -691,18 +693,17 @@ Specifies how many kernel threads should cryptography. Its purpose is to increase performance on SMP systems. If hardware acceleration is available, only one thread will be started. -If set to 0, CPU-bound thread will be started for every active CPU. +If set to 0, a CPU-pinned thread will be started for every active CPU. .It Va kern.geom.eli.batch : No 0 When set to 1, can speed-up crypto operations by using batching. -Batching allows to reduce number of interrupts by responding on a group of +Batching reduces the number of interrupts by responding to a group of crypto requests with one interrupt. The crypto card and the driver has to support this feature. .It Va kern.geom.eli.key_cache_limit : No 8192 Specifies how many encryption keys to cache. The default limit -.No ( 8192 -keys) will allow to cache all keys for 4TB provider with 512 bytes sectors and -will take around 1MB of memory. +(8192 keys) will allow caching of all keys for a 4TB provider with 512 byte +sectors and will take around 1MB of memory. .It Va kern.geom.eli.key_cache_hits Reports how many times we were looking up a key and it was already in cache. This sysctl is not updated for providers that need less keys than the limit @@ -710,7 +711,7 @@ specified in .Va kern.geom.eli.key_cache_limit . .It Va kern.geom.eli.key_cache_misses Reports how many times we were looking up a key and it was not in cache. -This sysctl is not updated for providers that need less keys than the limit +This sysctl is not updated for providers that need fewer keys than the limit specified in .Va kern.geom.eli.key_cache_limit . .El @@ -720,7 +721,7 @@ Exit status is 0 on success, and 1 if th Initialize a provider which is going to be encrypted with a passphrase and random data from a file on the user's pen drive. Use 4kB sector size. -Attach the provider, create a file system and mount it. +Attach the provider, create a file system, and mount it. Do the work. Unmount the provider and detach it: .Bd -literal -offset indent @@ -739,28 +740,28 @@ Enter passphrase: .Ed .Pp Create an encrypted provider, but use two keys: -one for your employee and one for you as company's security officer -(so there is no tragedy if the employee +one for your employee and one for you as the company's security officer +(so it's not a tragedy if the employee .Qq accidentally forgets his passphrase): .Bd -literal -offset indent # geli init /dev/da2 -Enter new passphrase: (enter security officer passphrase) +Enter new passphrase: (enter security officer's passphrase) Reenter new passphrase: # geli setkey -n 1 /dev/da2 -Enter passphrase: (enter security officer passphrase) +Enter passphrase: (enter security officer's passphrase) Enter new passphrase: (let your employee enter his passphrase ...) Reenter new passphrase: (... twice) .Ed .Pp -You are the security-person in your company. +You are the security officer in your company. Create an encrypted provider for use by the user, but remember that users -forget their passphrases, so back Master Key up with your own random key: +forget their passphrases, so backup the Master Key with your own random key: .Bd -literal -offset indent # dd if=/dev/random of=/mnt/pendrive/keys/`hostname` bs=64 count=1 # geli init -P -K /mnt/pendrive/keys/`hostname` /dev/ad0s1e # geli backup /dev/ad0s1e /mnt/pendrive/backups/`hostname` -(use key number 0, so the encrypted Master Key by you will be overwritten) +(use key number 0, so the encrypted Master Key will be overwritten by this) # geli setkey -n 0 -k /mnt/pendrive/keys/`hostname` /dev/ad0s1e (allow the user to enter his passphrase) Enter new passphrase: @@ -791,7 +792,7 @@ Reenter new passphrase: # geli init -b -P -K /boot/keys/da1s3a.key da1s3a .Ed .Pp -The providers are initialized, now we have to add those lines to +The providers are initialized, now we have to add these lines to .Pa /boot/loader.conf : .Bd -literal -offset indent geli_da0_keyfile0_load="YES" @@ -823,10 +824,10 @@ Enter passphrase: .Ed .Pp .Cm geli -backups metadata by default to the +writes the metadata backup by default to the .Pa /var/backups/.eli file. -If metadata is lost in any way (eg. by accidental overwrite), it can be restored. +If the metadata is lost in any way (e.g., by accidental overwrite), it can be restored. Consider the following situation: .Bd -literal -offset indent # geli init /dev/da0 @@ -846,7 +847,7 @@ geli: Cannot read metadata from /dev/da0 Enter passphrase: .Ed .Pp -If an encrypted filesystem is extended, it is necessary to relocate and +If an encrypted file system is extended, it is necessary to relocate and update the metadata: .Bd -literal -offset indent # gpart create -s GPT ada0 @@ -857,10 +858,10 @@ update the metadata: # geli attach -k keyfile -p ada0p1 .Ed .Pp -Initialize provider with passphrase split into two files. -The provider can be attached by giving those two files or by giving +Initialize provider with the passphrase split into two files. +The provider can be attached using those two files or by entering .Dq foobar -passphrase on +as the passphrase at the .Nm prompt: .Bd -literal -offset indent @@ -875,8 +876,8 @@ Enter passphrase: foobar .Pp Suspend all .Nm -devices, suspend a laptop, then resume devices one by one after resuming a -laptop: +devices on a laptop, suspend the laptop, then resume devices one by one after +resuming the laptop: .Bd -literal -offset indent # geli suspend -a # zzz @@ -916,12 +917,12 @@ to another even without modification, .Nm should be able to detect such a change. If an attacker can remember the encrypted data, he can overwrite any future -changes with the data he owns without notice. +changes with the data he owns without it being noticed. In other words .Nm will not protect your data against replay attacks. .Pp -It is recommended to write the whole provider before the first use, +It is recommended to write to the whole provider before first use, in order to make sure that all sectors and their corresponding checksums are properly initialized into a consistent state. .Sh SEE ALSO @@ -937,7 +938,7 @@ The .Nm utility appeared in .Fx 6.0 . -Support for +Support for the .Nm Camellia block cipher is implemented by Yoshisato Yanagisawa in .Fx 7.0 . From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 16:39:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0936B106564A; Sun, 4 Mar 2012 16:39:09 +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 ECCAE8FC12; Sun, 4 Mar 2012 16:39: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 q24Gd8s9043390; Sun, 4 Mar 2012 16:39:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24Gd8dJ043387; Sun, 4 Mar 2012 16:39:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041639.q24Gd8dJ043387@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 16:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232503 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 16:39:09 -0000 Author: eadler Date: Sun Mar 4 16:39:08 2012 New Revision: 232503 URL: http://svn.freebsd.org/changeset/base/232503 Log: POSIX mandates that swab do nothing when len < 0 PR: kern/140690 Submitted by: Jeremy Huddleston Approved by: cperciva MFC after: 2 weeks Modified: head/lib/libc/string/swab.3 head/lib/libc/string/swab.c Modified: head/lib/libc/string/swab.3 ============================================================================== --- head/lib/libc/string/swab.3 Sun Mar 4 16:37:44 2012 (r232502) +++ head/lib/libc/string/swab.3 Sun Mar 4 16:39:08 2012 (r232503) @@ -28,7 +28,7 @@ .\" @(#)swab.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 10, 2004 +.Dd March 4, 2012 .Dt SWAB 3 .Os .Sh NAME @@ -54,6 +54,9 @@ swapping adjacent bytes. The argument .Fa len must be an even number. +If +.Fa len +is less than zero, nothing will be done. .Sh SEE ALSO .Xr bzero 3 , .Xr memset 3 Modified: head/lib/libc/string/swab.c ============================================================================== --- head/lib/libc/string/swab.c Sun Mar 4 16:37:44 2012 (r232502) +++ head/lib/libc/string/swab.c Sun Mar 4 16:39:08 2012 (r232503) @@ -45,6 +45,8 @@ swab(const void * __restrict from, void int n; char *fp, *tp; + if (len <= 0) + return; n = len >> 1; fp = (char *)from; tp = (char *)to; From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 16:41:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6726A1065674; Sun, 4 Mar 2012 16:41:08 +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 56BBE8FC0C; Sun, 4 Mar 2012 16:41: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 q24Gf8jD043490; Sun, 4 Mar 2012 16:41:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24Gf8gM043488; Sun, 4 Mar 2012 16:41:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041641.q24Gf8gM043488@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 16:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232504 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 16:41:08 -0000 Author: eadler Date: Sun Mar 4 16:41:07 2012 New Revision: 232504 URL: http://svn.freebsd.org/changeset/base/232504 Log: Remove reference to gcc's non-standard -fwritable-strings, which doesn't exist in recent releases (and is bad advice anyway) PR: docs/163119 Submitted by: Yuri Pankov Approved by: cperciva MFC after: 1 week Modified: head/lib/libc/stdio/mktemp.3 Modified: head/lib/libc/stdio/mktemp.3 ============================================================================== --- head/lib/libc/stdio/mktemp.3 Sun Mar 4 16:39:08 2012 (r232503) +++ head/lib/libc/stdio/mktemp.3 Sun Mar 4 16:41:07 2012 (r232504) @@ -28,7 +28,7 @@ .\" @(#)mktemp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 11, 1998 +.Dd March 4, 2012 .Dt MKTEMP 3 .Os .Sh NAME @@ -180,12 +180,6 @@ with an argument of will result in a core dump due to .Fn mkstemp attempting to modify the string constant that was given. -If the program in question makes heavy use of that type -of function call, you do have the option of compiling the program -so that it will store string constants in a writable segment of memory. -See -.Xr gcc 1 -for more information. .Sh SEE ALSO .Xr chmod 2 , .Xr getpid 2 , From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 16:44:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFF91106564A; Sun, 4 Mar 2012 16:44:04 +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 CF6AE8FC08; Sun, 4 Mar 2012 16:44: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 q24Gi4uZ043627; Sun, 4 Mar 2012 16:44:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24Gi4TL043625; Sun, 4 Mar 2012 16:44:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041644.q24Gi4TL043625@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 16:44: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: r232505 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 16:44:05 -0000 Author: eadler Date: Sun Mar 4 16:44:04 2012 New Revision: 232505 URL: http://svn.freebsd.org/changeset/base/232505 Log: Remove outdated comment of seven years PR: docs/116116 Approved by: cperciva MFC after: 1 week Modified: head/lib/libc/stdio/mktemp.3 Modified: head/lib/libc/stdio/mktemp.3 ============================================================================== --- head/lib/libc/stdio/mktemp.3 Sun Mar 4 16:41:07 2012 (r232504) +++ head/lib/libc/stdio/mktemp.3 Sun Mar 4 16:44:04 2012 (r232505) @@ -236,10 +236,3 @@ and the return status of the call should This will ensure that the program does not continue blindly in the event that an attacker has already created the file with the intention of manipulating or reading its contents. -.Pp -The implementation of these functions calls -.Xr arc4random 3 , -which is not reentrant. -You must provide your own locking around this and other consumers of the -.Xr arc4random 3 -API. From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 16:46:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 936B91065670; Sun, 4 Mar 2012 16:46:28 +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 7E2678FC14; Sun, 4 Mar 2012 16:46: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 q24GkSLE043756; Sun, 4 Mar 2012 16:46:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24GkSig043754; Sun, 4 Mar 2012 16:46:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041646.q24GkSig043754@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 16:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232506 - head/sys/modules/dtrace/dtrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 16:46:28 -0000 Author: eadler Date: Sun Mar 4 16:46:27 2012 New Revision: 232506 URL: http://svn.freebsd.org/changeset/base/232506 Log: Explicitly list dependency PR: misc/160463 Submitted by: Garrett Cooper Helped by: kan Approved by: cperciva MFC after: 3 days Modified: head/sys/modules/dtrace/dtrace/Makefile Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Sun Mar 4 16:44:04 2012 (r232505) +++ head/sys/modules/dtrace/dtrace/Makefile Sun Mar 4 16:46:27 2012 (r232506) @@ -42,4 +42,6 @@ EXPORT_SYMS= dtrace_register \ dtrace_unregister \ dtrace_probe_lookup +dtrace_asm.o: assym.s + .include From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 16:59:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1424F1065674; Sun, 4 Mar 2012 16:59:46 +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 DA95B8FC12; Sun, 4 Mar 2012 16:59: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 q24GxjDk044206; Sun, 4 Mar 2012 16:59:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24GxjOT044204; Sun, 4 Mar 2012 16:59:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041659.q24GxjOT044204@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 16:59: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: r232507 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 16:59:46 -0000 Author: eadler Date: Sun Mar 4 16:59:45 2012 New Revision: 232507 URL: http://svn.freebsd.org/changeset/base/232507 Log: Bump date as modified the man page Submitted by: gjb Modified: head/share/man/man4/ehci.4 Modified: head/share/man/man4/ehci.4 ============================================================================== --- head/share/man/man4/ehci.4 Sun Mar 4 16:46:27 2012 (r232506) +++ head/share/man/man4/ehci.4 Sun Mar 4 16:59:45 2012 (r232507) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2011 +.Dd March 4, 2012 .Dt EHCI 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 17:08:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6857A1065670; Sun, 4 Mar 2012 17:08:44 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53C938FC12; Sun, 4 Mar 2012 17:08:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q24H8iIT044603; Sun, 4 Mar 2012 17:08:44 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24H8iAR044601; Sun, 4 Mar 2012 17:08:44 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201203041708.q24H8iAR044601@svn.freebsd.org> From: Bruce Cran Date: Sun, 4 Mar 2012 17:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232509 - head/sys/compat/ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 17:08:44 -0000 Author: brucec Date: Sun Mar 4 17:08:43 2012 New Revision: 232509 URL: http://svn.freebsd.org/changeset/base/232509 Log: Fix race condition in KfRaiseIrql(). After getting the current irql, if the kthread gets preempted and subsequently runs on a different CPU, the saved irql could be wrong. Also, correct the panic string. PR: kern/165630 Submitted by: Vladislav Movchan Modified: head/sys/compat/ndis/subr_hal.c Modified: head/sys/compat/ndis/subr_hal.c ============================================================================== --- head/sys/compat/ndis/subr_hal.c Sun Mar 4 17:00:46 2012 (r232508) +++ head/sys/compat/ndis/subr_hal.c Sun Mar 4 17:08:43 2012 (r232509) @@ -392,16 +392,18 @@ KfRaiseIrql(uint8_t irql) { uint8_t oldirql; + sched_pin(); oldirql = KeGetCurrentIrql(); /* I am so going to hell for this. */ if (oldirql > irql) - panic("IRQL_NOT_LESS_THAN"); + panic("IRQL_NOT_LESS_THAN_OR_EQUAL"); - if (oldirql != DISPATCH_LEVEL) { - sched_pin(); + if (oldirql != DISPATCH_LEVEL) mtx_lock(&disp_lock[curthread->td_oncpu]); - } + else + sched_unpin(); + /*printf("RAISE IRQL: %d %d\n", irql, oldirql);*/ return (oldirql); From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 17:33:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA9F7106566B; Sun, 4 Mar 2012 17:33:22 +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 B5DD18FC12; Sun, 4 Mar 2012 17:33: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 q24HXMLQ045467; Sun, 4 Mar 2012 17:33:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24HXM0p045465; Sun, 4 Mar 2012 17:33:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203041733.q24HXM0p045465@svn.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 17:33: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: r232510 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 17:33:22 -0000 Author: eadler Date: Sun Mar 4 17:33:22 2012 New Revision: 232510 URL: http://svn.freebsd.org/changeset/base/232510 Log: Permit the use of raidz3 in pc-sysinstall PR: conf/164709 Submitted by: Garrett Cooper Reviewed by: brd, brooks Approved by: cperciva MFC after: 3 days Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sun Mar 4 17:08:43 2012 (r232509) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sun Mar 4 17:33:22 2012 (r232510) @@ -59,7 +59,7 @@ get_fs_line_xvars() ZTYPE="NONE" ZFSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1 | xargs`" - echo $ZFSVARS | grep -qE "^(disk|file|mirror|raidz(1|2)?|spare|log|cache):" 2>/dev/null + echo $ZFSVARS | grep -qE "^(disk|file|mirror|raidz(1|2|3)?|spare|log|cache):" 2>/dev/null if [ $? -eq 0 ] ; then ZTYPE=`echo $ZFSVARS | cut -f1 -d:` ZFSVARS=`echo $ZFSVARS | sed "s|$ZTYPE: ||g" | sed "s|$ZTYPE:||g"` From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 18:13:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E668A106564A; Sun, 4 Mar 2012 18:13:45 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1B318FC0A; Sun, 4 Mar 2012 18:13: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 q24IDj05046843; Sun, 4 Mar 2012 18:13:45 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24IDj0R046841; Sun, 4 Mar 2012 18:13:45 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201203041813.q24IDj0R046841@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 4 Mar 2012 18:13: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: r232512 - head/sys/arm/mv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 18:13:46 -0000 Author: raj Date: Sun Mar 4 18:13:45 2012 New Revision: 232512 URL: http://svn.freebsd.org/changeset/base/232512 Log: Remove unused #defines. All this is now retrieved from the device tree. MFC after: 1 week Modified: head/sys/arm/mv/mvreg.h Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Sun Mar 4 17:53:40 2012 (r232511) +++ head/sys/arm/mv/mvreg.h Sun Mar 4 18:13:45 2012 (r232512) @@ -34,132 +34,6 @@ #ifndef _MVREG_H_ #define _MVREG_H_ -/* - * Interrupt sources - */ -#if defined(SOC_MV_ORION) - -#define MV_INT_BRIDGE 0 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_UART0 3 /* UART0 Interrupt */ -#define MV_INT_UART1 4 -#define MV_INT_GPIO7_0 6 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 7 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 8 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 9 /* GPIO[31:24] Interrupt */ -#define MV_INT_PEX0_ERR 10 /* PCI Express Error */ -#define MV_INT_PEX0 11 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_PCI_ERR 15 /* PCI Error */ -#define MV_INT_USB_BERR 16 /* USB Bridge Error */ -#define MV_INT_USB_CI 17 /* USB Controller interrupt */ -#define MV_INT_GBERX 18 /* GbE receive interrupt */ -#define MV_INT_GBETX 19 /* GbE transmit interrupt */ -#define MV_INT_GBEMISC 20 /* GbE misc. interrupt */ -#define MV_INT_GBESUM 21 /* GbE summary interrupt */ -#define MV_INT_GBEERR 22 /* GbE error interrupt */ -#define MV_INT_IDMA_ERR 23 /* DMA error interrupt */ -#define MV_INT_IDMA0 24 /* IDMA chan. 0 completion interrupt */ -#define MV_INT_IDMA1 25 /* IDMA chan. 1 completion interrupt */ -#define MV_INT_IDMA2 26 /* IDMA chan. 2 completion interrupt */ -#define MV_INT_IDMA3 27 /* IDMA chan. 3 completion interrupt */ -#define MV_INT_SATA 29 /* Serial-ATA Interrupt */ - -#elif defined(SOC_MV_KIRKWOOD) - -#define MV_INT_BRIDGE 1 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_XOR0_CHAN0 5 /* XOR engine 0 channel 0 Interrupt */ -#define MV_INT_XOR0_CHAN1 6 /* XOR engine 0 channel 1 Interrupt */ -#define MV_INT_XOR1_CHAN0 7 /* XOR engine 1 channel 0 Interrupt */ -#define MV_INT_XOR1_CHAN1 8 /* XOR engine 1 channel 1 Interrupt */ -#define MV_INT_PEX0 9 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_GBESUM 11 /* GbE0 summary interrupt */ -#define MV_INT_GBERX 12 /* GbE0 receive interrupt */ -#define MV_INT_GBETX 13 /* GbE0 transmit interrupt */ -#define MV_INT_GBEMISC 14 /* GbE0 misc. interrupt */ -#define MV_INT_GBE1SUM 15 /* GbE1 summary interrupt */ -#define MV_INT_GBE1RX 16 /* GbE1 receive interrupt */ -#define MV_INT_GBE1TX 17 /* GbE1 transmit interrupt */ -#define MV_INT_GBE1MISC 18 /* GbE1 misc. interrupt */ -#define MV_INT_USB_CI 19 /* USB Controller interrupt */ -#define MV_INT_SATA 21 /* Serial-ATA Interrupt */ -#define MV_INT_CESA 22 /* Security engine completion int. */ -#define MV_INT_IDMA_ERR 23 /* DMA error interrupt */ -#define MV_INT_UART0 33 /* UART0 Interrupt */ -#define MV_INT_UART1 34 -#define MV_INT_GPIO7_0 35 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 36 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 37 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 38 /* GPIO[31:24] Interrupt */ -#define MV_INT_GPIOHI7_0 39 /* GPIOHI[7:0] Interrupt */ -#define MV_INT_GPIOHI15_8 40 /* GPIOHI[15:8] Interrupt */ -#define MV_INT_GPIOHI23_16 41 /* GPIOHI[23:16] Interrupt */ -#define MV_INT_XOR0_ERR 42 /* XOR engine 0 error Interrupt */ -#define MV_INT_XOR1_ERR 43 /* XOR engine 1 error Interrupt */ -#define MV_INT_PEX0_ERR 44 /* PCI Express Error */ -#define MV_INT_GBEERR 46 /* GbE0 error interrupt */ -#define MV_INT_GBE1ERR 47 /* GbE1 error interrupt */ -#define MV_INT_USB_BERR 48 /* USB Bridge Error */ - -#elif defined(SOC_MV_DISCOVERY) - -#define MV_INT_ERRSUM 0 /* Summary of error interrupts */ -#define MV_INT_SPI 1 /* SPI interrupt */ -#define MV_INT_TWSI0 2 /* TWSI0 interrupt */ -#define MV_INT_TWSI1 3 /* TWSI1 interrupt */ -#define MV_INT_IDMA0 4 /* IDMA Channel0 completion */ -#define MV_INT_IDMA1 5 /* IDMA Channel0 completion */ -#define MV_INT_IDMA2 6 /* IDMA Channel0 completion */ -#define MV_INT_IDMA3 7 /* IDMA Channel0 completion */ -#define MV_INT_TIMER0 8 /* Timer0 interrupt */ -#define MV_INT_TIMER1 9 /* Timer1 interrupt */ -#define MV_INT_TIMER2 10 /* Timer2 interrupt */ -#define MV_INT_TIMER3 11 /* Timer3 interrupt */ -#define MV_INT_UART0 12 /* UART0 interrupt */ -#define MV_INT_UART1 13 /* UART1 interrupt */ -#define MV_INT_UART2 14 /* UART2 interrupt */ -#define MV_INT_UART3 15 /* UART3 interrupt */ -#define MV_INT_USB0 16 /* USB0 interrupt */ -#define MV_INT_USB1 17 /* USB1 interrupt */ -#define MV_INT_USB2 18 /* USB2 interrupt */ -#define MV_INT_CESA 19 /* Crypto engine completion interrupt */ -#define MV_INT_XOR0 22 /* XOR engine 0 completion interrupt */ -#define MV_INT_XOR1 23 /* XOR engine 1 completion interrupt */ -#define MV_INT_SATA 26 /* SATA interrupt */ -#define MV_INT_PEX00 32 /* PCI Express port 0.0 INTA/B/C/D */ -#define MV_INT_PEX01 33 /* PCI Express port 0.1 INTA/B/C/D */ -#define MV_INT_PEX02 34 /* PCI Express port 0.2 INTA/B/C/D */ -#define MV_INT_PEX03 35 /* PCI Express port 0.3 INTA/B/C/D */ -#define MV_INT_PEX10 36 /* PCI Express port 1.0 INTA/B/C/D */ -#define MV_INT_PEX11 37 /* PCI Express port 1.1 INTA/B/C/D */ -#define MV_INT_PEX12 38 /* PCI Express port 1.2 INTA/B/C/D */ -#define MV_INT_PEX13 39 /* PCI Express port 1.3 INTA/B/C/D */ -#define MV_INT_GBESUM 40 /* Gigabit Ethernet Port 0 summary */ -#define MV_INT_GBERX 41 /* Gigabit Ethernet Port 0 Rx summary */ -#define MV_INT_GBETX 42 /* Gigabit Ethernet Port 0 Tx summary */ -#define MV_INT_GBEMISC 43 /* Gigabit Ethernet Port 0 Misc summ. */ -#define MV_INT_GBE1SUM 44 /* Gigabit Ethernet Port 1 summary */ -#define MV_INT_GBE1RX 45 /* Gigabit Ethernet Port 1 Rx summary */ -#define MV_INT_GBE1TX 46 /* Gigabit Ethernet Port 1 Tx summary */ -#define MV_INT_GBE1MISC 47 /* Gigabit Ethernet Port 1 Misc summ. */ -#define MV_INT_GPIO7_0 56 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_8 57 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 58 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 59 /* GPIO[31:24] Interrupt */ -#define MV_INT_DB_IN 60 /* Inbound Doorbell Cause reg Summary */ -#define MV_INT_DB_OUT 61 /* Outbound Doorbell Cause reg Summ. */ -#define MV_INT_CRYPT_ERR 64 /* Crypto engine error */ -#define MV_INT_DEV_ERR 65 /* Device bus error */ -#define MV_INT_IDMA_ERR 66 /* DMA error */ -#define MV_INT_CPU_ERR 67 /* CPU error */ -#define MV_INT_PEX0_ERR 68 /* PCI-Express port0 error */ -#define MV_INT_PEX1_ERR 69 /* PCI-Express port1 error */ -#define MV_INT_GBE_ERR 70 /* Gigabit Ethernet error */ -#define MV_INT_USB_ERR 72 /* USB error */ -#define MV_INT_DRAM_ERR 73 /* DRAM ECC error */ -#define MV_INT_XOR_ERR 74 /* XOR engine error */ -#define MV_INT_WD 79 /* WD Timer interrupt */ - -#endif /* SOC_MV_ORION */ - #define BRIDGE_IRQ_CAUSE 0x10 #define BRIGDE_IRQ_MASK 0x14 From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 18:47:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22F21106564A; Sun, 4 Mar 2012 18:47:21 +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 0E0608FC16; Sun, 4 Mar 2012 18:47: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 q24IlK42047923; Sun, 4 Mar 2012 18:47:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24IlKij047921; Sun, 4 Mar 2012 18:47:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203041847.q24IlKij047921@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 4 Mar 2012 18:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232513 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 18:47:21 -0000 Author: bz Date: Sun Mar 4 18:47:20 2012 New Revision: 232513 URL: http://svn.freebsd.org/changeset/base/232513 Log: Correct typo in the RFC number for the constants based on IANA assignments for IPv6 Neighbor Discovery Option types for "IPv6 Router Advertisement Options for DNS Configuration". It is RFC 6106. MFC after: 3 days Modified: head/sys/netinet/icmp6.h Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Sun Mar 4 18:13:45 2012 (r232512) +++ head/sys/netinet/icmp6.h Sun Mar 4 18:47:20 2012 (r232513) @@ -298,8 +298,8 @@ struct nd_opt_hdr { /* Neighbor discove #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 #define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ -#define ND_OPT_RDNSS 25 /* RFC 6016 */ -#define ND_OPT_DNSSL 31 /* RFC 6016 */ +#define ND_OPT_RDNSS 25 /* RFC 6106 */ +#define ND_OPT_DNSSL 31 /* RFC 6106 */ struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 18:51:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03B3B106566C; Sun, 4 Mar 2012 18:51:26 +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 CA4268FC08; Sun, 4 Mar 2012 18:51:25 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6AB7446B0D; Sun, 4 Mar 2012 13:51:25 -0500 (EST) Received: from kavik.baldwin.cx (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E9C0EB974; Sun, 4 Mar 2012 13:51:24 -0500 (EST) From: John Baldwin To: Tijl Coosemans Date: Sun, 4 Mar 2012 13:51:22 -0500 User-Agent: KMail/1.13.7 (FreeBSD/9.0-BETA2; KDE/4.6.5; i386; ; ) References: <201202281838.q1SIcYhE082928@svn.freebsd.org> In-Reply-To: <201202281838.q1SIcYhE082928@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203041351.22847.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sun, 04 Mar 2012 13:51:25 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232264 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 18:51:26 -0000 On Tuesday, February 28, 2012 01:38:34 PM Tijl Coosemans wrote: > Author: tijl > Date: Tue Feb 28 18:38:33 2012 > New Revision: 232264 > URL: http://svn.freebsd.org/changeset/base/232264 > > Log: > Copy amd64 _stdint.h to x86 and merge with i386 _stdint.h. Replace > amd64/i386/pc98 _stdint.h with stubs. > > Added: > head/sys/x86/include/_stdint.h > - copied, changed from r232259, head/sys/amd64/include/_stdint.h This broke C++ software (such as the audio/flac port), that #includes with __STDC_LIMIT_MACROS defined but not __STDC_CONSTANT_MACROS defined. The problem is that you have changed UINT64_MAX and INT64_MAX to use UINT64_C() and INT64_C(), so in this case UINT64_MAX now expands to UINT64_C(...) which can't be resolved to a constant. You should be able to reproduce this via the following: % cat > bar.cc #define __STDC_LIMIT_MACROS #include % c++ -c bar.cc (The test to see if __WORDSIZE should be defined at the end of stdint.h trips over this bug.) While you could do something like add __INT64_C() and __UINT64_C() macros that are always defined and use them for INT64_MAX and UINT64_MAX, I think the simplest fix is probably to just use #ifdef _LP64 tests to define INT64_MAX and UINT64_MAX as pure constants as those are the only two macros effected. (I've just hardcoded those two constants on my little netbook so I can keep building ports and that worked fine for audio/flac). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 18:51:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70F07106564A; Sun, 4 Mar 2012 18:51:46 +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 5C6F48FC17; Sun, 4 Mar 2012 18:51: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 q24Ipk8q048085; Sun, 4 Mar 2012 18:51:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24IpkOY048083; Sun, 4 Mar 2012 18:51:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203041851.q24IpkOY048083@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 4 Mar 2012 18:51: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: r232514 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 18:51:46 -0000 Author: bz Date: Sun Mar 4 18:51:45 2012 New Revision: 232514 URL: http://svn.freebsd.org/changeset/base/232514 Log: In nd6_options() ignore the RFC 6106 options completely rather than printing them if nd6_debug is enabled as unknown. Leave a comment about the RFC4191 option as I am undecided so far. Discussed with: hrs MFC after: 3 days Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Mar 4 18:47:20 2012 (r232513) +++ head/sys/netinet6/nd6.c Sun Mar 4 18:51:45 2012 (r232514) @@ -380,6 +380,14 @@ nd6_options(union nd_opts *ndopts) ndopts->nd_opts_pi_end = (struct nd_opt_prefix_info *)nd_opt; break; + /* What about ND_OPT_ROUTE_INFO? RFC 4191 */ + case ND_OPT_RDNSS: /* RFC 6106 */ + case ND_OPT_DNSSL: /* RFC 6106 */ + /* + * Silently ignore options we know and do not care about + * in the kernel. + */ + break; default: /* * Unknown options must be silently ignored, From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 18:53:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0445D106566B; Sun, 4 Mar 2012 18:53:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA8298FC08; Sun, 4 Mar 2012 18:53: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 q24IrZem048171; Sun, 4 Mar 2012 18:53:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24IrZ5m048169; Sun, 4 Mar 2012 18:53:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203041853.q24IrZ5m048169@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 4 Mar 2012 18:53: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: r232515 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 18:53:36 -0000 Author: bz Date: Sun Mar 4 18:53:35 2012 New Revision: 232515 URL: http://svn.freebsd.org/changeset/base/232515 Log: Rather than printing the output from route add for all FIBs just print them for the default FIB followed by a statement with a list of FIB numbers for all the other FIBs we install the routes for. Request by: kib (to make it less noisy) Tested by: kib MFC after: 3 days Modified: head/etc/rc.d/routing Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Sun Mar 4 18:51:45 2012 (r232514) +++ head/etc/rc.d/routing Sun Mar 4 18:53:35 2012 (r232515) @@ -147,14 +147,21 @@ static_inet6() : ${fibs:=1} # disallow "internal" addresses to appear on the wire - i=0 - while test ${i} -lt ${fibs}; do - setfib -F ${i} route ${_action} \ - -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject - setfib -F ${i} route ${_action} \ - -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject - i=$((i + 1)) - done + route ${_action} -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + route ${_action} -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=1 + if test ${i} -lt ${fibs}; then + printf "Also installing reject routes for FIBs" + while test ${i} -lt ${fibs}; do + setfib -F ${i} route -q ${_action} \ + -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + setfib -F ${i} route -q ${_action} \ + -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + printf " %d" ${i} + i=$((i + 1)) + done + printf "\n" + fi case ${ipv6_defaultrouter} in [Nn][Oo] | '') @@ -226,14 +233,21 @@ static_inet6() # for the host case, you will allow to omit the identifiers. # Under this configuration, the packets will go to the default # interface. - i=0 - while test ${i} -lt ${fibs}; do - setfib -F ${i} route ${_action} \ - -inet6 fe80:: -prefixlen 10 ::1 -reject - setfib -F ${i} route ${_action} \ - -inet6 ff02:: -prefixlen 16 ::1 -reject - i=$((i + 1)) - done + route ${_action} -inet6 fe80:: -prefixlen 10 ::1 -reject + route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject + i=1 + if test ${i} -lt ${fibs}; then + printf "Also installing reject routes for FIBs" + while test ${i} -lt ${fibs}; do + setfib -F ${i} route -q ${_action} \ + -inet6 fe80:: -prefixlen 10 ::1 -reject + setfib -F ${i} route -q ${_action} \ + -inet6 ff02:: -prefixlen 16 ::1 -reject + printf " %d" ${i} + i=$((i + 1)) + done + printf "\n" + fi case ${ipv6_default_interface} in '') From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 18:55:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9AE7F106566B; Sun, 4 Mar 2012 18:55:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D8A88FC15; Sun, 4 Mar 2012 18:55: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 q24ItYcN048293; Sun, 4 Mar 2012 18:55:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24ItYvx048290; Sun, 4 Mar 2012 18:55:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203041855.q24ItYvx048290@svn.freebsd.org> From: John Baldwin Date: Sun, 4 Mar 2012 18:55: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: r232516 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 18:55:34 -0000 Author: jhb Date: Sun Mar 4 18:55:33 2012 New Revision: 232516 URL: http://svn.freebsd.org/changeset/base/232516 Log: Document pci_find_extcap() and pci_find_htcap(). Modified: head/share/man/man9/Makefile head/share/man/man9/pci.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Mar 4 18:53:35 2012 (r232515) +++ head/share/man/man9/Makefile Sun Mar 4 18:55:33 2012 (r232516) @@ -981,6 +981,8 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_cap.9 \ pci.9 pci_find_dbsf.9 \ pci.9 pci_find_device.9 \ + pci.9 pci_find_extcap.9 \ + pci.9 pci_find_htcap.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Sun Mar 4 18:53:35 2012 (r232515) +++ head/share/man/man9/pci.9 Sun Mar 4 18:55:33 2012 (r232516) @@ -40,6 +40,8 @@ .Nm pci_find_cap , .Nm pci_find_dbsf , .Nm pci_find_device , +.Nm pci_find_extcap , +.Nm pci_find_htcap , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -81,6 +83,10 @@ .Ft device_t .Fn pci_find_device "uint16_t vendor" "uint16_t device" .Ft int +.Fn pci_find_extcap "device_t dev" "int capability" "int *capreg" +.Ft int +.Fn pci_find_htcap "device_t dev" "int capability" "int *capreg" +.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -225,6 +231,49 @@ If the capability is not found or the de returns an error. .Pp The +.Fn pci_find_extcap +function is used to locate the first instance of a PCI-express +extended capability register set for the device +.Fa dev . +The extended capability to locate is specified by ID via +.Fa capability . +Constant macros of the form +.Dv PCIZ_xxx +for standard extended capability IDs are defined in +.In dev/pci/pcireg.h . +If the extended capability is found, then +.Fa *capreg +is set the offset in configuration space of the extended capability +register set, and +.Fn pci_find_extcap +returns zero. +If the extended capability is not found or the device is not a +PCI-express device, +.Fn pci_find_extcap +returns an error. +.Pp +The +.Fn pci_find_htcap +function is used to locate the first instance of a HyperTransport capability +register set for the device +.Fa dev . +The capability to locate is specified by type via +.Fa capability . +Constant macros of the form +.Dv PCIM_HTCAP_xxx +for standard HyperTransport capability types are defined in +.In dev/pci/pcireg.h . +If the capability is found, then +.Fa *capreg +is set the offset in configuration space of the capability register set, +and +.Fn pci_find_htcap +returns zero. +If the capability is not found or the device is not a HyperTransport device, +.Fn pci_find_htcap +returns an error. +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 18:59:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BB0F106564A; Sun, 4 Mar 2012 18:59:39 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7725C8FC18; Sun, 4 Mar 2012 18:59: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 q24IxdCo048447; Sun, 4 Mar 2012 18:59:39 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24Ixd29048445; Sun, 4 Mar 2012 18:59:39 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201203041859.q24Ixd29048445@svn.freebsd.org> From: Marko Zec Date: Sun, 4 Mar 2012 18:59: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: r232517 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 18:59:39 -0000 Author: zec Date: Sun Mar 4 18:59:38 2012 New Revision: 232517 URL: http://svn.freebsd.org/changeset/base/232517 Log: Change SYSINIT priorities so that ip_mroute_modevent() is executed before vnet_mroute_init(), since vnet_mroute_init() depends on mfchashsize tunable to be set, and that is done in in ip_mroute_modevent(). Apparently I broke that ordering with r208744 almost 2 years ago... PR: kern/162201 Submitted by: Stevan Markovic (mcafee.com) MFC after: 3 days Modified: head/sys/netinet/ip_mroute.c Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Sun Mar 4 18:55:33 2012 (r232516) +++ head/sys/netinet/ip_mroute.c Sun Mar 4 18:59:38 2012 (r232517) @@ -2822,7 +2822,7 @@ vnet_mroute_init(const void *unused __un callout_init(&V_bw_meter_ch, CALLOUT_MPSAFE); } -VNET_SYSINIT(vnet_mroute_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, vnet_mroute_init, +VNET_SYSINIT(vnet_mroute_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_mroute_init, NULL); static void @@ -2945,4 +2945,4 @@ static moduledata_t ip_mroutemod = { 0 }; -DECLARE_MODULE(ip_mroute, ip_mroutemod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(ip_mroute, ip_mroutemod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE); From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 19:03:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 144381065670; Sun, 4 Mar 2012 19:03: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 DC5228FC08; Sun, 4 Mar 2012 19:03:31 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 92DE346B39; Sun, 4 Mar 2012 14:03:31 -0500 (EST) Received: from kavik.baldwin.cx (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0DCD6B969; Sun, 4 Mar 2012 14:03:31 -0500 (EST) From: John Baldwin To: Eitan Adler Date: Sun, 4 Mar 2012 13:52:50 -0500 User-Agent: KMail/1.13.7 (FreeBSD/9.0-BETA2; KDE/4.6.5; i386; ; ) References: <201203041522.q24FM4sB040519@svn.freebsd.org> In-Reply-To: <201203041522.q24FM4sB040519@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203041352.50593.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sun, 04 Mar 2012 14:03:31 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232496 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 19:03:32 -0000 On Sunday, March 04, 2012 10:22:04 AM Eitan Adler wrote: > Author: eadler > Date: Sun Mar 4 15:22:03 2012 > New Revision: 232496 > URL: http://svn.freebsd.org/changeset/base/232496 > > Log: > PR: docs/158813 > Submitted by: Ben Kaduk > Approved by: bcr > MFC after: 1 week Can you do a forced commit to add a commit log of the actual change please? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 19:22:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FF09106566B; Sun, 4 Mar 2012 19:22:53 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 892A38FC17; Sun, 4 Mar 2012 19:22: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 q24JMrMQ049230; Sun, 4 Mar 2012 19:22:53 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24JMria049221; Sun, 4 Mar 2012 19:22:53 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201203041922.q24JMria049221@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 4 Mar 2012 19:22: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: r232518 - in head/sys: boot/fdt/dts dev/fdt dev/mge dev/tsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 19:22:53 -0000 Author: raj Date: Sun Mar 4 19:22:52 2012 New Revision: 232518 URL: http://svn.freebsd.org/changeset/base/232518 Log: Respect phy-handle property in Ethernet nodes of the device tree. This lets specify whereabouts of the parent PHY for a given MAC node (and get rid of ugly kludges in mge(4) and tsec(4)). Obtained from: Semihalf MFC after: 1 week Modified: head/sys/boot/fdt/dts/db78100.dts head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h head/sys/dev/mge/if_mge.c head/sys/dev/mge/if_mgevar.h head/sys/dev/tsec/if_tsec.c head/sys/dev/tsec/if_tsec.h head/sys/dev/tsec/if_tsec_fdt.c Modified: head/sys/boot/fdt/dts/db78100.dts ============================================================================== --- head/sys/boot/fdt/dts/db78100.dts Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/boot/fdt/dts/db78100.dts Sun Mar 4 19:22:52 2012 (r232518) @@ -221,6 +221,9 @@ phy0: ethernet-phy@0 { reg = <0x8>; }; + phy1: ethernet-phy@1 { + reg = <0x9>; + }; }; }; @@ -234,17 +237,7 @@ local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <45 46 47 44 70>; interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x9>; - }; - }; + phy-handle = <&phy1>; }; serial0: serial@12000 { Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/fdt/fdt_common.c Sun Mar 4 19:22:52 2012 (r232518) @@ -542,11 +542,13 @@ out: } int -fdt_get_phyaddr(phandle_t node, int *phy_addr) +fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; ihandle_t phy_ihandle; pcell_t phy_handle, phy_reg; + uint32_t i; + device_t parent, child; if (OF_getprop(node, "phy-handle", (void *)&phy_handle, sizeof(phy_handle)) <= 0) @@ -561,6 +563,47 @@ fdt_get_phyaddr(phandle_t node, int *phy return (ENXIO); *phy_addr = fdt32_to_cpu(phy_reg); + + /* + * Search for softc used to communicate with phy. + */ + + /* + * Step 1: Search for ancestor of the phy-node with a "phy-handle" + * property set. + */ + phy_node = OF_parent(phy_node); + while (phy_node != 0) { + if (OF_getprop(phy_node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) > 0) + break; + phy_node = OF_parent(phy_node); + } + if (phy_node == 0) + return (ENXIO); + + /* + * Step 2: For each device with the same parent and name as ours + * compare its node with the one found in step 1, ancestor of phy + * node (stored in phy_node). + */ + parent = device_get_parent(dev); + i = 0; + child = device_find_child(parent, device_get_name(dev), i); + while (child != NULL) { + if (ofw_bus_get_node(child) == phy_node) + break; + i++; + child = device_find_child(parent, device_get_name(dev), i); + } + if (child == NULL) + return (ENXIO); + + /* + * Use softc of the device found. + */ + *phy_sc = (void *)device_get_softc(child); + return (0); } Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/fdt/fdt_common.h Sun Mar 4 19:22:52 2012 (r232518) @@ -89,7 +89,7 @@ int fdt_data_to_res(pcell_t *, int, int, int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); -int fdt_get_phyaddr(phandle_t node, int *); +int fdt_get_phyaddr(phandle_t, device_t, int *, void **); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_intr_decode(phandle_t, pcell_t *, int *, int *, int *); Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/mge/if_mge.c Sun Mar 4 19:22:52 2012 (r232518) @@ -79,9 +79,6 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -/* PHY registers are in the address space of the first mge unit */ -static struct mge_softc *sc_mge0 = NULL; - static int mge_probe(device_t dev); static int mge_attach(device_t dev); static int mge_detach(device_t dev); @@ -635,14 +632,11 @@ mge_attach(device_t dev) sc->dev = dev; sc->node = ofw_bus_get_node(dev); - if (device_get_unit(dev) == 0) - sc_mge0 = sc; - /* Set chip version-dependent parameters */ mge_ver_params(sc); - /* Get phy address from fdt */ - if (fdt_get_phyaddr(sc->node, &phy) != 0) + /* Get phy address and used softc from fdt */ + if (fdt_get_phyaddr(sc->node, sc->dev, &phy, (void **)&sc->phy_sc) != 0) return (ENXIO); /* Initialize mutexes */ @@ -1294,17 +1288,18 @@ mge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & + MGE_WRITE(sc->phy_sc, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_READ | (reg << 21) | (phy << 16))); retries = MGE_SMI_READ_RETRIES; - while (--retries && !(MGE_READ(sc_mge0, MGE_REG_SMI) & MGE_SMI_READVALID)) + while (--retries && + !(MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_READVALID)) DELAY(MGE_SMI_READ_DELAY); if (retries == 0) device_printf(dev, "Timeout while reading from PHY\n"); - return (MGE_READ(sc_mge0, MGE_REG_SMI) & 0xffff); + return (MGE_READ(sc->phy_sc, MGE_REG_SMI) & 0xffff); } static int @@ -1315,11 +1310,11 @@ mge_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & + MGE_WRITE(sc->phy_sc, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_WRITE | (reg << 21) | (phy << 16) | (value & 0xffff))); retries = MGE_SMI_WRITE_RETRIES; - while (--retries && MGE_READ(sc_mge0, MGE_REG_SMI) & MGE_SMI_BUSY) + while (--retries && MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_BUSY) DELAY(MGE_SMI_WRITE_DELAY); if (retries == 0) Modified: head/sys/dev/mge/if_mgevar.h ============================================================================== --- head/sys/dev/mge/if_mgevar.h Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/mge/if_mgevar.h Sun Mar 4 19:22:52 2012 (r232518) @@ -103,6 +103,8 @@ struct mge_softc { uint32_t mge_tx_tok_cnt; uint16_t mge_mtu; int mge_ver; + + struct mge_softc *phy_sc; }; Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/tsec/if_tsec.c Sun Mar 4 19:22:52 2012 (r232518) @@ -106,8 +106,6 @@ static void tsec_offload_process_frame(s static void tsec_setup_multicast(struct tsec_softc *sc); static int tsec_set_mtu(struct tsec_softc *sc, unsigned int mtu); -struct tsec_softc *tsec0_sc = NULL; /* XXX ugly hack! */ - devclass_t tsec_devclass; DRIVER_MODULE(miibus, tsec, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(tsec, ether, 1, 1, 1); @@ -406,14 +404,14 @@ tsec_init_locked(struct tsec_softc *sc) TSEC_WRITE(sc, TSEC_REG_TBIPA, 5); /* Step 6: Reset the management interface */ - TSEC_WRITE(tsec0_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_RESETMGMT); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_RESETMGMT); /* Step 7: Setup the MII Mgmt clock speed */ - TSEC_WRITE(tsec0_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_CLKDIV28); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_CLKDIV28); /* Step 8: Read MII Mgmt indicator register and check for Busy = 0 */ timeout = TSEC_READ_RETRY; - while (--timeout && (TSEC_READ(tsec0_sc, TSEC_REG_MIIMIND) & + while (--timeout && (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); if (timeout == 0) { @@ -1561,21 +1559,21 @@ tsec_miibus_readreg(device_t dev, int ph struct tsec_softc *sc; uint32_t timeout; - sc = tsec0_sc; + sc = device_get_softc(dev); - TSEC_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg); - TSEC_WRITE(sc, TSEC_REG_MIIMCOM, 0); - TSEC_WRITE(sc, TSEC_REG_MIIMCOM, TSEC_MIIMCOM_READCYCLE); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMADD, (phy << 8) | reg); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCOM, 0); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCOM, TSEC_MIIMCOM_READCYCLE); timeout = TSEC_READ_RETRY; - while (--timeout && TSEC_READ(sc, TSEC_REG_MIIMIND) & + while (--timeout && TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & (TSEC_MIIMIND_NOTVALID | TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); if (timeout == 0) device_printf(dev, "Timeout while reading from PHY!\n"); - return (TSEC_READ(sc, TSEC_REG_MIIMSTAT)); + return (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMSTAT)); } int @@ -1584,13 +1582,13 @@ tsec_miibus_writereg(device_t dev, int p struct tsec_softc *sc; uint32_t timeout; - sc = tsec0_sc; + sc = device_get_softc(dev); - TSEC_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg); - TSEC_WRITE(sc, TSEC_REG_MIIMCON, value); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMADD, (phy << 8) | reg); + TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCON, value); timeout = TSEC_READ_RETRY; - while (--timeout && (TSEC_READ(sc, TSEC_REG_MIIMIND) & + while (--timeout && (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); Modified: head/sys/dev/tsec/if_tsec.h ============================================================================== --- head/sys/dev/tsec/if_tsec.h Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/tsec/if_tsec.h Sun Mar 4 19:22:52 2012 (r232518) @@ -133,6 +133,7 @@ struct tsec_softc { struct mbuf *frame; int phyaddr; + struct tsec_softc *phy_sc; }; /* interface to get/put generic objects */ Modified: head/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- head/sys/dev/tsec/if_tsec_fdt.c Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/tsec/if_tsec_fdt.c Sun Mar 4 19:22:52 2012 (r232518) @@ -68,8 +68,6 @@ __FBSDID("$FreeBSD$"); #define TSEC_RID_RXIRQ 1 #define TSEC_RID_ERRIRQ 2 -extern struct tsec_softc *tsec0_sc; - static int tsec_fdt_probe(device_t dev); static int tsec_fdt_attach(device_t dev); static int tsec_fdt_detach(device_t dev); @@ -156,12 +154,9 @@ tsec_fdt_attach(device_t dev) sc->dev = dev; sc->node = ofw_bus_get_node(dev); - /* XXX add comment on weird FSL's MII registers access design */ - if (device_get_unit(dev) == 0) - tsec0_sc = sc; - /* Get phy address from fdt */ - if (fdt_get_phyaddr(sc->node, &sc->phyaddr) != 0) + if (fdt_get_phyaddr(sc->node, sc->dev, &sc->phyaddr, + (void **)&sc->phy_sc) != 0) return (ENXIO); /* Init timer */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 19:33:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95C6C106564A for ; Sun, 4 Mar 2012 19:33:03 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 251978FC14 for ; Sun, 4 Mar 2012 19:33:02 +0000 (UTC) Received: by werl4 with SMTP id l4so2593401wer.13 for ; Sun, 04 Mar 2012 11:33:02 -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=g2oBvWzeHmSzTb5QjZKL2kzOFrbUi1KPJ+raluEiPqk=; b=nKKmgwUQ7l9pY3mjqNlflZchlYLyOgba7ryWM0buvGiXqIzrUQmyR3dFPvd93KFM2F l1+bPNbd38+DfVAKf8XmMkzfd+iV0tNhTpwjBR8s3/ukwWeq9riePKlCkLzt2xovqKbu dhCp1Sx+NOr58opBULvD+msWZwcpPrVCLiTAw= Received: by 10.180.76.175 with SMTP id l15mr8449841wiw.2.1330889581999; Sun, 04 Mar 2012 11:33:01 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.15.90 with HTTP; Sun, 4 Mar 2012 11:32:31 -0800 (PST) In-Reply-To: <201203041352.50593.jhb@freebsd.org> References: <201203041522.q24FM4sB040519@svn.freebsd.org> <201203041352.50593.jhb@freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2012 14:32:31 -0500 X-Google-Sender-Auth: s0hgOzwMRxzAiT-MRkZZ3R0YQ9M Message-ID: To: John Baldwin Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQl8LlMOijIvJSvk9OFJwigQ42aBaS5lxT8NuXYxXmIXnbEXo4c07x7kZvcgeb3ZfwVA6vft Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232496 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 19:33:03 -0000 On Sun, Mar 4, 2012 at 1:52 PM, John Baldwin wrote: > Can you do a forced commit to add a commit log of the actual change please? I don't know of any real way to do forced commits so does the following look acceptable? %cat log Forced commit because I forgot my log message in r232496: Fix a variety of English language grammar issues and style nits %svn diff Index: share/man/man4/jme.4 =================================================================== --- share/man/man4/jme.4 (revision 231896) +++ share/man/man4/jme.4 (working copy) Property changes on: share/man/man4/jme.4 ___________________________________________________________________ Added: forcecommit ## -0,0 +1 ## +1 \ No newline at end of property -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 20:02:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0493D106564A; Sun, 4 Mar 2012 20:02:21 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E40DA8FC16; Sun, 4 Mar 2012 20:02: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 q24K2KJF050462; Sun, 4 Mar 2012 20:02:20 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24K2KWF050460; Sun, 4 Mar 2012 20:02:20 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203042002.q24K2KWF050460@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 4 Mar 2012 20:02: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: r232519 - head/sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 20:02:21 -0000 Author: tijl Date: Sun Mar 4 20:02:20 2012 New Revision: 232519 URL: http://svn.freebsd.org/changeset/base/232519 Log: Do not use INT64_C and UINT64_C to define 64 bit integer limits. They aren't defined for C++ code unless __STDC_CONSTANT_MACROS is defined. Reported by: jhb Modified: head/sys/x86/include/_stdint.h Modified: head/sys/x86/include/_stdint.h ============================================================================== --- head/sys/x86/include/_stdint.h Sun Mar 4 19:22:52 2012 (r232518) +++ head/sys/x86/include/_stdint.h Sun Mar 4 20:02:20 2012 (r232519) @@ -69,23 +69,27 @@ * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types */ -/* Minimum values of exact-width signed integer types. */ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-1) -/* Maximum values of exact-width signed integer types. */ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff -#define INT64_MAX INT64_C(0x7fffffffffffffff) -/* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffffU -#define UINT64_MAX UINT64_C(0xffffffffffffffff) + +#ifdef _LP64 +#define INT64_MIN (-0x7fffffffffffffff-1) +#define INT64_MAX 0x7fffffffffffffff +#define UINT64_MAX 0xffffffffffffffff +#else +#define INT64_MIN (-0x7fffffffffffffffLL-1) +#define INT64_MAX 0x7fffffffffffffffLL +#define UINT64_MAX 0xffffffffffffffffULL +#endif /* * ISO/IEC 9899:1999 From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 20:05:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 618A2106567F; Sun, 4 Mar 2012 20:05:27 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay005.isp.belgacom.be (mailrelay005.isp.belgacom.be [195.238.6.171]) by mx1.freebsd.org (Postfix) with ESMTP id 522338FC14; Sun, 4 Mar 2012 20:05:25 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EAOvJU09bsWcW/2dsb2JhbABDhTSvDYEIgX0BAQUjMyMQCw4GBCoCAjkeBogeB6ZukRqPR4EWBKVQgmQ Received: from 22.103-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.103.22]) by relay.skynet.be with ESMTP; 04 Mar 2012 21:05:18 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q24K5ISa008170; Sun, 4 Mar 2012 21:05:18 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: John Baldwin Date: Sun, 4 Mar 2012 21:05:09 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201202281838.q1SIcYhE082928@svn.freebsd.org> <201203041351.22847.jhb@freebsd.org> In-Reply-To: <201203041351.22847.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1698307.50t2qeN2gg"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201203042105.15916.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232264 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 20:05:27 -0000 --nextPart1698307.50t2qeN2gg Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sunday 04 March 2012 19:51:22 John Baldwin wrote: > On Tuesday, February 28, 2012 01:38:34 PM Tijl Coosemans wrote: >> Author: tijl >> Date: Tue Feb 28 18:38:33 2012 >> New Revision: 232264 >> URL: http://svn.freebsd.org/changeset/base/232264 >>=20 >> Log: >> Copy amd64 _stdint.h to x86 and merge with i386 _stdint.h. Replace >> amd64/i386/pc98 _stdint.h with stubs. >>=20 >> Added: >> head/sys/x86/include/_stdint.h >> - copied, changed from r232259, head/sys/amd64/include/_stdint.h >=20 > This broke C++ software (such as the audio/flac port), that #includes > with __STDC_LIMIT_MACROS defined but not __STDC_CONSTANT_MACRO= S=20 > defined. The problem is that you have changed UINT64_MAX and INT64_MAX t= o use=20 > UINT64_C() and INT64_C(), so in this case UINT64_MAX now expands to=20 > UINT64_C(...) which can't be resolved to a constant. >=20 > You should be able to reproduce this via the following: >=20 > % cat > bar.cc > #define __STDC_LIMIT_MACROS > #include > % c++ -c bar.cc >=20 > (The test to see if __WORDSIZE should be defined at the end of stdint.h t= rips=20 > over this bug.) >=20 > While you could do something like add __INT64_C() and __UINT64_C() macros= that=20 > are always defined and use them for INT64_MAX and UINT64_MAX, I think the= =20 > simplest fix is probably to just use #ifdef _LP64 tests to define INT64_M= AX=20 > and UINT64_MAX as pure constants as those are the only two macros effecte= d. >=20 > (I've just hardcoded those two constants on my little netbook so I can ke= ep=20 > building ports and that worked fine for audio/flac). =46ixed in r232519. --nextPart1698307.50t2qeN2gg Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk9TyvsACgkQfoCS2CCgtisF9wD/SfvlMj3E2vfcD/7Mb6iUlJ1a fWY+7zWyjv18kcCuUlYA/3wQkD1hjPQW02PTS1+7GXEDLMoEFPLSIX9ltvGvG3Re =753o -----END PGP SIGNATURE----- --nextPart1698307.50t2qeN2gg-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 20:24:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4CA61065673; Sun, 4 Mar 2012 20:24:28 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEA608FC0A; Sun, 4 Mar 2012 20:24: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 q24KOSLx051198; Sun, 4 Mar 2012 20:24:28 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24KOSWK051192; Sun, 4 Mar 2012 20:24:28 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203042024.q24KOSWK051192@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 4 Mar 2012 20:24: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: r232520 - in head/sys: amd64/amd64 amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 20:24:29 -0000 Author: tijl Date: Sun Mar 4 20:24:28 2012 New Revision: 232520 URL: http://svn.freebsd.org/changeset/base/232520 Log: Copy amd64 ptrace.h to x86 and merge with i386 ptrace.h. Replace amd64/i386/pc98 ptrace.h with stubs. For amd64 PT_GETXSTATE and PT_SETXSTATE have been redefined to match the i386 values. The old values are still supported but should no longer be used. Reviewed by: kib Added: head/sys/x86/include/ptrace.h - copied, changed from r232518, head/sys/amd64/include/ptrace.h Modified: head/sys/amd64/amd64/ptrace_machdep.c head/sys/amd64/include/ptrace.h head/sys/i386/include/ptrace.h head/sys/pc98/include/ptrace.h Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Sun Mar 4 20:02:20 2012 (r232519) +++ head/sys/amd64/amd64/ptrace_machdep.c Sun Mar 4 20:24:28 2012 (r232520) @@ -126,6 +126,12 @@ cpu_ptrace(struct thread *td, int req, v return (cpu32_ptrace(td, req, addr, data)); #endif + /* Support old values of PT_GETXSTATE and PT_SETXSTATE. */ + if (req == PT_FIRSTMACH + 0) + req = PT_GETXSTATE; + if (req == PT_FIRSTMACH + 1) + req = PT_SETXSTATE; + switch (req) { case PT_GETXSTATE: case PT_SETXSTATE: Modified: head/sys/amd64/include/ptrace.h ============================================================================== --- head/sys/amd64/include/ptrace.h Sun Mar 4 20:02:20 2012 (r232519) +++ head/sys/amd64/include/ptrace.h Sun Mar 4 20:24:28 2012 (r232520) @@ -1,41 +1,6 @@ /*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)ptrace.h 8.1 (Berkeley) 6/11/93 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_PTRACE_H_ -#define _MACHINE_PTRACE_H_ - -#define __HAVE_PTRACE_MACHDEP - -#define PT_GETXSTATE (PT_FIRSTMACH + 0) -#define PT_SETXSTATE (PT_FIRSTMACH + 1) - -#endif +#include Modified: head/sys/i386/include/ptrace.h ============================================================================== --- head/sys/i386/include/ptrace.h Sun Mar 4 20:02:20 2012 (r232519) +++ head/sys/i386/include/ptrace.h Sun Mar 4 20:24:28 2012 (r232520) @@ -1,43 +1,6 @@ /*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)ptrace.h 8.1 (Berkeley) 6/11/93 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_PTRACE_H_ -#define _MACHINE_PTRACE_H_ - -#define __HAVE_PTRACE_MACHDEP - -#define PT_GETXMMREGS (PT_FIRSTMACH + 0) -#define PT_SETXMMREGS (PT_FIRSTMACH + 1) -#define PT_GETXSTATE (PT_FIRSTMACH + 2) -#define PT_SETXSTATE (PT_FIRSTMACH + 3) - -#endif +#include Modified: head/sys/pc98/include/ptrace.h ============================================================================== --- head/sys/pc98/include/ptrace.h Sun Mar 4 20:02:20 2012 (r232519) +++ head/sys/pc98/include/ptrace.h Sun Mar 4 20:24:28 2012 (r232520) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied and modified: head/sys/x86/include/ptrace.h (from r232518, head/sys/amd64/include/ptrace.h) ============================================================================== --- head/sys/amd64/include/ptrace.h Sun Mar 4 19:22:52 2012 (r232518, copy source) +++ head/sys/x86/include/ptrace.h Sun Mar 4 20:24:28 2012 (r232520) @@ -35,7 +35,14 @@ #define __HAVE_PTRACE_MACHDEP -#define PT_GETXSTATE (PT_FIRSTMACH + 0) -#define PT_SETXSTATE (PT_FIRSTMACH + 1) +/* + * On amd64 (PT_FIRSTMACH + 0) and (PT_FIRSTMACH + 1) are old values for + * PT_GETXSTATE and PT_SETXSTATE. They should not be (re)used. + */ + +#define PT_GETXMMREGS (PT_FIRSTMACH + 0) /* i386 only */ +#define PT_SETXMMREGS (PT_FIRSTMACH + 1) /* i386 only */ +#define PT_GETXSTATE (PT_FIRSTMACH + 2) +#define PT_SETXSTATE (PT_FIRSTMACH + 3) #endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 20:32:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57C181065670; Sun, 4 Mar 2012 20:32:38 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8041B8FC0C; Sun, 4 Mar 2012 20:32:37 +0000 (UTC) Received: by vcmm1 with SMTP id m1so1900610vcm.13 for ; Sun, 04 Mar 2012 12:32:37 -0800 (PST) Received-SPF: pass (google.com: domain of minimarmot@gmail.com designates 10.52.96.70 as permitted sender) client-ip=10.52.96.70; Authentication-Results: mr.google.com; spf=pass (google.com: domain of minimarmot@gmail.com designates 10.52.96.70 as permitted sender) smtp.mail=minimarmot@gmail.com; dkim=pass header.i=minimarmot@gmail.com Received: from mr.google.com ([10.52.96.70]) by 10.52.96.70 with SMTP id dq6mr30945973vdb.124.1330893157085 (num_hops = 1); Sun, 04 Mar 2012 12:32:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=JUmB3rf5StbvMFdL/d58ofTpDrZCxGmzXPTAFQkhNYE=; b=Ndek70lNeznvQuwwPs36cadOaibYtIC8siYnnJ9WW8+b/LgFXNZzSE56B7z4bx8TpS 5yKULzjpcr82Z9RsauTOPTBKsUdfuhPZIM9Uo3ZN0EAT2T+B0wrHBkKm4H4HOgdVDSan 1F+FuMww09RvRLxqUDzrZXc6hFkujt3bkZThuovEMQeEuI+508GwG91tYHNIQ5fEWykX iMuZfrJeNhiptMFJT+EpYbqEdoDfmcdZRkRkcp/ixafXjGNK6wcNtYl9UZDnRhorge+K LvWEJRnx1NFVEjbPW9a5rQEN1619xqXHGgQ4qB0VdpmlzXNXq2ikB9gRG9/DQXITSGIZ 3Rcw== MIME-Version: 1.0 Received: by 10.52.96.70 with SMTP id dq6mr26532180vdb.124.1330893157004; Sun, 04 Mar 2012 12:32:37 -0800 (PST) Received: by 10.52.0.14 with HTTP; Sun, 4 Mar 2012 12:32:36 -0800 (PST) In-Reply-To: References: <201203041522.q24FM4sB040519@svn.freebsd.org> <201203041352.50593.jhb@freebsd.org> Date: Sun, 4 Mar 2012 15:32:36 -0500 Message-ID: From: Ben Kaduk 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: r232496 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 20:32:38 -0000 On Sun, Mar 4, 2012 at 2:32 PM, Eitan Adler wrote: > On Sun, Mar 4, 2012 at 1:52 PM, John Baldwin wrote: >> Can you do a forced commit to add a commit log of the actual change plea= se? > > I don't know of any real way to do forced commits so does the > following look acceptable? You should be able to start that commit with an interactive editor for the commit message, background the editor, revert the actual change, and then foreground the editor and finish the commit. I believe that's the current best practice for doing forced commits. -Ben > > %cat log > Forced commit because I forgot my log message in r232496: > > Fix a variety of English language grammar issues and style nits > > %svn diff > Index: share/man/man4/jme.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/man/man4/jme.4 =A0 =A0 =A0 =A0(revision 231896) > +++ share/man/man4/jme.4 =A0 =A0 =A0 =A0(working copy) > > Property changes on: share/man/man4/jme.4 > ___________________________________________________________________ > Added: forcecommit > ## -0,0 +1 ## > +1 > \ No newline at end of property > > > > -- > Eitan Adler > Source & Ports committer > X11, Bugbusting teams > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 21:31:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 242E1106564A; Sun, 4 Mar 2012 21:31:14 +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 0598E8FC13; Sun, 4 Mar 2012 21:31: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 q24LVDjv053232; Sun, 4 Mar 2012 21:31:13 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24LVDfO053228; Sun, 4 Mar 2012 21:31:13 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201203042131.q24LVDfO053228@svn.freebsd.org> From: Robert Millan Date: Sun, 4 Mar 2012 21:31: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: r232521 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 21:31:14 -0000 Author: rmh Date: Sun Mar 4 21:31:13 2012 New Revision: 232521 URL: http://svn.freebsd.org/changeset/base/232521 Log: Exclude USB drivers (except umass and ukbd) from main kernel image on i386 and amd64. Reviewed by: hselasky, arch, usb Approved by: kib (mentor) Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/i386/conf/XBOX Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Mar 4 20:24:28 2012 (r232520) +++ head/sys/amd64/conf/GENERIC Sun Mar 4 21:31:13 2012 (r232521) @@ -303,39 +303,8 @@ device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) -#device udbp # USB Double Bulk Pipe devices (needs netgraph) -device uhid # "Human Interface Devices" device ukbd # Keyboard -device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device urio # Diamond Rio 500 MP3 player -# USB Serial devices -device u3g # USB-based 3G modems (Option, Huawei, Sierra) -device uark # Technologies ARK3116 based serial adapters -device ubsa # Belkin F5U103 and compatible serial adapters -device uftdi # For FTDI usb serial adapters -device uipaq # Some WinCE based devices -device uplcom # Prolific PL-2303 serial adapters -device uslcom # SI Labs CP2101/CP2102 serial adapters -device uvisor # Visor and Palm devices -device uvscom # USB serial support for DDI pocket's PHS -# USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB -# USB Wireless -device rum # Ralink Technology RT2501USB wireless NICs -device run # Ralink Technology RT2700/RT2800/RT3000 NICs. -device uath # Atheros AR5523 wireless NICs -device upgt # Conexant/Intersil PrismGT wireless NICs. -device ural # Ralink Technology RT2500USB wireless NICs -device urtw # Realtek RTL8187B/L wireless NICs -device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code @@ -351,7 +320,6 @@ device sound # Generic sound driver (r device snd_es137x # Ensoniq AudioPCI ES137x device snd_hda # Intel High Definition Audio device snd_ich # Intel, NVidia and other ICH AC'97 Audio -device snd_uaudio # USB Audio device snd_via8233 # VIA VT8233x Audio # MMC/SD Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Mar 4 20:24:28 2012 (r232520) +++ head/sys/i386/conf/GENERIC Sun Mar 4 21:31:13 2012 (r232521) @@ -316,39 +316,8 @@ device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) -#device udbp # USB Double Bulk Pipe devices (needs netgraph) -device uhid # "Human Interface Devices" device ukbd # Keyboard -device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device urio # Diamond Rio 500 MP3 player -# USB Serial devices -device u3g # USB-based 3G modems (Option, Huawei, Sierra) -device uark # Technologies ARK3116 based serial adapters -device ubsa # Belkin F5U103 and compatible serial adapters -device uftdi # For FTDI usb serial adapters -device uipaq # Some WinCE based devices -device uplcom # Prolific PL-2303 serial adapters -device uslcom # SI Labs CP2101/CP2102 serial adapters -device uvisor # Visor and Palm devices -device uvscom # USB serial support for DDI pocket's PHS -# USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB -# USB Wireless -device rum # Ralink Technology RT2501USB wireless NICs -device run # Ralink Technology RT2700/RT2800/RT3000 NICs. -device uath # Atheros AR5523 wireless NICs -device upgt # Conexant/Intersil PrismGT wireless NICs. -device ural # Ralink Technology RT2500USB wireless NICs -device urtw # Realtek RTL8187B/L wireless NICs -device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code @@ -364,7 +333,6 @@ device sound # Generic sound driver (r device snd_es137x # Ensoniq AudioPCI ES137x device snd_hda # Intel High Definition Audio device snd_ich # Intel, NVidia and other ICH AC'97 Audio -device snd_uaudio # USB Audio device snd_via8233 # VIA VT8233x Audio # MMC/SD Modified: head/sys/i386/conf/XBOX ============================================================================== --- head/sys/i386/conf/XBOX Sun Mar 4 20:24:28 2012 (r232520) +++ head/sys/i386/conf/XBOX Sun Mar 4 21:31:13 2012 (r232521) @@ -80,20 +80,10 @@ options USB_DEBUG # enable debug msgs #device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device usb # USB Bus (required) -device uhid # "Human Interface Devices" device ukbd # Keyboard -device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device urio # Diamond Rio 500 MP3 player device miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet device sound device snd_ich # nForce audio From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 21:36:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59FBC1065678; Sun, 4 Mar 2012 21:36:19 +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 458998FC19; Sun, 4 Mar 2012 21: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 q24LaJ37053420; Sun, 4 Mar 2012 21:36:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24LaJ6l053418; Sun, 4 Mar 2012 21:36:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203042136.q24LaJ6l053418@svn.freebsd.org> From: Dimitry Andric Date: Sun, 4 Mar 2012 21: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: r232522 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 21:36:19 -0000 Author: dim Date: Sun Mar 4 21:36:18 2012 New Revision: 232522 URL: http://svn.freebsd.org/changeset/base/232522 Log: Fix a thinko in r232322, where gcc (and its tools) are not built during the cross-tools stage, if CC=clang and WITH_CLANG_IS_CC is not set. This causes no 'cc' to be installed in the temporary cross-tools tree, making lint fall over later in the build, because it ignores ${CC} and attempts to run 'cc' anyway. To fix this, only skip building gcc during cross-tools, if WITHOUT_GCC is set, or if WITH_CLANG_IS_CC is set. Pointy hat to: dim MFC after: 2 weeks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 4 21:31:13 2012 (r232521) +++ head/Makefile.inc1 Sun Mar 4 21:36:18 2012 (r232522) @@ -1108,7 +1108,7 @@ _aicasm= sys/modules/aic7xxx/aicasm _share= share/syscons/scrnmaps .endif -.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") +.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" _gcc_tools= gnu/usr.bin/cc/cc_tools .endif @@ -1175,7 +1175,7 @@ _clang= usr.bin/clang _clang_libs= lib/clang .endif -.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") +.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" _cc= gnu/usr.bin/cc .endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 21:44:19 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6A59106564A; Sun, 4 Mar 2012 21:44:19 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id EBDF78FC19; Sun, 4 Mar 2012 21:44:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q24LiBAk076846; Mon, 5 Mar 2012 01:44:11 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q24LiB2B076845; Mon, 5 Mar 2012 01:44:11 +0400 (MSK) (envelope-from ache) Date: Mon, 5 Mar 2012 01:44:11 +0400 From: Andrey Chernov To: Robert Millan Message-ID: <20120304214411.GA76767@vniz.net> Mail-Followup-To: Andrey Chernov , Robert Millan , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201203042131.q24LVDfO053228@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203042131.q24LVDfO053228@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: r232521 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 21:44:19 -0000 On Sun, Mar 04, 2012 at 09:31:13PM +0000, Robert Millan wrote: > Author: rmh > Date: Sun Mar 4 21:31:13 2012 > New Revision: 232521 > URL: http://svn.freebsd.org/changeset/base/232521 > > Log: > Exclude USB drivers (except umass and ukbd) from main kernel image on i386 > and amd64. IMHO, generic should support USB mouse too. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 22:00:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8883A1065678; Sun, 4 Mar 2012 22:00:13 +0000 (UTC) (envelope-from andrey.kosachenko@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 41C3D8FC17; Sun, 4 Mar 2012 22:00:11 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so3603212bkc.13 for ; Sun, 04 Mar 2012 14:00:11 -0800 (PST) Received-SPF: pass (google.com: domain of andrey.kosachenko@gmail.com designates 10.205.122.144 as permitted sender) client-ip=10.205.122.144; Authentication-Results: mr.google.com; spf=pass (google.com: domain of andrey.kosachenko@gmail.com designates 10.205.122.144 as permitted sender) smtp.mail=andrey.kosachenko@gmail.com; dkim=pass header.i=andrey.kosachenko@gmail.com Received: from mr.google.com ([10.205.122.144]) by 10.205.122.144 with SMTP id gg16mr9737232bkc.12.1330898411354 (num_hops = 1); Sun, 04 Mar 2012 14:00:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=S7KX2/Lymizupu+MwQNpQolkT9bVpEM9L11WT0dDewg=; b=lJKpu+ifezTlZEDFOfdlOD45oy1iRdFqUA2EpJpMsQsXic6dSfB9d6/eT9L/hkgTbm rqJBm/X2dw4qBBXbrxiXTv8AsaoP8LFQk5WTmzvXw0Gfl5g9ZhIBA4api5Dm/RJBnXkW QiQi3/2IybDNNqelxVzUvuuRuxxwl0WeTD69zf6fY0i6FmHOfIRvaD7/6o5mleLJ8v9C 65vHEQntq/5VIRYrco4x5Zc531IMPlxGrMhUf/a+8ktLOPuFsXeLDbXN7US95n8E1YLT WMSl+am1JMibuUlSahGP1ZHrvq2zEyCqkhBOVDG0hKWUsbAKoUl12FiQKyTE7/R63wNS KtlQ== Received: by 10.205.122.144 with SMTP id gg16mr7739234bkc.12.1330896664811; Sun, 04 Mar 2012 13:31:04 -0800 (PST) Received: from beastie.intra ([46.149.81.168]) by mx.google.com with ESMTPS id t17sm21323812bke.6.2012.03.04.13.31.02 (version=SSLv3 cipher=OTHER); Sun, 04 Mar 2012 13:31:03 -0800 (PST) Message-ID: <4F53DF10.5080303@gmail.com> Date: Sun, 04 Mar 2012 23:30:56 +0200 From: Andrey Kosachenko User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120115 Thunderbird/9.0 MIME-Version: 1.0 To: John Baldwin References: <201202281838.q1SIcYhE082928@svn.freebsd.org> <201203041351.22847.jhb@freebsd.org> In-Reply-To: <201203041351.22847.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r232264 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 22:00:13 -0000 Hi, On 04.03.2012 20:51, John Baldwin wrote: > On Tuesday, February 28, 2012 01:38:34 PM Tijl Coosemans wrote: >> Author: tijl >> Date: Tue Feb 28 18:38:33 2012 >> New Revision: 232264 >> URL: http://svn.freebsd.org/changeset/base/232264 >> >> Log: >> Copy amd64 _stdint.h to x86 and merge with i386 _stdint.h. Replace >> amd64/i386/pc98 _stdint.h with stubs. >> >> Added: >> head/sys/x86/include/_stdint.h >> - copied, changed from r232259, head/sys/amd64/include/_stdint.h > > This broke C++ software (such as the audio/flac port), that #includes > with __STDC_LIMIT_MACROS defined but not __STDC_CONSTANT_MACROS > defined. The problem is that you have changed UINT64_MAX and INT64_MAX to use > UINT64_C() and INT64_C(), so in this case UINT64_MAX now expands to > UINT64_C(...) which can't be resolved to a constant. > > You should be able to reproduce this via the following: > > % cat> bar.cc > #define __STDC_LIMIT_MACROS > #include > % c++ -c bar.cc > > (The test to see if __WORDSIZE should be defined at the end of stdint.h trips > over this bug.) > > While you could do something like add __INT64_C() and __UINT64_C() macros that > are always defined and use them for INT64_MAX and UINT64_MAX, I think the > simplest fix is probably to just use #ifdef _LP64 tests to define INT64_MAX > and UINT64_MAX as pure constants as those are the only two macros effected. > > (I've just hardcoded those two constants on my little netbook so I can keep > building ports and that worked fine for audio/flac). As far as I can see reported issue was addressed in -r232519. However there is one more issue that might be connected to recent changes (sorry, not sure what exactly is wrong here). Attempt to build emulators/virtualbox-ose fails with the following error: --- kBuild: Compiling tstVMStructRC - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VMM/testcase/tstVMStructRC.cpp In file included from /usr/include/sys/types.h:63, from /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include/iprt/types.h:85, from /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include/VBox/types.h:30, from /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VMM/testcase/tstVMStructRC.cpp:33: /usr/include/sys/_stdint.h:74: error: conflicting declaration 'typedef __intptr_t intptr_t' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include/iprt/stdint.h:162: error: 'intptr_t' has a previous declaration as 'typedef long int intptr_t' /usr/include/sys/_stdint.h:78: error: conflicting declaration 'typedef __uintptr_t uintptr_t' /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include/iprt/stdint.h:165: error: 'uintptr_t' has a previous declaration as 'typedef long unsigned int uintptr_t' kBuild: Compiling tstAsmStructsasm - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VMM/testcase/tstAsmStructsAsm.asm kBuild: Compiling tstGlobalConfig - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VMM/testcase/tstGlobalConfig.cpp kmk: *** [/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o] Error 1 The failing command: @c++ -m32 -c -O2 -g -pipe -pedantic -Wshadow -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs -fdiagnostics-show-option -Wno-long-long -Wno-variadic-macros -fno-exceptions -O2 -mtune=generic -fno-omit-frame-pointer -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing -fno-stack-protector -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT -fvisibility-inlines-hidden -fno-rtti -O0 -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VMM/include -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VMM/PATM -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release -DVBOX -DVBOX_WITH_DEBUGGER -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS -DVBOX_WITH_HARDENING -DRTPATH_APP_PRIVATE=\"/usr/local/share/virtualbox-ose\" -DRTPATH_APP_PRIVATE_ARCH=\"/usr/local/lib/virtualbox\" -DRTPATH_SHARED_LIBS=\"/usr/local/lib/virtualbox\" -DRTPATH_APP_DOCS=\"/usr/local/share/doc/virtualbox-ose\" -DRT_OS_FREEBSD -D__FREEBSD__ -DRT_ARCH_X86 -D__X86__ -DIN_RC -DHC_ARCH_BITS=64 -DGC_ARCH_BITS=64 -DIN_VMM_RC -DIN_DIS -DIN_RT_RC -DVBOX_WITH_RAW_MODE -DIPRT_DONT_USE_SYSTEM_STDINT_H -Wp,-MD,/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o.dep -Wp,-MT,/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o -Wp,-MP -o /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VMM/testcase/tstVMStructRC.cpp kmk: *** Waiting for unfinished jobs.... kmk: *** Exiting with status 2 *** [do-build] Error code 2 Stop in /usr/ports/emulators/virtualbox-ose. *** [build] Error code 1 Stop in /usr/ports/emulators/virtualbox-ose. --- --- WBR, Andrey Kosachenko From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 23:04:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 991B31065675; Sun, 4 Mar 2012 23:04:17 +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 851EC8FC12; Sun, 4 Mar 2012 23:04: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 q24N4HVi056244; Sun, 4 Mar 2012 23:04:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24N4HUt056242; Sun, 4 Mar 2012 23:04:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203042304.q24N4HUt056242@svn.freebsd.org> From: Adrian Chadd Date: Sun, 4 Mar 2012 23:04: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: r232525 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 23:04:17 -0000 Author: adrian Date: Sun Mar 4 23:04:16 2012 New Revision: 232525 URL: http://svn.freebsd.org/changeset/base/232525 Log: Fix style(9) issues. Modified: head/sys/net80211/ieee80211_alq.c Modified: head/sys/net80211/ieee80211_alq.c ============================================================================== --- head/sys/net80211/ieee80211_alq.c Sun Mar 4 22:46:11 2012 (r232524) +++ head/sys/net80211/ieee80211_alq.c Sun Mar 4 23:04:16 2012 (r232525) @@ -85,8 +85,10 @@ ieee80211_alq_setlogging(int enable) ieee80211_alq_qsize); ieee80211_alq_lost = 0; ieee80211_alq_logged = 0; - printf("net80211: logging to %s enabled; struct size %d bytes\n", - ieee80211_alq_logfile, sizeof(struct ieee80211_alq_rec)); + printf("net80211: logging to %s enabled; " + "struct size %d bytes\n", + ieee80211_alq_logfile, + sizeof(struct ieee80211_alq_rec)); } else { if (ieee80211_alq) alq_close(ieee80211_alq); @@ -100,14 +102,14 @@ ieee80211_alq_setlogging(int enable) static int sysctl_ieee80211_alq_log(SYSCTL_HANDLER_ARGS) { - int error, enable; + int error, enable; - enable = (ieee80211_alq != NULL); - error = sysctl_handle_int(oidp, &enable, 0, req); - if (error || !req->newptr) - return (error); - else - return (ieee80211_alq_setlogging(enable)); + enable = (ieee80211_alq != NULL); + error = sysctl_handle_int(oidp, &enable, 0, req); + if (error || !req->newptr) + return (error); + else + return (ieee80211_alq_setlogging(enable)); } SYSCTL_PROC(_net_wlan, OID_AUTO, alq, CTLTYPE_INT|CTLFLAG_RW, From owner-svn-src-head@FreeBSD.ORG Sun Mar 4 23:13:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA44F1065764; Sun, 4 Mar 2012 23:13:52 +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 D53E08FC22; Sun, 4 Mar 2012 23:13: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 q24NDqJ4056559; Sun, 4 Mar 2012 23:13:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24NDqVx056556; Sun, 4 Mar 2012 23:13:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203042313.q24NDqVx056556@svn.freebsd.org> From: Adrian Chadd Date: Sun, 4 Mar 2012 23:13: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: r232526 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 23:13:53 -0000 Author: adrian Date: Sun Mar 4 23:13:52 2012 New Revision: 232526 URL: http://svn.freebsd.org/changeset/base/232526 Log: Add the thread id to the net80211 alq records. This will (hopefully) aid in debugging concurrency related issues. Modified: head/sys/net80211/ieee80211_alq.c head/sys/net80211/ieee80211_alq.h Modified: head/sys/net80211/ieee80211_alq.c ============================================================================== --- head/sys/net80211/ieee80211_alq.c Sun Mar 4 23:04:16 2012 (r232525) +++ head/sys/net80211/ieee80211_alq.c Sun Mar 4 23:13:52 2012 (r232526) @@ -152,6 +152,7 @@ ieee80211_alq_log(struct ieee80211vap *v r->r_version = 1; r->r_wlan = htons(vap->iv_ifp->if_dunit); r->r_op = op; + r->r_threadid = (uint32_t) curthread->td_ucred; memcpy(&r->r_payload, p, MIN(l, sizeof(r->r_payload))); alq_post(ieee80211_alq, ale); } Modified: head/sys/net80211/ieee80211_alq.h ============================================================================== --- head/sys/net80211/ieee80211_alq.h Sun Mar 4 23:04:16 2012 (r232525) +++ head/sys/net80211/ieee80211_alq.h Sun Mar 4 23:13:52 2012 (r232526) @@ -38,6 +38,7 @@ */ struct ieee80211_alq_rec { uint32_t r_timestamp; /* XXX may wrap! */ + uint32_t r_threadid; /* current thread id */ uint16_t r_wlan; /* wlan interface number */ uint8_t r_version; /* version */ uint8_t r_op; /* top-level operation id */ @@ -46,6 +47,7 @@ struct ieee80211_alq_rec { }; /* General logging function */ -extern void ieee80211_alq_log(struct ieee80211vap *vap, uint8_t op, u_char *p, int l); +extern void ieee80211_alq_log(struct ieee80211vap *vap, uint8_t op, + u_char *p, int l); #endif /* __IEEE80211_ALQ_H__ */ From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 00:53:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2CC41065672 for ; Mon, 5 Mar 2012 00:53:06 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id BE50E8FC15 for ; Mon, 5 Mar 2012 00:53:06 +0000 (UTC) Received: by iahk25 with SMTP id k25so6608637iah.13 for ; Sun, 04 Mar 2012 16:53:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.15.129 with SMTP id x1mr4343961igc.14.1330908786104; Sun, 04 Mar 2012 16:53:06 -0800 (PST) Sender: andy@fud.org.nz Received: by 10.231.28.225 with HTTP; Sun, 4 Mar 2012 16:53:06 -0800 (PST) In-Reply-To: <201203042313.q24NDqVx056556@svn.freebsd.org> References: <201203042313.q24NDqVx056556@svn.freebsd.org> Date: Mon, 5 Mar 2012 13:53:06 +1300 X-Google-Sender-Auth: mISgUBBcl_qAqcm4oY5hVBJzhTQ Message-ID: From: Andrew Thompson To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlhOt4c/56TQzYEZZTBF4VlpAnGMPsY+VLfEdZO5w1572q9moIMIcOP7sAerjrVneHvZ6RM Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232526 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 00:53:07 -0000 On 5 March 2012 12:13, Adrian Chadd wrote: > Author: adrian > Date: Sun Mar =A04 23:13:52 2012 > New Revision: 232526 > URL: http://svn.freebsd.org/changeset/base/232526 > > Log: > =A0Add the thread id to the net80211 alq records. > > =A0This will (hopefully) aid in debugging concurrency related issues. > > Modified: > =A0head/sys/net80211/ieee80211_alq.c > =A0head/sys/net80211/ieee80211_alq.h > > Modified: head/sys/net80211/ieee80211_alq.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/net80211/ieee80211_alq.c =A0 Sun Mar =A04 23:04:16 2012 =A0 = =A0 =A0 =A0(r232525) > +++ head/sys/net80211/ieee80211_alq.c =A0 Sun Mar =A04 23:13:52 2012 =A0 = =A0 =A0 =A0(r232526) > @@ -152,6 +152,7 @@ ieee80211_alq_log(struct ieee80211vap *v > =A0 =A0 =A0 =A0r->r_version =3D 1; > =A0 =A0 =A0 =A0r->r_wlan =3D htons(vap->iv_ifp->if_dunit); > =A0 =A0 =A0 =A0r->r_op =3D op; > + =A0 =A0 =A0 r->r_threadid =3D (uint32_t) curthread->td_ucred; Shouldn't this be td_tid? Andrew From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 01:37:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77E991065676; Mon, 5 Mar 2012 01:37:58 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 84DD48FC08; Mon, 5 Mar 2012 01:37:57 +0000 (UTC) Received: by wibhn6 with SMTP id hn6so2141259wib.13 for ; Sun, 04 Mar 2012 17:37:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 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=ldL2klxrcFFHyQ++QEhJ8mTG78kYvlhYEPVQMTOjNTY=; b=hAM+TsHmXnJXa2mjZn/Wojxfr55PFlwcyjSuKy1pAowz5I9v4upmOxfpHtrNxSRNk2 L5ocOnfca6QQ34sLKxJHLO0dk4lufj2BE32SvllJ7vK2To27Tci4isvSk5E+TWamFM2Y FILULShYyj9G2Fk4uigQ4knWM7lysvcG8kSpNZd7EjNlpKZ3AaRLh4f6LVKrvGU2pwAo PXcCUOGg/RnF7Kq20jeAzzozGeW1AgAEwM4muNCpOHQnJgPa0KXz1hQfmeSorCxoyBX8 3MBxmHh0xXCZyxYsDEDuvFt59YqMgmUhsXHpuA+52Z26kp/BSwWc6VNWKv1QVN29ml86 r7Sg== MIME-Version: 1.0 Received: by 10.180.96.8 with SMTP id do8mr9183532wib.21.1330911476445; Sun, 04 Mar 2012 17:37:56 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.198.81 with HTTP; Sun, 4 Mar 2012 17:37:56 -0800 (PST) In-Reply-To: References: <201203042313.q24NDqVx056556@svn.freebsd.org> Date: Sun, 4 Mar 2012 17:37:56 -0800 X-Google-Sender-Auth: h2NPbqDV4NGv0CSu-Exh3yGDk1g Message-ID: From: Adrian Chadd To: Andrew Thompson 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: r232526 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 01:37:58 -0000 grr, i must've mis-pasted the line. thanks, I'll fix this. Adrian On 4 March 2012 16:53, Andrew Thompson wrote: > On 5 March 2012 12:13, Adrian Chadd wrote: >> Author: adrian >> Date: Sun Mar =A04 23:13:52 2012 >> New Revision: 232526 >> URL: http://svn.freebsd.org/changeset/base/232526 >> >> Log: >> =A0Add the thread id to the net80211 alq records. >> >> =A0This will (hopefully) aid in debugging concurrency related issues. >> >> Modified: >> =A0head/sys/net80211/ieee80211_alq.c >> =A0head/sys/net80211/ieee80211_alq.h >> >> Modified: head/sys/net80211/ieee80211_alq.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/net80211/ieee80211_alq.c =A0 Sun Mar =A04 23:04:16 2012 =A0= =A0 =A0 =A0(r232525) >> +++ head/sys/net80211/ieee80211_alq.c =A0 Sun Mar =A04 23:13:52 2012 =A0= =A0 =A0 =A0(r232526) >> @@ -152,6 +152,7 @@ ieee80211_alq_log(struct ieee80211vap *v >> =A0 =A0 =A0 =A0r->r_version =3D 1; >> =A0 =A0 =A0 =A0r->r_wlan =3D htons(vap->iv_ifp->if_dunit); >> =A0 =A0 =A0 =A0r->r_op =3D op; >> + =A0 =A0 =A0 r->r_threadid =3D (uint32_t) curthread->td_ucred; > > Shouldn't this be td_tid? > > > Andrew From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 02:36:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50B2E106564A; Mon, 5 Mar 2012 02:36:16 +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 3C0398FC0A; Mon, 5 Mar 2012 02:36: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 q252aGSH062694; Mon, 5 Mar 2012 02:36:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q252aG7v062692; Mon, 5 Mar 2012 02:36:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203050236.q252aG7v062692@svn.freebsd.org> From: Adrian Chadd Date: Mon, 5 Mar 2012 02:36: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: r232530 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 02:36:16 -0000 Author: adrian Date: Mon Mar 5 02:36:15 2012 New Revision: 232530 URL: http://svn.freebsd.org/changeset/base/232530 Log: Oops - used the wrong field. Noticed by: nwhitehorn Modified: head/sys/net80211/ieee80211_alq.c Modified: head/sys/net80211/ieee80211_alq.c ============================================================================== --- head/sys/net80211/ieee80211_alq.c Mon Mar 5 02:14:47 2012 (r232529) +++ head/sys/net80211/ieee80211_alq.c Mon Mar 5 02:36:15 2012 (r232530) @@ -152,7 +152,7 @@ ieee80211_alq_log(struct ieee80211vap *v r->r_version = 1; r->r_wlan = htons(vap->iv_ifp->if_dunit); r->r_op = op; - r->r_threadid = (uint32_t) curthread->td_ucred; + r->r_threadid = (uint32_t) curthread->td_tid; memcpy(&r->r_payload, p, MIN(l, sizeof(r->r_payload))); alq_post(ieee80211_alq, ale); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 02:40:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23AA3106566C; Mon, 5 Mar 2012 02:40:19 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F4638FC1A; Mon, 5 Mar 2012 02:40: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 q252eI7A062836; Mon, 5 Mar 2012 02:40:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q252eI3J062834; Mon, 5 Mar 2012 02:40:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203050240.q252eI3J062834@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 5 Mar 2012 02: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: r232531 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 02:40:19 -0000 Author: nwhitehorn Date: Mon Mar 5 02:40:18 2012 New Revision: 232531 URL: http://svn.freebsd.org/changeset/base/232531 Log: Make the chroot shell more functional by providing devfs. Reported by: Robert Simmons MFC after: 4 days Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Mon Mar 5 02:36:15 2012 (r232530) +++ head/usr.sbin/bsdinstall/scripts/auto Mon Mar 5 02:40:18 2012 (r232531) @@ -216,6 +216,7 @@ dialog --backtitle "FreeBSD Installer" - --yesno "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 if [ $? -eq 0 ]; then clear + mount -t devfs devfs "$BSDINSTALL_CHROOT/dev" echo This shell is operating in a chroot in the new system. \ When finished making configuration changes, type \"exit\". chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 06:12:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24BE31065711; Mon, 5 Mar 2012 06:12:16 +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 0F62A8FC19; Mon, 5 Mar 2012 06:12: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 q256CFQs070223; Mon, 5 Mar 2012 06:12:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q256CF3h070221; Mon, 5 Mar 2012 06:12:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203050612.q256CF3h070221@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 5 Mar 2012 06:12: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: r232538 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 06:12:16 -0000 Author: glebius Date: Mon Mar 5 06:12:15 2012 New Revision: 232538 URL: http://svn.freebsd.org/changeset/base/232538 Log: Fix ng_ipfw(4) cookie number in example. Pointed out by: "Jacco van Buuren" Modified: head/share/man/man4/ng_patch.4 Modified: head/share/man/man4/ng_patch.4 ============================================================================== --- head/share/man/man4/ng_patch.4 Mon Mar 5 05:18:58 2012 (r232537) +++ head/share/man/man4/ng_patch.4 Mon Mar 5 06:12:15 2012 (r232538) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 9, 2010 +.Dd March 5, 2012 .Dt NG_PATCH 4 .Os .Sh NAME @@ -185,7 +185,7 @@ So you do: { mode=7 value=0xf7 length=1 offset=1 } \e { mode=8 value=0x02 length=1 offset=1 } ] } SEQ -/sbin/ipfw add 160 netgraph 600 ip from any to any not dst-port 80 +/sbin/ipfw add 160 netgraph 300 ip from any to any not dst-port 80 .Ed .Pp This first does From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 06:41:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7590A1065678; Mon, 5 Mar 2012 06:41:45 +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 560BB8FC12; Mon, 5 Mar 2012 06:41: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 q256fjvS071144; Mon, 5 Mar 2012 06:41:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q256fjk2071140; Mon, 5 Mar 2012 06:41:45 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203050641.q256fjk2071140@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 5 Mar 2012 06:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232539 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 06:41:45 -0000 Author: hselasky Date: Mon Mar 5 06:41:44 2012 New Revision: 232539 URL: http://svn.freebsd.org/changeset/base/232539 Log: Fix for DWC OTG interrupt register programming. Fix a compiler warning. Add missing header file. MFC after: 1 week Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h head/sys/dev/usb/controller/dwc_otg_atmelarm.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Mon Mar 5 06:12:15 2012 (r232538) +++ head/sys/dev/usb/controller/dwc_otg.c Mon Mar 5 06:41:44 2012 (r232539) @@ -91,6 +91,7 @@ __FBSDID("$FreeBSD$"); #define DWC_OTG_MSK_GINT_ENABLED \ (DWC_OTG_MSK_GINT_ENUM_DONE | \ + DWC_OTG_MSK_GINT_USB_RESET | \ DWC_OTG_MSK_GINT_USB_SUSPEND | \ DWC_OTG_MSK_GINT_INEP | \ DWC_OTG_MSK_GINT_RXFLVL | \ @@ -730,7 +731,10 @@ repeat: } } - /* check if no packets have been transferred */ + if (!to--) + goto not_complete; + + /* check if not all packets have been transferred */ temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { @@ -812,9 +816,7 @@ repeat: /* else we need to transmit a short packet */ } - - if (--to) - goto repeat; + goto repeat; not_complete: return (1); /* not complete */ @@ -927,7 +929,6 @@ repeat: if (sc->sc_last_rx_status != 0) { - uint32_t temp; uint8_t ep_no; temp = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT( @@ -1042,6 +1043,18 @@ dwc_otg_interrupt(struct dwc_otg_softc * DPRINTFN(14, "GINTSTS=0x%08x\n", status); + if (status & DWC_OTG_MSK_GINT_USB_RESET) { + + /* set correct state */ + sc->sc_flags.status_bus_reset = 0; + sc->sc_flags.status_suspend = 0; + sc->sc_flags.change_suspend = 0; + sc->sc_flags.change_connect = 1; + + /* complete root HUB interrupt endpoint */ + dwc_otg_root_intr(sc); + } + /* check for any bus state change interrupts */ if (status & DWC_OTG_MSK_GINT_ENUM_DONE) { @@ -1115,6 +1128,7 @@ dwc_otg_interrupt(struct dwc_otg_softc * } /* check VBUS */ if (status & (DWC_OTG_MSK_GINT_USB_SUSPEND | + DWC_OTG_MSK_GINT_USB_RESET | DWC_OTG_MSK_GINT_SESSREQINT)) { uint32_t temp; @@ -1133,9 +1147,10 @@ dwc_otg_interrupt(struct dwc_otg_softc * for (x = 0; x != sc->sc_dev_in_ep_max; x++) { temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPINT(x)); - if (temp == 0) - continue; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPINT(x), temp); + if (temp & DWC_OTG_MSK_DIEP_XFER_COMPLETE) { + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPINT(x), + DWC_OTG_MSK_DIEP_XFER_COMPLETE); + } } } @@ -1773,17 +1788,25 @@ dwc_otg_init(struct dwc_otg_softc *sc) sc->sc_irq_mask = DWC_OTG_MSK_GINT_ENABLED; DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); - /* - * Disable all endpoint interrupts, - * we use the SOF IRQ for transmit: - */ - /* enable all endpoint interrupts */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPMSK, - /* DWC_OTG_MSK_DIEP_FIFO_EMPTY | */ - DWC_OTG_MSK_DIEP_XFER_COMPLETE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPMSK, 0); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DAINTMSK, 0xFFFF); + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG2); + if (temp & DWC_OTG_MSK_GHWCFG2_MPI) { + uint8_t x; + + DPRINTF("Multi Process Interrupts\n"); + + for (x = 0; x != sc->sc_dev_in_ep_max; x++) { + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPEACHMSK(x), + DWC_OTG_MSK_DIEP_XFER_COMPLETE); + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPEACHMSK(x), 0); + } + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DEACHINTMSK, 0xFFFF); + } else { + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPMSK, + DWC_OTG_MSK_DIEP_XFER_COMPLETE); + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPMSK, 0); + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DAINTMSK, 0xFFFF); + } /* enable global IRQ */ DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GAHBCFG, Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Mon Mar 5 06:12:15 2012 (r232538) +++ head/sys/dev/usb/controller/dwc_otg.h Mon Mar 5 06:41:44 2012 (r232539) @@ -140,6 +140,8 @@ #define DWC_OTG_REG_GHWCFG2 0x0048 #define DWC_OTG_MSK_GHWCFG2_NUM_DEV_EP(x) ((((x) >> 10) & 15) + 1) #define DWC_OTG_MSK_GHWCFG2_NUM_HOST_EP(x) ((((x) >> 14) & 15) + 1) +#define DWC_OTG_MSK_GHWCFG2_DYN_FIFO (1U << 19) +#define DWC_OTG_MSK_GHWCFG2_MPI (1U << 20) #define DWC_OTG_REG_GHWCFG3 0x004C #define DWC_OTG_MSK_GHWCFG3_GET_DFIFO(x) ((x) >> 16) #define DWC_OTG_MSK_GHWCFG3_PKT_SIZE (0x10U << (((x) >> 4) & 7)) @@ -245,11 +247,7 @@ #define DWC_OTG_REG_DEACHINT 0x0838 #define DWC_OTG_REG_DEACHINTMSK 0x083C #define DWC_OTG_REG_DIEPEACHMSK(n) (0x0840 + (4*(n))) -#define DWC_OTG_MSK_DIEPEACH_XFER_COMPLETE (1U << 0) - #define DWC_OTG_REG_DOEPEACHMSK(n) (0x0880 + (4*(n))) -#define DWC_OTG_MSK_DOEPEACH_SETUP (1U << 3) -#define DWC_OTG_MSK_DOEPEACH_XFER_COMPLETE (1U << 0) #define DWC_OTG_REG_DIEPCTL(n) (0x0900 + (32*(n))) #define DWC_OTG_MSK_DIEPCTL_ENABLE (1U << 31) Modified: head/sys/dev/usb/controller/dwc_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_atmelarm.c Mon Mar 5 06:12:15 2012 (r232538) +++ head/sys/dev/usb/controller/dwc_otg_atmelarm.c Mon Mar 5 06:41:44 2012 (r232539) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 06:46:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78A45106564A; Mon, 5 Mar 2012 06:46:36 +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 58F688FC0C; Mon, 5 Mar 2012 06: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 q256kaHN071331; Mon, 5 Mar 2012 06:46:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q256kajW071328; Mon, 5 Mar 2012 06:46:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203050646.q256kajW071328@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 5 Mar 2012 06:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232540 - in head/sys/modules/usb: . dwc_otg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 06:46:36 -0000 Author: hselasky Date: Mon Mar 5 06:46:35 2012 New Revision: 232540 URL: http://svn.freebsd.org/changeset/base/232540 Log: Add DWC OTG module to ARM builds. MFC after: 1 week Added: head/sys/modules/usb/dwc_otg/ head/sys/modules/usb/dwc_otg/Makefile (contents, props changed) Modified: head/sys/modules/usb/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Mar 5 06:41:44 2012 (r232539) +++ head/sys/modules/usb/Makefile Mon Mar 5 06:46:35 2012 (r232540) @@ -31,7 +31,7 @@ # MK_SOURCELESS_UCODE option (see below). SUBDIR = usb -SUBDIR += ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci} ${_avr32dci} +SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} ${_at91dci} ${_atmegadci} ${_avr32dci} SUBDIR += ${_rum} run ${_uath} upgt usie ural ${_zyd} ${_urtw} SUBDIR += atp uhid ukbd ums udbp ufm uep SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ @@ -54,6 +54,9 @@ _urtw= urtw .if ${MACHINE_CPUARCH} == "arm" _at91dci= at91dci _atmegadci= atmegadci +_dwc_otg= dwc_otg +_musb= musb +_uss820dci= uss820dci .endif .if ${MACHINE_CPUARCH} == "i386" Added: head/sys/modules/usb/dwc_otg/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/dwc_otg/Makefile Mon Mar 5 06:46:35 2012 (r232540) @@ -0,0 +1,42 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2012 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/controller + +KMOD= dwc_otg +SRCS= bus_if.h device_if.h usb_if.h \ + opt_bus.h opt_usb.h \ + dwc_otg.c \ + pci_if.h + +.if defined(HAS_ATMELARM) +SRCS+= dwc_otg_atmelarm.c +.endif + +.include From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 11:38:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B5881065674; Mon, 5 Mar 2012 11:38:02 +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 70F1C8FC19; Mon, 5 Mar 2012 11:38: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 q25Bc21U084763; Mon, 5 Mar 2012 11:38:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25Bc2Q2084761; Mon, 5 Mar 2012 11:38:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203051138.q25Bc2Q2084761@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 5 Mar 2012 11:38: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: r232541 - head/sys/fs/pseudofs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 11:38:02 -0000 Author: kib Date: Mon Mar 5 11:38:02 2012 New Revision: 232541 URL: http://svn.freebsd.org/changeset/base/232541 Log: Apply inlined vn_vget_ino() algorithm for ".." lookup in pseudofs. Reported and tested by: pho MFC after: 2 weeks Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Mon Mar 5 06:46:35 2012 (r232540) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Mon Mar 5 11:38:02 2012 (r232541) @@ -432,6 +432,7 @@ pfs_lookup(struct vop_cachedlookup_args struct pfs_vdata *pvd = vn->v_data; struct pfs_node *pd = pvd->pvd_pn; struct pfs_node *pn, *pdn = NULL; + struct mount *mp; pid_t pid = pvd->pvd_pid; char *pname; int error, i, namelen, visible; @@ -474,10 +475,26 @@ pfs_lookup(struct vop_cachedlookup_args PFS_RETURN (0); } + mp = vn->v_mount; + /* parent */ if (cnp->cn_flags & ISDOTDOT) { if (pd->pn_type == pfstype_root) PFS_RETURN (EIO); + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { + vfs_ref(mp); + VOP_UNLOCK(vn, 0); + error = vfs_busy(mp, 0); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + vfs_rel(mp); + if (error != 0) + PFS_RETURN(ENOENT); + if (vn->v_iflag & VI_DOOMED) { + vfs_unbusy(mp); + PFS_RETURN(ENOENT); + } + } VOP_UNLOCK(vn, 0); KASSERT(pd->pn_parent != NULL, ("%s(): non-root directory has no parent", __func__)); @@ -535,18 +552,28 @@ pfs_lookup(struct vop_cachedlookup_args goto failed; } - error = pfs_vncache_alloc(vn->v_mount, vpp, pn, pid); + error = pfs_vncache_alloc(mp, vpp, pn, pid); if (error) goto failed; - if (cnp->cn_flags & ISDOTDOT) - vn_lock(vn, LK_EXCLUSIVE|LK_RETRY); + if (cnp->cn_flags & ISDOTDOT) { + vfs_unbusy(mp); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + if (vn->v_iflag & VI_DOOMED) { + vput(*vpp); + *vpp = NULL; + PFS_RETURN(ENOENT); + } + } if (cnp->cn_flags & MAKEENTRY && !(vn->v_iflag & VI_DOOMED)) cache_enter(vn, *vpp, cnp); PFS_RETURN (0); failed: - if (cnp->cn_flags & ISDOTDOT) - vn_lock(vn, LK_EXCLUSIVE|LK_RETRY); + if (cnp->cn_flags & ISDOTDOT) { + vfs_unbusy(mp); + vn_lock(vn, LK_EXCLUSIVE | LK_RETRY); + *vpp = NULL; + } PFS_RETURN(error); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 12:50:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DDC2E106566B; Mon, 5 Mar 2012 12:50:15 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay004.isp.belgacom.be (mailrelay004.isp.belgacom.be [195.238.6.170]) by mx1.freebsd.org (Postfix) with ESMTP id 92D148FC17; Mon, 5 Mar 2012 12:50:13 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EACS2VE9bsWcW/2dsb2JhbABDhTSvFIEIgX0BAQUjMyMQHwQjBwICOR4GiB4HphWRYY9HgRYEjlKWfoJk Received: from 22.103-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.103.22]) by relay.skynet.be with ESMTP; 05 Mar 2012 13:50:12 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q25CoB7J002882; Mon, 5 Mar 2012 13:50:11 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: Andrey Kosachenko Date: Mon, 5 Mar 2012 13:50:03 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201202281838.q1SIcYhE082928@svn.freebsd.org> <201203041351.22847.jhb@freebsd.org> <4F53DF10.5080303@gmail.com> In-Reply-To: <4F53DF10.5080303@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2952423.uHyMEgrBsJ"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201203051350.09141.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, emulation@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: virtualbox fix for recent current (was Re: svn commit: r232264 - in head/sys: amd64/include i386/include pc98/include x86/include) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 12:50:16 -0000 --nextPart2952423.uHyMEgrBsJ Content-Type: multipart/mixed; boundary="Boundary-01=_7ZLVPBzqF4/B/pY" Content-Transfer-Encoding: 7bit --Boundary-01=_7ZLVPBzqF4/B/pY Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 04 March 2012 22:30:56 Andrey Kosachenko wrote: >> On Tuesday, February 28, 2012 01:38:34 PM Tijl Coosemans wrote: >>> Author: tijl >>> Date: Tue Feb 28 18:38:33 2012 >>> New Revision: 232264 >>> URL: http://svn.freebsd.org/changeset/base/232264 >>> >>> Log: >>> Copy amd64 _stdint.h to x86 and merge with i386 _stdint.h. Replace >>> amd64/i386/pc98 _stdint.h with stubs. >>> >>> Added: >>> head/sys/x86/include/_stdint.h >>> - copied, changed from r232259, head/sys/amd64/include/_stdint.h > Attempt to build=20 > emulators/virtualbox-ose fails with the following error: >=20 > --- > kBuild: Compiling tstVMStructRC -=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VM= M/testcase/tstVMStructRC.cpp > In file included from /usr/include/sys/types.h:63, > from=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include/ipr= t/types.h:85, > from=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include/VBo= x/types.h:30, > from=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VM= M/testcase/tstVMStructRC.cpp:33: > /usr/include/sys/_stdint.h:74: error: conflicting declaration 'typedef=20 > __intptr_t intptr_t' > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include/ipr= t/stdint.h:162:=20 > error: 'intptr_t' has a previous declaration as 'typedef long int intptr_= t' > /usr/include/sys/_stdint.h:78: error: conflicting declaration 'typedef=20 > __uintptr_t uintptr_t' > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include/ipr= t/stdint.h:165:=20 > error: 'uintptr_t' has a previous declaration as 'typedef long unsigned=20 > int uintptr_t' > kBuild: Compiling tstAsmStructsasm -=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VM= M/testcase/tstAsmStructsAsm.asm > kBuild: Compiling tstGlobalConfig -=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VM= M/testcase/tstGlobalConfig.cpp > kmk: ***=20 > [/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebs= d.amd64/release/obj/tstVMStructRC/tstVMStructRC.o]=20 > Error 1 > The failing command: > @c++ -m32 -c -O2 -g -pipe -pedantic -Wshadow -Wall -Wextra=20 Compiling with -m32 wasn't really supported (until now)... > -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs=20 > -fdiagnostics-show-option -Wno-long-long -Wno-variadic-macros=20 > -fno-exceptions -O2 -mtune=3Dgeneric -fno-omit-frame-pointer -mno-sse=20 > -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing -fno-stack-protector=20 > -fvisibility=3Dhidden -DVBOX_HAVE_VISIBILITY_HIDDEN=20 > -DRT_USE_VISIBILITY_DEFAULT -fvisibility-inlines-hidden -fno-rtti -O0=20 > -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/= VMM/include=20 > -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/= VMM/PATM=20 > -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/include=20 > -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freeb= sd.amd64/release=20 > -DVBOX -DVBOX_WITH_DEBUGGER -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS=20 > -DVBOX_WITH_HARDENING=20 > -DRTPATH_APP_PRIVATE=3D\"/usr/local/share/virtualbox-ose\"=20 > -DRTPATH_APP_PRIVATE_ARCH=3D\"/usr/local/lib/virtualbox\"=20 > -DRTPATH_SHARED_LIBS=3D\"/usr/local/lib/virtualbox\"=20 > -DRTPATH_APP_DOCS=3D\"/usr/local/share/doc/virtualbox-ose\"=20 > -DRT_OS_FREEBSD -D__FREEBSD__ -DRT_ARCH_X86 -D__X86__ -DIN_RC=20 > -DHC_ARCH_BITS=3D64 -DGC_ARCH_BITS=3D64 -DIN_VMM_RC -DIN_DIS -DIN_RT_RC=20 > -DVBOX_WITH_RAW_MODE -DIPRT_DONT_USE_SYSTEM_STDINT_H=20 =2E..so virtualbox has hacks like IPRT_DONT_USE_SYSTEM_STDINT_H to make it work. I've attached a patch that you can put in the port's files/ directory. I'll leave it to the port maintainers to commit it or work out something else, because I think some hacks aren't necessary anymore (on current). > -Wp,-MD,/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out= /freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o.dep=20 > -Wp,-MT,/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out= /freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o=20 > -Wp,-MP -o=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd= =2Eamd64/release/obj/tstVMStructRC/tstVMStructRC.o=20 > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VM= M/testcase/tstVMStructRC.cpp > kmk: *** Waiting for unfinished jobs.... > kmk: *** Exiting with status 2 > *** [do-build] Error code 2 >=20 > Stop in /usr/ports/emulators/virtualbox-ose. > *** [build] Error code 1 >=20 > Stop in /usr/ports/emulators/virtualbox-ose. > --- --Boundary-01=_7ZLVPBzqF4/B/pY Content-Type: text/plain; charset="utf-8"; name="patch-include-iprt-types.h" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch-include-iprt-types.h" =2D-- include/iprt/types.h.orig 2012-03-05 10:48:48.000000000 +0100 +++ include/iprt/types.h 2012-03-05 11:21:25.000000000 +0100 @@ -82,6 +82,8 @@ # include # define _UINT64_T_DECLARED # define _INT64_T_DECLARED +# define _UINTPTR_T_DECLARED +# define _INTPTR_T_DECLARED # include =20 # elif defined(RT_OS_LINUX) && defined(__KERNEL__) --Boundary-01=_7ZLVPBzqF4/B/pY-- --nextPart2952423.uHyMEgrBsJ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk9UtoAACgkQfoCS2CCgtisVKQEAhL1bKk/NPyUPcp1H6VRwL6CV 8SKQzJF6E+Kepty6+OsA/2AnKMCwA/RydENuAA+Oj2H68NVFSHED8YKgSPQ5sXIH =2v6X -----END PGP SIGNATURE----- --nextPart2952423.uHyMEgrBsJ-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 14:19:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B119106566C; Mon, 5 Mar 2012 14:19:44 +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 EE6328FC18; Mon, 5 Mar 2012 14:19: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 q25EJhUr089888; Mon, 5 Mar 2012 14:19:43 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25EJhWk089886; Mon, 5 Mar 2012 14:19:43 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201203051419.q25EJhWk089886@svn.freebsd.org> From: Ivan Voras Date: Mon, 5 Mar 2012 14:19: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: r232547 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 14:19:44 -0000 Author: ivoras Date: Mon Mar 5 14:19:43 2012 New Revision: 232547 URL: http://svn.freebsd.org/changeset/base/232547 Log: Print out process name and thread id in the debugging message. This is useful because the message can end up in system logs in non-debugging operation. Reviewed by: attilio (earlier version) Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Mon Mar 5 14:04:12 2012 (r232546) +++ head/sys/kern/kern_lock.c Mon Mar 5 14:19:43 2012 (r232547) @@ -1277,8 +1277,9 @@ lockmgr_printinfo(const struct lock *lk) (uintmax_t)LK_SHARERS(lk->lk_lock)); else { td = lockmgr_xholder(lk); - printf("lock type %s: EXCL by thread %p (pid %d)\n", - lk->lock_object.lo_name, td, td->td_proc->p_pid); + printf("lock type %s: EXCL by thread %p " + "(pid %d, %s, tid %d)\n", lk->lock_object.lo_name, td, + td->td_proc->p_pid, td->td_proc->p_comm, td->td_tid); } x = lk->lk_lock; From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 16:37:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0449106564A; Mon, 5 Mar 2012 16:37:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDF908FC1B; Mon, 5 Mar 2012 16:37: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 q25Gbpkv094175; Mon, 5 Mar 2012 16:37:51 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25Gbp1u094172; Mon, 5 Mar 2012 16:37:51 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201203051637.q25Gbp1u094172@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 5 Mar 2012 16:37: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: r232548 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 16:37:52 -0000 Author: trasz Date: Mon Mar 5 16:37:51 2012 New Revision: 232548 URL: http://svn.freebsd.org/changeset/base/232548 Log: Make growfs(8) mostly style compliant. No functional changes, verified with MD5. Modified: head/sbin/growfs/debug.c head/sbin/growfs/growfs.c Modified: head/sbin/growfs/debug.c ============================================================================== --- head/sbin/growfs/debug.c Mon Mar 5 14:19:43 2012 (r232547) +++ head/sbin/growfs/debug.c Mon Mar 5 16:37:51 2012 (r232548) @@ -44,7 +44,6 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -/* ********************************************************** INCLUDES ***** */ #include #include @@ -57,15 +56,13 @@ static const char rcsid[] = #ifdef FS_DEBUG -/* *********************************************************** GLOBALS ***** */ -static FILE *dbg_log=NULL; -static unsigned int indent=0; +static FILE *dbg_log = NULL; +static unsigned int indent = 0; /* * prototypes not done here, as they come with debug.h */ -/* ********************************************************** dbg_open ***** */ /* * Open the filehandle where all debug output has to go. */ @@ -74,14 +71,13 @@ dbg_open(const char *fn) { if (strcmp(fn, "-") == 0) - dbg_log=fopen("/dev/stdout", "a"); + dbg_log = fopen("/dev/stdout", "a"); else - dbg_log=fopen(fn, "a"); + dbg_log = fopen(fn, "a"); return; } -/* ********************************************************* dbg_close ***** */ /* * Close the filehandle where all debug output went to. */ @@ -89,15 +85,14 @@ void dbg_close(void) { - if(dbg_log) { + if (dbg_log) { fclose(dbg_log); - dbg_log=NULL; + dbg_log = NULL; } return; } -/* ****************************************************** dbg_dump_hex ***** */ /* * Dump out a full file system block in hex. */ @@ -106,17 +101,16 @@ dbg_dump_hex(struct fs *sb, const char * { int i, j, k; - if(!dbg_log) { + if (!dbg_log) return; - } + fprintf(dbg_log, "===== START HEXDUMP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)mem, comment); indent++; - for (i=0; ifs_bsize; i+=24) { - for (j=0; j<3; j++) { - for (k=0; k<8; k++) { + for (i = 0; i < sb->fs_bsize; i += 24) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 8; k++) fprintf(dbg_log, "%02x ", *mem++); - } fprintf(dbg_log, " "); } fprintf(dbg_log, "\n"); @@ -127,7 +121,6 @@ dbg_dump_hex(struct fs *sb, const char * return; } -/* ******************************************************* dbg_dump_fs ***** */ /* * Dump the superblock. */ @@ -135,12 +128,11 @@ void dbg_dump_fs(struct fs *sb, const char *comment) { #ifdef FSMAXSNAP - int j; + int j; #endif /* FSMAXSNAP */ - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START SUPERBLOCK =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)sb, comment); @@ -308,10 +300,10 @@ dbg_dump_fs(struct fs *sb, const char *c sb->fs_pendinginodes); #ifdef FSMAXSNAP - for(j=0; jfs_snapinum[j]); - if(!sb->fs_snapinum[j]) { /* list is dense */ + if (!sb->fs_snapinum[j]) { /* list is dense */ break; } } @@ -356,7 +348,6 @@ dbg_dump_fs(struct fs *sb, const char *c return; } -/* ******************************************************* dbg_dump_cg ***** */ /* * Dump a cylinder group. */ @@ -365,9 +356,8 @@ dbg_dump_cg(const char *comment, struct { int j; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START CYLINDER GROUP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cgr, comment); @@ -383,7 +373,7 @@ dbg_dump_cg(const char *comment, struct fprintf(dbg_log, "rotor int32_t 0x%08x\n", cgr->cg_rotor); fprintf(dbg_log, "frotor int32_t 0x%08x\n", cgr->cg_frotor); fprintf(dbg_log, "irotor int32_t 0x%08x\n", cgr->cg_irotor); - for(j=0; jcg_frsum[j]); } @@ -411,7 +401,6 @@ dbg_dump_cg(const char *comment, struct return; } -/* ***************************************************** dbg_dump_csum ***** */ /* * Dump a cylinder summary. */ @@ -419,9 +408,8 @@ void dbg_dump_csum(const char *comment, struct csum *cs) { - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START CYLINDER SUMMARY =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cs, comment); @@ -438,7 +426,6 @@ dbg_dump_csum(const char *comment, struc return; } -/* ************************************************ dbg_dump_csum_total ***** */ /* * Dump a cylinder summary. */ @@ -446,9 +433,8 @@ void dbg_dump_csum_total(const char *comment, struct csum_total *cs) { - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START CYLINDER SUMMARY TOTAL =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cs, comment); @@ -475,7 +461,6 @@ dbg_dump_csum_total(const char *comment, return; } -/* **************************************************** dbg_dump_inmap ***** */ /* * Dump the inode allocation map in one cylinder group. */ @@ -485,30 +470,29 @@ dbg_dump_inmap(struct fs *sb, const char int j,k,l,e; unsigned char *cp; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START INODE ALLOCATION MAP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cgr, comment); indent++; - cp=(unsigned char *)cg_inosused(cgr); - e=sb->fs_ipg/8; - for(j=0; jfs_ipg / 8; + for (j = 0; j < e; j += 32) { fprintf(dbg_log, "%08x: ", j); - for(k=0; k<32; k+=8) { - if(j+k+8fs_old_nspf) - e=howmany((sb->fs_old_cpg * sb->fs_old_spc / sb->fs_old_nspf), CHAR_BIT); + e = howmany((sb->fs_old_cpg * sb->fs_old_spc / sb->fs_old_nspf), CHAR_BIT); else e = 0; - for(j=0; jfs_old_nspf) - e=howmany(sb->fs_old_cpg * sb->fs_old_spc / (sb->fs_old_nspf << sb->fs_fragshift), CHAR_BIT); + e = howmany(sb->fs_old_cpg * sb->fs_old_spc / (sb->fs_old_nspf << sb->fs_fragshift), CHAR_BIT); else e = 0; - for(j=0; jfs_contigsumsize; j++) { + ip = (int *)cg_clustersum(cgr); + for (j = 0; j <= sb->fs_contigsumsize; j++) { fprintf(dbg_log, "%02d: %8d\n", j, *ip++); } @@ -651,7 +629,6 @@ dbg_dump_clsum(struct fs *sb, const char * will leave it disabled for now; it should probably be re-enabled * specifically for UFS1. */ -/* **************************************************** dbg_dump_sptbl ***** */ /* * Dump the block summary, and the rotational layout table. */ @@ -661,23 +638,21 @@ dbg_dump_sptbl(struct fs *sb, const char int j,k; int *ip; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START BLOCK SUMMARY AND POSITION TABLE =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)cgr, comment); indent++; - ip=(int *)cg_blktot(cgr); - for(j=0; jfs_old_cpg; j++) { + ip = (int *)cg_blktot(cgr); + for (j = 0; j < sb->fs_old_cpg; j++) { fprintf(dbg_log, "%2d: %5d = ", j, *ip++); - for(k=0; kfs_old_nrpos; k++) { + for (k = 0; k < sb->fs_old_nrpos; k++) { fprintf(dbg_log, "%4d", cg_blks(sb, cgr, j)[k]); - if(kfs_old_nrpos-1) { + if (k < sb->fs_old_nrpos - 1) fprintf(dbg_log, " + "); - } } fprintf(dbg_log, "\n"); } @@ -689,7 +664,6 @@ dbg_dump_sptbl(struct fs *sb, const char } #endif -/* ************************************************** dbg_dump_ufs1_ino ***** */ /* * Dump a UFS1 inode structure. */ @@ -699,9 +673,8 @@ dbg_dump_ufs1_ino(struct fs *sb, const c int ictr; int remaining_blocks; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START UFS1 INODE DUMP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)ino, comment); @@ -723,25 +696,25 @@ dbg_dump_ufs1_ino(struct fs *sb, const c fprintf(dbg_log, "ctimensec int32_t 0x%08x\n", ino->di_ctimensec); - remaining_blocks=howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */ - for(ictr=0; ictr < MIN(NDADDR, remaining_blocks); ictr++) { + remaining_blocks = howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */ + for (ictr = 0; ictr < MIN(NDADDR, remaining_blocks); ictr++) { fprintf(dbg_log, "db ufs_daddr_t[%x] 0x%08x\n", ictr, ino->di_db[ictr]); } - remaining_blocks-=NDADDR; - if(remaining_blocks>0) { + remaining_blocks -= NDADDR; + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs_daddr_t[0] 0x%08x\n", ino->di_ib[0]); } - remaining_blocks-=howmany(sb->fs_bsize, sizeof(ufs1_daddr_t)); - if(remaining_blocks>0) { + remaining_blocks -= howmany(sb->fs_bsize, sizeof(ufs1_daddr_t)); + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs_daddr_t[1] 0x%08x\n", ino->di_ib[1]); } -#define SQUARE(a) ((a)*(a)) - remaining_blocks-=SQUARE(howmany(sb->fs_bsize, sizeof(ufs1_daddr_t))); +#define SQUARE(a) ((a) * (a)) + remaining_blocks -= SQUARE(howmany(sb->fs_bsize, sizeof(ufs1_daddr_t))); #undef SQUARE - if(remaining_blocks>0) { + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs_daddr_t[2] 0x%08x\n", ino->di_ib[2]); } @@ -758,7 +731,6 @@ dbg_dump_ufs1_ino(struct fs *sb, const c return; } -/* ************************************************** dbg_dump_ufs2_ino ***** */ /* * Dump a UFS2 inode structure. */ @@ -768,9 +740,8 @@ dbg_dump_ufs2_ino(struct fs *sb, const c int ictr; int remaining_blocks; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START UFS2 INODE DUMP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)ino, comment); @@ -785,8 +756,8 @@ dbg_dump_ufs2_ino(struct fs *sb, const c ((unsigned int *)&(ino->di_size))[1], ((unsigned int *)&(ino->di_size))[0]); fprintf(dbg_log, "blocks u_int64_t 0x%08x%08x\n", - ((unsigned int *)&(ino->di_blocks))[1], - ((unsigned int *)&(ino->di_blocks))[0]); + ((unsigned int *)&(ino->di_blocks))[1], + ((unsigned int *)&(ino->di_blocks))[0]); fprintf(dbg_log, "atime ufs_time_t %10jd\n", ino->di_atime); fprintf(dbg_log, "mtime ufs_time_t %10jd\n", ino->di_mtime); fprintf(dbg_log, "ctime ufs_time_t %10jd\n", ino->di_ctime); @@ -802,25 +773,25 @@ dbg_dump_ufs2_ino(struct fs *sb, const c /* XXX: What do we do with di_extb[NXADDR]? */ - remaining_blocks=howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */ - for(ictr=0; ictr < MIN(NDADDR, remaining_blocks); ictr++) { + remaining_blocks = howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */ + for (ictr = 0; ictr < MIN(NDADDR, remaining_blocks); ictr++) { fprintf(dbg_log, "db ufs2_daddr_t[%x] 0x%16jx\n", ictr, ino->di_db[ictr]); } - remaining_blocks-=NDADDR; - if(remaining_blocks>0) { + remaining_blocks -= NDADDR; + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs2_daddr_t[0] 0x%16jx\n", ino->di_ib[0]); } - remaining_blocks-=howmany(sb->fs_bsize, sizeof(ufs2_daddr_t)); - if(remaining_blocks>0) { + remaining_blocks -= howmany(sb->fs_bsize, sizeof(ufs2_daddr_t)); + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs2_daddr_t[1] 0x%16jx\n", ino->di_ib[1]); } -#define SQUARE(a) ((a)*(a)) - remaining_blocks-=SQUARE(howmany(sb->fs_bsize, sizeof(ufs2_daddr_t))); +#define SQUARE(a) ((a) * (a)) + remaining_blocks -= SQUARE(howmany(sb->fs_bsize, sizeof(ufs2_daddr_t))); #undef SQUARE - if(remaining_blocks>0) { + if (remaining_blocks > 0) { fprintf(dbg_log, "ib ufs2_daddr_t[2] 0x%16jx\n", ino->di_ib[2]); } @@ -831,7 +802,6 @@ dbg_dump_ufs2_ino(struct fs *sb, const c return; } -/* ***************************************************** dbg_dump_iblk ***** */ /* * Dump an indirect block. The iteration to dump a full file has to be * written around. @@ -841,9 +811,8 @@ dbg_dump_iblk(struct fs *sb, const char { unsigned int *mem, i, j, size; - if(!dbg_log) { + if (!dbg_log) return; - } fprintf(dbg_log, "===== START INDIRECT BLOCK DUMP =====\n"); fprintf(dbg_log, "# %d@%lx: %s\n", indent, (unsigned long)block, @@ -855,14 +824,13 @@ dbg_dump_iblk(struct fs *sb, const char else size = sizeof(ufs2_daddr_t); - mem=(unsigned int *)block; - for (i=0; (size_t)ifs_bsize, size), - length); i+=8) { + mem = (unsigned int *)block; + for (i = 0; (size_t)i < MIN(howmany(sb->fs_bsize, size), length); + i += 8) { fprintf(dbg_log, "%04x: ", i); - for (j=0; j<8; j++) { - if((size_t)(i+j) __FBSDID("$FreeBSD$"); -/* ********************************************************** INCLUDES ***** */ #include #include #include @@ -72,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include "debug.h" -/* *************************************************** GLOBALS & TYPES ***** */ #ifdef FS_DEBUG int _dbg_lvl_ = (DL_INFO); /* DL_TRC */ #endif /* FS_DEBUG */ @@ -117,7 +115,7 @@ union dinode { static ufs2_daddr_t inoblk; /* inode block address */ static char inobuf[MAXBSIZE]; /* inode block */ static ino_t maxino; /* last valid inode */ -static int unlabeled; /* unlabeled partition, e.g. vinum volume etc. */ +static int unlabeled; /* unlabeled partition, e.g. vinum volume */ /* * An array of elements of type struct gfs_bpp describes all blocks to @@ -130,10 +128,9 @@ struct gfs_bpp { #define GFS_FL_FIRST 1 #define GFS_FL_LAST 2 unsigned int flags; /* special handling required */ - int found; /* how many references were updated */ + int found; /* how many references were updated */ }; -/* ******************************************************** PROTOTYPES ***** */ static void growfs(int, int, unsigned int); static void rdfs(ufs2_daddr_t, size_t, void *, int); static void wtfs(ufs2_daddr_t, size_t, void *, int, unsigned int); @@ -158,7 +155,6 @@ static void indirchk(ufs_lbn_t, ufs_lbn_ struct gfs_bpp *, int, int, unsigned int); static void get_dev_size(int, int *); -/* ************************************************************ growfs ***** */ /* * Here we actually start growing the file system. We basically read the * cylinder summary from the first cylinder group as we want to update @@ -174,12 +170,12 @@ static void growfs(int fsi, int fso, unsigned int Nflag) { DBG_FUNC("growfs") - time_t modtime; - uint cylno; - int i, j, width; - char tmpbuf[100]; + time_t modtime; + uint cylno; + int i, j, width; + char tmpbuf[100]; #ifdef FSIRAND - static int randinit=0; + static int randinit=0; DBG_ENTER; @@ -198,37 +194,35 @@ growfs(int fsi, int fso, unsigned int Nf * Get the cylinder summary into the memory. */ fscs = (struct csum *)calloc((size_t)1, (size_t)sblock.fs_cssize); - if(fscs == NULL) { + if (fscs == NULL) errx(1, "calloc failed"); - } for (i = 0; i < osblock.fs_cssize; i += osblock.fs_bsize) { rdfs(fsbtodb(&osblock, osblock.fs_csaddr + numfrags(&osblock, i)), (size_t)MIN(osblock.fs_cssize - i, - osblock.fs_bsize), (void *)(((char *)fscs)+i), fsi); + osblock.fs_bsize), (void *)(((char *)fscs) + i), fsi); } #ifdef FS_DEBUG -{ - struct csum *dbg_csp; - int dbg_csc; - char dbg_line[80]; - - dbg_csp=fscs; - for(dbg_csc=0; dbg_csc= width) { printf("\n"); i = 0; @@ -288,20 +282,18 @@ growfs(int fsi, int fso, unsigned int Nf DBG_PRINT0("fscs written\n"); #ifdef FS_DEBUG -{ - struct csum *dbg_csp; - int dbg_csc; - char dbg_line[80]; - - dbg_csp=fscs; - for(dbg_csc=0; dbg_csc 0) @@ -549,7 +538,6 @@ initcg(int cylno, time_t modtime, int fs return; } -/* ******************************************************* frag_adjust ***** */ /* * Here we add or subtract (sign +1/-1) the available fragments in a given * block to or from the fragment statistics. By subtracting before and adding @@ -570,45 +558,38 @@ frag_adjust(ufs2_daddr_t frag, int sign) * Here frag only needs to point to any fragment in the block we want * to examine. */ - for(f=rounddown(frag, sblock.fs_frag); - ffound++; DBG_PRINT3("scg (%jd->%jd)[%d] reference updated\n", - (intmax_t)f->old, - (intmax_t)f->new, - fragnum); + (intmax_t)f->old, (intmax_t)f->new, fragnum); /* * Copy the block back immediately. @@ -669,7 +648,6 @@ cond_bl_upd(ufs2_daddr_t *block, struct return (0); } -/* ************************************************************ updjcg ***** */ /* * Here we do all needed work for the former last cylinder group. It has to be * changed in any case, even if the file system ended exactly on the end of @@ -685,10 +663,10 @@ static void updjcg(int cylno, time_t modtime, int fsi, int fso, unsigned int Nflag) { DBG_FUNC("updjcg") - ufs2_daddr_t cbase, dmax, dupper; - struct csum *cs; - int i,k; - int j=0; + ufs2_daddr_t cbase, dmax, dupper; + struct csum *cs; + int i, k; + int j = 0; DBG_ENTER; @@ -699,9 +677,7 @@ updjcg(int cylno, time_t modtime, int fs rdfs(fsbtodb(&osblock, cgtod(&osblock, cylno)), (size_t)osblock.fs_cgsize, (void *)&aocg, fsi); DBG_PRINT0("jcg read\n"); - DBG_DUMP_CG(&sblock, - "old joining cg", - &aocg); + DBG_DUMP_CG(&sblock, "old joining cg", &aocg); memcpy((void *)&cgun1, (void *)&cgun2, sizeof(cgun2)); @@ -713,16 +689,14 @@ updjcg(int cylno, time_t modtime, int fs * cylinder group we have to change that value now to fs_cpg. */ - if(cgbase(&osblock, cylno+1) == osblock.fs_size) { + if (cgbase(&osblock, cylno + 1) == osblock.fs_size) { if (sblock.fs_magic == FS_UFS1_MAGIC) acg.cg_old_ncyl=sblock.fs_old_cpg; wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); DBG_PRINT0("jcg written\n"); - DBG_DUMP_CG(&sblock, - "new joining cg", - &acg); + DBG_DUMP_CG(&sblock, "new joining cg", &acg); DBG_LEAVE; return; @@ -736,9 +710,8 @@ updjcg(int cylno, time_t modtime, int fs if (dmax > sblock.fs_size) dmax = sblock.fs_size; dupper = cgdmin(&sblock, cylno) - cbase; - if (cylno == 0) { /* XXX fscs may be relocated */ + if (cylno == 0) /* XXX fscs may be relocated */ dupper += howmany(sblock.fs_cssize, sblock.fs_fsize); - } /* * Set pointer to the cylinder summary for our cylinder group. @@ -760,21 +733,16 @@ updjcg(int cylno, time_t modtime, int fs } else { acg.cg_old_ncyl = sblock.fs_old_cpg; } - DBG_PRINT2("jcg dbg: %d %u", - cylno, - sblock.fs_ncg); + DBG_PRINT2("jcg dbg: %d %u", cylno, sblock.fs_ncg); #ifdef FS_DEBUG if (sblock.fs_magic == FS_UFS1_MAGIC) - DBG_PRINT2("%d %u", - acg.cg_old_ncyl, - sblock.fs_old_cpg); + DBG_PRINT2("%d %u", acg.cg_old_ncyl, sblock.fs_old_cpg); #endif DBG_PRINT0("\n"); acg.cg_ndblk = dmax - cbase; - sblock.fs_dsize += acg.cg_ndblk-aocg.cg_ndblk; - if (sblock.fs_contigsumsize > 0) { + sblock.fs_dsize += acg.cg_ndblk - aocg.cg_ndblk; + if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; - } /* * Now we have to update the free fragment bitmap for our new free @@ -788,15 +756,16 @@ updjcg(int cylno, time_t modtime, int fs * Handle the first new block here if it was partially available * before. */ - if(osblock.fs_size % sblock.fs_frag) { - if(roundup(osblock.fs_size, sblock.fs_frag)<=sblock.fs_size) { + if (osblock.fs_size % sblock.fs_frag) { + if (roundup(osblock.fs_size, sblock.fs_frag) <= + sblock.fs_size) { /* * The new space is enough to fill at least this * block */ - j=0; - for(i=roundup(osblock.fs_size-cbase, sblock.fs_frag)-1; - i>=osblock.fs_size-cbase; + j = 0; + for (i = roundup(osblock.fs_size - cbase, + sblock.fs_frag) - 1; i >= osblock.fs_size - cbase; i--) { setbit(cg_blksfree(&acg), i); acg.cg_cs.cs_nffree++; @@ -808,44 +777,43 @@ updjcg(int cylno, time_t modtime, int fs * already existing fragment at the former end of the * file system. */ - if(isblock(&sblock, cg_blksfree(&acg), - ((osblock.fs_size - cgbase(&sblock, cylno))/ - sblock.fs_frag))) { + if (isblock(&sblock, cg_blksfree(&acg), + ((osblock.fs_size - cgbase(&sblock, cylno)) / + sblock.fs_frag))) { /* * The block is now completely available. */ DBG_PRINT0("block was\n"); - acg.cg_frsum[osblock.fs_size%sblock.fs_frag]--; + acg.cg_frsum[osblock.fs_size % sblock.fs_frag]--; acg.cg_cs.cs_nbfree++; - acg.cg_cs.cs_nffree-=sblock.fs_frag; - k=rounddown(osblock.fs_size-cbase, + acg.cg_cs.cs_nffree -= sblock.fs_frag; + k = rounddown(osblock.fs_size - cbase, + sblock.fs_frag); + updclst((osblock.fs_size - cbase) / sblock.fs_frag); - updclst((osblock.fs_size-cbase)/sblock.fs_frag); } else { /* * Lets rejoin a possible partially growed * fragment. */ - k=0; - while(isset(cg_blksfree(&acg), i) && - (i>=rounddown(osblock.fs_size-cbase, + k = 0; + while (isset(cg_blksfree(&acg), i) && + (i >= rounddown(osblock.fs_size - cbase, sblock.fs_frag))) { i--; k++; } - if(k) { + if (k) acg.cg_frsum[k]--; - } - acg.cg_frsum[k+j]++; + acg.cg_frsum[k + j]++; } } else { /* * We only grow by some fragments within this last * block. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 17:38:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9266D106564A; Mon, 5 Mar 2012 17:38:45 +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 374648FC08; Mon, 5 Mar 2012 17:38: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 q25Hcjpa096414; Mon, 5 Mar 2012 17:38:45 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25Hcix2096412; Mon, 5 Mar 2012 17:38:44 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203051738.q25Hcix2096412@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 5 Mar 2012 17:38: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: r232553 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 17:38:45 -0000 Author: pluknet Date: Mon Mar 5 17:38:44 2012 New Revision: 232553 URL: http://svn.freebsd.org/changeset/base/232553 Log: Fix typo. Bump .Dd for the previous change. Modified: head/share/man/man9/pci.9 Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Mon Mar 5 17:33:01 2012 (r232552) +++ head/share/man/man9/pci.9 Mon Mar 5 17:38:44 2012 (r232553) @@ -537,7 +537,7 @@ The .Fn pci_release_msi function returns zero on success and an error on failure. .Pp -.The +The .Fn pci_count_msix function returns the maximum number of MSI-X messages supported by the device From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 17:44:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E987D1065673; Mon, 5 Mar 2012 17:44:53 +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 C131F8FC0C; Mon, 5 Mar 2012 17:44:53 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 77FB646B0C; Mon, 5 Mar 2012 12:44:53 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E66BCB924; Mon, 5 Mar 2012 12:44:52 -0500 (EST) From: John Baldwin To: Tijl Coosemans Date: Mon, 5 Mar 2012 12:11:30 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203042002.q24K2KWF050460@svn.freebsd.org> In-Reply-To: <201203042002.q24K2KWF050460@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203051211.30493.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 05 Mar 2012 12:44:53 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232519 - head/sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 17:44:54 -0000 On Sunday, March 04, 2012 3:02:20 pm Tijl Coosemans wrote: > Author: tijl > Date: Sun Mar 4 20:02:20 2012 > New Revision: 232519 > URL: http://svn.freebsd.org/changeset/base/232519 > > Log: > Do not use INT64_C and UINT64_C to define 64 bit integer limits. They > aren't defined for C++ code unless __STDC_CONSTANT_MACROS is defined. > > Reported by: jhb Thanks! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 17:44:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F3F41065670; Mon, 5 Mar 2012 17:44:57 +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 3D6908FC1B; Mon, 5 Mar 2012 17:44:57 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id E667446B0C; Mon, 5 Mar 2012 12:44:56 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 49848B924; Mon, 5 Mar 2012 12:44:56 -0500 (EST) From: John Baldwin To: Peter Holm Date: Mon, 5 Mar 2012 12:38:57 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203021153.06614.jhb@freebsd.org> <1978600220.298005.1330754492306.JavaMail.root@erie.cs.uoguelph.ca> <20120303163843.GA72020@x2.osted.lan> In-Reply-To: <20120303163843.GA72020@x2.osted.lan> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203051238.57501.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 05 Mar 2012 12:44:56 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Rick Macklem , src-committers@freebsd.org Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 17:44:57 -0000 On Saturday, March 03, 2012 11:38:43 am Peter Holm wrote: > On Sat, Mar 03, 2012 at 01:01:32AM -0500, Rick Macklem wrote: > > John Baldwin wrote: > > > On Friday, March 02, 2012 8:29:21 am Peter Holm wrote: > > > > On Thu, Mar 01, 2012 at 04:47:41PM -0500, John Baldwin wrote: > > > > > On Monday, October 31, 2011 11:01:47 am Peter Holm wrote: > > > > > > Author: pho > > > > > > Date: Mon Oct 31 15:01:47 2011 > > > > > > New Revision: 226967 > > > > > > URL: http://svn.freebsd.org/changeset/base/226967 > > > > > > > > > > > > Log: > > > > > > The kern_renameat() looks up the fvp using the DELETE flag, > > > > > > which causes > > > > > > the removal of the name cache entry for fvp. > > > > > > > > > > > > Reported by: Anton Yuzhaninov > > > > > > In collaboration with: kib > > > > > > MFC after: 1 week > > > > > > > > > > > > Modified: > > > > > > head/sys/ufs/ufs/ufs_vnops.c > > > > > > > > > > So I ran into this at work recently, and even this fix applied I > > > > > was still > > > > > seeing rename()'s that were seemingly not taking effect. After > > > > > getting some > > > > > extra KTR traces, I figured out that the same purge needs to be > > > > > applied to the > > > > > destination vnode. Specifically, the issue I ran into was that was > > > > > renaming > > > > > 'foo' to 'bar', but lookups for 'bar' were still returning the old > > > > > file. The > > > > > reason was that a lookup after the namei(RENAME) of the > > > > > destination while > > > > > ufs_rename() had its locks dropped was readding the name cache > > > > > entry for > > > > > 'bar', and then a cache_lookup() of 'bar' would return the old > > > > > vnode as long > > > > > as that vnode was valid (e.g. if it had a link in another > > > > > location, or other > > > > > processes had an open file descriptor for it). I'm currently > > > > > testing the > > > > > patch below: > > > > > > > > > > > > > I now have a scenario that fails, but not quite the same way you > > > > describe. > > > > > > > > It looks like this: > > > > > > > > touch file1 > > > > echo xxx > file2 > > > > rename(file1, file2) > > > > > > > > A different process performs stat() on both files in a tight loop. > > > > > > > > Once in a while I observe that a stat() of file2, after the rename, > > > > returns a link count of zero. Size is zero as expected, but the > > > > inode > > > > number of file2 is unchanged. > > > > > Peter, were you doing a stat() using the file name, or an fstat()? > > (Using stat() with afile name might explain it, maybe??) > > > > Yes. Switching to open()/fstat() of the "from" file in the loop, makes > the cache problem go away. Using fstat avoids the changes of getting a stale name cache, so it just avoids the race altogether. However, there is no reason I can think of why stat() should ever give you can inconsistent view of attributes. You should always get a consistent snapshot of attributes. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 18:47:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9AF8B1065670; Mon, 5 Mar 2012 18:47:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A4488FC19; Mon, 5 Mar 2012 18:47: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 q25Ilhlw099370; Mon, 5 Mar 2012 18:47:43 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25IlhrW099367; Mon, 5 Mar 2012 18:47:43 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203051847.q25IlhrW099367@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 5 Mar 2012 18:47: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: r232561 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 18:47:43 -0000 Author: jkim Date: Mon Mar 5 18:47:42 2012 New Revision: 232561 URL: http://svn.freebsd.org/changeset/base/232561 Log: Fix few style nits. Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Mar 5 18:40:53 2012 (r232560) +++ head/sys/amd64/conf/GENERIC Mon Mar 5 18:47:42 2012 (r232561) @@ -168,7 +168,7 @@ device psm # PS/2 mouse device kbdmux # keyboard multiplexer device vga # VGA video card driver -options VESA # add support for VESA BIOS Extensions +options VESA # Add support for VESA BIOS Extensions (VBE) device splash # Splash screen and screen saver support Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Mar 5 18:40:53 2012 (r232560) +++ head/sys/i386/conf/GENERIC Mon Mar 5 18:47:42 2012 (r232561) @@ -173,7 +173,7 @@ device psm # PS/2 mouse device kbdmux # keyboard multiplexer device vga # VGA video card driver -options VESA # add support for VESA BIOS Extensions +options VESA # Add support for VESA BIOS Extensions (VBE) device splash # Splash screen and screen saver support From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 19:25:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3FAE106566B; Mon, 5 Mar 2012 19:25:51 +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 834A88FC15; Mon, 5 Mar 2012 19:25:51 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 1A25F46B52; Mon, 5 Mar 2012 14:25:51 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 756DAB955; Mon, 5 Mar 2012 14:25:50 -0500 (EST) From: John Baldwin To: Marius Strobl Date: Mon, 5 Mar 2012 14:17:38 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203022038.q22Kc5vd046376@svn.freebsd.org> <201203021718.38092.jhb@freebsd.org> <20120302223807.GI55090@alchemy.franken.de> In-Reply-To: <20120302223807.GI55090@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203051417.38470.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 05 Mar 2012 14:25:50 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232403 - in head/sys: dev/acpica dev/cardbus dev/pci powerpc/ofw sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 19:25:52 -0000 On Friday, March 02, 2012 5:38:07 pm Marius Strobl wrote: > On Fri, Mar 02, 2012 at 05:18:37PM -0500, John Baldwin wrote: > > On Friday, March 02, 2012 4:45:52 pm Marius Strobl wrote: > > > On Fri, Mar 02, 2012 at 08:38:05PM +0000, John Baldwin wrote: > > > > Author: jhb > > > > Date: Fri Mar 2 20:38:04 2012 > > > > New Revision: 232403 > > > > URL: http://svn.freebsd.org/changeset/base/232403 > > > > > > > > Log: > > > > - Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge. > > > > The tag enforces a single restriction that all DMA transactions must not > > > > cross a 4GB boundary. Note that while this restriction technically only > > > > applies to PCI-express, this change applies it to all PCI devices as it > > > > is simpler to implement that way and errs on the side of caution. > > > > > > Hrm, wouldn't it have been more appropriate to implement this in the > > > Host-PCI bridges instead? Probably for anything but x86 this would > > > allow to easily distinguish at least between PCI and PCI-Express capable > > > bus hierarchies and would move the PAE workaround to the MD bits to > > > where it belongs. > > > > The PAE workaround is dying as I've already fixed HEAD to make boundary arguments > > use a bus_addr_t. However, I committed it in this fashion so it can be MFC'd > > since I can't merge the boundary KBI change. > > > > The reason I did not do this in the Host-PCI bridge drivers is that we would have > > to do this in umpteen different drivers, and all for a change that is mandated by > > the PCI spec and not specific to the various specs the Host-PCI bridge drivers > > all cater to (OFW, ACPI, MPTable, various and sundry embedded platforms, etc.). > > > > Well, on !x86 we don't have generic Host-PCI bridge drivers based on > what you call specs here, but rather specific drivers for individual > Host-PCI, Host-PCI-X and Host-PCI-Express chips. Whether the PCI* > buses beneath these are enumerated using FDT, OFW etc. doesn't really > matter in this context. Yes, but the 4GB limit is also not specific to the things that make psycho(4) differ from schizo(4). We could at least have a common helper routine to create the tag, but we'd still have a lot of duplicated code to implement N bus_get_dma_tag methods, etc. That type of setup is just begging to have some random Host-PCI bridge driver forget to include the right logic. It seems simpler and safer to do it in one central place, so it is always correct. Also, while PCI-express is the only type of PCI whose specification enforces a 4GB boundary, we have seen non-PCI-e PCI devices also need a 4GB boundary (e.g. bge(4) devices behind an AMD HyperTransport PCI-X bridge). Given all that, I think having older, non-PCI-e devices possibly use an extra S/G element in the rare case that a transaction crosses a 4GB boundary (which won't even happen with the 32-bit DVMA on sparc64 IIUC), is an ok tradeoff to ensure this constraint is correctly defined for all platforms, including future chipsets. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 19:39:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D57D106564A; Mon, 5 Mar 2012 19:39:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CDB98FC13; Mon, 5 Mar 2012 19:39: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 q25Jd0QQ001777; Mon, 5 Mar 2012 19:39:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25Jd0k7001775; Mon, 5 Mar 2012 19:39:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203051939.q25Jd0k7001775@svn.freebsd.org> From: John Baldwin Date: Mon, 5 Mar 2012 19:39: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: r232569 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 19:39:00 -0000 Author: jhb Date: Mon Mar 5 19:38:59 2012 New Revision: 232569 URL: http://svn.freebsd.org/changeset/base/232569 Log: Fix three instances of a missing word. Submitted by: bjk Modified: head/share/man/man9/pci.9 Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Mon Mar 5 19:32:44 2012 (r232568) +++ head/share/man/man9/pci.9 Mon Mar 5 19:38:59 2012 (r232569) @@ -222,7 +222,7 @@ for standard capability IDs are defined .In dev/pci/pcireg.h . If the capability is found, then .Fa *capreg -is set the offset in configuration space of the capability register set, +is set to the offset in configuration space of the capability register set, and .Fn pci_find_cap returns zero. @@ -243,7 +243,7 @@ for standard extended capability IDs are .In dev/pci/pcireg.h . If the extended capability is found, then .Fa *capreg -is set the offset in configuration space of the extended capability +is set to the offset in configuration space of the extended capability register set, and .Fn pci_find_extcap returns zero. @@ -265,7 +265,7 @@ for standard HyperTransport capability t .In dev/pci/pcireg.h . If the capability is found, then .Fa *capreg -is set the offset in configuration space of the capability register set, +is set to the offset in configuration space of the capability register set, and .Fn pci_find_htcap returns zero. From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 19:53:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 733281065672; Mon, 5 Mar 2012 19:53:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 496018FC1D; Mon, 5 Mar 2012 19:53: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 q25JrIeY002271; Mon, 5 Mar 2012 19:53:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25JrIS1002269; Mon, 5 Mar 2012 19:53:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203051953.q25JrIS1002269@svn.freebsd.org> From: John Baldwin Date: Mon, 5 Mar 2012 19:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232570 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 19:53:18 -0000 Author: jhb Date: Mon Mar 5 19:53:17 2012 New Revision: 232570 URL: http://svn.freebsd.org/changeset/base/232570 Log: Fix boot2 to handle boot config files that only contain a custom path to a loader or kernel. Specifically, kname cannot be pointed at cmd[] since it's value is change to be an empty string after the initial call to parse, and cmd[]'s value can be changed (thus losing a prior setting for kname) due to user input at the boot prompt. While here, ensure that that initial boot config file text is nul-terminated, that ops is initialized to zero, and that kname is always initialized to a valid string. Tested by: Domagoj Smolcic rank1seeker of gmail MFC after: 1 week Modified: head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Mon Mar 5 19:38:59 2012 (r232569) +++ head/sys/boot/i386/boot2/boot2.c Mon Mar 5 19:53:17 2012 (r232570) @@ -128,7 +128,7 @@ static struct dsk { unsigned start; int init; } dsk; -static char cmd[512], cmddup[512]; +static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; static uint32_t opts; static int comspeed = SIOSPD; @@ -223,7 +223,9 @@ main(void) { uint8_t autoboot; ino_t ino; + size_t nbyte; + opts = 0; kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -240,8 +242,10 @@ main(void) autoboot = 1; if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); @@ -258,9 +262,9 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !kname) { + if (!kname) { kname = PATH_BOOT3; - if (!keyhit(3*SECOND)) { + if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; } @@ -457,7 +461,12 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - kname = arg; + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } } arg = p; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 20:04:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 102C21065673; Mon, 5 Mar 2012 20:04:29 +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 DA5958FC15; Mon, 5 Mar 2012 20:04: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 q25K4SA1002718; Mon, 5 Mar 2012 20:04:28 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25K4Ssa002716; Mon, 5 Mar 2012 20:04:28 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203052004.q25K4Ssa002716@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 5 Mar 2012 20:04: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: r232571 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 20:04:29 -0000 Author: pluknet Date: Mon Mar 5 20:04:28 2012 New Revision: 232571 URL: http://svn.freebsd.org/changeset/base/232571 Log: Actually bump date, sigh. Modified: head/share/man/man9/pci.9 Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Mon Mar 5 19:53:17 2012 (r232570) +++ head/share/man/man9/pci.9 Mon Mar 5 20:04:28 2012 (r232571) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2007 +.Dd March 5, 2012 .Dt PCI 9 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 20:43:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F5421065677; Mon, 5 Mar 2012 20:43:07 +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 3571F8FC1F; Mon, 5 Mar 2012 20:43: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 q25Kh7Dm004044; Mon, 5 Mar 2012 20:43:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25Kh7Pq004042; Mon, 5 Mar 2012 20:43:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203052043.q25Kh7Pq004042@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 5 Mar 2012 20:43: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: r232572 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 20:43:07 -0000 Author: kib Date: Mon Mar 5 20:43:06 2012 New Revision: 232572 URL: http://svn.freebsd.org/changeset/base/232572 Log: The libmap.conf initialization is performed before TLS is functional. Since after r232498 the ctype macros require working access to thread-local variables, rtld crashes when libmap.conf is present. Use hand-made isspace1() macro which is enough to detect spaces in libmap.conf. Reported by: alc, lme, many on current@ Tested by: lme Reviewed by: dim, kan MFC after: 1 week Modified: head/libexec/rtld-elf/libmap.c Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Mon Mar 5 20:04:28 2012 (r232571) +++ head/libexec/rtld-elf/libmap.c Mon Mar 5 20:43:06 2012 (r232572) @@ -3,7 +3,6 @@ */ #include -#include #include #include #include @@ -53,6 +52,12 @@ static int closestrfn (void * cookie); #define iseol(c) (((c) == '#') || ((c) == '\0') || \ ((c) == '\n') || ((c) == '\r')) +/* + * Do not use ctype.h macros, which rely on working TLS. It is + * too early to have thread-local variables functional. + */ +#define isspace1(c) ((c) == ' ' || (c) == '\t') + int lm_init (char *libmap_override) { @@ -107,7 +112,7 @@ lmc_parse (FILE *fp) t = f = c = NULL; /* Skip over leading space */ - while (isspace(*cp)) cp++; + while (isspace1(*cp)) cp++; /* Found a comment or EOL */ if (iseol(*cp)) continue; @@ -117,7 +122,7 @@ lmc_parse (FILE *fp) cp++; /* Skip leading space */ - while (isspace(*cp)) cp++; + while (isspace1(*cp)) cp++; /* Found comment, EOL or end of selector */ if (iseol(*cp) || *cp == ']') @@ -125,11 +130,11 @@ lmc_parse (FILE *fp) c = cp++; /* Skip to end of word */ - while (!isspace(*cp) && !iseol(*cp) && *cp != ']') + while (!isspace1(*cp) && !iseol(*cp) && *cp != ']') cp++; /* Skip and zero out trailing space */ - while (isspace(*cp)) *cp++ = '\0'; + while (isspace1(*cp)) *cp++ = '\0'; /* Check if there is a closing brace */ if (*cp != ']') continue; @@ -141,7 +146,7 @@ lmc_parse (FILE *fp) * There should be nothing except whitespace or comment from this point to the end of the line. */ - while(isspace(*cp)) cp++; + while(isspace1(*cp)) cp++; if (!iseol(*cp)) continue; strcpy(prog, c); @@ -151,20 +156,20 @@ lmc_parse (FILE *fp) /* Parse the 'from' candidate. */ f = cp++; - while (!isspace(*cp) && !iseol(*cp)) cp++; + while (!isspace1(*cp) && !iseol(*cp)) cp++; /* Skip and zero out the trailing whitespace */ - while (isspace(*cp)) *cp++ = '\0'; + while (isspace1(*cp)) *cp++ = '\0'; /* Found a comment or EOL */ if (iseol(*cp)) continue; /* Parse 'to' mapping */ t = cp++; - while (!isspace(*cp) && !iseol(*cp)) cp++; + while (!isspace1(*cp) && !iseol(*cp)) cp++; /* Skip and zero out the trailing whitespace */ - while (isspace(*cp)) *cp++ = '\0'; + while (isspace1(*cp)) *cp++ = '\0'; /* Should be no extra tokens at this point */ if (!iseol(*cp)) continue; From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 20:59:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4172F106566C; Mon, 5 Mar 2012 20:59:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C3BC8FC08; Mon, 5 Mar 2012 20:59: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 q25KxZ3f004666; Mon, 5 Mar 2012 20:59:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25KxY8h004664; Mon, 5 Mar 2012 20:59:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201203052059.q25KxY8h004664@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 5 Mar 2012 20:59: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: r232574 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 20:59:35 -0000 Author: pjd Date: Mon Mar 5 20:59:34 2012 New Revision: 232574 URL: http://svn.freebsd.org/changeset/base/232574 Log: Link EV_SET(3) to kqueue(2). MFC after: 3 days Modified: head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Mon Mar 5 20:44:54 2012 (r232573) +++ head/lib/libc/sys/Makefile.inc Mon Mar 5 20:59:34 2012 (r232574) @@ -165,7 +165,7 @@ MLINKS+=jail.2 jail_attach.2 \ jail.2 jail_remove.2 \ jail.2 jail_set.2 MLINKS+=kldunload.2 kldunloadf.2 -MLINKS+=kqueue.2 kevent.2 +MLINKS+=kqueue.2 kevent.2 kqueue.2 EV_SET.3 MLINKS+=link.2 linkat.2 MLINKS+=madvise.2 posix_madvise.2 MLINKS+=mkdir.2 mkdirat.2 From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 21:44:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7E8F1065670 for ; Mon, 5 Mar 2012 21:44:04 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay02.pair.com (relay02.pair.com [209.68.5.16]) by mx1.freebsd.org (Postfix) with SMTP id 863088FC1A for ; Mon, 5 Mar 2012 21:44:04 +0000 (UTC) Received: (qmail 44020 invoked from network); 5 Mar 2012 21:43:57 -0000 Received: from 87.58.144.241 (HELO x2.osted.lan) (87.58.144.241) by relay02.pair.com with SMTP; 5 Mar 2012 21:43:57 -0000 X-pair-Authenticated: 87.58.144.241 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.4/8.14.4) with ESMTP id q25Lht2W041441; Mon, 5 Mar 2012 22:43:55 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.4/8.14.4/Submit) id q25Lhs9S041438; Mon, 5 Mar 2012 22:43:54 +0100 (CET) (envelope-from pho) Date: Mon, 5 Mar 2012 22:43:54 +0100 From: Peter Holm To: John Baldwin Message-ID: <20120305214354.GA41216@x2.osted.lan> References: <201203021153.06614.jhb@freebsd.org> <1978600220.298005.1330754492306.JavaMail.root@erie.cs.uoguelph.ca> <20120303163843.GA72020@x2.osted.lan> <201203051238.57501.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203051238.57501.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Rick Macklem , src-committers@freebsd.org Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 21:44:05 -0000 On Mon, Mar 05, 2012 at 12:38:57PM -0500, John Baldwin wrote: > On Saturday, March 03, 2012 11:38:43 am Peter Holm wrote: > > On Sat, Mar 03, 2012 at 01:01:32AM -0500, Rick Macklem wrote: > > > John Baldwin wrote: > > > > On Friday, March 02, 2012 8:29:21 am Peter Holm wrote: > > > > > On Thu, Mar 01, 2012 at 04:47:41PM -0500, John Baldwin wrote: > > > > > > On Monday, October 31, 2011 11:01:47 am Peter Holm wrote: > > > > > > > Author: pho > > > > > > > Date: Mon Oct 31 15:01:47 2011 > > > > > > > New Revision: 226967 > > > > > > > URL: http://svn.freebsd.org/changeset/base/226967 > > > > > > > > > > > > > > Log: > > > > > > > The kern_renameat() looks up the fvp using the DELETE flag, > > > > > > > which causes > > > > > > > the removal of the name cache entry for fvp. > > > > > > > > > > > > > > Reported by: Anton Yuzhaninov > > > > > > > In collaboration with: kib > > > > > > > MFC after: 1 week > > > > > > > > > > > > > > Modified: > > > > > > > head/sys/ufs/ufs/ufs_vnops.c > > > > > > > > > > > > So I ran into this at work recently, and even this fix applied I > > > > > > was still > > > > > > seeing rename()'s that were seemingly not taking effect. After > > > > > > getting some > > > > > > extra KTR traces, I figured out that the same purge needs to be > > > > > > applied to the > > > > > > destination vnode. Specifically, the issue I ran into was that was > > > > > > renaming > > > > > > 'foo' to 'bar', but lookups for 'bar' were still returning the old > > > > > > file. The > > > > > > reason was that a lookup after the namei(RENAME) of the > > > > > > destination while > > > > > > ufs_rename() had its locks dropped was readding the name cache > > > > > > entry for > > > > > > 'bar', and then a cache_lookup() of 'bar' would return the old > > > > > > vnode as long > > > > > > as that vnode was valid (e.g. if it had a link in another > > > > > > location, or other > > > > > > processes had an open file descriptor for it). I'm currently > > > > > > testing the > > > > > > patch below: > > > > > > > > > > > > > > > > I now have a scenario that fails, but not quite the same way you > > > > > describe. > > > > > > > > > > It looks like this: > > > > > > > > > > touch file1 > > > > > echo xxx > file2 > > > > > rename(file1, file2) > > > > > > > > > > A different process performs stat() on both files in a tight loop. > > > > > > > > > > Once in a while I observe that a stat() of file2, after the rename, > > > > > returns a link count of zero. Size is zero as expected, but the > > > > > inode > > > > > number of file2 is unchanged. > > > > > > > Peter, were you doing a stat() using the file name, or an fstat()? > > > (Using stat() with afile name might explain it, maybe??) > > > > > > > Yes. Switching to open()/fstat() of the "from" file in the loop, makes > > the cache problem go away. > > Using fstat avoids the changes of getting a stale name cache, so it just > avoids the race altogether. However, there is no reason I can think of why > stat() should ever give you can inconsistent view of attributes. You should > always get a consistent snapshot of attributes. > Maybe my test scenario is broken, but it sure looks like the link count is zero, after the rename. $ ./r9.sh FAIL: old and new "To" inode number is identical stat() before the rename(): fromFile.log : ino = 4, nlink = 1, size = 0 toFile.log.00065: ino = 70, nlink = 1, size = 8 stat() after the rename(): toFile.log.00065: ino = 70, nlink = 0, size = 0 $ This on r232558 with r232401 reverted. No problem on a pristine HEAD of cause. http://people.freebsd.org/~pho/r9.sh - Peter From owner-svn-src-head@FreeBSD.ORG Mon Mar 5 22:03:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4C2B1065670; Mon, 5 Mar 2012 22:03:13 +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 85F798FC25; Mon, 5 Mar 2012 22:03:13 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 3AB4746B09; Mon, 5 Mar 2012 17:03:13 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 982AEB98F; Mon, 5 Mar 2012 17:03:12 -0500 (EST) From: John Baldwin To: Peter Holm Date: Mon, 5 Mar 2012 17:02:49 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203021153.06614.jhb@freebsd.org> <201203051238.57501.jhb@freebsd.org> <20120305214354.GA41216@x2.osted.lan> In-Reply-To: <20120305214354.GA41216@x2.osted.lan> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203051702.50005.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 05 Mar 2012 17:03:12 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Rick Macklem , src-committers@freebsd.org Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 22:03:13 -0000 On Monday, March 05, 2012 4:43:54 pm Peter Holm wrote: > On Mon, Mar 05, 2012 at 12:38:57PM -0500, John Baldwin wrote: > > On Saturday, March 03, 2012 11:38:43 am Peter Holm wrote: > > > On Sat, Mar 03, 2012 at 01:01:32AM -0500, Rick Macklem wrote: > > > > John Baldwin wrote: > > > > > On Friday, March 02, 2012 8:29:21 am Peter Holm wrote: > > > > > > On Thu, Mar 01, 2012 at 04:47:41PM -0500, John Baldwin wrote: > > > > > > > On Monday, October 31, 2011 11:01:47 am Peter Holm wrote: > > > > > > > > Author: pho > > > > > > > > Date: Mon Oct 31 15:01:47 2011 > > > > > > > > New Revision: 226967 > > > > > > > > URL: http://svn.freebsd.org/changeset/base/226967 > > > > > > > > > > > > > > > > Log: > > > > > > > > The kern_renameat() looks up the fvp using the DELETE flag, > > > > > > > > which causes > > > > > > > > the removal of the name cache entry for fvp. > > > > > > > > > > > > > > > > Reported by: Anton Yuzhaninov > > > > > > > > In collaboration with: kib > > > > > > > > MFC after: 1 week > > > > > > > > > > > > > > > > Modified: > > > > > > > > head/sys/ufs/ufs/ufs_vnops.c > > > > > > > > > > > > > > So I ran into this at work recently, and even this fix applied I > > > > > > > was still > > > > > > > seeing rename()'s that were seemingly not taking effect. After > > > > > > > getting some > > > > > > > extra KTR traces, I figured out that the same purge needs to be > > > > > > > applied to the > > > > > > > destination vnode. Specifically, the issue I ran into was that was > > > > > > > renaming > > > > > > > 'foo' to 'bar', but lookups for 'bar' were still returning the old > > > > > > > file. The > > > > > > > reason was that a lookup after the namei(RENAME) of the > > > > > > > destination while > > > > > > > ufs_rename() had its locks dropped was readding the name cache > > > > > > > entry for > > > > > > > 'bar', and then a cache_lookup() of 'bar' would return the old > > > > > > > vnode as long > > > > > > > as that vnode was valid (e.g. if it had a link in another > > > > > > > location, or other > > > > > > > processes had an open file descriptor for it). I'm currently > > > > > > > testing the > > > > > > > patch below: > > > > > > > > > > > > > > > > > > > I now have a scenario that fails, but not quite the same way you > > > > > > describe. > > > > > > > > > > > > It looks like this: > > > > > > > > > > > > touch file1 > > > > > > echo xxx > file2 > > > > > > rename(file1, file2) > > > > > > > > > > > > A different process performs stat() on both files in a tight loop. > > > > > > > > > > > > Once in a while I observe that a stat() of file2, after the rename, > > > > > > returns a link count of zero. Size is zero as expected, but the > > > > > > inode > > > > > > number of file2 is unchanged. > > > > > > > > > Peter, were you doing a stat() using the file name, or an fstat()? > > > > (Using stat() with afile name might explain it, maybe??) > > > > > > > > > > Yes. Switching to open()/fstat() of the "from" file in the loop, makes > > > the cache problem go away. > > > > Using fstat avoids the changes of getting a stale name cache, so it just > > avoids the race altogether. However, there is no reason I can think of why > > stat() should ever give you can inconsistent view of attributes. You should > > always get a consistent snapshot of attributes. > > > > Maybe my test scenario is broken, but it sure looks like the link > count is zero, after the rename. Hmmm, I think it is more the size of zero I'm surprised at. Presumably a vnode whose only references are open file descriptors would have a link count of zero, and so if this race were to occur, I would expect to see that. However, I would expect the file to have the 'xxx' contents, so a non-zero file. Hmm, I wonder what happens if the only link to a file are hold counts (e.g. name cache entries), but the usecount drops to zero. Will UFS recycle the i-node in that case? If so, perhaps that could explain it? Or even better, perhaps because the usecount is zero, when the rename happens, UFS goes ahead and zeros out the file. That probably explains it then. (Clearly we need to add a 4th reference count to vnodes as it is far too simple as-is..) > > $ ./r9.sh > FAIL: old and new "To" inode number is identical > stat() before the rename(): > fromFile.log : ino = 4, nlink = 1, size = 0 > toFile.log.00065: ino = 70, nlink = 1, size = 8 > > stat() after the rename(): > toFile.log.00065: ino = 70, nlink = 0, size = 0 > $ > > This on r232558 with r232401 reverted. No problem on a pristine > HEAD of cause. > > http://people.freebsd.org/~pho/r9.sh > > - Peter > -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 02:23:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 814991065673; Tue, 6 Mar 2012 02:23:16 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 194418FC1D; Tue, 6 Mar 2012 02:23: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 q262NFHd015019; Tue, 6 Mar 2012 02:23:15 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q262NFEk015017; Tue, 6 Mar 2012 02:23:15 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203060223.q262NFEk015017@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 02:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232576 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 02:23:16 -0000 Author: jmallett Date: Tue Mar 6 02:23:15 2012 New Revision: 232576 URL: http://svn.freebsd.org/changeset/base/232576 Log: In the trap messages that aid the primitive debugging environment of MIPS, include the tid as well, so it's easier to tell which thread of a process with multiple is responsible for a crash. Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Mon Mar 5 22:36:50 2012 (r232575) +++ head/sys/mips/mips/trap.c Tue Mar 6 02:23:15 2012 (r232576) @@ -1312,15 +1312,19 @@ log_illegal_instruction(const char *msg, pt_entry_t *ptep; pd_entry_t *pdep; unsigned int *addr; - struct proc *p = curproc; + struct thread *td; + struct proc *p; register_t pc; + td = curthread; + p = td->td_proc; + #ifdef SMP printf("cpuid = %d\n", PCPU_GET(cpuid)); #endif pc = frame->pc + (DELAYBRANCH(frame->cause) ? 4 : 0); - log(LOG_ERR, "%s: pid %d (%s), uid %d: pc %#jx ra %#jx\n", - msg, p->p_pid, p->p_comm, + log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: pc %#jx ra %#jx\n", + msg, p->p_pid, (long)td->td_tid, p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, (intmax_t)pc, (intmax_t)frame->ra); @@ -1357,12 +1361,16 @@ log_bad_page_fault(char *msg, struct tra pt_entry_t *ptep; pd_entry_t *pdep; unsigned int *addr; - struct proc *p = curproc; + struct thread *td; + struct proc *p; char *read_or_write; register_t pc; trap_type &= ~T_USER; + td = curthread; + p = td->td_proc; + #ifdef SMP printf("cpuid = %d\n", PCPU_GET(cpuid)); #endif @@ -1381,8 +1389,8 @@ log_bad_page_fault(char *msg, struct tra } pc = frame->pc + (DELAYBRANCH(frame->cause) ? 4 : 0); - log(LOG_ERR, "%s: pid %d (%s), uid %d: pc %#jx got a %s fault at %#jx\n", - msg, p->p_pid, p->p_comm, + log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: pc %#jx got a %s fault at %#jx\n", + msg, p->p_pid, (long)td->td_tid, p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, (intmax_t)pc, read_or_write, From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 03:25:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1CA3106566B; Tue, 6 Mar 2012 03:25:51 +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 9CBD18FC12; Tue, 6 Mar 2012 03:25: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 q263PpoS017369; Tue, 6 Mar 2012 03:25:51 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q263PpkV017366; Tue, 6 Mar 2012 03:25:51 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203060325.q263PpkV017366@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 03:25: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: r232577 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 03:25:51 -0000 Author: gonzo Date: Tue Mar 6 03:25:50 2012 New Revision: 232577 URL: http://svn.freebsd.org/changeset/base/232577 Log: Prepare for large TLS redo. Save pointer to the beginning of TLS area, and offset it only if requested by RDHWR handler. Otherwise things get overly complicated - we need to track whether address passsed in request for setting td_md.md_tls is already offseted or not. Added: head/sys/mips/include/tls.h (contents, props changed) Modified: head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Added: head/sys/mips/include/tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/tls.h Tue Mar 6 03:25:50 2012 (r232577) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * 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 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 __MIPS_TLS_H__ +#define __MIPS_TLS_H__ + +/* + * TLS parameters + */ + +#define TLS_TP_OFFSET 0x7000 +#define TLS_DTP_OFFSET 0x8000 + +#ifdef __mips_n64 +#define TLS_TCB_SIZE 16 +#else +#define TLS_TCB_SIZE 8 +#endif + +#endif /* __MIPS_TLS_H__ */ Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Mar 6 02:23:15 2012 (r232576) +++ head/sys/mips/mips/trap.c Tue Mar 6 03:25:50 2012 (r232577) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef DDB @@ -813,6 +814,7 @@ dofault: if (inst.RType.rd == 29) { frame_regs = &(trapframe->zero); frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls; + frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE; trapframe->pc += sizeof(int); goto out; } Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Tue Mar 6 02:23:15 2012 (r232576) +++ head/sys/mips/mips/vm_machdep.c Tue Mar 6 03:25:50 2012 (r232577) @@ -608,28 +608,9 @@ int cpu_set_user_tls(struct thread *td, void *tls_base) { - /* - * tls_base passed to this function - * from thr_new call and points to actual TCB struct, - * so we should add TP_OFFSET + sizeof(struct tcb) - * to make it the same way TLS base is passed to - * MIPS_SET_TLS/MIPS_GET_TLS API - */ - -#ifdef __mips_n64 -#ifdef COMPAT_FREEBSD32 - if (!SV_PROC_FLAG(td->td_proc, SV_ILP32)) { -#endif - td->td_md.md_tls = (char*)tls_base + 0x7010; - return (0); -#ifdef COMPAT_FREEBSD32 - } -#endif -#endif -#if !defined(__mips_n64) || defined(COMPAT_FREEBSD32) - td->td_md.md_tls = (char*)tls_base + 0x7008; + td->td_md.md_tls = (char*)tls_base; + return (0); -#endif } #ifdef DDB From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 03:27:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE656106564A; Tue, 6 Mar 2012 03:27:09 +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 808AF8FC15; Tue, 6 Mar 2012 03:27: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 q263R9dR017452; Tue, 6 Mar 2012 03:27:09 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q263R9HD017449; Tue, 6 Mar 2012 03:27:09 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203060327.q263R9HD017449@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 03:27: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: r232578 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 03:27:09 -0000 Author: gonzo Date: Tue Mar 6 03:27:08 2012 New Revision: 232578 URL: http://svn.freebsd.org/changeset/base/232578 Log: - Switch to saving non-offseted pointer to TLS block in order too keep things simple Modified: head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/mips/rtld_machdep.h Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Tue Mar 6 03:25:50 2012 (r232577) +++ head/libexec/rtld-elf/mips/reloc.c Tue Mar 6 03:27:08 2012 (r232578) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "debug.h" #include "rtld.h" @@ -622,8 +623,7 @@ allocate_initial_tls(Obj_Entry *objs) */ tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; - tls = ((char *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8) - + TLS_TP_OFFSET + TLS_TCB_SIZE); + tls = (char *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8); sysarch(MIPS_SET_TLS, tls); } @@ -636,8 +636,7 @@ __tls_get_addr(tls_index* ti) sysarch(MIPS_GET_TLS, &tls); - p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tls - TLS_TP_OFFSET - - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset + TLS_DTP_OFFSET); + p = tls_get_addr_common(tls, ti->ti_module, ti->ti_offset + TLS_DTP_OFFSET); return (p); } Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Tue Mar 6 03:25:50 2012 (r232577) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Tue Mar 6 03:27:08 2012 (r232578) @@ -31,6 +31,7 @@ #include #include +#include struct Struct_Obj_Entry; @@ -48,19 +49,6 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, #define call_initfini_pointer(obj, target) \ (((InitFunc)(target))()) -/* - * TLS - */ - -#define TLS_TP_OFFSET 0x7000 -#define TLS_DTP_OFFSET 0x8000 - -#ifdef __mips_n64 -#define TLS_TCB_SIZE 16 -#else -#define TLS_TCB_SIZE 8 -#endif - typedef struct { unsigned long ti_module; unsigned long ti_offset; From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 03:27:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D81106566C; Tue, 6 Mar 2012 03:27:58 +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 8E74A8FC19; Tue, 6 Mar 2012 03:27: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 q263RwiR017507; Tue, 6 Mar 2012 03:27:58 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q263RwIu017505; Tue, 6 Mar 2012 03:27:58 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203060327.q263RwIu017505@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 03:27: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: r232579 - head/lib/libthr/arch/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 03:27:58 -0000 Author: gonzo Date: Tue Mar 6 03:27:58 2012 New Revision: 232579 URL: http://svn.freebsd.org/changeset/base/232579 Log: - Switch to saving non-offseted pointer to TLS block in order too keep things simple Modified: head/lib/libthr/arch/mips/include/pthread_md.h Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Tue Mar 6 03:27:08 2012 (r232578) +++ head/lib/libthr/arch/mips/include/pthread_md.h Tue Mar 6 03:27:58 2012 (r232579) @@ -35,15 +35,11 @@ #include #include +#include #include #define CPU_SPINWAIT #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) -#ifdef __mips_n64 -#define TP_OFFSET 0x7010 -#else -#define TP_OFFSET 0x7008 -#endif /* * Variant I tcb. The structure layout is fixed, don't blindly @@ -65,7 +61,7 @@ static __inline void _tcb_set(struct tcb *tcb) { - sysarch(MIPS_SET_TLS, ((uint8_t*)tcb + TP_OFFSET)); + sysarch(MIPS_SET_TLS, tcb); } /* @@ -74,10 +70,10 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { - uint8_t *tcb; + struct tcb *tcb; sysarch(MIPS_GET_TLS, &tcb); - return ((struct tcb *)(tcb - TP_OFFSET)); + return tcb; } extern struct pthread *_thr_initial; From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 03:29:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A76E1065673; Tue, 6 Mar 2012 03:29:47 +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 648918FC17; Tue, 6 Mar 2012 03:29: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 q263TlQI017596; Tue, 6 Mar 2012 03:29:47 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q263TlLn017594; Tue, 6 Mar 2012 03:29:47 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203060329.q263TlLn017594@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 03:29: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: r232580 - head/lib/csu/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 03:29:47 -0000 Author: gonzo Date: Tue Mar 6 03:29:46 2012 New Revision: 232580 URL: http://svn.freebsd.org/changeset/base/232580 Log: - Remove NOSHARED parts since it seems to be no-op - Call _init_tls for statically linked binaries Modified: head/lib/csu/mips/crt1.c Modified: head/lib/csu/mips/crt1.c ============================================================================== --- head/lib/csu/mips/crt1.c Tue Mar 6 03:27:58 2012 (r232579) +++ head/lib/csu/mips/crt1.c Tue Mar 6 03:29:46 2012 (r232580) @@ -47,10 +47,8 @@ __FBSDID("$FreeBSD$"); struct Struct_Obj_Entry; struct ps_strings; -#ifndef NOSHARED extern int _DYNAMIC; #pragma weak _DYNAMIC -#endif extern void _init(void); extern void _fini(void); @@ -91,10 +89,11 @@ __start(char **ap, __progname = s + 1; } -#ifndef NOSHARED if (&_DYNAMIC != NULL) atexit(cleanup); -#endif + else + _init_tls(); + #ifdef GCRT atexit(_mcleanup); #endif From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 03:30:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 054F1106564A; Tue, 6 Mar 2012 03:30:10 +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 CC0E48FC14; Tue, 6 Mar 2012 03:30: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 q263U96Y017656; Tue, 6 Mar 2012 03:30:09 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q263U959017654; Tue, 6 Mar 2012 03:30:09 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203060330.q263U959017654@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 03:30: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: r232581 - head/lib/libc/mips/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 03:30:10 -0000 Author: gonzo Date: Tue Mar 6 03:30:09 2012 New Revision: 232581 URL: http://svn.freebsd.org/changeset/base/232581 Log: Implement _set_tp Modified: head/lib/libc/mips/gen/_set_tp.c Modified: head/lib/libc/mips/gen/_set_tp.c ============================================================================== --- head/lib/libc/mips/gen/_set_tp.c Tue Mar 6 03:29:46 2012 (r232580) +++ head/lib/libc/mips/gen/_set_tp.c Tue Mar 6 03:30:09 2012 (r232581) @@ -29,7 +29,11 @@ #include #include +#include + void _set_tp(void *tp) { + + sysarch(MIPS_SET_TLS, tp); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 03:42:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D36A1106566B; Tue, 6 Mar 2012 03:42:54 +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 BE2828FC08; Tue, 6 Mar 2012 03:42: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 q263gsLt018069; Tue, 6 Mar 2012 03:42:54 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q263gs7g018067; Tue, 6 Mar 2012 03:42:54 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203060342.q263gs7g018067@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 03:42: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: r232582 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 03:42:54 -0000 Author: gonzo Date: Tue Mar 6 03:42:54 2012 New Revision: 232582 URL: http://svn.freebsd.org/changeset/base/232582 Log: - Switch ARM and MIPS to TLS Variant I - Fix TLS allocation for Variant I: both rtld and libc allocators assume that tls_static_space includes space for TLS structure. So increment calculated static size by the size of it. Modified: head/lib/libc/gen/tls.c Modified: head/lib/libc/gen/tls.c ============================================================================== --- head/lib/libc/gen/tls.c Tue Mar 6 03:30:09 2012 (r232581) +++ head/lib/libc/gen/tls.c Tue Mar 6 03:42:54 2012 (r232582) @@ -66,11 +66,11 @@ void __libc_free_tls(void *tls, size_t t #error TLS_TCB_ALIGN undefined for target architecture #endif -#if defined(__ia64__) || defined(__powerpc__) +#if defined(__arm__) || defined(__ia64__) || defined(__mips__) || \ + defined(__powerpc__) #define TLS_VARIANT_I #endif -#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \ - defined(__arm__) || defined(__mips__) +#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) #define TLS_VARIANT_II #endif @@ -308,6 +308,13 @@ _init_tls() } } +#ifdef TLS_VARIANT_I + /* + * tls_static_space should include space for TLS structure + */ + tls_static_space += TLS_TCB_SIZE; +#endif + tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN); _set_tp(tls); From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 07:47:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50626106567A; Tue, 6 Mar 2012 07:47:29 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BAB28FC18; Tue, 6 Mar 2012 07:47: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 q267lT75026198; Tue, 6 Mar 2012 07:47:29 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q267lTm1026195; Tue, 6 Mar 2012 07:47:29 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203060747.q267lTm1026195@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 07:47: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: r232583 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 07:47:29 -0000 Author: jmallett Date: Tue Mar 6 07:47:28 2012 New Revision: 232583 URL: http://svn.freebsd.org/changeset/base/232583 Log: When emulating rdhwr for TLS, use the 32-bit offset under COMPAT_FREEBSD32. Modified: head/sys/mips/include/tls.h head/sys/mips/mips/trap.c Modified: head/sys/mips/include/tls.h ============================================================================== --- head/sys/mips/include/tls.h Tue Mar 6 03:42:54 2012 (r232582) +++ head/sys/mips/include/tls.h Tue Mar 6 07:47:28 2012 (r232583) @@ -32,6 +32,10 @@ #ifndef __MIPS_TLS_H__ #define __MIPS_TLS_H__ +#if defined(_KERNEL) && !defined(KLD_MODULE) && !defined(_STANDALONE) +#include "opt_compat.h" +#endif + /* * TLS parameters */ @@ -41,6 +45,9 @@ #ifdef __mips_n64 #define TLS_TCB_SIZE 16 +#ifdef COMPAT_FREEBSD32 +#define TLS_TCB_SIZE32 8 +#endif #else #define TLS_TCB_SIZE 8 #endif Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Mar 6 03:42:54 2012 (r232582) +++ head/sys/mips/mips/trap.c Tue Mar 6 07:47:28 2012 (r232583) @@ -814,6 +814,11 @@ dofault: if (inst.RType.rd == 29) { frame_regs = &(trapframe->zero); frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls; +#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) + frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE32; + else +#endif frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE; trapframe->pc += sizeof(int); goto out; From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 07:50:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C9951065673; Tue, 6 Mar 2012 07:50:45 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DD858FC0C; Tue, 6 Mar 2012 07:50: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 q267oj0O026361; Tue, 6 Mar 2012 07:50:45 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q267ojMZ026358; Tue, 6 Mar 2012 07:50:45 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203060750.q267ojMZ026358@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 07:50: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: r232584 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 07:50:45 -0000 Author: jmallett Date: Tue Mar 6 07:50:45 2012 New Revision: 232584 URL: http://svn.freebsd.org/changeset/base/232584 Log: Fix two and a half oversights in COMPAT_FREEBSD32 related to contexts and TLS: o) The mc_tls field used to store the TLS base when doing context gets and restores was left a pointer and not converted to a 32-bit integer. This had the bug of not correctly capturing the TLS value desired by the user, and the extra nastiness of making the structure the wrong size. o) The mc_tls field was not being saved by sendsig. As a result, the TLS base would always be set to NULL when restoring from a signal handler. Thanks to gonzo for helping track down a bunch of other TLS bugs that came out of tracking these down. Modified: head/sys/mips/include/ucontext.h head/sys/mips/mips/freebsd32_machdep.c Modified: head/sys/mips/include/ucontext.h ============================================================================== --- head/sys/mips/include/ucontext.h Tue Mar 6 07:47:28 2012 (r232583) +++ head/sys/mips/include/ucontext.h Tue Mar 6 07:50:45 2012 (r232584) @@ -73,7 +73,7 @@ typedef struct __mcontext32 { int mc_fpused; int32_t mc_fpregs[33]; int32_t mc_fpc_eir; - void *mc_tls; + int32_t mc_tls; int __spare__[8]; } mcontext32_t; Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Tue Mar 6 07:47:28 2012 (r232583) +++ head/sys/mips/mips/freebsd32_machdep.c Tue Mar 6 07:50:45 2012 (r232584) @@ -222,7 +222,7 @@ get_mcontext32(struct thread *td, mconte for (i = 0; i < 33; i++) mcp->mc_fpregs[i] = mcp64.mc_fpregs[i]; mcp->mc_fpc_eir = mcp64.mc_fpc_eir; - mcp->mc_tls = mcp64.mc_tls; + mcp->mc_tls = (int32_t)(intptr_t)mcp64.mc_tls; return (0); } @@ -244,7 +244,7 @@ set_mcontext32(struct thread *td, const for (i = 0; i < 33; i++) mcp64.mc_fpregs[i] = mcp->mc_fpregs[i]; mcp64.mc_fpc_eir = mcp->mc_fpc_eir; - mcp64.mc_tls = mcp->mc_tls; + mcp64.mc_tls = (void *)(intptr_t)mcp->mc_tls; return (set_mcontext(td, &mcp64)); } @@ -395,6 +395,7 @@ freebsd32_sendsig(sig_t catcher, ksiginf sf.sf_uc.uc_mcontext.mc_pc = regs.r_regs[PC]; sf.sf_uc.uc_mcontext.mullo = regs.r_regs[MULLO]; sf.sf_uc.uc_mcontext.mulhi = regs.r_regs[MULHI]; + sf.sf_uc.uc_mcontext.mc_tls = (int32_t)(intptr_t)td->td_md.md_tls; sf.sf_uc.uc_mcontext.mc_regs[0] = UCONTEXT_MAGIC; /* magic number */ for (i = 1; i < 32; i++) sf.sf_uc.uc_mcontext.mc_regs[i] = regs.r_regs[i]; From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 08:02:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C551065679; Tue, 6 Mar 2012 08:02:10 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91C628FC23; Tue, 6 Mar 2012 08:02: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 q2682A3V026780; Tue, 6 Mar 2012 08:02:10 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2682Ark026778; Tue, 6 Mar 2012 08:02:10 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203060802.q2682Ark026778@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 08:02: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: r232585 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 08:02:10 -0000 Author: jmallett Date: Tue Mar 6 08:02:10 2012 New Revision: 232585 URL: http://svn.freebsd.org/changeset/base/232585 Log: Store TLS base in the sigframe just as is done in freebsd32_sendsig. Because the native sigreturn doesn't use set_mcontext like the COMPAT_FREEBSD32 version does, this wouldn't actually result in overwriting the TLS base. Probably it makes sense to restructure the native sigreturn to use set_mcontext for consistency, and to allow sigreturn to change the TLS base. Modified: head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Tue Mar 6 07:50:45 2012 (r232584) +++ head/sys/mips/mips/pm_machdep.c Tue Mar 6 08:02:10 2012 (r232585) @@ -110,6 +110,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_pc = regs->pc; sf.sf_uc.uc_mcontext.mullo = regs->mullo; sf.sf_uc.uc_mcontext.mulhi = regs->mulhi; + sf.sf_uc.uc_mcontext.mc_tls = td->td_md.md_tls; sf.sf_uc.uc_mcontext.mc_regs[0] = UCONTEXT_MAGIC; /* magic number */ bcopy((void *)®s->ast, (void *)&sf.sf_uc.uc_mcontext.mc_regs[1], sizeof(sf.sf_uc.uc_mcontext.mc_regs) - sizeof(register_t)); From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 08:10:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 460A7106566B; Tue, 6 Mar 2012 08:10:49 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 189518FC1A; Tue, 6 Mar 2012 08:10: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 q268AmII027066; Tue, 6 Mar 2012 08:10:48 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q268Amin027064; Tue, 6 Mar 2012 08:10:48 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203060810.q268Amin027064@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 08:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232586 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 08:10:49 -0000 Author: jmallett Date: Tue Mar 6 08:10:48 2012 New Revision: 232586 URL: http://svn.freebsd.org/changeset/base/232586 Log: Make the native sigreturn just wrap set_mcontext, much as freebsd32_sigreturn does. Modified: head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Tue Mar 6 08:02:10 2012 (r232585) +++ head/sys/mips/mips/pm_machdep.c Tue Mar 6 08:10:48 2012 (r232586) @@ -216,51 +216,22 @@ cpu_thread_siginfo(int sig, u_long code, int sys_sigreturn(struct thread *td, struct sigreturn_args *uap) { - struct trapframe *regs; - ucontext_t *ucp; ucontext_t uc; int error; - ucp = &uc; - error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) return (error); - regs = td->td_frame; - -/* #ifdef DEBUG */ - if (ucp->uc_mcontext.mc_regs[ZERO] != UCONTEXT_MAGIC) { - printf("sigreturn: pid %d, ucp %p\n", td->td_proc->p_pid, ucp); - printf(" old sp %p ra %p pc %p\n", - (void *)(intptr_t)regs->sp, (void *)(intptr_t)regs->ra, (void *)(intptr_t)regs->pc); - printf(" new sp %p ra %p pc %p z %p\n", - (void *)(intptr_t)ucp->uc_mcontext.mc_regs[SP], - (void *)(intptr_t)ucp->uc_mcontext.mc_regs[RA], - (void *)(intptr_t)ucp->uc_mcontext.mc_regs[PC], - (void *)(intptr_t)ucp->uc_mcontext.mc_regs[ZERO]); - return EINVAL; - } -/* #endif */ - - bcopy((const void *)&ucp->uc_mcontext.mc_regs[1], (void *)®s->ast, - sizeof(ucp->uc_mcontext.mc_regs) - sizeof(register_t)); - - if (ucp->uc_mcontext.mc_fpused) - bcopy((const void *)ucp->uc_mcontext.mc_fpregs, - (void *)&td->td_frame->f0, - sizeof(ucp->uc_mcontext.mc_fpregs)); - - regs->pc = ucp->uc_mcontext.mc_pc; - regs->mullo = ucp->uc_mcontext.mullo; - regs->mulhi = ucp->uc_mcontext.mulhi; + error = set_mcontext(td, &uc.uc_mcontext); + if (error != 0) + return (error); - kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); - return(EJUSTRETURN); + return (EJUSTRETURN); } - int ptrace_set_pc(struct thread *td, unsigned long addr) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 08:40:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCDC1106566B; Tue, 6 Mar 2012 08:40:21 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6B1B8FC12; Tue, 6 Mar 2012 08:40: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 q268eLMW028077; Tue, 6 Mar 2012 08:40:21 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q268eLR7028075; Tue, 6 Mar 2012 08:40:21 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203060840.q268eLR7028075@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 08:40: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: r232587 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 08:40:21 -0000 Author: jmallett Date: Tue Mar 6 08:40:21 2012 New Revision: 232587 URL: http://svn.freebsd.org/changeset/base/232587 Log: Garbage collect some unused symbols. Modified: head/sys/mips/mips/genassym.c Modified: head/sys/mips/mips/genassym.c ============================================================================== --- head/sys/mips/mips/genassym.c Tue Mar 6 08:10:48 2012 (r232586) +++ head/sys/mips/mips/genassym.c Tue Mar 6 08:40:21 2012 (r232587) @@ -71,12 +71,8 @@ ASSYM(TD_UPTE, offsetof(struct thread, t ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack)); ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); -ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); -ASSYM(TD_TLS, offsetof(struct thread, td_md.md_tls)); ASSYM(TD_MDFLAGS, offsetof(struct thread, td_md.md_flags)); -ASSYM(TF_REG_SR, offsetof(struct trapframe, sr)); - ASSYM(U_PCB_REGS, offsetof(struct pcb, pcb_regs.zero)); ASSYM(U_PCB_CONTEXT, offsetof(struct pcb, pcb_context)); ASSYM(U_PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); @@ -87,7 +83,6 @@ ASSYM(PC_SEGBASE, offsetof(struct pcpu, ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); ASSYM(PC_FPCURTHREAD, offsetof(struct pcpu, pc_fpcurthread)); ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); -ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); ASSYM(VM_MAX_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); @@ -98,13 +93,10 @@ ASSYM(SIGF32_UC, offsetof(struct sigfram ASSYM(SIGFPE, SIGFPE); ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_SIZE, PAGE_SIZE); -ASSYM(PAGE_MASK, PAGE_MASK); ASSYM(PDRSHIFT, PDRSHIFT); ASSYM(SEGSHIFT, SEGSHIFT); -ASSYM(NPTEPG, NPTEPG); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); -ASSYM(PCPU_SIZE, sizeof(struct pcpu)); ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(MDTD_COP2USED, MDTD_COP2USED); From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 08:57:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0319106567D; Tue, 6 Mar 2012 08:57:30 +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 30E5D8FC14; Tue, 6 Mar 2012 08:57:29 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q268vNDB066742; Tue, 6 Mar 2012 10:57:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q268vNXg094911; Tue, 6 Mar 2012 10:57:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q268vNdJ094910; Tue, 6 Mar 2012 10:57:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 6 Mar 2012 10:57:23 +0200 From: Konstantin Belousov To: Oleksandr Tymoshenko Message-ID: <20120306085723.GY75778@deviant.kiev.zoral.com.ua> References: <201203060329.q263TlLn017594@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+sXEj1HC0AeGgRD2" Content-Disposition: inline In-Reply-To: <201203060329.q263TlLn017594@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=-4.0 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: r232580 - head/lib/csu/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 08:57:31 -0000 --+sXEj1HC0AeGgRD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 06, 2012 at 03:29:47AM +0000, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Tue Mar 6 03:29:46 2012 > New Revision: 232580 > URL: http://svn.freebsd.org/changeset/base/232580 >=20 > Log: > - Remove NOSHARED parts since it seems to be no-op > - Call _init_tls for statically linked binaries >=20 > Modified: > head/lib/csu/mips/crt1.c >=20 > Modified: head/lib/csu/mips/crt1.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/csu/mips/crt1.c Tue Mar 6 03:27:58 2012 (r232579) > +++ head/lib/csu/mips/crt1.c Tue Mar 6 03:29:46 2012 (r232580) > @@ -47,10 +47,8 @@ __FBSDID("$FreeBSD$"); > struct Struct_Obj_Entry; > struct ps_strings; > =20 > -#ifndef NOSHARED > extern int _DYNAMIC; > #pragma weak _DYNAMIC > -#endif > =20 > extern void _init(void); > extern void _fini(void); > @@ -91,10 +89,11 @@ __start(char **ap, > __progname =3D s + 1; > } > =20 > -#ifndef NOSHARED > if (&_DYNAMIC !=3D NULL) > atexit(cleanup); > -#endif > + else > + _init_tls(); > + > #ifdef GCRT > atexit(_mcleanup); > #endif Oh great. I tried to understand this bits for some time, due to init_array work, and was unable to make any sense of it. I will update the patchset to include MIPS now. --+sXEj1HC0AeGgRD2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9V0XIACgkQC3+MBN1Mb4gwkwCeLasAfaEpAQrVLAUhRKpBgqeL d7sAoKQNHipqeV+Ffb5YnPwOFfXlqs1Y =s7h0 -----END PGP SIGNATURE----- --+sXEj1HC0AeGgRD2-- From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 08:59:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC07B1065672; Tue, 6 Mar 2012 08:59:42 +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 ADBDF8FC0A; Tue, 6 Mar 2012 08:59: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 q268xgc9028712; Tue, 6 Mar 2012 08:59:42 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q268xgWq028710; Tue, 6 Mar 2012 08:59:42 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203060859.q268xgWq028710@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 6 Mar 2012 08:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232588 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 08:59:43 -0000 Author: pluknet Date: Tue Mar 6 08:59:42 2012 New Revision: 232588 URL: http://svn.freebsd.org/changeset/base/232588 Log: - ifnet_addrs has gone and replaced by ifaddr_byindex(), as per r83130 - access to the AF_LINK address through if_addrhead is deprecated (r128315) MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Mar 6 08:40:21 2012 (r232587) +++ head/share/man/man9/ifnet.9 Tue Mar 6 08:59:42 2012 (r232588) @@ -73,6 +73,8 @@ .\" .Ss "Interface Address Functions" .Ft "struct ifaddr *" +.Fn ifaddr_byindex "u_short idx" +.Ft "struct ifaddr *" .Fn ifa_ifwithaddr "struct sockaddr *addr" .Ft "struct ifaddr *" .Fn ifa_ifwithdstaddr "struct sockaddr *addr" @@ -127,7 +129,7 @@ .\" .Ss "Global Variables" .Vt extern struct ifnethead ifnet ; -.Vt extern struct ifaddr **ifnet_addrs ; +.\" extern struct ifindex_entry *ifindex_table ; .Vt extern int if_index ; .Vt extern int ifqmaxlen ; .Sh DATA STRUCTURES @@ -192,12 +194,18 @@ Each interface also has a .Li TAILQ of interface addresses, described by .Vt ifaddr -structures; the head of the queue is always an +structures. +An .Dv AF_LINK address (see .Xr link_addr 3 ) -describing the link layer implemented by the interface (if any). +describing the link layer implemented by the interface (if any) +is accessed by the +.Fn ifaddr_byindex +function or +.Va if_addr +structure. (Some trivial interfaces do not provide any link layer addresses; this structure, while still present, serves only to identify the interface name and index.) @@ -1085,8 +1093,11 @@ addresses on that interface, and create .Vt ifaddr structure to be the first element in that list. (A pointer to -this address structure is saved in the global array -.Va ifnet_addrs . ) +this address structure is saved in the +.Vt ifnet +structure and shall be accessed by the +.Fn ifaddr_byindex +function.) The .Fa ifp must have been allocated by From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 09:04:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C85E106564A; Tue, 6 Mar 2012 09:04:53 +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 67A808FC18; Tue, 6 Mar 2012 09: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 q2694rYn028922; Tue, 6 Mar 2012 09:04:53 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2694rAY028920; Tue, 6 Mar 2012 09:04:53 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203060904.q2694rAY028920@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 6 Mar 2012 09:04: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: r232589 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 09:04:53 -0000 Author: pluknet Date: Tue Mar 6 09:04:53 2012 New Revision: 232589 URL: http://svn.freebsd.org/changeset/base/232589 Log: The missing part of r232588 that documents ifaddr_byindex() itself. MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Mar 6 08:59:42 2012 (r232588) +++ head/share/man/man9/ifnet.9 Tue Mar 6 09:04:53 2012 (r232589) @@ -1351,6 +1351,10 @@ precisely .Fa addr will be returned. .Pp +.Fn ifaddr_byindex +returns the link-level address of the interface with the given index +.Fa idx . +.Pp All of these functions return a null pointer if no such address can be found. .Ss "Interface Multicast Address Functions" From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 09:34:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FA861065674; Tue, 6 Mar 2012 09:34:31 +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 D5C308FC12; Tue, 6 Mar 2012 09: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 q269YUuM029843; Tue, 6 Mar 2012 09:34:30 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q269YUIp029840; Tue, 6 Mar 2012 09:34:30 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203060934.q269YUIp029840@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 6 Mar 2012 09: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: r232590 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 09:34:31 -0000 Author: pluknet Date: Tue Mar 6 09:34:30 2012 New Revision: 232590 URL: http://svn.freebsd.org/changeset/base/232590 Log: Cosmetic nit: - rename isspace1() macro to the more appropriate rtld_isspace(). Discussed with: kib Modified: head/libexec/rtld-elf/libmap.c Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Tue Mar 6 09:04:53 2012 (r232589) +++ head/libexec/rtld-elf/libmap.c Tue Mar 6 09:34:30 2012 (r232590) @@ -56,7 +56,7 @@ static int closestrfn (void * cookie); * Do not use ctype.h macros, which rely on working TLS. It is * too early to have thread-local variables functional. */ -#define isspace1(c) ((c) == ' ' || (c) == '\t') +#define rtld_isspace(c) ((c) == ' ' || (c) == '\t') int lm_init (char *libmap_override) @@ -112,7 +112,7 @@ lmc_parse (FILE *fp) t = f = c = NULL; /* Skip over leading space */ - while (isspace1(*cp)) cp++; + while (rtld_isspace(*cp)) cp++; /* Found a comment or EOL */ if (iseol(*cp)) continue; @@ -122,7 +122,7 @@ lmc_parse (FILE *fp) cp++; /* Skip leading space */ - while (isspace1(*cp)) cp++; + while (rtld_isspace(*cp)) cp++; /* Found comment, EOL or end of selector */ if (iseol(*cp) || *cp == ']') @@ -130,11 +130,11 @@ lmc_parse (FILE *fp) c = cp++; /* Skip to end of word */ - while (!isspace1(*cp) && !iseol(*cp) && *cp != ']') + while (!rtld_isspace(*cp) && !iseol(*cp) && *cp != ']') cp++; /* Skip and zero out trailing space */ - while (isspace1(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) *cp++ = '\0'; /* Check if there is a closing brace */ if (*cp != ']') continue; @@ -146,7 +146,7 @@ lmc_parse (FILE *fp) * There should be nothing except whitespace or comment from this point to the end of the line. */ - while(isspace1(*cp)) cp++; + while(rtld_isspace(*cp)) cp++; if (!iseol(*cp)) continue; strcpy(prog, c); @@ -156,20 +156,20 @@ lmc_parse (FILE *fp) /* Parse the 'from' candidate. */ f = cp++; - while (!isspace1(*cp) && !iseol(*cp)) cp++; + while (!rtld_isspace(*cp) && !iseol(*cp)) cp++; /* Skip and zero out the trailing whitespace */ - while (isspace1(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) *cp++ = '\0'; /* Found a comment or EOL */ if (iseol(*cp)) continue; /* Parse 'to' mapping */ t = cp++; - while (!isspace1(*cp) && !iseol(*cp)) cp++; + while (!rtld_isspace(*cp) && !iseol(*cp)) cp++; /* Skip and zero out the trailing whitespace */ - while (isspace1(*cp)) *cp++ = '\0'; + while (rtld_isspace(*cp)) *cp++ = '\0'; /* Should be no extra tokens at this point */ if (!iseol(*cp)) continue; From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 09:40:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E749106566C; Tue, 6 Mar 2012 09:40:34 +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 897B28FC0C; Tue, 6 Mar 2012 09:40: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 q269eYxw030055; Tue, 6 Mar 2012 09:40:34 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q269eYJM030053; Tue, 6 Mar 2012 09:40:34 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203060940.q269eYJM030053@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 6 Mar 2012 09:40: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: r232591 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 09:40:34 -0000 Author: pluknet Date: Tue Mar 6 09:40:34 2012 New Revision: 232591 URL: http://svn.freebsd.org/changeset/base/232591 Log: Kill EoL whitespaces. Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Mar 6 09:34:30 2012 (r232590) +++ head/share/man/man9/ifnet.9 Tue Mar 6 09:40:34 2012 (r232591) @@ -394,7 +394,7 @@ This function will return .Dv ENOBUFS if the devices software and hardware queues are both full. This function must be installed after -.Fn if_attach +.Fn if_attach to override the default implementation. This function is exposed in order to allow drivers to manage their own queues and to reduce the latency caused by a frequently gratuitous enqueue / dequeue @@ -402,8 +402,8 @@ pair to ifq. The suggested internal software queueing mechanism is buf_ring. .It Fn if_qflush Free mbufs in internally managed queues when the interface is marked down. -This function must be installed after -.Fn if_attach +This function must be installed after +.Fn if_attach to override the default implementation. This function is exposed in order to allow drivers to manage their own queues and to reduce the latency caused by a frequently gratuitous enqueue / dequeue @@ -623,14 +623,14 @@ This Ethernet interface supports TCP Seg .It Dv IFCAP_TSO6 This Ethernet interface supports TCP6 Segmentation offloading. .It Dv IFCAP_TSO -A shorthand for +A shorthand for .Pq Dv IFCAP_TSO4 | IFCAP_TSO6 . .It Dv IFCAP_TOE4 This Ethernet interface supports TCP offloading. .It Dv IFCAP_TOE6 This Ethernet interface supports TCP6 offloading. .It Dv ICAP_TOE -A Shorthand for +A Shorthand for .Pq Dv IFCAP_TOE4 | IFCAP_TOE6 . .It Dv IFCAP_WOL_UCAST This Ethernet interface supports waking up on any Unicast packet. From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 09:57:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8944D106566B; Tue, 6 Mar 2012 09:57:51 +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 3A6C58FC16; Tue, 6 Mar 2012 09:57: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 q269vpRi030612; Tue, 6 Mar 2012 09:57:51 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q269vp2v030610; Tue, 6 Mar 2012 09:57:51 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203060957.q269vp2v030610@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 6 Mar 2012 09:57: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: r232592 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 09:57:51 -0000 Author: pluknet Date: Tue Mar 6 09:57:50 2012 New Revision: 232592 URL: http://svn.freebsd.org/changeset/base/232592 Log: Fix a typo: use lower case in "A Shorthand". Noted by: maxim Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Mar 6 09:40:34 2012 (r232591) +++ head/share/man/man9/ifnet.9 Tue Mar 6 09:57:50 2012 (r232592) @@ -630,7 +630,7 @@ This Ethernet interface supports TCP off .It Dv IFCAP_TOE6 This Ethernet interface supports TCP6 offloading. .It Dv ICAP_TOE -A Shorthand for +A shorthand for .Pq Dv IFCAP_TOE4 | IFCAP_TOE6 . .It Dv IFCAP_WOL_UCAST This Ethernet interface supports waking up on any Unicast packet. From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 11:05:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE398106566C; Tue, 6 Mar 2012 11:05:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89E38FC16; Tue, 6 Mar 2012 11:05: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 q26B5ogE036594; Tue, 6 Mar 2012 11:05:50 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26B5oq8036590; Tue, 6 Mar 2012 11:05:50 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201203061105.q26B5oq8036590@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 6 Mar 2012 11:05: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: r232598 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 11:05:50 -0000 Author: trasz Date: Tue Mar 6 11:05:50 2012 New Revision: 232598 URL: http://svn.freebsd.org/changeset/base/232598 Log: Make racct and rctl correctly handle jail renaming. Previously they would continue using old name, the one jail was created with. PR: bin/165207 Modified: head/sys/kern/kern_jail.c head/sys/kern/kern_racct.c head/sys/sys/racct.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Mar 6 10:51:53 2012 (r232597) +++ head/sys/kern/kern_jail.c Tue Mar 6 11:05:50 2012 (r232598) @@ -130,6 +130,7 @@ static char *prison_path(struct prison * static void prison_remove_one(struct prison *pr); #ifdef RACCT static void prison_racct_attach(struct prison *pr); +static void prison_racct_modify(struct prison *pr); static void prison_racct_detach(struct prison *pr); #endif #ifdef INET @@ -1830,6 +1831,12 @@ kern_jail_set(struct thread *td, struct if (!(flags & JAIL_ATTACH)) sx_sunlock(&allprison_lock); } + +#ifdef RACCT + if (!created) + prison_racct_modify(pr); +#endif + td->td_retval[0] = pr->pr_id; goto done_errmsg; @@ -4427,24 +4434,32 @@ prison_racct_hold(struct prison_racct *p refcount_acquire(&prr->prr_refcount); } +static void +prison_racct_free_locked(struct prison_racct *prr) +{ + + sx_assert(&allprison_lock, SA_XLOCKED); + + if (refcount_release(&prr->prr_refcount)) { + racct_destroy(&prr->prr_racct); + LIST_REMOVE(prr, prr_next); + free(prr, M_PRISON_RACCT); + } +} + void prison_racct_free(struct prison_racct *prr) { int old; + sx_assert(&allprison_lock, SA_UNLOCKED); + old = prr->prr_refcount; if (old > 1 && atomic_cmpset_int(&prr->prr_refcount, old, old - 1)) return; sx_xlock(&allprison_lock); - if (refcount_release(&prr->prr_refcount)) { - racct_destroy(&prr->prr_racct); - LIST_REMOVE(prr, prr_next); - sx_xunlock(&allprison_lock); - free(prr, M_PRISON_RACCT); - - return; - } + prison_racct_free_locked(prr); sx_xunlock(&allprison_lock); } @@ -4454,15 +4469,63 @@ prison_racct_attach(struct prison *pr) { struct prison_racct *prr; + sx_assert(&allprison_lock, SA_XLOCKED); + prr = prison_racct_find_locked(pr->pr_name); KASSERT(prr != NULL, ("cannot find prison_racct")); pr->pr_prison_racct = prr; } +/* + * Handle jail renaming. From the racct point of view, renaming means + * moving from one prison_racct to another. + */ +static void +prison_racct_modify(struct prison *pr) +{ + struct proc *p; + struct ucred *cred; + struct prison_racct *oldprr; + + sx_slock(&allproc_lock); + sx_xlock(&allprison_lock); + + if (strcmp(pr->pr_name, pr->pr_prison_racct->prr_name) == 0) + return; + + oldprr = pr->pr_prison_racct; + pr->pr_prison_racct = NULL; + + prison_racct_attach(pr); + + /* + * Move resource utilisation records. + */ + racct_move(pr->pr_prison_racct->prr_racct, oldprr->prr_racct); + + /* + * Force rctl to reattach rules to processes. + */ + FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + cred = crhold(p->p_ucred); + PROC_UNLOCK(p); + racct_proc_ucred_changed(p, cred, cred); + crfree(cred); + } + + sx_sunlock(&allproc_lock); + prison_racct_free_locked(oldprr); + sx_xunlock(&allprison_lock); +} + static void prison_racct_detach(struct prison *pr) { + + sx_assert(&allprison_lock, SA_UNLOCKED); + prison_racct_free(pr->pr_prison_racct); pr->pr_prison_racct = NULL; } Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Tue Mar 6 10:51:53 2012 (r232597) +++ head/sys/kern/kern_racct.c Tue Mar 6 11:05:50 2012 (r232598) @@ -697,6 +697,18 @@ racct_proc_ucred_changed(struct proc *p, #endif } +void +racct_move(struct racct *dest, struct racct *src) +{ + + mtx_lock(&racct_lock); + + racct_add_racct(dest, src); + racct_sub_racct(src, src); + + mtx_unlock(&racct_lock); +} + static void racctd(void) { Modified: head/sys/sys/racct.h ============================================================================== --- head/sys/sys/racct.h Tue Mar 6 10:51:53 2012 (r232597) +++ head/sys/sys/racct.h Tue Mar 6 11:05:50 2012 (r232598) @@ -142,5 +142,6 @@ void racct_proc_exit(struct proc *p); void racct_proc_ucred_changed(struct proc *p, struct ucred *oldcred, struct ucred *newcred); +void racct_move(struct racct *dest, struct racct *src); #endif /* !_RACCT_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 11:34:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9F161065676; Tue, 6 Mar 2012 11:34:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 961E68FC18; Tue, 6 Mar 2012 11:34:43 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:c159:bac:b18f:a901] (unknown [IPv6:2001:7b8:3a7:0:c159:bac:b18f:a901]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id CBEBD5C37; Tue, 6 Mar 2012 12:34:42 +0100 (CET) Message-ID: <4F55F652.2040908@FreeBSD.org> Date: Tue, 06 Mar 2012 12:34:42 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120229 Thunderbird/11.0 MIME-Version: 1.0 To: John Baldwin References: <201203051953.q25JrIS1002269@svn.freebsd.org> In-Reply-To: <201203051953.q25JrIS1002269@svn.freebsd.org> X-Enigmail-Version: 1.4a1pre 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: r232570 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 11:34:44 -0000 On 2012-03-05 20:53, John Baldwin wrote: > Author: jhb > Date: Mon Mar 5 19:53:17 2012 > New Revision: 232570 > URL: http://svn.freebsd.org/changeset/base/232570 > > Log: > Fix boot2 to handle boot config files that only contain a custom path to > a loader or kernel. Specifically, kname cannot be pointed at cmd[] since > it's value is change to be an empty string after the initial call to > parse, and cmd[]'s value can be changed (thus losing a prior setting for > kname) due to user input at the boot prompt. While here, ensure that that > initial boot config file text is nul-terminated, that ops is initialized > to zero, and that kname is always initialized to a valid string. Sigh, this broke building boot2 with clang again... :( From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 12:20:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 098831065677; Tue, 6 Mar 2012 12:20:38 +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 ECE888FC13; Tue, 6 Mar 2012 12:20: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 q26CKbMm039773; Tue, 6 Mar 2012 12:20:37 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26CKbTs039771; Tue, 6 Mar 2012 12:20:37 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203061220.q26CKbTs039771@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 6 Mar 2012 12:20: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: r232600 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 12:20:38 -0000 Author: pluknet Date: Tue Mar 6 12:20:37 2012 New Revision: 232600 URL: http://svn.freebsd.org/changeset/base/232600 Log: Remove if_watchdog remnants after if_timer/if_watchdog removal in r199975. This part was missed in r199992. MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Mar 6 11:16:14 2012 (r232599) +++ head/share/man/man9/ifnet.9 Tue Mar 6 12:20:37 2012 (r232600) @@ -114,8 +114,6 @@ .Ft int .Fn \*(lp*if_ioctl\*(rp "struct ifnet *ifp" "u_long cmd" "caddr_t data" .Ft void -.Fn \*(lp*if_watchdog\*(rp "struct ifnet *ifp" -.Ft void .Fn \*(lp*if_init\*(rp "void *if_softc" .Ft int .Fo \*(lp*if_resolvemulti\*(rp From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 12:53:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EAD3106566B; Tue, 6 Mar 2012 12:53:45 +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 F1FE88FC27; Tue, 6 Mar 2012 12:53: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 q26CriYu040892; Tue, 6 Mar 2012 12:53:44 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26CrivP040889; Tue, 6 Mar 2012 12:53:44 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201203061253.q26CrivP040889@svn.freebsd.org> From: David Chisnall Date: Tue, 6 Mar 2012 12:53: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: r232601 - in head/lib/libc: locale regex X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 12:53:45 -0000 Author: theraven Date: Tue Mar 6 12:53:44 2012 New Revision: 232601 URL: http://svn.freebsd.org/changeset/base/232601 Log: Remove some duplicated copyright notices. Approved by: dim (mentor) Modified: head/lib/libc/locale/collate.c head/lib/libc/regex/regcomp.c Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Tue Mar 6 12:20:37 2012 (r232600) +++ head/lib/libc/locale/collate.c Tue Mar 6 12:53:44 2012 (r232601) @@ -8,11 +8,6 @@ * Portions of this software were developed by David Chisnall * under sponsorship from the FreeBSD Foundation. * - * 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: Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Tue Mar 6 12:20:37 2012 (r232600) +++ head/lib/libc/regex/regcomp.c Tue Mar 6 12:53:44 2012 (r232601) @@ -11,11 +11,6 @@ * This code is derived from software contributed to Berkeley by * Henry Spencer. * - * 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: From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 13:43:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 304491065673; Tue, 6 Mar 2012 13:43:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E3B58FC15; Tue, 6 Mar 2012 13:43: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 q26DhvqZ042585; Tue, 6 Mar 2012 13:43:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26Dhvqp042574; Tue, 6 Mar 2012 13:43:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201203061343.q26Dhvqp042574@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 6 Mar 2012 13:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232604 - in head: sys/cam/ctl usr.sbin/ctladm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 13:43:58 -0000 Author: trasz Date: Tue Mar 6 13:43:57 2012 New Revision: 232604 URL: http://svn.freebsd.org/changeset/base/232604 Log: Add LUN resizing to CTL. Also make it possible to explicitly set size when creating file-backed or device-backed LUN. Reviewed by: ken (earlier version) Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_error.c head/sys/cam/ctl/ctl_ioctl.h head/usr.sbin/ctladm/Makefile head/usr.sbin/ctladm/ctladm.8 head/usr.sbin/ctladm/ctladm.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Mar 6 12:58:19 2012 (r232603) +++ head/sys/cam/ctl/ctl.c Tue Mar 6 13:43:57 2012 (r232604) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003-2009 Silicon Graphics International Corp. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * 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: @@ -4797,6 +4801,25 @@ ctl_lun_power_lock(struct ctl_be_lun *be return (0); } +void +ctl_lun_capacity_changed(struct ctl_be_lun *be_lun) +{ + struct ctl_lun *lun; + struct ctl_softc *softc; + int i; + + softc = control_softc; + + mtx_lock(&softc->ctl_lock); + + lun = (struct ctl_lun *)be_lun->ctl_lun; + + for (i = 0; i < CTL_MAX_INITIATORS; i++) + lun->pending_sense[i].ua_pending |= CTL_UA_CAPACITY_CHANGED; + + mtx_unlock(&softc->ctl_lock); +} + /* * Backend "memory move is complete" callback for requests that never * make it down to say RAIDCore's configuration code. Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Tue Mar 6 12:58:19 2012 (r232603) +++ head/sys/cam/ctl/ctl.h Tue Mar 6 13:43:57 2012 (r232604) @@ -120,7 +120,8 @@ typedef enum { CTL_UA_RES_PREEMPT = 0x0200, CTL_UA_RES_RELEASE = 0x0400, CTL_UA_REG_PREEMPT = 0x0800, - CTL_UA_ASYM_ACC_CHANGE = 0x1000 + CTL_UA_ASYM_ACC_CHANGE = 0x1000, + CTL_UA_CAPACITY_CHANGED = 0x2000 } ctl_ua_type; #ifdef _KERNEL Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Tue Mar 6 12:58:19 2012 (r232603) +++ head/sys/cam/ctl/ctl_backend.h Tue Mar 6 13:43:57 2012 (r232604) @@ -280,6 +280,11 @@ int ctl_lun_power_lock(struct ctl_be_lun int ctl_lun_offline(struct ctl_be_lun *be_lun); int ctl_lun_online(struct ctl_be_lun *be_lun); +/* + * Let the backend notify the initiator about changed capacity. + */ +void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun); + #endif /* _KERNEL */ #endif /* _CTL_BACKEND_H_ */ Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Tue Mar 6 12:58:19 2012 (r232603) +++ head/sys/cam/ctl/ctl_backend_block.c Tue Mar 6 13:43:57 2012 (r232604) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2003 Silicon Graphics International Corp. * Copyright (c) 2009-2011 Spectra Logic Corporation + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * 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: @@ -250,6 +254,12 @@ static int ctl_be_block_create(struct ct struct ctl_lun_req *req); static int ctl_be_block_rm(struct ctl_be_block_softc *softc, struct ctl_lun_req *req); +static int ctl_be_block_modify_file(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req); +static int ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req); +static int ctl_be_block_modify(struct ctl_be_block_softc *softc, + struct ctl_lun_req *req); static void ctl_be_block_lun_shutdown(void *be_lun); static void ctl_be_block_lun_config_status(void *be_lun, ctl_lun_config_status status); @@ -1263,6 +1273,9 @@ ctl_be_block_ioctl(struct cdev *dev, u_l case CTL_LUNREQ_RM: error = ctl_be_block_rm(softc, lun_req); break; + case CTL_LUNREQ_MODIFY: + error = ctl_be_block_modify(softc, lun_req); + break; default: lun_req->status = CTL_LUN_ERROR; snprintf(lun_req->error_str, sizeof(lun_req->error_str), @@ -1321,7 +1334,10 @@ ctl_be_block_open_file(struct ctl_be_blo file_data->cred = crhold(curthread->td_ucred); - be_lun->size_bytes = vattr.va_size; + if (params->lun_size_bytes != 0) + be_lun->size_bytes = params->lun_size_bytes; + else + be_lun->size_bytes = vattr.va_size; /* * We set the multi thread flag for file operations because all * filesystems (in theory) are capable of allowing multiple readers @@ -1446,15 +1462,27 @@ ctl_be_block_open_dev(struct ctl_be_bloc curthread); if (error) { snprintf(req->error_str, sizeof(req->error_str), - "%s: error %d returned for DIOCGMEDIASIZE ioctl " - "on %s!", __func__, error, be_lun->dev_path); + "%s: error %d returned for DIOCGMEDIASIZE " + " ioctl on %s!", __func__, error, + be_lun->dev_path); return (error); } - return (0); + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes > be_lun->size_bytes) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: requested LUN size %ju > backing device " + "size %ju", __func__, + (uintmax_t)params->lun_size_bytes, + (uintmax_t)be_lun->size_bytes); + return (EINVAL); + } -} + be_lun->size_bytes = params->lun_size_bytes; + } + return (0); +} static int ctl_be_block_close(struct ctl_be_block_lun *be_lun) @@ -1599,7 +1627,6 @@ ctl_be_block_open(struct ctl_be_block_so be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; return (0); - } static int @@ -2007,6 +2034,155 @@ bailout_error: return (0); } +static int +ctl_be_block_modify_file(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req) +{ + struct vattr vattr; + int error; + struct ctl_lun_modify_params *params; + + params = &req->reqdata.modify; + + if (params->lun_size_bytes != 0) { + be_lun->size_bytes = params->lun_size_bytes; + } else { + error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); + if (error != 0) { + snprintf(req->error_str, sizeof(req->error_str), + "error calling VOP_GETATTR() for file %s", + be_lun->dev_path); + return (error); + } + + be_lun->size_bytes = vattr.va_size; + } + + return (0); +} + +static int +ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun, + struct ctl_lun_req *req) +{ + struct cdev *dev; + struct cdevsw *devsw; + int error; + struct ctl_lun_modify_params *params; + uint64_t size_bytes; + + params = &req->reqdata.modify; + + dev = be_lun->vn->v_rdev; + devsw = dev->si_devsw; + if (!devsw->d_ioctl) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: no d_ioctl for device %s!", __func__, + be_lun->dev_path); + return (ENODEV); + } + + error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, + (caddr_t)&size_bytes, FREAD, + curthread); + if (error) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: error %d returned for DIOCGMEDIASIZE ioctl " + "on %s!", __func__, error, be_lun->dev_path); + return (error); + } + + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes > size_bytes) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: requested LUN size %ju > backing device " + "size %ju", __func__, + (uintmax_t)params->lun_size_bytes, + (uintmax_t)size_bytes); + return (EINVAL); + } + + be_lun->size_bytes = params->lun_size_bytes; + } else { + be_lun->size_bytes = size_bytes; + } + + return (0); +} + +static int +ctl_be_block_modify(struct ctl_be_block_softc *softc, struct ctl_lun_req *req) +{ + struct ctl_lun_modify_params *params; + struct ctl_be_block_lun *be_lun; + int vfs_is_locked, error; + + params = &req->reqdata.modify; + + mtx_lock(&softc->lock); + + be_lun = NULL; + + STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->ctl_be_lun.lun_id == params->lun_id) + break; + } + mtx_unlock(&softc->lock); + + if (be_lun == NULL) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN %u is not managed by the block backend", + __func__, params->lun_id); + goto bailout_error; + } + + if (params->lun_size_bytes != 0) { + if (params->lun_size_bytes < be_lun->blocksize) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size %ju < blocksize %u", __func__, + params->lun_size_bytes, be_lun->blocksize); + goto bailout_error; + } + } + + vfs_is_locked = VFS_LOCK_GIANT(be_lun->vn->v_mount); + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); + + if (be_lun->vn->v_type == VREG) + error = ctl_be_block_modify_file(be_lun, req); + else + error = ctl_be_block_modify_dev(be_lun, req); + + VOP_UNLOCK(be_lun->vn, 0); + VFS_UNLOCK_GIANT(vfs_is_locked); + + if (error != 0) + goto bailout_error; + + be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; + + /* + * The maximum LBA is the size - 1. + * + * XXX: Note that this field is being updated without locking, + * which might cause problems on 32-bit architectures. + */ + be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; + ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + + /* Tell the user the exact size we ended up using */ + params->lun_size_bytes = be_lun->size_bytes; + + req->status = CTL_LUN_OK; + + return (0); + +bailout_error: + req->status = CTL_LUN_ERROR; + + return (0); +} + static void ctl_be_block_lun_shutdown(void *be_lun) { Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Mar 6 12:58:19 2012 (r232603) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Mar 6 13:43:57 2012 (r232604) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003, 2008 Silicon Graphics International Corp. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * 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: @@ -102,6 +106,8 @@ static int ctl_backend_ramdisk_rm(struct struct ctl_lun_req *req); static int ctl_backend_ramdisk_create(struct ctl_be_ramdisk_softc *softc, struct ctl_lun_req *req, int do_wait); +static int ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, + struct ctl_lun_req *req); static void ctl_backend_ramdisk_lun_shutdown(void *be_lun); static void ctl_backend_ramdisk_lun_config_status(void *be_lun, ctl_lun_config_status status); @@ -376,6 +382,9 @@ ctl_backend_ramdisk_ioctl(struct cdev *d case CTL_LUNREQ_RM: retval = ctl_backend_ramdisk_rm(softc, lun_req); break; + case CTL_LUNREQ_MODIFY: + retval = ctl_backend_ramdisk_modify(softc, lun_req); + break; default: lun_req->status = CTL_LUN_ERROR; snprintf(lun_req->error_str, sizeof(lun_req->error_str), @@ -666,6 +675,73 @@ bailout_error: return (retval); } +static int +ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, + struct ctl_lun_req *req) +{ + struct ctl_be_ramdisk_lun *be_lun; + struct ctl_lun_modify_params *params; + uint32_t blocksize; + + params = &req->reqdata.modify; + + be_lun = NULL; + + mtx_lock(&softc->lock); + STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->ctl_be_lun.lun_id == params->lun_id) + break; + } + mtx_unlock(&softc->lock); + + if (be_lun == NULL) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN %u is not managed by the ramdisk backend", + __func__, params->lun_id); + goto bailout_error; + } + + if (params->lun_size_bytes == 0) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size \"auto\" not supported " + "by the ramdisk backend", __func__); + goto bailout_error; + } + + blocksize = be_lun->ctl_be_lun.blocksize; + + if (params->lun_size_bytes < blocksize) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: LUN size %ju < blocksize %u", __func__, + params->lun_size_bytes, blocksize); + goto bailout_error; + } + + be_lun->size_blocks = params->lun_size_bytes / blocksize; + be_lun->size_bytes = be_lun->size_blocks * blocksize; + + /* + * The maximum LBA is the size - 1. + * + * XXX: Note that this field is being updated without locking, + * which might cause problems on 32-bit architectures. + */ + be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; + ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + + /* Tell the user the exact size we ended up using */ + params->lun_size_bytes = be_lun->size_bytes; + + req->status = CTL_LUN_OK; + + return (0); + +bailout_error: + req->status = CTL_LUN_ERROR; + + return (0); +} + static void ctl_backend_ramdisk_lun_shutdown(void *be_lun) { Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Tue Mar 6 12:58:19 2012 (r232603) +++ head/sys/cam/ctl/ctl_error.c Tue Mar 6 13:43:57 2012 (r232604) @@ -454,6 +454,11 @@ ctl_build_ua(ctl_ua_type ua_type, struct asc = 0x2A; ascq = 0x06; break; + case CTL_UA_CAPACITY_CHANGED: + /* 2Ah/09n CAPACITY DATA HAS CHANGED */ + asc = 0x2A; + ascq = 0x09; + break; default: ua_to_build = CTL_UA_NONE; return (ua_to_build); Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Tue Mar 6 12:58:19 2012 (r232603) +++ head/sys/cam/ctl/ctl_ioctl.h Tue Mar 6 13:43:57 2012 (r232604) @@ -397,7 +397,8 @@ struct ctl_be_arg { typedef enum { CTL_LUNREQ_CREATE, - CTL_LUNREQ_RM + CTL_LUNREQ_RM, + CTL_LUNREQ_MODIFY, } ctl_lunreq_type; @@ -471,12 +472,27 @@ struct ctl_lun_rm_params { }; /* + * LUN modification parameters: + * + * lun_id: The number of the LUN to modify. This must be set. + * The LUN must be backed by the given backend. + * + * lun_size_bytes: The size of the LUN in bytes. If zero, update + * the size using the backing file size, if possible. + */ +struct ctl_lun_modify_params { + uint32_t lun_id; + uint64_t lun_size_bytes; +}; + +/* * Union of request type data. Fill in the appropriate union member for * the request type. */ union ctl_lunreq_data { struct ctl_lun_create_params create; struct ctl_lun_rm_params rm; + struct ctl_lun_modify_params modify; }; /* Modified: head/usr.sbin/ctladm/Makefile ============================================================================== --- head/usr.sbin/ctladm/Makefile Tue Mar 6 12:58:19 2012 (r232603) +++ head/usr.sbin/ctladm/Makefile Tue Mar 6 13:43:57 2012 (r232604) @@ -14,8 +14,8 @@ CFLAGS+= -I${SDIR} WARNS?= 3 .endif -DPADD= ${LIBCAM} ${LIBSBUF} -LDADD= -lcam -lsbuf -lbsdxml +DPADD= ${LIBCAM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL} +LDADD= -lcam -lsbuf -lbsdxml -lutil MAN= ctladm.8 .include Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Tue Mar 6 12:58:19 2012 (r232603) +++ head/usr.sbin/ctladm/ctladm.8 Tue Mar 6 13:43:57 2012 (r232604) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd July 8, 2011 +.Dd March 6, 2012 .Dt CTLADM 8 .Os .Sh NAME @@ -173,6 +173,11 @@ .Aq Fl l Ar lun_id .Op Fl o Ar name=value .Nm +.Ic modify +.Aq Fl b Ar backend +.Aq Fl l Ar lun_id +.Aq Fl s Ar size_bytes +.Nm .Ic devlist .Op Fl b Ar backend .Op Fl v @@ -830,6 +835,27 @@ Multiple arguments may be specified. Refer to the backend documentation for arguments that may be used. .El +.It Ic modify +Modify a LUN size. +The backend, the LUN number, and the size must be specified. +.Bl -tag -width 14n +.It Fl b Ar backend +Specify the backend that owns the LUN to be removed. +Examples are +.Dq ramdisk +and +.Dq block . +.It Fl l Ar lun_id +Specify the LUN number to remove. +.It Fl s Ar size_bytes +Specify the size of the LUN in bytes. +For the +.Dq block +backend, an +.Dq auto +keyword may be passed instead; this will make CTL use the size of backing +file or device. +.El .It Ic devlist Get a list of all configured LUNs. This also includes the LUN size and blocksize, serial number and device ID. Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Tue Mar 6 12:58:19 2012 (r232603) +++ head/usr.sbin/ctladm/ctladm.c Tue Mar 6 13:43:57 2012 (r232604) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2003, 2004 Silicon Graphics International Corp. * Copyright (c) 1997-2007 Kenneth D. Merry + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * 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: @@ -68,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "ctladm.h" #ifdef min @@ -110,7 +115,8 @@ typedef enum { CTLADM_CMD_PRES_IN, CTLADM_CMD_PRES_OUT, CTLADM_CMD_INQ_VPD_DEVID, - CTLADM_CMD_RTPG + CTLADM_CMD_RTPG, + CTLADM_CMD_MODIFY } ctladm_cmdfunction; typedef enum { @@ -175,6 +181,7 @@ struct ctladm_opts option_table[] = { {"inquiry", CTLADM_CMD_INQUIRY, CTLADM_ARG_NEED_TL, NULL}, {"lunlist", CTLADM_CMD_LUNLIST, CTLADM_ARG_NONE, NULL}, {"modesense", CTLADM_CMD_MODESENSE, CTLADM_ARG_NEED_TL, "P:S:dlm:c:"}, + {"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:s:"}, {"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "lo:p:qt:w:W:x"}, {"prin", CTLADM_CMD_PRES_IN, CTLADM_ARG_NEED_TL, "a:"}, {"prout", CTLADM_CMD_PRES_OUT, CTLADM_ARG_NEED_TL, "a:k:r:s:"}, @@ -249,6 +256,7 @@ static int cctl_create_lun(int fd, int a static int cctl_inquiry_vpd_devid(int fd, int target, int lun, int initiator); static int cctl_report_target_port_group(int fd, int target, int lun, int initiator); +static int cctl_modify_lun(int fd, int argc, char **argv, char *combinedopt); ctladm_optret getoption(struct ctladm_opts *table, char *arg, uint32_t *cmdnum, @@ -3045,7 +3053,15 @@ cctl_create_lun(int fd, int argc, char * break; } case 's': - lun_size = strtoull(optarg, NULL, 0); + if (strcasecmp(optarg, "auto") != 0) { + retval = expand_number(optarg, &lun_size); + if (retval != 0) { + warn("%s: invalid -s argument", + __func__); + retval = 1; + goto bailout; + } + } lun_size_set = 1; break; case 'S': @@ -3289,12 +3305,12 @@ cctl_rm_lun(int fd, int argc, char **arg } if (req.status == CTL_LUN_ERROR) { - warnx("%s: error returned from LUN creation request:\n%s", + warnx("%s: error returned from LUN removal request:\n%s", __func__, req.error_str); retval = 1; goto bailout; } else if (req.status != CTL_LUN_OK) { - warnx("%s: unknown LUN creation request status %d", + warnx("%s: unknown LUN removal request status %d", __func__, req.status); retval = 1; goto bailout; @@ -3306,6 +3322,84 @@ bailout: return (retval); } +static int +cctl_modify_lun(int fd, int argc, char **argv, char *combinedopt) +{ + struct ctl_lun_req req; + uint64_t lun_size = 0; + uint32_t lun_id = 0; + int lun_id_set = 0, lun_size_set = 0; + char *backend_name = NULL; + int retval = 0, c; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'b': + backend_name = strdup(optarg); + break; + case 'l': + lun_id = strtoul(optarg, NULL, 0); + lun_id_set = 1; + break; + case 's': + if (strcasecmp(optarg, "auto") != 0) { + retval = expand_number(optarg, &lun_size); + if (retval != 0) { + warn("%s: invalid -s argument", + __func__); + retval = 1; + goto bailout; + } + } + lun_size_set = 1; + break; + default: + break; + } + } + + if (backend_name == NULL) + errx(1, "%s: backend name (-b) must be specified", __func__); + + if (lun_id_set == 0) + errx(1, "%s: LUN id (-l) must be specified", __func__); + + if (lun_size_set == 0) + errx(1, "%s: size (-s) must be specified", __func__); + + bzero(&req, sizeof(req)); + + strlcpy(req.backend, backend_name, sizeof(req.backend)); + req.reqtype = CTL_LUNREQ_MODIFY; + + req.reqdata.modify.lun_id = lun_id; + req.reqdata.modify.lun_size_bytes = lun_size; + + if (ioctl(fd, CTL_LUN_REQ, &req) == -1) { + warn("%s: error issuing CTL_LUN_REQ ioctl", __func__); + retval = 1; + goto bailout; + } + + if (req.status == CTL_LUN_ERROR) { + warnx("%s: error returned from LUN modification request:\n%s", + __func__, req.error_str); + retval = 1; + goto bailout; + } else if (req.status != CTL_LUN_OK) { + warnx("%s: unknown LUN modification request status %d", + __func__, req.status); + retval = 1; + goto bailout; + } + + printf("LUN %d modified successfully\n", lun_id); + +bailout: + return (retval); +} + + /* * Name/value pair used for per-LUN attributes. */ @@ -3601,6 +3695,7 @@ usage(int error) " [-l lun_id] [-o name=value] [-s size_bytes]\n" " [-S serial_num] [-t dev_type]\n" " ctladm remove <-b backend> <-l lun_id> [-o name=value]\n" +" ctladm modify <-b backend> <-l lun_id> <-s size_bytes>\n" " ctladm devlist [-b][-v][-x]\n" " ctladm shutdown\n" " ctladm startup\n" @@ -3987,6 +4082,9 @@ main(int argc, char **argv) case CTLADM_CMD_RTPG: retval = cctl_report_target_port_group(fd, target, lun, initid); break; + case CTLADM_CMD_MODIFY: + retval = cctl_modify_lun(fd, argc, argv, combinedopt); + break; case CTLADM_CMD_HELP: default: usage(retval); From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 14:19:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52CFD106568E; Tue, 6 Mar 2012 14:19:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4259E8FC2C; Tue, 6 Mar 2012 14:19: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 q26EJbT0044031; Tue, 6 Mar 2012 14:19:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26EJbx3044029; Tue, 6 Mar 2012 14:19:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203061419.q26EJbx3044029@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 6 Mar 2012 14:19: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: r232609 - head/tools/test/netfibs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 14:19:37 -0000 Author: bz Date: Tue Mar 6 14:19:36 2012 New Revision: 232609 URL: http://svn.freebsd.org/changeset/base/232609 Log: Use = rather than == for expressions to test(1) builtin(1) in sh(1) to comply with standards. On modern branches there is an undocumented alias (see r219084) but on stable/7 this is still an error. Sponsored by: Cisco Systems, Inc. MFC after: 3 days Modified: head/tools/test/netfibs/initiator.sh Modified: head/tools/test/netfibs/initiator.sh ============================================================================== --- head/tools/test/netfibs/initiator.sh Tue Mar 6 14:18:54 2012 (r232608) +++ head/tools/test/netfibs/initiator.sh Tue Mar 6 14:19:36 2012 (r232609) @@ -410,7 +410,7 @@ testtx_ulp6_connected() *) _f="SETFIB" ;; esac - if test "${_o}" == "-i" -a "${_f}" == "SO_SETFIB"; then + if test "${_o}" = "-i" -a "${_f}" = "SO_SETFIB"; then print_debug "Skipping icmp6 tests for SO_SETFIB." return 0 fi From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 15:39:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFDEB106567E; Tue, 6 Mar 2012 15:39:55 +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 B752D8FC16; Tue, 6 Mar 2012 15:39:55 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 707E846B55; Tue, 6 Mar 2012 10:39:55 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CB8F2B90E; Tue, 6 Mar 2012 10:39:54 -0500 (EST) From: John Baldwin To: Dimitry Andric Date: Tue, 6 Mar 2012 08:35:16 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203051953.q25JrIS1002269@svn.freebsd.org> <4F55F652.2040908@FreeBSD.org> In-Reply-To: <4F55F652.2040908@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201203060835.16865.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 06 Mar 2012 10:39:54 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232570 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 15:39:56 -0000 On Tuesday, March 06, 2012 6:34:42 am Dimitry Andric wrote: > On 2012-03-05 20:53, John Baldwin wrote: > > Author: jhb > > Date: Mon Mar 5 19:53:17 2012 > > New Revision: 232570 > > URL: http://svn.freebsd.org/changeset/base/232570 > > > > Log: > > Fix boot2 to handle boot config files that only contain a custom path to > > a loader or kernel. Specifically, kname cannot be pointed at cmd[] since > > it's value is change to be an empty string after the initial call to > > parse, and cmd[]'s value can be changed (thus losing a prior setting for > > kname) due to user input at the boot prompt. While here, ensure that that > > initial boot config file text is nul-terminated, that ops is initialized > > to zero, and that kname is always initialized to a valid string. > > Sigh, this broke building boot2 with clang again... :( I only put back 1 of the memcpy's instead of 3 to try to make it as small as possible. :( The problem is the last round of changes to shrink it broke functionality. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 17:17:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 246C9106566C; Tue, 6 Mar 2012 17:17:04 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1474E8FC22; Tue, 6 Mar 2012 17: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 q26HH3al049799; Tue, 6 Mar 2012 17:17:03 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26HH3SK049797; Tue, 6 Mar 2012 17:17:03 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201203061717.q26HH3SK049797@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 6 Mar 2012 17:17: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: r232612 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 17:17:04 -0000 Author: gnn Date: Tue Mar 6 17:17:03 2012 New Revision: 232612 URL: http://svn.freebsd.org/changeset/base/232612 Log: Properly mask off bits that are not supported in the IAP counters. This fixes a bug where users would see massively large counts, near to 2**64 -1, due to the bits not being cleared. MFC after: 3 weeks Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 6 15:05:59 2012 (r232611) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 6 17:17:03 2012 (r232612) @@ -2021,7 +2021,7 @@ iap_read_pmc(int cpu, int ri, pmc_value_ if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) *v = iap_perfctr_value_to_reload_count(tmp); else - *v = tmp; + *v = tmp & ((1ULL << core_iap_width) - 1); PMCDBG(MDP,REA,1, "iap-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri, ri, *v); From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 18:39:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63CAD106566C; Tue, 6 Mar 2012 18:39:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 543628FC1A; Tue, 6 Mar 2012 18:39: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 q26Id8mB052424; Tue, 6 Mar 2012 18:39:08 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26Id8ge052422; Tue, 6 Mar 2012 18:39:08 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203061839.q26Id8ge052422@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 6 Mar 2012 18:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232613 - head/usr.sbin/jls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 18:39:09 -0000 Author: bz Date: Tue Mar 6 18:39:07 2012 New Revision: 232613 URL: http://svn.freebsd.org/changeset/base/232613 Log: Fix building with WITHOUT_INET_SUPPORT set. Reviewed by: jamie (actually provided the real fix) MFC after: 3 days Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Tue Mar 6 17:17:03 2012 (r232612) +++ head/usr.sbin/jls/jls.c Tue Mar 6 18:39:07 2012 (r232613) @@ -403,11 +403,13 @@ print_jail(int pflags, int jflags) #ifdef INET (!ip4_ok || params[1].jp_valuelen == 0) ? "-" : inet_ntoa(*(struct in_addr *)params[1].jp_value), + (char *)params[2-!ip4_ok].jp_value, + (char *)params[3-!ip4_ok].jp_value); #else "-", + (char *)params[1].jp_value, + (char *)params[2].jp_value); #endif - (char *)params[2-!ip4_ok].jp_value, - (char *)params[3-!ip4_ok].jp_value); else { param_values = alloca(nparams * sizeof(*param_values)); for (i = 0; i < nparams; i++) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 18:44:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3239F106568A; Tue, 6 Mar 2012 18:44: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 1F0C28FC20; Tue, 6 Mar 2012 18:44: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 q26IirMV052665; Tue, 6 Mar 2012 18:44:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26IiqZL052653; Tue, 6 Mar 2012 18:44:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201203061844.q26IiqZL052653@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 6 Mar 2012 18:44: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: r232614 - in head: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/wbwd sys/i386/conf sys/modules sys/modules/wbwd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 18:44:53 -0000 Author: bz Date: Tue Mar 6 18:44:52 2012 New Revision: 232614 URL: http://svn.freebsd.org/changeset/base/232614 Log: Provide wbwd(4), a driver for the watchdog timer found on various Winbond Super I/O chips. With minor efforts it should be possible the extend the driver to support further chips/revisions available from Winbond. In the simplest case only new IDs need to be added, while different chipsets might require their own function to enter extended function mode, etc. Sponsored by: Sandvine Incorporated ULC (in 2011) Reviewed by: emaste, brueffer MFC after: 2 weeks Added: head/share/man/man4/wbwd.4 (contents, props changed) head/sys/dev/wbwd/ head/sys/dev/wbwd/wbwd.c (contents, props changed) head/sys/modules/wbwd/ head/sys/modules/wbwd/Makefile (contents, props changed) Modified: head/sys/amd64/conf/GENERIC.hints head/sys/amd64/conf/NOTES head/sys/boot/forth/loader.conf head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/GENERIC.hints head/sys/i386/conf/NOTES head/sys/modules/Makefile Added: head/share/man/man4/wbwd.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/wbwd.4 Tue Mar 6 18:44:52 2012 (r232614) @@ -0,0 +1,117 @@ +.\"- +.\" Copyright (c) 2012 Bjoern A. Zeeb +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 6, 2012 +.Dt wbwd 4 +.Os +.Sh NAME +.Nm wbwd +.Nd device driver for watchdog timer found on Winbond Super I/O chips +.Sh SYNOPSIS +To compile this driver into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device wbwd" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +wbwd_load="YES" +.Ed +.Pp +In +.Pa /boot/device.hints : +.Cd hint.wbwd.0.at="isa" +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog interrupt timer present on at least the following +Winbond Super I/O chips: +.Pp +.Bl -bullet -compact +.It +83627HF/F/HG/G Rev. G +.It +83627HF/F/HG/G Rev. J +.It +83627HF/F/HG/G Rev. UD-A +.It +83627DHG IC ver. 5 +.El +.Sh SYSCTL VARIABLES +The +.Nm +driver provides the following options as +.Xr sysctl 8 +variables. +.Bl -tag -width "xxxxxx" +.It Va dev.wbwd.0.timeout_override +This variable allows to program the timer to a value independent on the one +provided by the +.Xr watchdog 4 +framework while still relying on the regular updates from e.g. +.Xr watchdogd 8 . +This is particularly useful if your system provides multiple watchdogs and +you want them to fire in a special sequence to trigger an NMI after a shorter +period than the reset timeout for example. +The value set must not be lower than the sleep time of +.Xr watchdogd 8 . +A value of 0 disables this feature and the timeout value provided by +.Xr watchdog 4 +will be used. +.It Va dev.wbwd.0.debug_verbose +If set this sysctl will tell the driver to log its current state before and +after the timer reset on each invocation from +.Xr watchdog 9 +to the kernel message buffer for debugging. +.It Va dev.wbwd.0.debug +This read-only value gives the state of some registers on last update. +.El +.Pp +The +.Nm +driver also provides further sysctl options that are hidden by default. +See the source code for more information. +.Sh SEE ALSO +.Xr watchdog 4 , +.Xr device.hints 5 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Bjoern A. Zeeb Aq bz@FreeBSD.org . Modified: head/sys/amd64/conf/GENERIC.hints ============================================================================== --- head/sys/amd64/conf/GENERIC.hints Tue Mar 6 18:39:07 2012 (r232613) +++ head/sys/amd64/conf/GENERIC.hints Tue Mar 6 18:44:52 2012 (r232614) @@ -30,3 +30,4 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" +hint.wbwd.0.at="isa" Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Mar 6 18:39:07 2012 (r232613) +++ head/sys/amd64/conf/NOTES Tue Mar 6 18:44:52 2012 (r232614) @@ -465,10 +465,12 @@ device tpm # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer # viawd: VIA south bridge watchdog timer +# wbwd: Winbond watchdog timer # device ichwd device amdsbwd device viawd +device wbwd # # Temperature sensors: Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Mar 6 18:39:07 2012 (r232613) +++ head/sys/boot/forth/loader.conf Tue Mar 6 18:44:52 2012 (r232614) @@ -488,6 +488,7 @@ vpd_load="NO" # Vital Product Data ker vpo_load="NO" # Parallel to SCSI interface driver amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor tpm_load="NO" # Trusted Platform Module +wbwd_load="NO" # Winbond watchdog ############################################################## ### ACPI settings ########################################## Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Mar 6 18:39:07 2012 (r232613) +++ head/sys/conf/files.amd64 Tue Mar 6 18:44:52 2012 (r232614) @@ -270,6 +270,7 @@ dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart dev/viawd/viawd.c optional viawd +dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci dev/isci/isci_controller.c optional isci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Mar 6 18:39:07 2012 (r232613) +++ head/sys/conf/files.i386 Tue Mar 6 18:44:52 2012 (r232614) @@ -247,6 +247,7 @@ dev/uart/uart_cpu_i386.c optional uart dev/viawd/viawd.c optional viawd dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard +dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci dev/isci/isci_controller.c optional isci Added: head/sys/dev/wbwd/wbwd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/wbwd/wbwd.c Tue Mar 6 18:44:52 2012 (r232614) @@ -0,0 +1,721 @@ +/*- + * Copyright (c) 2011 Sandvine Incorporated ULC. + * 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. + */ +/* + * Support for Winbond watchdog. + * + * With minor abstractions it might be possible to add support for other + * different Winbond Super I/O chips as well. Winbond seems to have four + * different types of chips, four different ways to get into extended config + * mode. + * + * Note: there is no serialization between the debugging sysctl handlers and + * the watchdog functions and possibly others poking the registers at the same + * time. For that at least possibly interfering sysctls are hidden by default. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +/* + * Global registers. + */ +#define WB_DEVICE_ID_REG 0x20 /* Device ID */ +#define WB_DEVICE_REV_REG 0x21 /* Device revision */ +#define WB_CR26 0x26 /* Bit6: HEFRAS (base port selector) */ + +/* LDN selection. */ +#define WB_LDN_REG 0x07 +#define WB_LDN_REG_LDN8 0x08 /* GPIO 2, Watchdog */ + +/* + * LDN8 (GPIO 2, Watchdog) specific registers and options. + */ +/* CR30: LDN8 activation control. */ +#define WB_LDN8_CR30 0x30 +#define WB_LDN8_CR30_ACTIVE 0x01 /* 1: LD active */ + +/* CRF5: Watchdog scale, P20. Mapped to reg_1. */ +#define WB_LDN8_CRF5 0xF5 +#define WB_LDN8_CRF5_SCALE 0x08 /* 0: 1s, 1: 60s */ +#define WB_LDN8_CRF5_KEYB_P20 0x04 /* 1: keyb P20 forces timeout */ + +/* CRF6: Watchdog Timeout (0 == off). Mapped to reg_timeout. */ +#define WB_LDN8_CRF6 0xF6 + +/* CRF7: Watchdog mouse, keyb, force, .. Mapped to reg_2. */ +#define WB_LDN8_CRF7 0xF7 +#define WB_LDN8_CRF7_MOUSE 0x80 /* 1: mouse irq resets wd timer */ +#define WB_LDN8_CRF7_KEYB 0x40 /* 1: keyb irq resets wd timer */ +#define WB_LDN8_CRF7_FORCE 0x20 /* 1: force timeout (self-clear) */ +#define WB_LDN8_CRF7_TS 0x10 /* 0: counting, 1: fired */ +#define WB_LDN8_CRF7_IRQS 0x0f /* irq source for watchdog, 2 == SMI */ +#define WB_LDN8_CRF7_CLEAR_MASK \ + (WB_LDN8_CRF7_MOUSE|WB_LDN8_CRF7_KEYB|WB_LDN8_CRF7_TS|WB_LDN8_CRF7_IRQS) + +#define write_efir_1(sc, value) \ + bus_space_write_1((sc)->bst, (sc)->bsh, 0, (value)) +#define read_efir_1(sc) \ + bus_space_read_1((sc)->bst, (sc)->bsh, 0) +#define write_efdr_1(sc, value) \ + bus_space_write_1((sc)->bst, (sc)->bsh, 1, (value)) +#define read_efdr_1(sc) \ + bus_space_read_1((sc)->bst, (sc)->bsh, 1) + +struct wb_softc { + device_t dev; + struct resource *portres; + bus_space_tag_t bst; + bus_space_handle_t bsh; + int rid; + eventhandler_tag ev_tag; + int (*ext_cfg_enter_f)(struct wb_softc *); + void (*ext_cfg_exit_f)(struct wb_softc *); + int debug_verbose; + + /* + * Special feature to let the watchdog fire at a different + * timeout as set by watchdog(4) but still use that API to + * re-load it periodically. + */ + unsigned int timeout_override; + + /* + * Space to save current state temporary and for sysctls. + * We want to know the timeout value and usually need two + * additional registers for options. Do not name them by + * register as these might be different by chip. + */ + uint8_t reg_timeout; + uint8_t reg_1; + uint8_t reg_2; +}; + +static int ext_cfg_enter_0x87_0x87(struct wb_softc *); +static void ext_cfg_exit_0xaa(struct wb_softc *); + +struct winbond_superio_cfg { + uint8_t efer; /* and efir */ + int (*ext_cfg_enter_f)(struct wb_softc *); + void (*ext_cfg_exit_f)(struct wb_softc *); +} probe_addrs[] = { + { + .efer = 0x2e, + .ext_cfg_enter_f = ext_cfg_enter_0x87_0x87, + .ext_cfg_exit_f = ext_cfg_exit_0xaa, + }, + { + .efer = 0x4e, + .ext_cfg_enter_f = ext_cfg_enter_0x87_0x87, + .ext_cfg_exit_f = ext_cfg_exit_0xaa, + }, +}; + +struct winbond_vendor_device_id { + uint16_t vendor_id; + uint8_t device_id; + uint8_t device_rev; + const char * descr; +} wb_devs[] = { + { + .vendor_id = 0x5ca3, + .device_id = 0x52, + .device_rev = 0x17, + .descr = "Winbond 83627HF/F/HG/G Rev. G", + }, + { + .vendor_id = 0x5ca3, + .device_id = 0x52, + .device_rev = 0x3a, + .descr = "Winbond 83627HF/F/HG/G Rev. J", + }, + { + .vendor_id = 0x5ca3, + .device_id = 0x52, + .device_rev = 0x41, + .descr = "Winbond 83627HF/F/HG/G Rev. UD-A", + }, + { + .vendor_id = 0x5ca3, + .device_id = 0xa0, + .device_rev = 0x25, + .descr = "Winbond 83627DHG IC ver. 5", + }, +}; + +/* + * Return the watchdog related registers as we last read them. This will + * usually not give the current timeout or state on whether the watchdog + * fired. + */ +static int +sysctl_wb_debug(SYSCTL_HANDLER_ARGS) +{ + struct wb_softc *sc; + struct sbuf sb; + int error; + + sc = arg1; + + sbuf_new_for_sysctl(&sb, NULL, 64, req); + + sbuf_printf(&sb, "LDN8 (GPIO2, Watchdog): "); + sbuf_printf(&sb, "CRF5 0x%02x ", sc->reg_1); + sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout); + sbuf_printf(&sb, "CRF7 0x%02x ", sc->reg_2); + + sbuf_trim(&sb); + error = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error); +} + +/* + * Read the current values before returning them. Given this might poke + * the registers the same time as the watchdog, this sysctl handler should + * be marked CTLFLAG_SKIP to not show up by default. + */ +static int +sysctl_wb_debug_current(SYSCTL_HANDLER_ARGS) +{ + struct wb_softc *sc; + + sc = arg1; + + /* + * Enter extended function mode in case someone else has been + * poking on the registers. We will not leave it though. + */ + if ((*sc->ext_cfg_enter_f)(sc) != 0) + return (ENXIO); + + /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ + write_efir_1(sc, WB_LDN_REG); + write_efdr_1(sc, WB_LDN_REG_LDN8); + + write_efir_1(sc, WB_LDN8_CRF5); + sc->reg_1 = read_efdr_1(sc); + write_efir_1(sc, WB_LDN8_CRF6); + sc->reg_timeout = read_efdr_1(sc); + write_efir_1(sc, WB_LDN8_CRF7); + sc->reg_2 = read_efdr_1(sc); + + return (sysctl_wb_debug(oidp, arg1, arg2, req)); +} + +/* + * Sysctl handlers to force a watchdog timeout or to test the NMI functionality + * works as expetced. + * For testing we could set a test_nmi flag in the softc that, in case of NMI, a + * callback function from trap.c could check whether we fired and not report the + * timeout but clear the flag for the sysctl again. This is interesting given a + * lot of boards have jumpers to change the action on watchdog timeout or + * disable the watchdog completely. + * XXX-BZ notyet: currently no general infrastructure exists to do this. + */ +static int +sysctl_wb_force_test_nmi(SYSCTL_HANDLER_ARGS) +{ + struct wb_softc *sc; + int error, test, val; + + sc = arg1; + test = arg2; + +#ifdef notyet + val = sc->test_nmi; +#else + val = 0; +#endif + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + return (error); + +#ifdef notyet + /* Manually clear the test for a value of 0 and do nothing else. */ + if (test && val == 0) { + sc->test_nmi = 0; + return (0); + } +#endif + + /* + * Enter extended function mode in case someone else has been + * poking on the registers. We will not leave it though. + */ + if ((*sc->ext_cfg_enter_f)(sc) != 0) + return (ENXIO); + +#ifdef notyet + /* + * If we are testing the NMI functionality, set the flag before + * forcing the timeout. + */ + if (test) + sc->test_nmi = 1; +#endif + + /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ + write_efir_1(sc, WB_LDN_REG); + write_efdr_1(sc, WB_LDN_REG_LDN8); + + /* Force watchdog to fire. */ + write_efir_1(sc, WB_LDN8_CRF7); + sc->reg_2 = read_efdr_1(sc); + sc->reg_2 |= WB_LDN8_CRF7_FORCE; + + write_efir_1(sc, WB_LDN8_CRF7); + write_efdr_1(sc, sc->reg_2); + + return (0); +} + +/* + * Print current watchdog state. + * + * Note: it is the responsibility of the caller to update the registers + * upfront. + */ +static void +wb_print_state(struct wb_softc *sc, const char *msg) +{ + + device_printf(sc->dev, "%s%sWatchdog %sabled. %s" + "Scaling by %ds, timer at %d (%s=%ds%s). " + "CRF5 0x%02x CRF7 0x%02x\n", + (msg != NULL) ? msg : "", (msg != NULL) ? ": " : "", + (sc->reg_timeout > 0x00) ? "en" : "dis", + (sc->reg_2 & WB_LDN8_CRF7_TS) ? "Watchdog fired. " : "", + (sc->reg_1 & WB_LDN8_CRF5_SCALE) ? 60 : 1, + sc->reg_timeout, + (sc->reg_timeout > 0x00) ? "<" : "", + sc->reg_timeout * ((sc->reg_1 & WB_LDN8_CRF5_SCALE) ? 60 : 1), + (sc->reg_timeout > 0x00) ? " left" : "", + sc->reg_1, sc->reg_2); +} + +/* + * Functions to enter and exit extended function mode. Possibly shared + * between different chips. + */ +static int +ext_cfg_enter_0x87_0x87(struct wb_softc *sc) +{ + + /* + * Enable extended function mode. + * Winbond does not allow us to validate so always return success. + */ + write_efir_1(sc, 0x87); + write_efir_1(sc, 0x87); + + return (0); +} + +static void +ext_cfg_exit_0xaa(struct wb_softc *sc) +{ + + write_efir_1(sc, 0xaa); +} + +/* + * (Re)load the watchdog counter depending on timeout. A timeout of 0 will + * disable the watchdog. + */ +static int +wb_set_watchdog(struct wb_softc *sc, unsigned int timeout) +{ + + if (sc->debug_verbose) + wb_print_state(sc, "Before watchdog counter (re)load"); + + /* + * Enter extended function mode in case someone else has been + * poking on the registers. We will not leave it though. + */ + if ((*sc->ext_cfg_enter_f)(sc) != 0) + return (ENXIO); + + /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog) */ + write_efir_1(sc, WB_LDN_REG); + write_efdr_1(sc, WB_LDN_REG_LDN8); + + /* Disable and validate or arm/reset watchdog. */ + if (timeout == 0) { + /* Disable watchdog. */ + write_efir_1(sc, WB_LDN8_CRF6); + write_efdr_1(sc, 0x00); + + /* Re-check. */ + write_efir_1(sc, WB_LDN8_CRF6); + sc->reg_timeout = read_efdr_1(sc); + + if (sc->reg_timeout != 0x00) { + device_printf(sc->dev, "Failed to disable watchdog: " + "0x%02x.\n", sc->reg_timeout); + return (EIO); + } + + } else { + /* + * In case an override is set, let it override. It may lead + * to strange results as we do not check the input of the sysctl. + */ + if (sc->timeout_override > 0) + timeout = sc->timeout_override; + + /* Make sure we support the requested timeout. */ + if (timeout > 255 * 60) + return (EINVAL); + + /* Read current scaling factor. */ + write_efir_1(sc, WB_LDN8_CRF5); + sc->reg_1 = read_efdr_1(sc); + + if (timeout > 255) { + /* Set scaling factor to 60s. */ + sc->reg_1 |= WB_LDN8_CRF5_SCALE; + sc->reg_timeout = (timeout / 60); + if (timeout % 60) + sc->reg_timeout++; + } else { + /* Set scaling factor to 1s. */ + sc->reg_1 &= ~WB_LDN8_CRF5_SCALE; + sc->reg_timeout = timeout; + } + + /* In case we fired before we need to clear to fire again. */ + write_efir_1(sc, WB_LDN8_CRF7); + sc->reg_2 = read_efdr_1(sc); + if (sc->reg_2 & WB_LDN8_CRF7_TS) { + sc->reg_2 &= ~WB_LDN8_CRF7_TS; + write_efir_1(sc, WB_LDN8_CRF7); + write_efdr_1(sc, sc->reg_2); + } + + /* Write back scaling factor. */ + write_efir_1(sc, WB_LDN8_CRF5); + write_efdr_1(sc, sc->reg_1); + + /* Set timer and arm/reset the watchdog. */ + write_efir_1(sc, WB_LDN8_CRF6); + write_efdr_1(sc, sc->reg_timeout); + } + + if (sc->debug_verbose) + wb_print_state(sc, "After watchdog counter (re)load"); + + return (0); +} + +/* + * watchdog(9) EVENTHANDLER function implementation to (re)load the counter + * with the given timeout or disable the watchdog. + */ +static void +wb_watchdog_fn(void *private, u_int cmd, int *error) +{ + struct wb_softc *sc; + unsigned int timeout; + int e; + + sc = private; + KASSERT(sc != NULL, ("%s: watchdog handler function called without " + "softc.", __func__)); + + cmd &= WD_INTERVAL; + if (cmd > 0 && cmd <= 63) { + /* Reset (and arm) watchdog. */ + timeout = ((uint64_t)1 << cmd) / 1000000000; + if (timeout == 0) + timeout = 1; + e = wb_set_watchdog(sc, timeout); + if (e == 0) { + if (error != NULL) + *error = 0; + } else { + /* On error, try to make sure the WD is disabled. */ + wb_set_watchdog(sc, 0); + } + + } else { + /* Disable watchdog. */ + e = wb_set_watchdog(sc, 0); + if (e != 0 && cmd == 0 && error != NULL) { + /* Failed to disable watchdog. */ + *error = EOPNOTSUPP; + } + } +} + +/* + * Probe/attach the Winbond Super I/O chip. + * + * Initial abstraction to possibly support more chips: + * - Iterate over the well known base ports, try to enable extended function + * mode and read and match the device ID and device revision. Unfortunately + * the Vendor ID is in the hardware monitoring section accessible by different + * base ports only. + * - Also HEFRAS, which would tell use the base port, is only accessible after + * entering extended function mode, for which the base port is needed. + * At least check HEFRAS to match the current base port we are probing. + * - On match set the description, remember functions to enter/exit extended + * function mode as well as the base port. + */ +static int +wb_probe_enable(device_t dev, int probe) +{ + struct wb_softc *sc; + int error, found, i, j; + uint8_t dev_id, dev_rev, cr26; + + sc = device_get_softc(dev); + bzero(sc, sizeof(*sc)); + sc->dev = dev; + + error = ENXIO; + for (i = 0; i < sizeof(probe_addrs) / sizeof(*probe_addrs); i++) { + + /* Allocate bus resources for IO index/data register access. */ + sc->portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->rid, + probe_addrs[i].efer, probe_addrs[i].efer + 1, 2, RF_ACTIVE); + if (sc->portres == NULL) + continue; + sc->bst = rman_get_bustag(sc->portres); + sc->bsh = rman_get_bushandle(sc->portres); + + found = 0; + error = (*probe_addrs[i].ext_cfg_enter_f)(sc); + if (error != 0) + goto cleanup; + + /* Identify the SuperIO chip. */ + write_efir_1(sc, WB_DEVICE_ID_REG); + dev_id = read_efdr_1(sc); + write_efir_1(sc, WB_DEVICE_REV_REG); + dev_rev = read_efdr_1(sc); + write_efir_1(sc, WB_CR26); + cr26 = read_efdr_1(sc); + + /* HEFRAS of 0 means EFER at 0x2e, 1 means EFER at 0x4e. */ + if (((cr26 & 0x40) == 0x00 && probe_addrs[i].efer != 0x2e) || + ((cr26 & 0x40) == 0x40 && probe_addrs[i].efer != 0x4e)) { + device_printf(dev, "HEFRAS and EFER do not align: EFER " + "0x%02x DevID 0x%02x DevRev 0x%02x CR26 0x%02x\n", + probe_addrs[i].efer, dev_id, dev_rev, cr26); + goto cleanup; + } + + for (j = 0; j < sizeof(wb_devs) / sizeof(*wb_devs); j++) { + if (wb_devs[j].device_id == dev_id && + wb_devs[j].device_rev == dev_rev) { + if (probe) + device_set_desc(dev, wb_devs[j].descr); + found++; + break; + } + } + if (probe && found && bootverbose) + device_printf(dev, "%s EFER 0x%02x ID 0x%02x Rev 0x%02x" + " CR26 0x%02x (probing)\n", device_get_desc(dev), + probe_addrs[i].efer, dev_id, dev_rev, cr26); +cleanup: + if (probe || !found) { + (*probe_addrs[i].ext_cfg_exit_f)(sc); + + (void) bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, + sc->portres); + } + + /* + * Stop probing if have successfully identified the SuperIO. + * Remember the extended function mode enter/exit functions + * for operations. + */ + if (found) { + sc->ext_cfg_enter_f = probe_addrs[i].ext_cfg_enter_f; + sc->ext_cfg_exit_f = probe_addrs[i].ext_cfg_exit_f; + error = BUS_PROBE_DEFAULT; + break; + } else + error = ENXIO; + } + + return (error); +} + +static int +wb_probe(device_t dev) +{ + + /* Make sure we do not claim some ISA PNP device. */ + if (isa_get_logicalid(dev) != 0) + return (ENXIO); + + return (wb_probe_enable(dev, 1)); +} + +static int +wb_attach(device_t dev) +{ + struct wb_softc *sc; + struct sysctl_ctx_list *sctx; + struct sysctl_oid *soid; + unsigned long timeout; + int error; + + error = wb_probe_enable(dev, 0); + if (error > 0) + return (ENXIO); + + sc = device_get_softc(dev); + KASSERT(sc->ext_cfg_enter_f != NULL && sc->ext_cfg_exit_f != NULL, + ("%s: successfull probe result but not setup correctly", __func__)); + + /* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */ + write_efir_1(sc, WB_LDN_REG); + write_efdr_1(sc, WB_LDN_REG_LDN8); + + /* Make sure LDN8 is enabled (Do we need to? Also affects GPIO). */ + write_efir_1(sc, WB_LDN8_CR30); + write_efdr_1(sc, WB_LDN8_CR30_ACTIVE); + + /* Read the current watchdog configuration. */ + write_efir_1(sc, WB_LDN8_CRF5); + sc->reg_1 = read_efdr_1(sc); + write_efir_1(sc, WB_LDN8_CRF6); + sc->reg_timeout = read_efdr_1(sc); + write_efir_1(sc, WB_LDN8_CRF7); + sc->reg_2 = read_efdr_1(sc); + + /* Print current state if bootverbose or watchdog already enabled. */ + if (bootverbose || (sc->reg_timeout > 0x00)) + wb_print_state(sc, "Before watchdog attach"); + + /* + * Clear a previous watchdog timeout event (if (still) set). + * Disable all all interrupt reset sources (defaults). + */ + sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); + write_efir_1(sc, WB_LDN8_CRF5); + write_efir_1(sc, sc->reg_1); + + sc->reg_2 &= ~WB_LDN8_CRF7_CLEAR_MASK; + write_efir_1(sc, WB_LDN8_CRF7); + write_efdr_1(sc, sc->reg_2); + + /* Read global timeout override tunable, Add per device sysctls. */ + if (TUNABLE_ULONG_FETCH("hw.wbwd.timeout_override", &timeout)) { + if (timeout > 0) + sc->timeout_override = timeout; + } + sctx = device_get_sysctl_ctx(dev); + soid = device_get_sysctl_tree(dev); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, + "timeout_override", CTLFLAG_RW, &sc->timeout_override, 0, + "Timeout in seconds overriding default watchdog timeout"); + SYSCTL_ADD_INT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, + "debug_verbose", CTLFLAG_RW, &sc->debug_verbose, 0, + "Enables extra debugging information"); + SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "debug", + CTLTYPE_STRING|CTLFLAG_RD, sc, 0, sysctl_wb_debug, "A", + "Selected register information from last change by driver"); + SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "debug_current", + CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_SKIP, sc, 0, + sysctl_wb_debug_current, "A", + "Selected register information (may interfere)"); + SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "force_timeout", + CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_SKIP, sc, 0, + sysctl_wb_force_test_nmi, "I", "Enable to force watchdog to fire."); + + /* Register watchdog. */ + sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, wb_watchdog_fn, sc, + 0); + + if (bootverbose) + wb_print_state(sc, "After watchdog attach"); + + return (0); +} + +static int +wb_detach(device_t dev) +{ + struct wb_softc *sc; + + sc = device_get_softc(dev); + + /* Unregister and stop the watchdog if running. */ + if (sc->ev_tag) + EVENTHANDLER_DEREGISTER(watchdog_list, sc->ev_tag); + wb_set_watchdog(sc, 0); + + /* Disable extended function mode. */ + (*sc->ext_cfg_exit_f)(sc); + + /* Cleanup resources. */ + (void) bus_release_resource(dev, SYS_RES_IOPORT, sc->rid, sc->portres); + + /* Bus subroutines take care of sysctls already. */ + + return (0); +} + +static device_method_t wb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, wb_probe), + DEVMETHOD(device_attach, wb_attach), + DEVMETHOD(device_detach, wb_detach), + + { 0, 0 } +}; + +static driver_t wb_isa_driver = { + "wbwd", + wb_methods, + sizeof(struct wb_softc) +}; + +static devclass_t wb_devclass; + +DRIVER_MODULE(wb, isa, wb_isa_driver, wb_devclass, NULL, NULL); Modified: head/sys/i386/conf/GENERIC.hints ============================================================================== --- head/sys/i386/conf/GENERIC.hints Tue Mar 6 18:39:07 2012 (r232613) +++ head/sys/i386/conf/GENERIC.hints Tue Mar 6 18:44:52 2012 (r232614) @@ -38,3 +38,4 @@ hint.atrtc.0.irq="8" hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" +hint.wbwd.0.at="isa" Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Mar 6 18:39:07 2012 (r232613) +++ head/sys/i386/conf/NOTES Tue Mar 6 18:44:52 2012 (r232614) @@ -838,10 +838,12 @@ hint.pcf.0.irq="5" # ichwd: Intel ICH watchdog timer # amdsbwd: AMD SB7xx watchdog timer # viawd: VIA south bridge watchdog timer +# wbwd: Winbond watchdog timer # device ichwd device amdsbwd device viawd +device wbwd # # Temperature sensors: Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Mar 6 18:39:07 2012 (r232613) +++ head/sys/modules/Makefile Tue Mar 6 18:44:52 2012 (r232614) @@ -333,6 +333,7 @@ SUBDIR= ${_3dfx} \ vx \ ${_vxge} \ wb \ + ${_wbwd} \ ${_wi} \ wlan \ wlan_acl \ @@ -510,6 +511,7 @@ _stg= stg _streams= streams _svr4= svr4 _vxge= vxge +_wbwd= wbwd _wi= wi _xe= xe .if ${MK_ZFS} != "no" || defined(ALL_MODULES) @@ -704,6 +706,7 @@ _viawd= viawd _virtio= virtio _vxge= vxge _x86bios= x86bios +_wbwd= wbwd _wi= wi _wpi= wpi .if ${MK_SOURCELESS_UCODE} != "no" Added: head/sys/modules/wbwd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/wbwd/Makefile Tue Mar 6 18:44:52 2012 (r232614) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/wbwd + +KMOD= wbwd +SRCS= wbwd.c +SRCS+= bus_if.h device_if.h isa_if.h + +.include From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 18:51:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03FAD1065676; Tue, 6 Mar 2012 18:51:25 +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 86D0A8FC14; Tue, 6 Mar 2012 18:51:24 +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 783BE25D385D; Tue, 6 Mar 2012 18:51:23 +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 A085CBDCD4D; Tue, 6 Mar 2012 18:51:22 +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 VvFtRC2gyNHj; Tue, 6 Mar 2012 18:51:21 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id A34CDBDCD4A; Tue, 6 Mar 2012 18:51:21 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201203061844.q26IiqZL052653@svn.freebsd.org> Date: Tue, 6 Mar 2012 18:51:20 +0000 Content-Transfer-Encoding: 7bit Message-Id: <3EB76A03-948B-407B-B8AE-AB25B035D620@FreeBSD.org> References: <201203061844.q26IiqZL052653@svn.freebsd.org> To: src-committers@freebsd.org X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r232614 - in head: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/wbwd sys/i386/conf sys/modules sys/modules/wbwd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 18:51:25 -0000 On 6. Mar 2012, at 18:44 , Bjoern A. Zeeb wrote: > Author: bz > Date: Tue Mar 6 18:44:52 2012 > New Revision: 232614 > URL: http://svn.freebsd.org/changeset/base/232614 > > Log: > Provide wbwd(4), a driver for the watchdog timer found on various > Winbond Super I/O chips. The supported chips can be found on a variety of motherboards. I have especially seen it on SuperMicro. Some of these (like X8DT3) provide a jumper to set whether the watchdog would trigger an NMI or a reset (or be disabled). Some others only distinguish between disabled and reset. It's been tested on at least SM X7SPA-HF, H8QM8 and X8DT3 etc. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 19:01:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDE5F106566B; Tue, 6 Mar 2012 19:01:33 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC9298FC14; Tue, 6 Mar 2012 19:01: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 q26J1XeI053313; Tue, 6 Mar 2012 19:01:33 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26J1XF9053302; Tue, 6 Mar 2012 19:01:33 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203061901.q26J1XF9053302@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 19:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232615 - in head/sys/mips: include mips sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 19:01:33 -0000 Author: jmallett Date: Tue Mar 6 19:01:32 2012 New Revision: 232615 URL: http://svn.freebsd.org/changeset/base/232615 Log: At the risk of reducing source compatibility with old NetBSD and Sprite: o) Get rid of some unused macros related to features we don't intend to provide. o) Get rid of macro definitions for MIPS-I CPUs. We are not likely to support anything that predartes MIPS-III. o) Respell MIPS3_* macros as MIPS_*, which is how most of them were being used already. o) Eliminate a duplicate and mostly-unused set of exception vector macros. There's still considerable duplication and lots more obsolete in our headers, but this reduces one of the larger files to a size where one could reckon about the correctness of its contents with a mere few hours of contemplation. There is, of course, a question of whether we need definitions for fields, registers and configurations that we are unlikely to ever use or implement, even if they're not obsolete since 1991. FreeBSD is not a processor reference manual, and things that aren't used may be wrong, or may be duplicated because nobody could possibly actually know whether they're already defined. Modified: head/sys/mips/include/asm.h head/sys/mips/include/cpuregs.h head/sys/mips/include/locore.h head/sys/mips/mips/cpu.c head/sys/mips/mips/exception.S head/sys/mips/mips/locore.S head/sys/mips/mips/machdep.c head/sys/mips/mips/support.S head/sys/mips/mips/trap.c head/sys/mips/sibyte/sb_machdep.c Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/include/asm.h Tue Mar 6 19:01:32 2012 (r232615) @@ -765,29 +765,6 @@ _C_LABEL(x): : /* no outputs */ \ : "r" (data), "i" (spr), "i" (sel)); /* inputs */ -/* - * The DYNAMIC_STATUS_MASK option adds an additional masking operation - * when updating the hardware interrupt mask in the status register. - * - * This is useful for platforms that need to at run-time mask - * interrupts based on motherboard configuration or to handle - * slowly clearing interrupts. - * - * XXX this is only currently implemented for mips3. - */ -#ifdef MIPS_DYNAMIC_STATUS_MASK -#define DYNAMIC_STATUS_MASK(sr,scratch) \ - lw scratch, mips_dynamic_status_mask; \ - and sr, sr, scratch - -#define DYNAMIC_STATUS_MASK_TOUSER(sr,scratch1) \ - ori sr, (MIPS_INT_MASK | MIPS_SR_INT_IE); \ - DYNAMIC_STATUS_MASK(sr,scratch1) -#else -#define DYNAMIC_STATUS_MASK(sr,scratch) -#define DYNAMIC_STATUS_MASK_TOUSER(sr,scratch1) -#endif - #define GET_CPU_PCPU(reg) \ PTR_L reg, _C_LABEL(pcpup); Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/include/cpuregs.h Tue Mar 6 19:01:32 2012 (r232615) @@ -229,8 +229,7 @@ */ #define MIPS_CR_BR_DELAY 0x80000000 #define MIPS_CR_COP_ERR 0x30000000 -#define MIPS1_CR_EXC_CODE 0x0000003C /* four bits */ -#define MIPS3_CR_EXC_CODE 0x0000007C /* five bits */ +#define MIPS_CR_EXC_CODE 0x0000007C /* five bits */ #define MIPS_CR_IP 0x0000FF00 #define MIPS_CR_EXC_CODE_SHIFT 2 #define MIPS_CR_COP_ERR_SHIFT 28 @@ -268,94 +267,31 @@ #define MIPS_SR_INT_MASK 0x0000ff00 /* - * The R2000/R3000-specific status register bit definitions. - * all bits are active when set to 1. - * - * MIPS_SR_PARITY_ERR Parity error. - * MIPS_SR_CACHE_MISS Most recent D-cache load resulted in a miss. - * MIPS_SR_PARITY_ZERO Zero replaces outgoing parity bits. - * MIPS_SR_SWAP_CACHES Swap I-cache and D-cache. - * MIPS_SR_ISOL_CACHES Isolate D-cache from main memory. - * Interrupt enable bits defined below. - * MIPS_SR_KU_OLD Old kernel/user mode bit. 1 => user mode. - * MIPS_SR_INT_ENA_OLD Old interrupt enable bit. - * MIPS_SR_KU_PREV Previous kernel/user mode bit. 1 => user mode. - * MIPS_SR_INT_ENA_PREV Previous interrupt enable bit. - * MIPS_SR_KU_CUR Current kernel/user mode bit. 1 => user mode. - */ - -#define MIPS1_PARITY_ERR 0x00100000 -#define MIPS1_CACHE_MISS 0x00080000 -#define MIPS1_PARITY_ZERO 0x00040000 -#define MIPS1_SWAP_CACHES 0x00020000 -#define MIPS1_ISOL_CACHES 0x00010000 - -#define MIPS1_SR_KU_OLD 0x00000020 /* 2nd stacked KU/IE*/ -#define MIPS1_SR_INT_ENA_OLD 0x00000010 /* 2nd stacked KU/IE*/ -#define MIPS1_SR_KU_PREV 0x00000008 /* 1st stacked KU/IE*/ -#define MIPS1_SR_INT_ENA_PREV 0x00000004 /* 1st stacked KU/IE*/ -#define MIPS1_SR_KU_CUR 0x00000002 /* current KU */ - -/* backwards compatibility */ -#define MIPS_SR_PARITY_ERR MIPS1_PARITY_ERR -#define MIPS_SR_CACHE_MISS MIPS1_CACHE_MISS -#define MIPS_SR_PARITY_ZERO MIPS1_PARITY_ZERO -#define MIPS_SR_SWAP_CACHES MIPS1_SWAP_CACHES -#define MIPS_SR_ISOL_CACHES MIPS1_ISOL_CACHES - -#define MIPS_SR_KU_OLD MIPS1_SR_KU_OLD -#define MIPS_SR_INT_ENA_OLD MIPS1_SR_INT_ENA_OLD -#define MIPS_SR_KU_PREV MIPS1_SR_KU_PREV -#define MIPS_SR_KU_CUR MIPS1_SR_KU_CUR -#define MIPS_SR_INT_ENA_PREV MIPS1_SR_INT_ENA_PREV - -/* * R4000 status register bit definitons, * where different from r2000/r3000. */ -#define MIPS3_SR_XX 0x80000000 -#define MIPS3_SR_RP 0x08000000 -#define MIPS3_SR_FR 0x04000000 -#define MIPS3_SR_RE 0x02000000 - -#define MIPS3_SR_DIAG_DL 0x01000000 /* QED 52xx */ -#define MIPS3_SR_DIAG_IL 0x00800000 /* QED 52xx */ -#define MIPS3_SR_SR 0x00100000 -#define MIPS3_SR_NMI 0x00080000 /* MIPS32/64 */ -#define MIPS3_SR_DIAG_CH 0x00040000 -#define MIPS3_SR_DIAG_CE 0x00020000 -#define MIPS3_SR_DIAG_PE 0x00010000 -#define MIPS3_SR_EIE 0x00010000 /* TX79/R5900 */ -#define MIPS3_SR_KX 0x00000080 -#define MIPS3_SR_SX 0x00000040 -#define MIPS3_SR_UX 0x00000020 -#define MIPS3_SR_KSU_MASK 0x00000018 -#define MIPS3_SR_KSU_USER 0x00000010 -#define MIPS3_SR_KSU_SUPER 0x00000008 -#define MIPS3_SR_KSU_KERNEL 0x00000000 -#define MIPS3_SR_ERL 0x00000004 -#define MIPS3_SR_EXL 0x00000002 - -#ifdef MIPS3_5900 -#undef MIPS_SR_INT_IE -#define MIPS_SR_INT_IE 0x00010001 /* XXX */ -#endif - -#define MIPS_SR_SOFT_RESET MIPS3_SR_SR -#define MIPS_SR_DIAG_CH MIPS3_SR_DIAG_CH -#define MIPS_SR_DIAG_CE MIPS3_SR_DIAG_CE -#define MIPS_SR_DIAG_PE MIPS3_SR_DIAG_PE -#define MIPS_SR_KX MIPS3_SR_KX -#define MIPS_SR_SX MIPS3_SR_SX -#define MIPS_SR_UX MIPS3_SR_UX - -#define MIPS_SR_KSU_MASK MIPS3_SR_KSU_MASK -#define MIPS_SR_KSU_USER MIPS3_SR_KSU_USER -#define MIPS_SR_KSU_SUPER MIPS3_SR_KSU_SUPER -#define MIPS_SR_KSU_KERNEL MIPS3_SR_KSU_KERNEL -#define MIPS_SR_ERL MIPS3_SR_ERL -#define MIPS_SR_EXL MIPS3_SR_EXL - +#define MIPS_SR_XX 0x80000000 +#define MIPS_SR_RP 0x08000000 +#define MIPS_SR_FR 0x04000000 +#define MIPS_SR_RE 0x02000000 + +#define MIPS_SR_DIAG_DL 0x01000000 /* QED 52xx */ +#define MIPS_SR_DIAG_IL 0x00800000 /* QED 52xx */ +#define MIPS_SR_SR 0x00100000 +#define MIPS_SR_NMI 0x00080000 /* MIPS32/64 */ +#define MIPS_SR_DIAG_CH 0x00040000 +#define MIPS_SR_DIAG_CE 0x00020000 +#define MIPS_SR_DIAG_PE 0x00010000 +#define MIPS_SR_EIE 0x00010000 /* TX79/R5900 */ +#define MIPS_SR_KX 0x00000080 +#define MIPS_SR_SX 0x00000040 +#define MIPS_SR_UX 0x00000020 +#define MIPS_SR_KSU_MASK 0x00000018 +#define MIPS_SR_KSU_USER 0x00000010 +#define MIPS_SR_KSU_SUPER 0x00000008 +#define MIPS_SR_KSU_KERNEL 0x00000000 +#define MIPS_SR_ERL 0x00000004 +#define MIPS_SR_EXL 0x00000002 /* * The interrupt masks. @@ -373,149 +309,87 @@ #define MIPS_SOFT_INT_MASK_0 0x0100 /* - * mips3 CPUs have on-chip timer at INT_MASK_5. Each platform can - * choose to enable this interrupt. - */ -#if defined(MIPS3_ENABLE_CLOCK_INTR) -#define MIPS3_INT_MASK MIPS_INT_MASK -#define MIPS3_HARD_INT_MASK MIPS_HARD_INT_MASK -#else -#define MIPS3_INT_MASK (MIPS_INT_MASK & ~MIPS_INT_MASK_5) -#define MIPS3_HARD_INT_MASK (MIPS_HARD_INT_MASK & ~MIPS_INT_MASK_5) -#endif - -/* - * The bits in the context register. - */ -#define MIPS1_CNTXT_PTE_BASE 0xFFE00000 -#define MIPS1_CNTXT_BAD_VPN 0x001FFFFC - -#define MIPS3_CNTXT_PTE_BASE 0xFF800000 -#define MIPS3_CNTXT_BAD_VPN2 0x007FFFF0 - -/* - * Location of MIPS32 exception vectors. Most are multiplexed in - * the sense that further decoding is necessary (e.g. reading the - * CAUSE register or NMI bits in STATUS). - * Most interrupts go via the - * The INT vector is dedicated for hardware interrupts; it is - * only referenced if the IV bit in CAUSE is set to 1. - */ -#define MIPS_VEC_RESET 0xBFC00000 /* Hard, soft, or NMI */ -#define MIPS_VEC_EJTAG 0xBFC00480 -#define MIPS_VEC_TLB 0x80000000 -#define MIPS_VEC_XTLB 0x80000080 -#define MIPS_VEC_CACHE 0x80000100 -#define MIPS_VEC_GENERIC 0x80000180 /* Most exceptions */ -#define MIPS_VEC_INTERRUPT 0x80000200 - -/* * The bits in the MIPS3 config register. * * bit 0..5: R/W, Bit 6..31: R/O */ /* kseg0 coherency algorithm - see MIPS3_TLB_ATTR values */ -#define MIPS3_CONFIG_K0_MASK 0x00000007 +#define MIPS_CONFIG_K0_MASK 0x00000007 /* * R/W Update on Store Conditional * 0: Store Conditional uses coherency algorithm specified by TLB * 1: Store Conditional uses cacheable coherent update on write */ -#define MIPS3_CONFIG_CU 0x00000008 +#define MIPS_CONFIG_CU 0x00000008 -#define MIPS3_CONFIG_DB 0x00000010 /* Primary D-cache line size */ -#define MIPS3_CONFIG_IB 0x00000020 /* Primary I-cache line size */ -#define MIPS3_CONFIG_CACHE_L1_LSIZE(config, bit) \ +#define MIPS_CONFIG_DB 0x00000010 /* Primary D-cache line size */ +#define MIPS_CONFIG_IB 0x00000020 /* Primary I-cache line size */ +#define MIPS_CONFIG_CACHE_L1_LSIZE(config, bit) \ (((config) & (bit)) ? 32 : 16) -#define MIPS3_CONFIG_DC_MASK 0x000001c0 /* Primary D-cache size */ -#define MIPS3_CONFIG_DC_SHIFT 6 -#define MIPS3_CONFIG_IC_MASK 0x00000e00 /* Primary I-cache size */ -#define MIPS3_CONFIG_IC_SHIFT 9 -#define MIPS3_CONFIG_C_DEFBASE 0x1000 /* default base 2^12 */ +#define MIPS_CONFIG_DC_MASK 0x000001c0 /* Primary D-cache size */ +#define MIPS_CONFIG_DC_SHIFT 6 +#define MIPS_CONFIG_IC_MASK 0x00000e00 /* Primary I-cache size */ +#define MIPS_CONFIG_IC_SHIFT 9 +#define MIPS_CONFIG_C_DEFBASE 0x1000 /* default base 2^12 */ /* Cache size mode indication: available only on Vr41xx CPUs */ -#define MIPS3_CONFIG_CS 0x00001000 -#define MIPS3_CONFIG_C_4100BASE 0x0400 /* base is 2^10 if CS=1 */ -#define MIPS3_CONFIG_CACHE_SIZE(config, mask, base, shift) \ +#define MIPS_CONFIG_CS 0x00001000 +#define MIPS_CONFIG_C_4100BASE 0x0400 /* base is 2^10 if CS=1 */ +#define MIPS_CONFIG_CACHE_SIZE(config, mask, base, shift) \ ((base) << (((config) & (mask)) >> (shift))) /* External cache enable: Controls L2 for R5000/Rm527x and L3 for Rm7000 */ -#define MIPS3_CONFIG_SE 0x00001000 +#define MIPS_CONFIG_SE 0x00001000 /* Block ordering: 0: sequential, 1: sub-block */ -#define MIPS3_CONFIG_EB 0x00002000 +#define MIPS_CONFIG_EB 0x00002000 /* ECC mode - 0: ECC mode, 1: parity mode */ -#define MIPS3_CONFIG_EM 0x00004000 +#define MIPS_CONFIG_EM 0x00004000 /* BigEndianMem - 0: kernel and memory are little endian, 1: big endian */ -#define MIPS3_CONFIG_BE 0x00008000 +#define MIPS_CONFIG_BE 0x00008000 /* Dirty Shared coherency state - 0: enabled, 1: disabled */ -#define MIPS3_CONFIG_SM 0x00010000 +#define MIPS_CONFIG_SM 0x00010000 /* Secondary Cache - 0: present, 1: not present */ -#define MIPS3_CONFIG_SC 0x00020000 +#define MIPS_CONFIG_SC 0x00020000 /* System Port width - 0: 64-bit, 1: 32-bit (QED RM523x), 2,3: reserved */ -#define MIPS3_CONFIG_EW_MASK 0x000c0000 -#define MIPS3_CONFIG_EW_SHIFT 18 +#define MIPS_CONFIG_EW_MASK 0x000c0000 +#define MIPS_CONFIG_EW_SHIFT 18 /* Secondary Cache port width - 0: 128-bit data path to S-cache, 1: reserved */ -#define MIPS3_CONFIG_SW 0x00100000 +#define MIPS_CONFIG_SW 0x00100000 /* Split Secondary Cache Mode - 0: I/D mixed, 1: I/D separated by SCAddr(17) */ -#define MIPS3_CONFIG_SS 0x00200000 +#define MIPS_CONFIG_SS 0x00200000 /* Secondary Cache line size */ -#define MIPS3_CONFIG_SB_MASK 0x00c00000 -#define MIPS3_CONFIG_SB_SHIFT 22 -#define MIPS3_CONFIG_CACHE_L2_LSIZE(config) \ - (0x10 << (((config) & MIPS3_CONFIG_SB_MASK) >> MIPS3_CONFIG_SB_SHIFT)) +#define MIPS_CONFIG_SB_MASK 0x00c00000 +#define MIPS_CONFIG_SB_SHIFT 22 +#define MIPS_CONFIG_CACHE_L2_LSIZE(config) \ + (0x10 << (((config) & MIPS_CONFIG_SB_MASK) >> MIPS_CONFIG_SB_SHIFT)) /* Write back data rate */ -#define MIPS3_CONFIG_EP_MASK 0x0f000000 -#define MIPS3_CONFIG_EP_SHIFT 24 +#define MIPS_CONFIG_EP_MASK 0x0f000000 +#define MIPS_CONFIG_EP_SHIFT 24 /* System clock ratio - this value is CPU dependent */ -#define MIPS3_CONFIG_EC_MASK 0x70000000 -#define MIPS3_CONFIG_EC_SHIFT 28 +#define MIPS_CONFIG_EC_MASK 0x70000000 +#define MIPS_CONFIG_EC_SHIFT 28 /* Master-Checker Mode - 1: enabled */ -#define MIPS3_CONFIG_CM 0x80000000 +#define MIPS_CONFIG_CM 0x80000000 /* * The bits in the MIPS4 config register. */ -/* kseg0 coherency algorithm - see MIPS3_TLB_ATTR values */ -#define MIPS4_CONFIG_K0_MASK MIPS3_CONFIG_K0_MASK -#define MIPS4_CONFIG_DN_MASK 0x00000018 /* Device number */ -#define MIPS4_CONFIG_CT 0x00000020 /* CohPrcReqTar */ -#define MIPS4_CONFIG_PE 0x00000040 /* PreElmReq */ -#define MIPS4_CONFIG_PM_MASK 0x00000180 /* PreReqMax */ -#define MIPS4_CONFIG_EC_MASK 0x00001e00 /* SysClkDiv */ -#define MIPS4_CONFIG_SB 0x00002000 /* SCBlkSize */ -#define MIPS4_CONFIG_SK 0x00004000 /* SCColEn */ -#define MIPS4_CONFIG_BE 0x00008000 /* MemEnd */ -#define MIPS4_CONFIG_SS_MASK 0x00070000 /* SCSize */ -#define MIPS4_CONFIG_SC_MASK 0x00380000 /* SCClkDiv */ -#define MIPS4_CONFIG_RESERVED 0x03c00000 /* Reserved wired 0 */ -#define MIPS4_CONFIG_DC_MASK 0x1c000000 /* Primary D-Cache size */ -#define MIPS4_CONFIG_IC_MASK 0xe0000000 /* Primary I-Cache size */ - -#define MIPS4_CONFIG_DC_SHIFT 26 -#define MIPS4_CONFIG_IC_SHIFT 29 - -#define MIPS4_CONFIG_CACHE_SIZE(config, mask, base, shift) \ - ((base) << (((config) & (mask)) >> (shift))) - -#define MIPS4_CONFIG_CACHE_L2_LSIZE(config) \ - (((config) & MIPS4_CONFIG_SB) ? 128 : 64) - /* * Location of exception vectors. * @@ -525,27 +399,16 @@ #define MIPS_UTLB_MISS_EXC_VEC ((intptr_t)(int32_t)0x80000000) /* - * MIPS-1 general exception vector (everything else) - */ -#define MIPS1_GEN_EXC_VEC ((intptr_t)(int32_t)0x80000080) - -/* * MIPS-III exception vectors */ -#define MIPS3_XTLB_MISS_EXC_VEC ((intptr_t)(int32_t)0x80000080) -#define MIPS3_CACHE_ERR_EXC_VEC ((intptr_t)(int32_t)0x80000100) -#define MIPS3_GEN_EXC_VEC ((intptr_t)(int32_t)0x80000180) - -/* - * TX79 (R5900) exception vectors - */ -#define MIPS_R5900_COUNTER_EXC_VEC 0x80000080 -#define MIPS_R5900_DEBUG_EXC_VEC 0x80000100 +#define MIPS_XTLB_MISS_EXC_VEC ((intptr_t)(int32_t)0x80000080) +#define MIPS_CACHE_ERR_EXC_VEC ((intptr_t)(int32_t)0x80000100) +#define MIPS_GEN_EXC_VEC ((intptr_t)(int32_t)0x80000180) /* * MIPS32/MIPS64 (and some MIPS3) dedicated interrupt vector. */ -#define MIPS3_INTR_EXC_VEC 0x80000200 +#define MIPS_INTR_EXC_VEC 0x80000200 /* * Coprocessor 0 registers: @@ -712,7 +575,7 @@ */ #define MIPS_MIN_CACHE_SIZE (16 * 1024) #define MIPS_MAX_CACHE_SIZE (256 * 1024) -#define MIPS3_MAX_PCACHE_SIZE (32 * 1024) /* max. primary cache size */ +#define MIPS_MAX_PCACHE_SIZE (32 * 1024) /* max. primary cache size */ /* * The floating point version and status registers. @@ -749,8 +612,7 @@ #define MIPS_FPU_EXCEPTION_UNIMPL 0x00020000 #define MIPS_FPU_COND_BIT 0x00800000 #define MIPS_FPU_FLUSH_BIT 0x01000000 /* r4k, MBZ on r3k */ -#define MIPS1_FPC_MBZ_BITS 0xff7c0000 -#define MIPS3_FPC_MBZ_BITS 0xfe7c0000 +#define MIPS_FPC_MBZ_BITS 0xfe7c0000 /* @@ -759,235 +621,4 @@ #define MIPS_OPCODE_SHIFT 26 #define MIPS_OPCODE_C1 0x11 - -/* - * The low part of the TLB entry. - */ -#define MIPS1_TLB_PFN 0xfffff000 -#define MIPS1_TLB_NON_CACHEABLE_BIT 0x00000800 -#define MIPS1_TLB_DIRTY_BIT 0x00000400 -#define MIPS1_TLB_VALID_BIT 0x00000200 -#define MIPS1_TLB_GLOBAL_BIT 0x00000100 - -#define MIPS3_TLB_PFN 0x3fffffc0 -#define MIPS3_TLB_ATTR_MASK 0x00000038 -#define MIPS3_TLB_ATTR_SHIFT 3 -#define MIPS3_TLB_DIRTY_BIT 0x00000004 -#define MIPS3_TLB_VALID_BIT 0x00000002 -#define MIPS3_TLB_GLOBAL_BIT 0x00000001 - -#define MIPS1_TLB_PHYS_PAGE_SHIFT 12 -#define MIPS3_TLB_PHYS_PAGE_SHIFT 6 -#define MIPS1_TLB_PF_NUM MIPS1_TLB_PFN -#define MIPS3_TLB_PF_NUM MIPS3_TLB_PFN -#define MIPS1_TLB_MOD_BIT MIPS1_TLB_DIRTY_BIT -#define MIPS3_TLB_MOD_BIT MIPS3_TLB_DIRTY_BIT - -/* - * MIPS3_TLB_ATTR values - coherency algorithm: - * 0: cacheable, noncoherent, write-through, no write allocate - * 1: cacheable, noncoherent, write-through, write allocate - * 2: uncached - * 3: cacheable, noncoherent, write-back (noncoherent) - * 4: cacheable, coherent, write-back, exclusive (exclusive) - * 5: cacheable, coherent, write-back, exclusive on write (sharable) - * 6: cacheable, coherent, write-back, update on write (update) - * 7: uncached, accelerated (gather STORE operations) - */ -#define MIPS3_TLB_ATTR_WT 0 /* IDT */ -#define MIPS3_TLB_ATTR_WT_WRITEALLOCATE 1 /* IDT */ -#define MIPS3_TLB_ATTR_UNCACHED 2 /* R4000/R4400, IDT */ -#define MIPS3_TLB_ATTR_WB_NONCOHERENT 3 /* R4000/R4400, IDT */ -#define MIPS3_TLB_ATTR_WB_EXCLUSIVE 4 /* R4000/R4400 */ -#define MIPS3_TLB_ATTR_WB_SHARABLE 5 /* R4000/R4400 */ -#define MIPS3_TLB_ATTR_WB_UPDATE 6 /* R4000/R4400 */ -#define MIPS4_TLB_ATTR_UNCACHED_ACCELERATED 7 /* R10000 */ - - -/* - * The high part of the TLB entry. - */ -#define MIPS1_TLB_VPN 0xfffff000 -#define MIPS1_TLB_PID 0x00000fc0 -#define MIPS1_TLB_PID_SHIFT 6 - -#define MIPS3_TLB_VPN2 0xffffe000 -#define MIPS3_TLB_ASID 0x000000ff - -#define MIPS1_TLB_VIRT_PAGE_NUM MIPS1_TLB_VPN -#define MIPS3_TLB_VIRT_PAGE_NUM MIPS3_TLB_VPN2 -#define MIPS3_TLB_PID MIPS3_TLB_ASID -#define MIPS_TLB_VIRT_PAGE_SHIFT 12 - -/* - * r3000: shift count to put the index in the right spot. - */ -#define MIPS1_TLB_INDEX_SHIFT 8 - -/* - * The first TLB that write random hits. - */ -#define MIPS1_TLB_FIRST_RAND_ENTRY 8 -#define MIPS3_TLB_WIRED_UPAGES 1 - -/* - * The number of process id entries. - */ -#define MIPS1_TLB_NUM_PIDS 64 -#define MIPS3_TLB_NUM_ASIDS 256 - -/* - * Patch codes to hide CPU design differences between MIPS1 and MIPS3. - */ - -/* XXX simonb: this is before MIPS3_PLUS is defined (and is ugly!) */ - -#if !(defined(MIPS3) || defined(MIPS4) || defined(MIPS32) || defined(MIPS64)) \ - && defined(MIPS1) /* XXX simonb must be neater! */ -#define MIPS_TLB_PID_SHIFT MIPS1_TLB_PID_SHIFT -#define MIPS_TLB_NUM_PIDS MIPS1_TLB_NUM_PIDS -#endif - -#if (defined(MIPS3) || defined(MIPS4) || defined(MIPS32) || defined(MIPS64)) \ - && !defined(MIPS1) /* XXX simonb must be neater! */ -#define MIPS_TLB_PID_SHIFT 0 -#define MIPS_TLB_NUM_PIDS MIPS3_TLB_NUM_ASIDS -#endif - - -#if !defined(MIPS_TLB_PID_SHIFT) -#define MIPS_TLB_PID_SHIFT \ - ((MIPS_HAS_R4K_MMU) ? 0 : MIPS1_TLB_PID_SHIFT) - -#define MIPS_TLB_NUM_PIDS \ - ((MIPS_HAS_R4K_MMU) ? MIPS3_TLB_NUM_ASIDS : MIPS1_TLB_NUM_PIDS) -#endif - -/* - * CPU processor revision IDs for company ID == 0 (non mips32/64 chips) - */ -#define MIPS_R2000 0x01 /* MIPS R2000 ISA I */ -#define MIPS_R3000 0x02 /* MIPS R3000 ISA I */ -#define MIPS_R6000 0x03 /* MIPS R6000 ISA II */ -#define MIPS_R4000 0x04 /* MIPS R4000/R4400 ISA III */ -#define MIPS_R3LSI 0x05 /* LSI Logic R3000 derivative ISA I */ -#define MIPS_R6000A 0x06 /* MIPS R6000A ISA II */ -#define MIPS_R3IDT 0x07 /* IDT R3041 or RC36100 ISA I */ -#define MIPS_R10000 0x09 /* MIPS R10000 ISA IV */ -#define MIPS_R4200 0x0a /* NEC VR4200 ISA III */ -#define MIPS_R4300 0x0b /* NEC VR4300 ISA III */ -#define MIPS_R4100 0x0c /* NEC VR4100 ISA III */ -#define MIPS_R12000 0x0e /* MIPS R12000 ISA IV */ -#define MIPS_R14000 0x0f /* MIPS R14000 ISA IV */ -#define MIPS_R8000 0x10 /* MIPS R8000 Blackbird/TFP ISA IV */ -#define MIPS_RC32300 0x18 /* IDT RC32334,332,355 ISA 32 */ -#define MIPS_R4600 0x20 /* QED R4600 Orion ISA III */ -#define MIPS_R4700 0x21 /* QED R4700 Orion ISA III */ -#define MIPS_R3SONY 0x21 /* Sony R3000 based ISA I */ -#define MIPS_R4650 0x22 /* QED R4650 ISA III */ -#define MIPS_TX3900 0x22 /* Toshiba TX39 family ISA I */ -#define MIPS_R5000 0x23 /* MIPS R5000 ISA IV */ -#define MIPS_R3NKK 0x23 /* NKK R3000 based ISA I */ -#define MIPS_RC32364 0x26 /* IDT RC32364 ISA 32 */ -#define MIPS_RM7000 0x27 /* QED RM7000 ISA IV */ -#define MIPS_RM5200 0x28 /* QED RM5200s ISA IV */ -#define MIPS_TX4900 0x2d /* Toshiba TX49 family ISA III */ -#define MIPS_R5900 0x2e /* Toshiba R5900 (EECore) ISA --- */ -#define MIPS_RC64470 0x30 /* IDT RC64474/RC64475 ISA III */ -#define MIPS_TX7900 0x38 /* Toshiba TX79 ISA III+*/ -#define MIPS_R5400 0x54 /* NEC VR5400 ISA IV */ -#define MIPS_R5500 0x55 /* NEC VR5500 ISA IV */ - -/* - * CPU revision IDs for some prehistoric processors. - */ - -/* For MIPS_R3000 */ -#define MIPS_REV_R3000 0x20 -#define MIPS_REV_R3000A 0x30 - -/* For MIPS_TX3900 */ -#define MIPS_REV_TX3912 0x10 -#define MIPS_REV_TX3922 0x30 -#define MIPS_REV_TX3927 0x40 - -/* For MIPS_R4000 */ -#define MIPS_REV_R4000_A 0x00 -#define MIPS_REV_R4000_B 0x22 -#define MIPS_REV_R4000_C 0x30 -#define MIPS_REV_R4400_A 0x40 -#define MIPS_REV_R4400_B 0x50 -#define MIPS_REV_R4400_C 0x60 - -/* For MIPS_TX4900 */ -#define MIPS_REV_TX4927 0x22 - -/* - * CPU processor revision IDs for company ID == 1 (MIPS) - */ -#define MIPS_4Kc 0x80 /* MIPS 4Kc ISA 32 */ -#define MIPS_5Kc 0x81 /* MIPS 5Kc ISA 64 */ -#define MIPS_20Kc 0x82 /* MIPS 20Kc ISA 64 */ -#define MIPS_4Kmp 0x83 /* MIPS 4Km/4Kp ISA 32 */ -#define MIPS_4KEc 0x84 /* MIPS 4KEc ISA 32 */ -#define MIPS_4KEmp 0x85 /* MIPS 4KEm/4KEp ISA 32 */ -#define MIPS_4KSc 0x86 /* MIPS 4KSc ISA 32 */ -#define MIPS_M4K 0x87 /* MIPS M4K ISA 32 Rel 2 */ -#define MIPS_25Kf 0x88 /* MIPS 25Kf ISA 64 */ -#define MIPS_5KE 0x89 /* MIPS 5KE ISA 64 Rel 2 */ -#define MIPS_4KEc_R2 0x90 /* MIPS 4KEc_R2 ISA 32 Rel 2 */ -#define MIPS_4KEmp_R2 0x91 /* MIPS 4KEm/4KEp_R2 ISA 32 Rel 2 */ -#define MIPS_4KSd 0x92 /* MIPS 4KSd ISA 32 Rel 2 */ -#define MIPS_24K 0x93 /* MIPS 24Kc/24Kf ISA 32 Rel 2 */ -#define MIPS_34K 0x95 /* MIPS 34K ISA 32 R2 MT */ -#define MIPS_24KE 0x96 /* MIPS 24KEc ISA 32 Rel 2 */ -#define MIPS_74K 0x97 /* MIPS 74Kc/74Kf ISA 32 Rel 2 */ - -/* - * AMD (company ID 3) use the processor ID field to donote the CPU core - * revision and the company options field do donate the SOC chip type. - */ - -/* CPU processor revision IDs */ -#define MIPS_AU_REV1 0x01 /* Alchemy Au1000 (Rev 1) ISA 32 */ -#define MIPS_AU_REV2 0x02 /* Alchemy Au1000 (Rev 2) ISA 32 */ - -/* CPU company options IDs */ -#define MIPS_AU1000 0x00 -#define MIPS_AU1500 0x01 -#define MIPS_AU1100 0x02 -#define MIPS_AU1550 0x03 - -/* - * CPU processor revision IDs for company ID == 4 (Broadcom) - */ -#define MIPS_SB1 0x01 /* SiByte SB1 ISA 64 */ - -/* - * CPU processor revision IDs for company ID == 5 (SandCraft) - */ -#define MIPS_SR7100 0x04 /* SandCraft SR7100 ISA 64 */ - -/* - * FPU processor revision ID - */ -#define MIPS_SOFT 0x00 /* Software emulation ISA I */ -#define MIPS_R2360 0x01 /* MIPS R2360 FPC ISA I */ -#define MIPS_R2010 0x02 /* MIPS R2010 FPC ISA I */ -#define MIPS_R3010 0x03 /* MIPS R3010 FPC ISA I */ -#define MIPS_R6010 0x04 /* MIPS R6010 FPC ISA II */ -#define MIPS_R4010 0x05 /* MIPS R4010 FPC ISA II */ -#define MIPS_R31LSI 0x06 /* LSI Logic derivate ISA I */ -#define MIPS_R3TOSH 0x22 /* Toshiba R3000 based FPU ISA I */ - -#ifdef ENABLE_MIPS_TX3900 -#include -#endif -#ifdef MIPS3_5900 -#include -#endif -#ifdef MIPS64_SB1 -#include -#endif - #endif /* _MIPS_CPUREGS_H_ */ Modified: head/sys/mips/include/locore.h ============================================================================== --- head/sys/mips/include/locore.h Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/include/locore.h Tue Mar 6 19:01:32 2012 (r232615) @@ -34,7 +34,6 @@ /* * CPU identification, from PRID register. */ -typedef int mips_prid_t; #define MIPS_PRID_REV(x) (((x) >> 0) & 0x00ff) #define MIPS_PRID_IMPL(x) (((x) >> 8) & 0x00ff) @@ -62,9 +61,4 @@ typedef int mips_prid_t; #define MIPS_PRID_CID_CAVIUM 0x0d /* Cavium */ #define MIPS_PRID_COPTS(x) (((x) >> 24) & 0x00ff) /* Company Options */ -#ifdef _KERNEL -#ifdef __HAVE_MIPS_MACHDEP_CACHE_CONFIG -void mips_machdep_cache_config(void); -#endif -#endif /* _KERNEL */ #endif /* _MIPS_LOCORE_H */ Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/mips/cpu.c Tue Mar 6 19:01:32 2012 (r232615) @@ -96,7 +96,7 @@ mips_get_identity(struct mips_cpuinfo *c cpuinfo->icache_virtual = cfg0 & MIPS_CONFIG0_VI; /* If config register selection 1 does not exist, exit. */ - if (!(cfg0 & MIPS3_CONFIG_CM)) + if (!(cfg0 & MIPS_CONFIG_CM)) return; /* Learn TLB size and L1 cache geometry. */ @@ -274,7 +274,7 @@ cpu_identify(void) cfg0 = mips_rd_config(); /* If config register selection 1 does not exist, exit. */ - if (!(cfg0 & MIPS3_CONFIG_CM)) + if (!(cfg0 & MIPS_CONFIG_CM)) return; cfg1 = mips_rd_config1(); @@ -282,7 +282,7 @@ cpu_identify(void) "\20\7COP2\6MDMX\5PerfCount\4WatchRegs\3MIPS16\2EJTAG\1FPU"); /* If config register selection 2 does not exist, exit. */ - if (!(cfg1 & MIPS3_CONFIG_CM)) + if (!(cfg1 & MIPS_CONFIG_CM)) return; cfg2 = mips_rd_config2(); /* @@ -291,7 +291,7 @@ cpu_identify(void) */ /* If config register selection 3 does not exist, exit. */ - if (!(cfg2 & MIPS3_CONFIG_CM)) + if (!(cfg2 & MIPS_CONFIG_CM)) return; cfg3 = mips_rd_config3(); Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/mips/exception.S Tue Mar 6 19:01:32 2012 (r232615) @@ -166,7 +166,7 @@ VECTOR(MipsException, unknown) # sneaky but the bits are # with us........ sll k0, k0, 3 # shift user bit for cause index - and k1, k1, MIPS3_CR_EXC_CODE # Mask out the cause bits. + and k1, k1, MIPS_CR_EXC_CODE # Mask out the cause bits. or k1, k1, k0 # change index to user table #if defined(__mips_n64) PTR_SLL k1, k1, 1 # shift to get 8-byte offset @@ -467,7 +467,7 @@ NNON_LEAF(MipsUserGenException, CALLFRAM REG_S a3, CALLFRAME_RA(sp) # for debugging PTR_LA gp, _C_LABEL(_gp) # switch to kernel GP # Turn off fpu and enter kernel mode - and t0, a0, ~(MIPS_SR_COP_1_BIT | MIPS_SR_EXL | MIPS3_SR_KSU_MASK | MIPS_SR_INT_IE) + and t0, a0, ~(MIPS_SR_COP_1_BIT | MIPS_SR_EXL | MIPS_SR_KSU_MASK | MIPS_SR_INT_IE) #if defined(CPU_CNMIPS) and t0, t0, ~(MIPS_SR_COP_2_BIT) or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX | MIPS_SR_PX) @@ -726,7 +726,7 @@ NNON_LEAF(MipsUserIntr, CALLFRAME_SIZ, r PTR_LA gp, _C_LABEL(_gp) # switch to kernel GP # Turn off fpu, disable interrupts, set kernel mode kernel mode, clear exception level. - and t0, a0, ~(MIPS_SR_COP_1_BIT | MIPS_SR_EXL | MIPS_SR_INT_IE | MIPS3_SR_KSU_MASK) + and t0, a0, ~(MIPS_SR_COP_1_BIT | MIPS_SR_EXL | MIPS_SR_INT_IE | MIPS_SR_KSU_MASK) #ifdef CPU_CNMIPS and t0, t0, ~(MIPS_SR_COP_2_BIT) or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX | MIPS_SR_PX) Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/mips/locore.S Tue Mar 6 19:01:32 2012 (r232615) @@ -98,20 +98,20 @@ VECTOR(_locore, unknown) li t1, (MIPS_SR_COP_0_BIT | MIPS_SR_PX | MIPS_SR_KX | MIPS_SR_UX | MIPS_SR_SX | MIPS_SR_BEV) /* Reset these bits */ - li t0, ~(MIPS_SR_DE | MIPS_SR_SOFT_RESET | MIPS_SR_ERL | MIPS_SR_EXL | MIPS_SR_INT_IE | MIPS_SR_COP_2_BIT) + li t0, ~(MIPS_SR_DE | MIPS_SR_SR | MIPS_SR_ERL | MIPS_SR_EXL | MIPS_SR_INT_IE | MIPS_SR_COP_2_BIT) #elif defined (CPU_RMI) || defined (CPU_NLM) /* Set these bits */ li t1, (MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT | MIPS_SR_KX | MIPS_SR_UX) /* Reset these bits */ - li t0, ~(MIPS_SR_BEV | MIPS_SR_SOFT_RESET | MIPS_SR_INT_IE) + li t0, ~(MIPS_SR_BEV | MIPS_SR_SR | MIPS_SR_INT_IE) #else /* * t0: Bits to preserve if set: * Soft reset * Boot exception vectors (firmware-provided) */ - li t0, (MIPS_SR_BEV | MIPS_SR_SOFT_RESET) + li t0, (MIPS_SR_BEV | MIPS_SR_SR) /* * t1: Bits to set explicitly: * Enable FPU Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/mips/machdep.c Tue Mar 6 19:01:32 2012 (r232615) @@ -349,14 +349,14 @@ mips_vector_init(void) #if defined(CPU_CNMIPS) || defined(CPU_RMI) || defined(CPU_NLM) /* Fake, but sufficient, for the 32-bit with 64-bit hardware addresses */ - bcopy(MipsTLBMiss, (void *)MIPS3_XTLB_MISS_EXC_VEC, + bcopy(MipsTLBMiss, (void *)MIPS_XTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); #endif - bcopy(MipsException, (void *)MIPS3_GEN_EXC_VEC, + bcopy(MipsException, (void *)MIPS_GEN_EXC_VEC, MipsExceptionEnd - MipsException); - bcopy(MipsCache, (void *)MIPS3_CACHE_ERR_EXC_VEC, + bcopy(MipsCache, (void *)MIPS_CACHE_ERR_EXC_VEC, MipsCacheEnd - MipsCache); /* @@ -406,7 +406,7 @@ mips_postboot_fixup(void) void mips_generic_reset() { - ((void(*)(void))(intptr_t)MIPS_VEC_RESET)(); + ((void(*)(void))MIPS_RESET_EXC_VEC)(); } #ifdef SMP Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/mips/support.S Tue Mar 6 19:01:32 2012 (r232615) @@ -793,12 +793,6 @@ LEAF(memset) PTR_ADDU t0, t0, a0 # compute ending address 2: PTR_ADDU a0, a0, 4 # clear words -#ifdef MIPS3_5900 - nop - nop - nop - nop -#endif bne a0, t0, 2b # unrolling loop does not help sw t1, -4(a0) # since we are limited by memory speed @@ -807,12 +801,6 @@ memsetsmallclr: PTR_ADDU t0, a2, a0 # compute ending address 1: PTR_ADDU a0, a0, 1 # clear bytes -#ifdef MIPS3_5900 - nop - nop - nop - nop -#endif bne a0, t0, 1b sb a1, -1(a0) 2: Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/mips/trap.c Tue Mar 6 19:01:32 2012 (r232615) @@ -458,7 +458,7 @@ trap(struct trapframe *trapframe) trapdebug_enter(trapframe, 0); - type = (trapframe->cause & MIPS3_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT; + type = (trapframe->cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT; if (TRAPF_USERMODE(trapframe)) { type |= T_USER; usermode = 1; @@ -1046,7 +1046,7 @@ trapDump(char *msg) break; printf("%s: ADR %jx PC %jx CR %jx SR %jx\n", - trap_type[(trp->cause & MIPS3_CR_EXC_CODE) >> + trap_type[(trp->cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT], (intmax_t)trp->vadr, (intmax_t)trp->pc, (intmax_t)trp->cause, (intmax_t)trp->status); Modified: head/sys/mips/sibyte/sb_machdep.c ============================================================================== --- head/sys/mips/sibyte/sb_machdep.c Tue Mar 6 18:44:52 2012 (r232614) +++ head/sys/mips/sibyte/sb_machdep.c Tue Mar 6 19:01:32 2012 (r232615) @@ -253,7 +253,7 @@ mips_init(void) * code to the XTLB exception vector. */ { - bcopy(MipsTLBMiss, (void *)MIPS3_XTLB_MISS_EXC_VEC, + bcopy(MipsTLBMiss, (void *)MIPS_XTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); mips_icache_sync_all(); @@ -314,7 +314,7 @@ kseg0_map_coherent(void) const int CFG_K0_COHERENT = 5; config = mips_rd_config(); - config &= ~MIPS3_CONFIG_K0_MASK; + config &= ~MIPS_CONFIG_K0_MASK; config |= CFG_K0_COHERENT; mips_wr_config(config); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 19:19:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E49E106564A; Tue, 6 Mar 2012 19:19:34 +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 152D68FC0A; Tue, 6 Mar 2012 19:19: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 q26JJX6T053870; Tue, 6 Mar 2012 19:19:33 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26JJX2m053868; Tue, 6 Mar 2012 19:19:33 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203061919.q26JJX2m053868@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 19:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232616 - head/lib/csu/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 19:19:34 -0000 Author: gonzo Date: Tue Mar 6 19:19:33 2012 New Revision: 232616 URL: http://svn.freebsd.org/changeset/base/232616 Log: - Remove one more no-op #ifndef Modified: head/lib/csu/mips/crt1.c Modified: head/lib/csu/mips/crt1.c ============================================================================== --- head/lib/csu/mips/crt1.c Tue Mar 6 19:01:32 2012 (r232615) +++ head/lib/csu/mips/crt1.c Tue Mar 6 19:19:33 2012 (r232616) @@ -101,9 +101,7 @@ __start(char **ap, #ifdef GCRT monstartup(&eprol, &etext); #endif -#ifndef NOGPREL _init(); -#endif exit( main(argc, argv, env) ); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 20:01:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8500B1065672; Tue, 6 Mar 2012 20:01:26 +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 72D1D8FC08; Tue, 6 Mar 2012 20:01: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 q26K1QRA055255; Tue, 6 Mar 2012 20:01:26 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26K1Q7R055245; Tue, 6 Mar 2012 20:01:26 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201203062001.q26K1Q7R055245@svn.freebsd.org> From: Attilio Rao Date: Tue, 6 Mar 2012 20:01: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: r232619 - in head: . sys/amd64/conf sys/arm/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/pc98/conf sys/powerpc/conf sys/sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 20:01:26 -0000 Author: attilio Date: Tue Mar 6 20:01:25 2012 New Revision: 232619 URL: http://svn.freebsd.org/changeset/base/232619 Log: Disable the option VFS_ALLOW_NONMPSAFE by default on all the supported platforms. This will make every attempt to mount a non-mpsafe filesystem to the kernel forbidden, unless it is expressely compiled with VFS_ALLOW_NONMPSAFE option. This patch is part of the effort of killing non-MPSAFE filesystems from the tree. No MFC is expected for this patch. Modified: head/UPDATING head/sys/amd64/conf/DEFAULTS head/sys/arm/conf/DEFAULTS head/sys/i386/conf/DEFAULTS head/sys/ia64/conf/DEFAULTS head/sys/mips/conf/DEFAULTS head/sys/pc98/conf/DEFAULTS head/sys/powerpc/conf/DEFAULTS head/sys/sparc64/conf/DEFAULTS Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Mar 6 19:46:57 2012 (r232618) +++ head/UPDATING Tue Mar 6 20:01:25 2012 (r232619) @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20120306: + Disable by default the option VFS_ALLOW_NONMPSAFE for all supported + platforms. + 20120229: Now unix domain sockets behave "as expected" on nullfs(5). Previously nullfs(5) did not pass through all behaviours to the underlying layer, Modified: head/sys/amd64/conf/DEFAULTS ============================================================================== --- head/sys/amd64/conf/DEFAULTS Tue Mar 6 19:46:57 2012 (r232618) +++ head/sys/amd64/conf/DEFAULTS Tue Mar 6 20:01:25 2012 (r232619) @@ -22,6 +22,3 @@ options GEOM_PART_EBR_COMPAT options GEOM_PART_MBR options NEW_PCIB - -# Allow mounting non-MPSAFE filesystems -options VFS_ALLOW_NONMPSAFE Modified: head/sys/arm/conf/DEFAULTS ============================================================================== --- head/sys/arm/conf/DEFAULTS Tue Mar 6 19:46:57 2012 (r232618) +++ head/sys/arm/conf/DEFAULTS Tue Mar 6 20:01:25 2012 (r232619) @@ -9,5 +9,3 @@ device mem options GEOM_PART_BSD options GEOM_PART_MBR - -options VFS_ALLOW_NONMPSAFE Modified: head/sys/i386/conf/DEFAULTS ============================================================================== --- head/sys/i386/conf/DEFAULTS Tue Mar 6 19:46:57 2012 (r232618) +++ head/sys/i386/conf/DEFAULTS Tue Mar 6 20:01:25 2012 (r232619) @@ -30,6 +30,3 @@ options NATIVE device atpic options NEW_PCIB - -# Allow mounting non-MPSAFE filesystems -options VFS_ALLOW_NONMPSAFE Modified: head/sys/ia64/conf/DEFAULTS ============================================================================== --- head/sys/ia64/conf/DEFAULTS Tue Mar 6 19:46:57 2012 (r232618) +++ head/sys/ia64/conf/DEFAULTS Tue Mar 6 20:01:25 2012 (r232619) @@ -20,6 +20,3 @@ options GEOM_PART_GPT options GEOM_PART_MBR options NEW_PCIB - -# Allow mounting non-MPSAFE filesystems -options VFS_ALLOW_NONMPSAFE Modified: head/sys/mips/conf/DEFAULTS ============================================================================== --- head/sys/mips/conf/DEFAULTS Tue Mar 6 19:46:57 2012 (r232618) +++ head/sys/mips/conf/DEFAULTS Tue Mar 6 20:01:25 2012 (r232619) @@ -9,5 +9,3 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_MBR - -options VFS_ALLOW_NONMPSAFE Modified: head/sys/pc98/conf/DEFAULTS ============================================================================== --- head/sys/pc98/conf/DEFAULTS Tue Mar 6 19:46:57 2012 (r232618) +++ head/sys/pc98/conf/DEFAULTS Tue Mar 6 20:01:25 2012 (r232619) @@ -29,6 +29,3 @@ options GEOM_PART_PC98 device atpic options NEW_PCIB - -# Allow mounting non-MPSAFE filesystems -options VFS_ALLOW_NONMPSAFE Modified: head/sys/powerpc/conf/DEFAULTS ============================================================================== --- head/sys/powerpc/conf/DEFAULTS Tue Mar 6 19:46:57 2012 (r232618) +++ head/sys/powerpc/conf/DEFAULTS Tue Mar 6 20:01:25 2012 (r232619) @@ -14,6 +14,3 @@ options GEOM_PART_APM options GEOM_PART_MBR options NEW_PCIB - -# Allow mounting non-MPSAFE filesystems -options VFS_ALLOW_NONMPSAFE Modified: head/sys/sparc64/conf/DEFAULTS ============================================================================== --- head/sys/sparc64/conf/DEFAULTS Tue Mar 6 19:46:57 2012 (r232618) +++ head/sys/sparc64/conf/DEFAULTS Tue Mar 6 20:01:25 2012 (r232619) @@ -21,6 +21,3 @@ options GEOM_PART_VTOC8 options SUNKBD_EMULATE_ATKBD options NEW_PCIB - -# Allow mounting non-MPSAFE filesystems -options VFS_ALLOW_NONMPSAFE From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 20:15:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4371B1065672; Tue, 6 Mar 2012 20:15:24 +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 332F98FC0A; Tue, 6 Mar 2012 20:15: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 q26KFOD9055746; Tue, 6 Mar 2012 20:15:24 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26KFNJA055743; Tue, 6 Mar 2012 20:15:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203062015.q26KFNJA055743@svn.freebsd.org> From: Dimitry Andric Date: Tue, 6 Mar 2012 20:15: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: r232620 - in head/include: . xlocale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 20:15:24 -0000 Author: dim Date: Tue Mar 6 20:15:23 2012 New Revision: 232620 URL: http://svn.freebsd.org/changeset/base/232620 Log: After r232498, programs built with -ansi or -std=c89 including would not compile anymore, due to plain 'inline' keywords. Fix this by using __inline instead. Reported by: Jia-Shiun Li Discussed with: theraven Modified: head/include/runetype.h head/include/xlocale/_ctype.h Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Tue Mar 6 20:01:25 2012 (r232619) +++ head/include/runetype.h Tue Mar 6 20:15:23 2012 (r232620) @@ -90,7 +90,7 @@ extern const _RuneLocale *_CurrentRuneLo extern const _RuneLocale *__getCurrentRuneLocale(void); #else extern _Thread_local const _RuneLocale *_ThreadRuneLocale; -static inline const _RuneLocale *__getCurrentRuneLocale(void) +static __inline const _RuneLocale *__getCurrentRuneLocale(void) { if (_ThreadRuneLocale) Modified: head/include/xlocale/_ctype.h ============================================================================== --- head/include/xlocale/_ctype.h Tue Mar 6 20:01:25 2012 (r232619) +++ head/include/xlocale/_ctype.h Tue Mar 6 20:15:23 2012 (r232620) @@ -55,11 +55,11 @@ _RuneLocale *__runes_for_locale(locale_t #ifndef _XLOCALE_INLINE #if __GNUC__ && !__GNUC_STDC_INLINE__ /* GNU89 inline has nonstandard semantics. */ -#define _XLOCALE_INLINE extern inline +#define _XLOCALE_INLINE extern __inline #else /* Hack to work around people who define inline away */ #ifdef inline -#define _XLOCALE_INLINE __inline static +#define _XLOCALE_INLINE static __inline #else /* Define with C++ / C99 compatible semantics */ #define _XLOCALE_INLINE inline From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 20:23:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6AA481065674; Tue, 6 Mar 2012 20:23:30 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4153C8FC16; Tue, 6 Mar 2012 20:23: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 q26KNUo9056051; Tue, 6 Mar 2012 20:23:30 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26KNUGp056050; Tue, 6 Mar 2012 20:23:30 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203062023.q26KNUGp056050@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 20:23: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: r232621 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 20:23:30 -0000 Author: jmallett Date: Tue Mar 6 20:23:29 2012 New Revision: 232621 URL: http://svn.freebsd.org/changeset/base/232621 Log: Remove unused file. Deleted: head/sys/mips/mips/elf64_machdep.c From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 20:45:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DD37106566B; Tue, 6 Mar 2012 20:45:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DA9A8FC1C; Tue, 6 Mar 2012 20:45: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 q26KjD5l056869; Tue, 6 Mar 2012 20:45:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26KjDR8056867; Tue, 6 Mar 2012 20:45:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203062045.q26KjDR8056867@svn.freebsd.org> From: John Baldwin Date: Tue, 6 Mar 2012 20:45: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: r232623 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 20:45:14 -0000 Author: jhb Date: Tue Mar 6 20:45:13 2012 New Revision: 232623 URL: http://svn.freebsd.org/changeset/base/232623 Log: Add a note to clarify why we create a relocated copy of boot1 in lower memory. Modified: head/sys/boot/i386/boot2/boot1.S Modified: head/sys/boot/i386/boot2/boot1.S ============================================================================== --- head/sys/boot/i386/boot2/boot1.S Tue Mar 6 20:37:06 2012 (r232622) +++ head/sys/boot/i386/boot2/boot1.S Tue Mar 6 20:45:13 2012 (r232623) @@ -125,7 +125,10 @@ main: cld # String ops inc mov $start,%sp # stack /* * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets - * %cx == 0x100. + * %cx == 0x100. Note that boot1 does not use this relocated copy + * of itself while loading boot2; however, BTX reclaims the memory + * used by boot1 during its initialization. As a result, boot2 uses + * xread from the relocated copy. */ mov %sp,%si # Source mov $MEM_REL,%di # Destination From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 21:20:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 151E7106566C; Tue, 6 Mar 2012 21:20:17 +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 03F7B8FC21; Tue, 6 Mar 2012 21:20: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 q26LKGNJ058100; Tue, 6 Mar 2012 21:20:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26LKGUr058096; Tue, 6 Mar 2012 21:20:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203062120.q26LKGUr058096@svn.freebsd.org> From: Adrian Chadd Date: Tue, 6 Mar 2012 21:20: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: r232625 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 21:20:17 -0000 Author: adrian Date: Tue Mar 6 21:20:16 2012 New Revision: 232625 URL: http://svn.freebsd.org/changeset/base/232625 Log: Modify HWMP to be able to allocate memory for PREQ/PREP/PERR for all scenarios. * Added verify_mesh_*_len functions that verify the length according to the amendment spec and return number of destination addresses for allocation of appropriate struct size in memory; * Modified hwmp_recv_action_meshpath to allocate HWMP ie instead of storing them on the stack and store all available field according the flags; * Modify hwmp_add_mesh* to work with all cases of HWMP according to amendment. * Modify hwmp_send_* to calculate correct len of bytes for the HWMP ie. * Added new M_80211_MESH_* malloc defines. * Added macros with magic numbers for HWMP ie sizes according to amendment. * Added the external address to all HWMP ie structs. Submitted by: monthadar@gmail.com Modified: head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Tue Mar 6 21:13:12 2012 (r232624) +++ head/sys/net80211/ieee80211_hwmp.c Tue Mar 6 21:20:16 2012 (r232625) @@ -279,17 +279,114 @@ hwmp_newstate(struct ieee80211vap *vap, return 0; } +/* + * Verify the length of an HWMP PREQ and return the number + * of destinations >= 1, if verification fails -1 is returned. + */ +static int +verify_mesh_preq_len(struct ieee80211vap *vap, + const struct ieee80211_frame *wh, const uint8_t *iefrm) +{ + int alloc_sz = -1; + int ndest = -1; + if (iefrm[2] & IEEE80211_MESHPREQ_FLAGS_AE) { + /* Originator External Address present */ + alloc_sz = IEEE80211_MESHPREQ_BASE_SZ_AE; + ndest = iefrm[IEEE80211_MESHPREQ_TCNT_OFFSET_AE]; + } else { + /* w/o Originator External Address */ + alloc_sz = IEEE80211_MESHPREQ_BASE_SZ; + ndest = iefrm[IEEE80211_MESHPREQ_TCNT_OFFSET]; + } + alloc_sz += ndest * IEEE80211_MESHPREQ_TRGT_SZ; + + if(iefrm[1] != (alloc_sz)) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, + wh, NULL, "PREQ (AE=%s) with wrong len", + iefrm[2] & IEEE80211_MESHPREQ_FLAGS_AE ? "1" : "0"); + return (-1); + } + return ndest; +} + +/* + * Verify the length of an HWMP PREP and returns 1 on success, + * otherwise -1. + */ +static int +verify_mesh_prep_len(struct ieee80211vap *vap, + const struct ieee80211_frame *wh, const uint8_t *iefrm) +{ + int alloc_sz = -1; + if (iefrm[2] & IEEE80211_MESHPREP_FLAGS_AE) { + if (iefrm[1] == IEEE80211_MESHPREP_BASE_SZ_AE) + alloc_sz = IEEE80211_MESHPREP_BASE_SZ_AE; + } else if (iefrm[1] == IEEE80211_MESHPREP_BASE_SZ) + alloc_sz = IEEE80211_MESHPREP_BASE_SZ; + if(alloc_sz < 0) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, + wh, NULL, "PREP (AE=%s) with wrong len", + iefrm[2] & IEEE80211_MESHPREP_FLAGS_AE ? "1" : "0"); + return (-1); + } + return (1); +} + +/* + * Verify the length of an HWMP PERR and return the number + * of destinations >= 1, if verification fails -1 is returned. + */ +static int +verify_mesh_perr_len(struct ieee80211vap *vap, + const struct ieee80211_frame *wh, const uint8_t *iefrm) +{ + int alloc_sz = -1; + const uint8_t *iefrm_t = iefrm; + uint8_t ndest = iefrm_t[IEEE80211_MESHPERR_NDEST_OFFSET]; + int i; + + if(ndest > IEEE80211_MESHPERR_MAXDEST) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, + wh, NULL, "PERR with wrong number of destionat (>19), %u", + ndest); + return (-1); + } + + iefrm_t += IEEE80211_MESHPERR_NDEST_OFFSET + 1; /* flag is next field */ + /* We need to check each destionation flag to know size */ + for(i = 0; ini_vap; - struct ieee80211_meshpreq_ie preq; - struct ieee80211_meshprep_ie prep; - struct ieee80211_meshperr_ie perr; + struct ieee80211_meshpreq_ie *preq; + struct ieee80211_meshprep_ie *prep; + struct ieee80211_meshperr_ie *perr; struct ieee80211_meshrann_ie rann; const uint8_t *iefrm = frm + 2; /* action + code */ + const uint8_t *iefrm_t = iefrm; /* temporary pointer */ + int ndest = -1; int found = 0; while (efrm - iefrm > 1) { @@ -297,66 +394,132 @@ hwmp_recv_action_meshpath(struct ieee802 switch (*iefrm) { case IEEE80211_ELEMID_MESHPREQ: { - const struct ieee80211_meshpreq_ie *mpreq = - (const struct ieee80211_meshpreq_ie *) iefrm; - /* XXX > 1 target */ - if (mpreq->preq_len != - sizeof(struct ieee80211_meshpreq_ie) - 2) { - IEEE80211_DISCARD(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, - wh, NULL, "%s", "PREQ with wrong len"); + int i = 0; + + iefrm_t = iefrm; + ndest = verify_mesh_preq_len(vap, wh, iefrm_t); + if (ndest < 0) { vap->iv_stats.is_rx_mgtdiscard++; break; } - memcpy(&preq, mpreq, sizeof(preq)); - preq.preq_id = LE_READ_4(&mpreq->preq_id); - preq.preq_origseq = LE_READ_4(&mpreq->preq_origseq); - preq.preq_lifetime = LE_READ_4(&mpreq->preq_lifetime); - preq.preq_metric = LE_READ_4(&mpreq->preq_metric); - preq.preq_targets[0].target_seq = - LE_READ_4(&mpreq->preq_targets[0].target_seq); - hwmp_recv_preq(vap, ni, wh, &preq); + preq = malloc(sizeof(*preq) + + (ndest - 1) * sizeof(*preq->preq_targets), + M_80211_MESH_PREQ, M_NOWAIT | M_ZERO); + KASSERT(preq != NULL, ("preq == NULL")); + + preq->preq_ie = *iefrm_t++; + preq->preq_len = *iefrm_t++; + preq->preq_flags = *iefrm_t++; + preq->preq_hopcount = *iefrm_t++; + preq->preq_ttl = *iefrm_t++; + preq->preq_id = LE_READ_4(iefrm_t); iefrm_t += 4; + IEEE80211_ADDR_COPY(preq->preq_origaddr, iefrm_t); + iefrm_t += 6; + preq->preq_origseq = LE_READ_4(iefrm_t); iefrm_t += 4; + /* NB: may have Originator Proxied Address */ + if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE) { + IEEE80211_ADDR_COPY( + preq->preq_orig_ext_addr, iefrm_t); + iefrm_t += 6; + } + preq->preq_lifetime = LE_READ_4(iefrm_t); iefrm_t += 4; + preq->preq_metric = LE_READ_4(iefrm_t); iefrm_t += 4; + preq->preq_tcount = *iefrm_t++; + + for (i = 0; i < preq->preq_tcount; i++) { + preq->preq_targets[i].target_flags = *iefrm_t++; + IEEE80211_ADDR_COPY( + preq->preq_targets[i].target_addr, iefrm_t); + iefrm_t += 6; + preq->preq_targets[i].target_seq = + LE_READ_4(iefrm_t); + iefrm_t += 4; + } + + hwmp_recv_preq(vap, ni, wh, preq); + free(preq, M_80211_MESH_PREQ); found++; - break; + break; } case IEEE80211_ELEMID_MESHPREP: { - const struct ieee80211_meshprep_ie *mprep = - (const struct ieee80211_meshprep_ie *) iefrm; - if (mprep->prep_len != - sizeof(struct ieee80211_meshprep_ie) - 2) { - IEEE80211_DISCARD(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, - wh, NULL, "%s", "PREP with wrong len"); + iefrm_t = iefrm; + ndest = verify_mesh_prep_len(vap, wh, iefrm_t); + if (ndest < 0) { vap->iv_stats.is_rx_mgtdiscard++; break; } - memcpy(&prep, mprep, sizeof(prep)); - prep.prep_targetseq = LE_READ_4(&mprep->prep_targetseq); - prep.prep_lifetime = LE_READ_4(&mprep->prep_lifetime); - prep.prep_metric = LE_READ_4(&mprep->prep_metric); - prep.prep_origseq = LE_READ_4(&mprep->prep_origseq); - hwmp_recv_prep(vap, ni, wh, &prep); + prep = malloc(sizeof(*prep), + M_80211_MESH_PREP, M_NOWAIT | M_ZERO); + KASSERT(prep != NULL, ("prep == NULL")); + + prep->prep_ie = *iefrm_t++; + prep->prep_len = *iefrm_t++; + prep->prep_flags = *iefrm_t++; + prep->prep_hopcount = *iefrm_t++; + prep->prep_ttl = *iefrm_t++; + IEEE80211_ADDR_COPY(prep->prep_targetaddr, iefrm_t); + iefrm_t += 6; + prep->prep_targetseq = LE_READ_4(iefrm_t); iefrm_t += 4; + /* NB: May have Target Proxied Address */ + if (prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE) { + IEEE80211_ADDR_COPY( + prep->prep_target_ext_addr, iefrm_t); + iefrm_t += 6; + } + prep->prep_lifetime = LE_READ_4(iefrm_t); iefrm_t += 4; + prep->prep_metric = LE_READ_4(iefrm_t); iefrm_t += 4; + IEEE80211_ADDR_COPY(prep->prep_origaddr, iefrm_t); + iefrm_t += 6; + prep->prep_origseq = LE_READ_4(iefrm_t); iefrm_t += 4; + + hwmp_recv_prep(vap, ni, wh, prep); + free(prep, M_80211_MESH_PREP); found++; break; } case IEEE80211_ELEMID_MESHPERR: { - const struct ieee80211_meshperr_ie *mperr = - (const struct ieee80211_meshperr_ie *) iefrm; - /* XXX > 1 target */ - if (mperr->perr_len != - sizeof(struct ieee80211_meshperr_ie) - 2) { - IEEE80211_DISCARD(vap, - IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, - wh, NULL, "%s", "PERR with wrong len"); + int i = 0; + + iefrm_t = iefrm; + ndest = verify_mesh_perr_len(vap, wh, iefrm_t); + if (ndest < 0) { vap->iv_stats.is_rx_mgtdiscard++; break; } - memcpy(&perr, mperr, sizeof(perr)); - perr.perr_dests[0].dest_seq = - LE_READ_4(&mperr->perr_dests[0].dest_seq); - hwmp_recv_perr(vap, ni, wh, &perr); + perr = malloc(sizeof(*perr) + + (ndest - 1) * sizeof(*perr->perr_dests), + M_80211_MESH_PERR, M_NOWAIT | M_ZERO); + KASSERT(perr != NULL, ("perr == NULL")); + + perr->perr_ie = *iefrm_t++; + perr->perr_len = *iefrm_t++; + perr->perr_ttl = *iefrm_t++; + perr->perr_ndests = *iefrm_t++; + + for (i = 0; iperr_ndests; i++) { + perr->perr_dests[i].dest_flags = *iefrm_t++; + IEEE80211_ADDR_COPY( + perr->perr_dests[i].dest_addr, iefrm_t); + iefrm_t += 6; + perr->perr_dests[i].dest_seq = LE_READ_4(iefrm_t); + iefrm_t += 4; + /* NB: May have Target Proxied Address */ + if (perr->perr_dests[i].dest_flags & + IEEE80211_MESHPERR_FLAGS_AE) { + IEEE80211_ADDR_COPY( + perr->perr_dests[i].dest_ext_addr, + iefrm_t); + iefrm_t += 6; + } + perr->perr_dests[i].dest_rcode = + LE_READ_2(iefrm_t); + iefrm_t += 2; + } + + hwmp_recv_perr(vap, ni, wh, perr); + free(perr, M_80211_MESH_PERR); found++; break; } @@ -369,7 +532,7 @@ hwmp_recv_action_meshpath(struct ieee802 IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, wh, NULL, "%s", "RAN with wrong len"); - vap->iv_stats.is_rx_mgtdiscard++; + vap->iv_stats.is_rx_mgtdiscard++; return 1; } memcpy(&rann, mrann, sizeof(rann)); @@ -492,31 +655,40 @@ hwmp_send_action(struct ieee80211_node * /* * Add a Mesh Path Request IE to a frame. */ +#define PREQ_TFLAGS(n) preq->preq_targets[n].target_flags +#define PREQ_TADDR(n) preq->preq_targets[n].target_addr +#define PREQ_TSEQ(n) preq->preq_targets[n].target_seq static uint8_t * hwmp_add_meshpreq(uint8_t *frm, const struct ieee80211_meshpreq_ie *preq) { int i; *frm++ = IEEE80211_ELEMID_MESHPREQ; - *frm++ = sizeof(struct ieee80211_meshpreq_ie) - 2 + - (preq->preq_tcount - 1) * sizeof(*preq->preq_targets); + *frm++ = preq->preq_len; /* len already calculated */ *frm++ = preq->preq_flags; *frm++ = preq->preq_hopcount; *frm++ = preq->preq_ttl; ADDWORD(frm, preq->preq_id); IEEE80211_ADDR_COPY(frm, preq->preq_origaddr); frm += 6; ADDWORD(frm, preq->preq_origseq); + if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE) { + IEEE80211_ADDR_COPY(frm, preq->preq_orig_ext_addr); + frm += 6; + } ADDWORD(frm, preq->preq_lifetime); ADDWORD(frm, preq->preq_metric); *frm++ = preq->preq_tcount; for (i = 0; i < preq->preq_tcount; i++) { - *frm++ = preq->preq_targets[i].target_flags; - IEEE80211_ADDR_COPY(frm, preq->preq_targets[i].target_addr); + *frm++ = PREQ_TFLAGS(i); + IEEE80211_ADDR_COPY(frm, PREQ_TADDR(i)); frm += 6; - ADDWORD(frm, preq->preq_targets[i].target_seq); + ADDWORD(frm, PREQ_TSEQ(i)); } return frm; } +#undef PREQ_TFLAGS +#undef PREQ_TADDR +#undef PREQ_TSEQ /* * Add a Mesh Path Reply IE to a frame. @@ -525,12 +697,16 @@ static uint8_t * hwmp_add_meshprep(uint8_t *frm, const struct ieee80211_meshprep_ie *prep) { *frm++ = IEEE80211_ELEMID_MESHPREP; - *frm++ = sizeof(struct ieee80211_meshprep_ie) - 2; + *frm++ = prep->prep_len; /* len already calculated */ *frm++ = prep->prep_flags; *frm++ = prep->prep_hopcount; *frm++ = prep->prep_ttl; IEEE80211_ADDR_COPY(frm, prep->prep_targetaddr); frm += 6; ADDWORD(frm, prep->prep_targetseq); + if (prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE) { + IEEE80211_ADDR_COPY(frm, prep->prep_target_ext_addr); + frm += 6; + } ADDWORD(frm, prep->prep_lifetime); ADDWORD(frm, prep->prep_metric); IEEE80211_ADDR_COPY(frm, prep->prep_origaddr); frm += 6; @@ -541,25 +717,38 @@ hwmp_add_meshprep(uint8_t *frm, const st /* * Add a Mesh Path Error IE to a frame. */ +#define PERR_DFLAGS(n) perr->perr_dests[n].dest_flags +#define PERR_DADDR(n) perr->perr_dests[n].dest_addr +#define PERR_DSEQ(n) perr->perr_dests[n].dest_seq +#define PERR_EXTADDR(n) perr->perr_dests[n].dest_ext_addr +#define PERR_DRCODE(n) perr->perr_dests[n].dest_rcode static uint8_t * hwmp_add_meshperr(uint8_t *frm, const struct ieee80211_meshperr_ie *perr) { int i; *frm++ = IEEE80211_ELEMID_MESHPERR; - *frm++ = sizeof(struct ieee80211_meshperr_ie) - 2 + - (perr->perr_ndests - 1) * sizeof(*perr->perr_dests); + *frm++ = perr->perr_len; /* len already calculated */ *frm++ = perr->perr_ttl; *frm++ = perr->perr_ndests; for (i = 0; i < perr->perr_ndests; i++) { - *frm++ = perr->perr_dests[i].dest_flags; - IEEE80211_ADDR_COPY(frm, perr->perr_dests[i].dest_addr); + *frm++ = PERR_DFLAGS(i); + IEEE80211_ADDR_COPY(frm, PERR_DADDR(i)); frm += 6; - ADDWORD(frm, perr->perr_dests[i].dest_seq); - ADDSHORT(frm, perr->perr_dests[i].dest_rcode); + ADDWORD(frm, PERR_DSEQ(i)); + if (PERR_DFLAGS(i) & IEEE80211_MESHPERR_FLAGS_AE) { + IEEE80211_ADDR_COPY(frm, PERR_EXTADDR(i)); + frm += 6; + } + ADDSHORT(frm, PERR_DRCODE(i)); } return frm; } +#undef PERR_DFLAGS +#undef PERR_DADDR +#undef PERR_DSEQ +#undef PERR_EXTADDR +#undef PERR_DRCODE /* * Add a Root Annoucement IE to a frame. @@ -568,12 +757,13 @@ static uint8_t * hwmp_add_meshrann(uint8_t *frm, const struct ieee80211_meshrann_ie *rann) { *frm++ = IEEE80211_ELEMID_MESHRANN; - *frm++ = sizeof(struct ieee80211_meshrann_ie) - 2; + *frm++ = rann->rann_len; *frm++ = rann->rann_flags; *frm++ = rann->rann_hopcount; *frm++ = rann->rann_ttl; IEEE80211_ADDR_COPY(frm, rann->rann_addr); frm += 6; ADDWORD(frm, rann->rann_seq); + ADDWORD(frm, rann->rann_interval); ADDWORD(frm, rann->rann_metric); return frm; } @@ -980,8 +1170,10 @@ hwmp_send_preq(struct ieee80211_node *ni * [tlv] mesh path request */ preq->preq_ie = IEEE80211_ELEMID_MESHPREQ; - return hwmp_send_action(ni, sa, da, (uint8_t *)preq, - sizeof(struct ieee80211_meshpreq_ie)); + preq->preq_len = (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE ? + IEEE80211_MESHPREQ_BASE_SZ_AE : IEEE80211_MESHPREQ_BASE_SZ) + + preq->preq_tcount * IEEE80211_MESHPREQ_TRGT_SZ; + return hwmp_send_action(ni, sa, da, (uint8_t *)preq, preq->preq_len+2); } static void @@ -1162,8 +1354,10 @@ hwmp_send_prep(struct ieee80211_node *ni * [tlv] mesh path reply */ prep->prep_ie = IEEE80211_ELEMID_MESHPREP; + prep->prep_len = prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE ? + IEEE80211_MESHPREP_BASE_SZ_AE : IEEE80211_MESHPREP_BASE_SZ; return hwmp_send_action(ni, sa, da, (uint8_t *)prep, - sizeof(struct ieee80211_meshprep_ie)); + prep->prep_len + 2); } #define PERR_DFLAGS(n) perr.perr_dests[n].dest_flags @@ -1254,8 +1448,10 @@ hwmp_recv_perr(struct ieee80211vap *vap, &pperr); } } +#undef PERR_DFLAGS #undef PEER_DADDR #undef PERR_DSEQ +#undef PERR_DRCODE static int hwmp_send_perr(struct ieee80211_node *ni, @@ -1264,6 +1460,8 @@ hwmp_send_perr(struct ieee80211_node *ni struct ieee80211_meshperr_ie *perr) { struct ieee80211_hwmp_state *hs = ni->ni_vap->iv_hwmp; + int i; + uint8_t length = 0; /* * Enforce PERR interval. @@ -1282,8 +1480,17 @@ hwmp_send_perr(struct ieee80211_node *ni * [tlv] mesh path error */ perr->perr_ie = IEEE80211_ELEMID_MESHPERR; - return hwmp_send_action(ni, sa, da, (uint8_t *)perr, - sizeof(struct ieee80211_meshperr_ie)); + length = IEEE80211_MESHPERR_BASE_SZ; + for (i = 0; iperr_ndests; i++) { + if (perr->perr_dests[i].dest_flags & + IEEE80211_MESHPERR_FLAGS_AE) { + length += IEEE80211_MESHPERR_DEST_SZ_AE; + continue ; + } + length += IEEE80211_MESHPERR_DEST_SZ; + } + perr->perr_len =length; + return hwmp_send_action(ni, sa, da, (uint8_t *)perr, perr->perr_len+2); } static void @@ -1342,8 +1549,9 @@ hwmp_send_rann(struct ieee80211_node *ni * [tlv] root annoucement */ rann->rann_ie = IEEE80211_ELEMID_MESHRANN; + rann->rann_len = IEEE80211_MESHRANN_BASE_SZ; return hwmp_send_action(ni, sa, da, (uint8_t *)rann, - sizeof(struct ieee80211_meshrann_ie)); + rann->rann_len + 2); } #define PREQ_TFLAGS(n) preq.preq_targets[n].target_flags Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Tue Mar 6 21:13:12 2012 (r232624) +++ head/sys/net80211/ieee80211_mesh.c Tue Mar 6 21:20:16 2012 (r232625) @@ -142,6 +142,10 @@ static struct ieee80211_mesh_proto_metri #define MESH_RT_LOCK_ASSERT(ms) mtx_assert(&(ms)->ms_rt_lock, MA_OWNED) #define MESH_RT_UNLOCK(ms) mtx_unlock(&(ms)->ms_rt_lock) +MALLOC_DEFINE(M_80211_MESH_PREQ, "80211preq", "802.11 MESH Path Request frame"); +MALLOC_DEFINE(M_80211_MESH_PREP, "80211prep", "802.11 MESH Path Reply frame"); +MALLOC_DEFINE(M_80211_MESH_PERR, "80211perr", "802.11 MESH Path Error frame"); + MALLOC_DEFINE(M_80211_MESH_RT, "80211mesh", "802.11s routing table"); /* Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Tue Mar 6 21:13:12 2012 (r232624) +++ head/sys/net80211/ieee80211_mesh.h Tue Mar 6 21:20:16 2012 (r232625) @@ -212,6 +212,7 @@ struct ieee80211_meshpann_ie { } __packed; /* Root (MP) Annoucement */ +#define IEEE80211_MESHRANN_BASE_SZ (21) struct ieee80211_meshrann_ie { uint8_t rann_ie; /* IEEE80211_ELEMID_MESHRANN */ uint8_t rann_len; @@ -221,10 +222,16 @@ struct ieee80211_meshrann_ie { uint8_t rann_ttl; uint8_t rann_addr[IEEE80211_ADDR_LEN]; uint32_t rann_seq; /* HWMP Sequence Number */ + uint32_t rann_interval; uint32_t rann_metric; } __packed; /* Mesh Path Request */ +#define IEEE80211_MESHPREQ_BASE_SZ (26) +#define IEEE80211_MESHPREQ_BASE_SZ_AE (32) +#define IEEE80211_MESHPREQ_TRGT_SZ (11) +#define IEEE80211_MESHPREQ_TCNT_OFFSET (27) +#define IEEE80211_MESHPREQ_TCNT_OFFSET_AE (33) struct ieee80211_meshpreq_ie { uint8_t preq_ie; /* IEEE80211_ELEMID_MESHPREQ */ uint8_t preq_len; @@ -238,7 +245,8 @@ struct ieee80211_meshpreq_ie { uint32_t preq_id; uint8_t preq_origaddr[IEEE80211_ADDR_LEN]; uint32_t preq_origseq; /* HWMP Sequence Number */ - /* NB: may have Originator Proxied Address */ + /* NB: may have Originator External Address */ + uint8_t preq_orig_ext_addr[IEEE80211_ADDR_LEN]; uint32_t preq_lifetime; uint32_t preq_metric; uint8_t preq_tcount; /* target count */ @@ -253,15 +261,19 @@ struct ieee80211_meshpreq_ie { } __packed; /* Mesh Path Reply */ +#define IEEE80211_MESHPREP_BASE_SZ (31) +#define IEEE80211_MESHPREP_BASE_SZ_AE (37) struct ieee80211_meshprep_ie { uint8_t prep_ie; /* IEEE80211_ELEMID_MESHPREP */ uint8_t prep_len; uint8_t prep_flags; +#define IEEE80211_MESHPREP_FLAGS_AE 0x40 /* Address Extension */ uint8_t prep_hopcount; uint8_t prep_ttl; uint8_t prep_targetaddr[IEEE80211_ADDR_LEN]; uint32_t prep_targetseq; - /* NB: May have Target Proxied Address */ + /* NB: May have Target External Address */ + uint8_t prep_target_ext_addr[IEEE80211_ADDR_LEN]; uint32_t prep_lifetime; uint32_t prep_metric; uint8_t prep_origaddr[IEEE80211_ADDR_LEN]; @@ -269,6 +281,11 @@ struct ieee80211_meshprep_ie { } __packed; /* Mesh Path Error */ +#define IEEE80211_MESHPERR_MAXDEST (19) +#define IEEE80211_MESHPERR_NDEST_OFFSET (3) +#define IEEE80211_MESHPERR_BASE_SZ (2) +#define IEEE80211_MESHPERR_DEST_SZ (13) +#define IEEE80211_MESHPERR_DEST_SZ_AE (19) struct ieee80211_meshperr_ie { uint8_t perr_ie; /* IEEE80211_ELEMID_MESHPERR */ uint8_t perr_len; @@ -276,10 +293,13 @@ struct ieee80211_meshperr_ie { uint8_t perr_ndests; /* Number of Destinations */ struct { uint8_t dest_flags; -#define IEEE80211_MESHPERR_DFLAGS_USN 0x01 -#define IEEE80211_MESHPERR_DFLAGS_RC 0x02 +#define IEEE80211_MESHPERR_DFLAGS_USN 0x01 /* XXX: not part of standard */ +#define IEEE80211_MESHPERR_DFLAGS_RC 0x02 /* XXX: not part of standard */ +#define IEEE80211_MESHPERR_FLAGS_AE 0x40 /* Address Extension */ uint8_t dest_addr[IEEE80211_ADDR_LEN]; uint32_t dest_seq; /* HWMP Sequence Number */ + /* NB: May have Destination External Address */ + uint8_t dest_ext_addr[IEEE80211_ADDR_LEN]; uint16_t dest_rcode; } __packed perr_dests[1]; /* NB: variable size */ } __packed; @@ -390,6 +410,10 @@ struct ieee80211_meshcntl_ae11 { } __packed; #ifdef _KERNEL +MALLOC_DECLARE(M_80211_MESH_PREQ); +MALLOC_DECLARE(M_80211_MESH_PREP); +MALLOC_DECLARE(M_80211_MESH_PERR); + MALLOC_DECLARE(M_80211_MESH_RT); struct ieee80211_mesh_route { TAILQ_ENTRY(ieee80211_mesh_route) rt_next; From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 21:56:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3FC2106566C; Tue, 6 Mar 2012 21:56:30 +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 B3BE48FC0C; Tue, 6 Mar 2012 21:56: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 q26LuU7R059189; Tue, 6 Mar 2012 21:56:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26LuUsd059187; Tue, 6 Mar 2012 21:56:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203062156.q26LuUsd059187@svn.freebsd.org> From: Dimitry Andric Date: Tue, 6 Mar 2012 21:56: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: r232626 - head/lib/libc/locale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 21:56:30 -0000 Author: dim Date: Tue Mar 6 21:56:30 2012 New Revision: 232626 URL: http://svn.freebsd.org/changeset/base/232626 Log: Fix build of libc.so after r232620. This caused a duplicate definition of __getCurrentRuneLocale(). Pointy hat to: me Modified: head/lib/libc/locale/nomacros.c Modified: head/lib/libc/locale/nomacros.c ============================================================================== --- head/lib/libc/locale/nomacros.c Tue Mar 6 21:20:16 2012 (r232625) +++ head/lib/libc/locale/nomacros.c Tue Mar 6 21:56:30 2012 (r232626) @@ -9,4 +9,10 @@ __FBSDID("$FreeBSD$"); */ #define _EXTERNALIZE_CTYPE_INLINES_ +/* + * Also make sure does not generate an inline definition + * of __getCurrentRuneLocale(). + */ +#define __RUNETYPE_INTERNAL + #include From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 22:16:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6971A1065740; Tue, 6 Mar 2012 22:16:11 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 579638FC1D; Tue, 6 Mar 2012 22:16: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 q26MGB5M059827; Tue, 6 Mar 2012 22:16:11 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26MGBFG059825; Tue, 6 Mar 2012 22:16:11 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201203062216.q26MGBFG059825@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 6 Mar 2012 22:16: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: r232627 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 22:16:11 -0000 Author: ray Date: Tue Mar 6 22:16:10 2012 New Revision: 232627 URL: http://svn.freebsd.org/changeset/base/232627 Log: Remove EoL whitespaces. Approved by: adri (mentor) Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Tue Mar 6 21:56:30 2012 (r232626) +++ head/sys/mips/atheros/if_arge.c Tue Mar 6 22:16:10 2012 (r232627) @@ -175,7 +175,7 @@ DRIVER_MODULE(arge, nexus, arge_driver, DRIVER_MODULE(miibus, arge, miibus_driver, miibus_devclass, 0, 0); /* - * RedBoot passes MAC address to entry point as environment + * RedBoot passes MAC address to entry point as environment * variable. platfrom_start parses it and stores in this variable */ extern uint32_t ar711_base_mac[ETHER_ADDR_LEN]; @@ -184,9 +184,8 @@ static struct mtx miibus_mtx; MTX_SYSINIT(miibus_mtx, &miibus_mtx, "arge mii lock", MTX_DEF); - /* - * Flushes all + * Flushes all */ static void arge_flush_ddr(struct arge_softc *sc) @@ -195,7 +194,7 @@ arge_flush_ddr(struct arge_softc *sc) ar71xx_device_flush_ddr_ge(sc->arge_mac_unit); } -static int +static int arge_probe(device_t dev) { @@ -260,7 +259,7 @@ arge_attach(device_t dev) * in CPU address space. */ if (sc->arge_mac_unit == 0 && - resource_long_value(device_get_name(dev), device_get_unit(dev), + resource_long_value(device_get_name(dev), device_get_unit(dev), "eeprommac", &eeprom_mac_addr) == 0) { int i; const char *mac = (const char *) MIPS_PHYS_TO_KSEG1(eeprom_mac_addr); @@ -270,17 +269,17 @@ arge_attach(device_t dev) } } - KASSERT(((sc->arge_mac_unit == 0) || (sc->arge_mac_unit == 1)), + KASSERT(((sc->arge_mac_unit == 0) || (sc->arge_mac_unit == 1)), ("if_arge: Only MAC0 and MAC1 supported")); /* * Get which PHY of 5 available we should use for this unit */ - if (resource_int_value(device_get_name(dev), device_get_unit(dev), + if (resource_int_value(device_get_name(dev), device_get_unit(dev), "phymask", &phymask) != 0) { /* - * Use port 4 (WAN) for GE0. For any other port use - * its PHY the same as its unit number + * Use port 4 (WAN) for GE0. For any other port use + * its PHY the same as its unit number */ if (sc->arge_mac_unit == 0) phymask = (1 << 4); @@ -292,10 +291,10 @@ arge_attach(device_t dev) } /* - * Get default media & duplex mode, by default its Base100T + * Get default media & duplex mode, by default its Base100T * and full duplex */ - if (resource_int_value(device_get_name(dev), device_get_unit(dev), + if (resource_int_value(device_get_name(dev), device_get_unit(dev), "media", &hint) != 0) hint = 0; @@ -304,7 +303,7 @@ arge_attach(device_t dev) else sc->arge_media_type = IFM_100_TX; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), + if (resource_int_value(device_get_name(dev), device_get_unit(dev), "fduplex", &hint) != 0) hint = 1; @@ -322,7 +321,7 @@ arge_attach(device_t dev) /* Map control/status registers. */ sc->arge_rid = 0; - sc->arge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + sc->arge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->arge_rid, RF_ACTIVE); if (sc->arge_res == NULL) { @@ -333,7 +332,7 @@ arge_attach(device_t dev) /* Allocate interrupts */ rid = 0; - sc->arge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + sc->arge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->arge_irq == NULL) { @@ -381,7 +380,7 @@ arge_attach(device_t dev) * No MAC address configured. Generate the random one. */ if (bootverbose) - device_printf(dev, + device_printf(dev, "Generating random ethernet address.\n"); rnd = arc4random(); @@ -402,7 +401,7 @@ arge_attach(device_t dev) } /* Initialize the MAC block */ - + /* Step 1. Soft-reset MAC */ ARGE_SET_BITS(sc, AR71XX_MAC_CFG1, MAC_CFG1_SOFT_RESET); DELAY(20); @@ -413,7 +412,7 @@ arge_attach(device_t dev) ar71xx_device_start(sc->arge_mac_unit == 0 ? RST_RESET_GE0_MAC : RST_RESET_GE1_MAC); /* Step 3. Reconfigure MAC block */ - ARGE_WRITE(sc, AR71XX_MAC_CFG1, + ARGE_WRITE(sc, AR71XX_MAC_CFG1, MAC_CFG1_SYNC_RX | MAC_CFG1_RX_ENABLE | MAC_CFG1_SYNC_TX | MAC_CFG1_TX_ENABLE); @@ -429,15 +428,15 @@ arge_attach(device_t dev) ARGE_WRITE(sc, AR71XX_MAC_MII_CFG, MAC_MII_CFG_CLOCK_DIV_28); DELAY(100); - /* + /* * Set all Ethernet address registers to the same initial values - * set all four addresses to 66-88-aa-cc-dd-ee + * set all four addresses to 66-88-aa-cc-dd-ee */ - ARGE_WRITE(sc, AR71XX_MAC_STA_ADDR1, + ARGE_WRITE(sc, AR71XX_MAC_STA_ADDR1, (eaddr[2] << 24) | (eaddr[3] << 16) | (eaddr[4] << 8) | eaddr[5]); ARGE_WRITE(sc, AR71XX_MAC_STA_ADDR2, (eaddr[0] << 8) | eaddr[1]); - ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG0, + ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG0, FIFO_CFG0_ALL << FIFO_CFG0_ENABLE_SHIFT); switch (ar71xx_soc) { @@ -452,13 +451,13 @@ arge_attach(device_t dev) ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG2, 0x00001fff); } - ARGE_WRITE(sc, AR71XX_MAC_FIFO_RX_FILTMATCH, + ARGE_WRITE(sc, AR71XX_MAC_FIFO_RX_FILTMATCH, FIFO_RX_FILTMATCH_DEFAULT); - ARGE_WRITE(sc, AR71XX_MAC_FIFO_RX_FILTMASK, + ARGE_WRITE(sc, AR71XX_MAC_FIFO_RX_FILTMASK, FIFO_RX_FILTMASK_DEFAULT); - /* + /* * Check if we have single-PHY MAC or multi-PHY */ phys_total = 0; @@ -482,11 +481,11 @@ arge_attach(device_t dev) } } else { - ifmedia_init(&sc->arge_ifmedia, 0, + ifmedia_init(&sc->arge_ifmedia, 0, arge_multiphy_mediachange, arge_multiphy_mediastatus); ifmedia_add(&sc->arge_ifmedia, - IFM_ETHER | sc->arge_media_type | sc->arge_duplex_mode, + IFM_ETHER | sc->arge_media_type | sc->arge_duplex_mode, 0, NULL); ifmedia_set(&sc->arge_ifmedia, IFM_ETHER | sc->arge_media_type | sc->arge_duplex_mode); @@ -510,7 +509,7 @@ arge_attach(device_t dev) arge_attach_sysctl(dev); fail: - if (error) + if (error) arge_detach(dev); return (error); @@ -548,7 +547,7 @@ arge_detach(device_t dev) bus_teardown_intr(dev, sc->arge_irq, sc->arge_intrhand); if (sc->arge_res) - bus_release_resource(dev, SYS_RES_MEMORY, sc->arge_rid, + bus_release_resource(dev, SYS_RES_MEMORY, sc->arge_rid, sc->arge_res); if (ifp) @@ -597,7 +596,7 @@ arge_miibus_readreg(device_t dev, int ph { struct arge_softc * sc = device_get_softc(dev); int i, result; - uint32_t addr = (phy << MAC_MII_PHY_ADDR_SHIFT) + uint32_t addr = (phy << MAC_MII_PHY_ADDR_SHIFT) | (reg & MAC_MII_REG_MASK); if ((sc->arge_phymask & (1 << phy)) == 0) @@ -609,7 +608,7 @@ arge_miibus_readreg(device_t dev, int ph ARGE_MII_WRITE(AR71XX_MAC_MII_CMD, MAC_MII_CMD_READ); i = ARGE_MII_TIMEOUT; - while ((ARGE_MII_READ(AR71XX_MAC_MII_INDICATOR) & + while ((ARGE_MII_READ(AR71XX_MAC_MII_INDICATOR) & MAC_MII_INDICATOR_BUSY) && (i--)) DELAY(5); @@ -624,7 +623,7 @@ arge_miibus_readreg(device_t dev, int ph ARGE_MII_WRITE(AR71XX_MAC_MII_CMD, MAC_MII_CMD_WRITE); mtx_unlock(&miibus_mtx); - ARGEDEBUG(sc, ARGE_DBG_MII, "%s: phy=%d, reg=%02x, value[%08x]=%04x\n", __func__, + ARGEDEBUG(sc, ARGE_DBG_MII, "%s: phy=%d, reg=%02x, value[%08x]=%04x\n", __func__, phy, reg, addr, result); return (result); @@ -635,14 +634,14 @@ arge_miibus_writereg(device_t dev, int p { struct arge_softc * sc = device_get_softc(dev); int i; - uint32_t addr = + uint32_t addr = (phy << MAC_MII_PHY_ADDR_SHIFT) | (reg & MAC_MII_REG_MASK); if ((sc->arge_phymask & (1 << phy)) == 0) return (-1); - ARGEDEBUG(sc, ARGE_DBG_MII, "%s: phy=%d, reg=%02x, value=%04x\n", __func__, + ARGEDEBUG(sc, ARGE_DBG_MII, "%s: phy=%d, reg=%02x, value=%04x\n", __func__, phy, reg, data); mtx_lock(&miibus_mtx); @@ -650,7 +649,7 @@ arge_miibus_writereg(device_t dev, int p ARGE_MII_WRITE(AR71XX_MAC_MII_CONTROL, data); i = ARGE_MII_TIMEOUT; - while ((ARGE_MII_READ(AR71XX_MAC_MII_INDICATOR) & + while ((ARGE_MII_READ(AR71XX_MAC_MII_INDICATOR) & MAC_MII_INDICATOR_BUSY) && (i--)) DELAY(5); @@ -668,7 +667,7 @@ arge_miibus_writereg(device_t dev, int p static void arge_miibus_statchg(device_t dev) { - struct arge_softc *sc; + struct arge_softc *sc; sc = device_get_softc(dev); taskqueue_enqueue(taskqueue_swi, &sc->arge_link_task); @@ -716,8 +715,8 @@ arge_set_pll(struct arge_softc *sc, int int if_speed; cfg = ARGE_READ(sc, AR71XX_MAC_CFG2); - cfg &= ~(MAC_CFG2_IFACE_MODE_1000 - | MAC_CFG2_IFACE_MODE_10_100 + cfg &= ~(MAC_CFG2_IFACE_MODE_1000 + | MAC_CFG2_IFACE_MODE_10_100 | MAC_CFG2_FULL_DUPLEX); if (duplex == IFM_FDX) @@ -725,7 +724,7 @@ arge_set_pll(struct arge_softc *sc, int ifcontrol = ARGE_READ(sc, AR71XX_MAC_IFCONTROL); ifcontrol &= ~MAC_IFCONTROL_SPEED; - rx_filtmask = + rx_filtmask = ARGE_READ(sc, AR71XX_MAC_FIFO_RX_FILTMASK); rx_filtmask &= ~FIFO_RX_MASK_BYTE_MODE; @@ -747,7 +746,7 @@ arge_set_pll(struct arge_softc *sc, int break; default: if_speed = 100; - device_printf(sc->arge_dev, + device_printf(sc->arge_dev, "Unknown media %d\n", media); } @@ -767,7 +766,7 @@ arge_set_pll(struct arge_softc *sc, int ARGE_WRITE(sc, AR71XX_MAC_CFG2, cfg); ARGE_WRITE(sc, AR71XX_MAC_IFCONTROL, ifcontrol); - ARGE_WRITE(sc, AR71XX_MAC_FIFO_RX_FILTMASK, + ARGE_WRITE(sc, AR71XX_MAC_FIFO_RX_FILTMASK, rx_filtmask); ARGE_WRITE(sc, AR71XX_MAC_FIFO_TX_THRESHOLD, fifo_tx); @@ -789,18 +788,18 @@ arge_reset_dma(struct arge_softc *sc) while(ARGE_READ(sc, AR71XX_DMA_RX_STATUS) & DMA_RX_STATUS_PKT_RECVD) ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, DMA_RX_STATUS_PKT_RECVD); - /* + /* * Clear all possible TX interrupts */ while(ARGE_READ(sc, AR71XX_DMA_TX_STATUS) & DMA_TX_STATUS_PKT_SENT) ARGE_WRITE(sc, AR71XX_DMA_TX_STATUS, DMA_TX_STATUS_PKT_SENT); - /* + /* * Now Rx/Tx errors */ - ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, + ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, DMA_RX_STATUS_BUS_ERROR | DMA_RX_STATUS_OVERFLOW); - ARGE_WRITE(sc, AR71XX_DMA_TX_STATUS, + ARGE_WRITE(sc, AR71XX_DMA_TX_STATUS, DMA_TX_STATUS_BUS_ERROR | DMA_TX_STATUS_UNDERRUN); } @@ -923,7 +922,7 @@ arge_encap(struct arge_softc *sc, struct prod = sc->arge_cdata.arge_tx_prod; txd = &sc->arge_cdata.arge_txdesc[prod]; - error = bus_dmamap_load_mbuf_sg(sc->arge_cdata.arge_tx_tag, + error = bus_dmamap_load_mbuf_sg(sc->arge_cdata.arge_tx_tag, txd->tx_dmamap, *m_head, txsegs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { @@ -947,7 +946,7 @@ arge_encap(struct arge_softc *sc, struct bus_dmamap_sync(sc->arge_cdata.arge_tx_tag, txd->tx_dmamap, BUS_DMASYNC_PREWRITE); - /* + /* * Make a list of descriptors for this packet. DMA controller will * walk through it while arge_link is not zero. */ @@ -961,7 +960,7 @@ arge_encap(struct arge_softc *sc, struct panic("TX packet address unaligned\n"); desc->packet_addr = txsegs[i].ds_addr; - + /* link with previous descriptor */ if (prev_desc) prev_desc->packet_ctrl |= ARGE_DESC_MORE; @@ -1097,7 +1096,7 @@ arge_ioctl(struct ifnet *ifp, u_long com & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { /* XXX: handle promisc & multi flags */ } - + } else { if (!sc->arge_detach) arge_init_locked(sc); @@ -1121,7 +1120,7 @@ arge_ioctl(struct ifnet *ifp, u_long com mii = device_get_softc(sc->arge_miibus); error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); } - else + else error = ifmedia_ioctl(ifp, ifr, &sc->arge_ifmedia, command); break; case SIOCSIFCAP: @@ -1701,14 +1700,14 @@ arge_rx_locked(struct arge_softc *sc) sc->arge_cdata.arge_rx_ring_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - for (prog = 0; prog < ARGE_RX_RING_COUNT; + for (prog = 0; prog < ARGE_RX_RING_COUNT; ARGE_INC(cons, ARGE_RX_RING_COUNT)) { cur_rx = &sc->arge_rdata.arge_rx_ring[cons]; rxd = &sc->arge_cdata.arge_rxdesc[cons]; m = rxd->rx_m; if ((cur_rx->packet_ctrl & ARGE_DESC_EMPTY) != 0) - break; + break; ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, DMA_RX_STATUS_PKT_RECVD); @@ -1737,7 +1736,7 @@ arge_rx_locked(struct arge_softc *sc) i = sc->arge_cdata.arge_rx_cons; for (; prog > 0 ; prog--) { if (arge_newbuf(sc, i) != 0) { - device_printf(sc->arge_dev, + device_printf(sc->arge_dev, "Failed to allocate buffer\n"); break; } @@ -1766,7 +1765,7 @@ arge_intr_filter(void *arg) ARGEDEBUG(sc, ARGE_DBG_INTR, "int mask(filter) = %b\n", ints, "\20\10RX_BUS_ERROR\7RX_OVERFLOW\5RX_PKT_RCVD" "\4TX_BUS_ERROR\2TX_UNDERRUN\1TX_PKT_SENT"); - ARGEDEBUG(sc, ARGE_DBG_INTR, "status(filter) = %b\n", status, + ARGEDEBUG(sc, ARGE_DBG_INTR, "status(filter) = %b\n", status, "\20\10RX_BUS_ERROR\7RX_OVERFLOW\5RX_PKT_RCVD" "\4TX_BUS_ERROR\2TX_UNDERRUN\1TX_PKT_SENT"); @@ -1774,7 +1773,7 @@ arge_intr_filter(void *arg) sc->arge_intr_status |= status; ARGE_WRITE(sc, AR71XX_DMA_INTR, 0); return (FILTER_SCHEDULE_THREAD); - } + } sc->arge_intr_status = 0; return (FILTER_STRAY); @@ -1790,12 +1789,12 @@ arge_intr(void *arg) status = ARGE_READ(sc, AR71XX_DMA_INTR_STATUS); status |= sc->arge_intr_status; - ARGEDEBUG(sc, ARGE_DBG_INTR, "int status(intr) = %b\n", status, + ARGEDEBUG(sc, ARGE_DBG_INTR, "int status(intr) = %b\n", status, "\20\10\7RX_OVERFLOW\5RX_PKT_RCVD" "\4TX_BUS_ERROR\2TX_UNDERRUN\1TX_PKT_SENT"); - /* - * Is it our interrupt at all? + /* + * Is it our interrupt at all? */ if (status == 0) return; @@ -1817,9 +1816,9 @@ arge_intr(void *arg) if (status & DMA_INTR_RX_PKT_RCVD) arge_rx_locked(sc); - /* - * RX overrun disables the receiver. - * Clear indication and re-enable rx. + /* + * RX overrun disables the receiver. + * Clear indication and re-enable rx. */ if ( status & DMA_INTR_RX_OVERFLOW) { ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, DMA_RX_STATUS_OVERFLOW); @@ -1829,16 +1828,16 @@ arge_intr(void *arg) if (status & DMA_INTR_TX_PKT_SENT) arge_tx_locked(sc); - /* - * Underrun turns off TX. Clear underrun indication. - * If there's anything left in the ring, reactivate the tx. + /* + * Underrun turns off TX. Clear underrun indication. + * If there's anything left in the ring, reactivate the tx. */ if (status & DMA_INTR_TX_UNDERRUN) { ARGE_WRITE(sc, AR71XX_DMA_TX_STATUS, DMA_TX_STATUS_UNDERRUN); sc->stats.tx_underflow++; ARGEDEBUG(sc, ARGE_DBG_TX, "%s: TX underrun; tx_cnt=%d\n", __func__, sc->arge_cdata.arge_tx_cnt); if (sc->arge_cdata.arge_tx_cnt > 0 ) { - ARGE_WRITE(sc, AR71XX_DMA_TX_CONTROL, + ARGE_WRITE(sc, AR71XX_DMA_TX_CONTROL, DMA_TX_CONTROL_EN); } } @@ -1870,7 +1869,7 @@ arge_intr(void *arg) sc->arge_intr_status = 0; ARGE_UNLOCK(sc); /* - * re-enable all interrupts + * re-enable all interrupts */ ARGE_WRITE(sc, AR71XX_DMA_INTR, DMA_INTR_ALL); } @@ -1902,7 +1901,7 @@ arge_multiphy_mediachange(struct ifnet * return (EINVAL); if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) { - device_printf(sc->arge_dev, + device_printf(sc->arge_dev, "AUTO is not supported for multiphy MAC"); return (EINVAL); } @@ -1919,7 +1918,7 @@ arge_multiphy_mediastatus(struct ifnet * struct arge_softc *sc = ifp->if_softc; ifmr->ifm_status = IFM_AVALID | IFM_ACTIVE; - ifmr->ifm_active = IFM_ETHER | sc->arge_media_type | + ifmr->ifm_active = IFM_ETHER | sc->arge_media_type | sc->arge_duplex_mode; } From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 22:45:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D81F106564A; Tue, 6 Mar 2012 22:45:55 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA988FC0A; Tue, 6 Mar 2012 22:45:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q26MjtIB060829; Tue, 6 Mar 2012 22:45:55 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26MjtA2060827; Tue, 6 Mar 2012 22:45:55 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201203062245.q26MjtA2060827@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 6 Mar 2012 22:45: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: r232628 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 22:45:55 -0000 Author: ray Date: Tue Mar 6 22:45:54 2012 New Revision: 232628 URL: http://svn.freebsd.org/changeset/base/232628 Log: Break long lines. Approved by: adri (mentor) Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Tue Mar 6 22:16:10 2012 (r232627) +++ head/sys/mips/atheros/if_arge.c Tue Mar 6 22:45:54 2012 (r232628) @@ -220,8 +220,8 @@ arge_attach_sysctl(device_t dev) "number of TX aligned packets"); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "tx_pkts_unaligned", CTLFLAG_RW, &sc->stats.tx_pkts_unaligned, 0, - "number of TX unaligned packets"); + "tx_pkts_unaligned", CTLFLAG_RW, &sc->stats.tx_pkts_unaligned, + 0, "number of TX unaligned packets"); #ifdef ARGE_DEBUG SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tx_prod", @@ -262,7 +262,8 @@ arge_attach(device_t dev) resource_long_value(device_get_name(dev), device_get_unit(dev), "eeprommac", &eeprom_mac_addr) == 0) { int i; - const char *mac = (const char *) MIPS_PHYS_TO_KSEG1(eeprom_mac_addr); + const char *mac = + (const char *) MIPS_PHYS_TO_KSEG1(eeprom_mac_addr); device_printf(dev, "Overriding MAC from EEPROM\n"); for (i = 0; i < 6; i++) { ar711_base_mac[i] = mac[i]; @@ -287,7 +288,8 @@ arge_attach(device_t dev) /* Use all phys up to 4 */ phymask = (1 << 4) - 1; - device_printf(dev, "No PHY specified, using mask %d\n", phymask); + device_printf(dev, "No PHY specified, using mask %d\n", + phymask); } /* @@ -407,9 +409,11 @@ arge_attach(device_t dev) DELAY(20); /* Step 2. Punt the MAC core from the central reset register */ - ar71xx_device_stop(sc->arge_mac_unit == 0 ? RST_RESET_GE0_MAC : RST_RESET_GE1_MAC); + ar71xx_device_stop(sc->arge_mac_unit == 0 ? RST_RESET_GE0_MAC : + RST_RESET_GE1_MAC); DELAY(100); - ar71xx_device_start(sc->arge_mac_unit == 0 ? RST_RESET_GE0_MAC : RST_RESET_GE1_MAC); + ar71xx_device_start(sc->arge_mac_unit == 0 ? RST_RESET_GE0_MAC : + RST_RESET_GE1_MAC); /* Step 3. Reconfigure MAC block */ ARGE_WRITE(sc, AR71XX_MAC_CFG1, @@ -433,7 +437,7 @@ arge_attach(device_t dev) * set all four addresses to 66-88-aa-cc-dd-ee */ ARGE_WRITE(sc, AR71XX_MAC_STA_ADDR1, - (eaddr[2] << 24) | (eaddr[3] << 16) | (eaddr[4] << 8) | eaddr[5]); + (eaddr[2] << 24) | (eaddr[3] << 16) | (eaddr[4] << 8) | eaddr[5]); ARGE_WRITE(sc, AR71XX_MAC_STA_ADDR2, (eaddr[0] << 8) | eaddr[1]); ARGE_WRITE(sc, AR71XX_MAC_FIFO_CFG0, @@ -521,7 +525,8 @@ arge_detach(device_t dev) struct arge_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->arge_ifp; - KASSERT(mtx_initialized(&sc->arge_mtx), ("arge mutex not initialized")); + KASSERT(mtx_initialized(&sc->arge_mtx), + ("arge mutex not initialized")); /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { @@ -623,8 +628,9 @@ arge_miibus_readreg(device_t dev, int ph ARGE_MII_WRITE(AR71XX_MAC_MII_CMD, MAC_MII_CMD_WRITE); mtx_unlock(&miibus_mtx); - ARGEDEBUG(sc, ARGE_DBG_MII, "%s: phy=%d, reg=%02x, value[%08x]=%04x\n", __func__, - phy, reg, addr, result); + ARGEDEBUG(sc, ARGE_DBG_MII, + "%s: phy=%d, reg=%02x, value[%08x]=%04x\n", + __func__, phy, reg, addr, result); return (result); } @@ -641,8 +647,8 @@ arge_miibus_writereg(device_t dev, int p if ((sc->arge_phymask & (1 << phy)) == 0) return (-1); - ARGEDEBUG(sc, ARGE_DBG_MII, "%s: phy=%d, reg=%02x, value=%04x\n", __func__, - phy, reg, data); + ARGEDEBUG(sc, ARGE_DBG_MII, "%s: phy=%d, reg=%02x, value=%04x\n", + __func__, phy, reg, data); mtx_lock(&miibus_mtx); ARGE_MII_WRITE(AR71XX_MAC_MII_ADDR, addr); @@ -979,7 +985,8 @@ arge_encap(struct arge_softc *sc, struct BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Start transmitting */ - ARGEDEBUG(sc, ARGE_DBG_TX, "%s: setting DMA_TX_CONTROL_EN\n", __func__); + ARGEDEBUG(sc, ARGE_DBG_TX, "%s: setting DMA_TX_CONTROL_EN\n", + __func__); ARGE_WRITE(sc, AR71XX_DMA_TX_CONTROL, DMA_TX_CONTROL_EN); return (0); } @@ -1022,8 +1029,10 @@ arge_start_locked(struct ifnet *ifp) */ if (sc->arge_cdata.arge_tx_cnt >= ARGE_TX_RING_COUNT - 2) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ARGEDEBUG(sc, ARGE_DBG_ERR, "%s: tx_cnt %d >= max %d; setting IFF_DRV_OACTIVE\n", - __func__, sc->arge_cdata.arge_tx_cnt, ARGE_TX_RING_COUNT - 2); + ARGEDEBUG(sc, ARGE_DBG_ERR, + "%s: tx_cnt %d >= max %d; setting IFF_DRV_OACTIVE\n", + __func__, sc->arge_cdata.arge_tx_cnt, + ARGE_TX_RING_COUNT - 2); return; } @@ -1054,7 +1063,8 @@ arge_start_locked(struct ifnet *ifp) */ ETHER_BPF_MTAP(ifp, m_head); } - ARGEDEBUG(sc, ARGE_DBG_TX, "%s: finished; queued %d packets\n", __func__, enq); + ARGEDEBUG(sc, ARGE_DBG_TX, "%s: finished; queued %d packets\n", + __func__, enq); } static void @@ -1118,10 +1128,12 @@ arge_ioctl(struct ifnet *ifp, u_long com case SIOCSIFMEDIA: if (sc->arge_miibus) { mii = device_get_softc(sc->arge_miibus); - error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, + command); } else - error = ifmedia_ioctl(ifp, ifr, &sc->arge_ifmedia, command); + error = ifmedia_ioctl(ifp, ifr, &sc->arge_ifmedia, + command); break; case SIOCSIFCAP: /* XXX: Check other capabilities */ @@ -1231,7 +1243,8 @@ arge_dma_alloc(struct arge_softc *sc) NULL, NULL, /* lockfunc, lockarg */ &sc->arge_cdata.arge_parent_tag); if (error != 0) { - device_printf(sc->arge_dev, "failed to create parent DMA tag\n"); + device_printf(sc->arge_dev, + "failed to create parent DMA tag\n"); goto fail; } /* Create tag for Tx ring. */ @@ -1248,7 +1261,8 @@ arge_dma_alloc(struct arge_softc *sc) NULL, NULL, /* lockfunc, lockarg */ &sc->arge_cdata.arge_tx_ring_tag); if (error != 0) { - device_printf(sc->arge_dev, "failed to create Tx ring DMA tag\n"); + device_printf(sc->arge_dev, + "failed to create Tx ring DMA tag\n"); goto fail; } @@ -1266,7 +1280,8 @@ arge_dma_alloc(struct arge_softc *sc) NULL, NULL, /* lockfunc, lockarg */ &sc->arge_cdata.arge_rx_ring_tag); if (error != 0) { - device_printf(sc->arge_dev, "failed to create Rx ring DMA tag\n"); + device_printf(sc->arge_dev, + "failed to create Rx ring DMA tag\n"); goto fail; } @@ -1309,7 +1324,8 @@ arge_dma_alloc(struct arge_softc *sc) /* Allocate DMA'able memory and load the DMA map for Tx ring. */ error = bus_dmamem_alloc(sc->arge_cdata.arge_tx_ring_tag, (void **)&sc->arge_rdata.arge_tx_ring, BUS_DMA_WAITOK | - BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->arge_cdata.arge_tx_ring_map); + BUS_DMA_COHERENT | BUS_DMA_ZERO, + &sc->arge_cdata.arge_tx_ring_map); if (error != 0) { device_printf(sc->arge_dev, "failed to allocate DMA'able memory for Tx ring\n"); @@ -1330,7 +1346,8 @@ arge_dma_alloc(struct arge_softc *sc) /* Allocate DMA'able memory and load the DMA map for Rx ring. */ error = bus_dmamem_alloc(sc->arge_cdata.arge_rx_ring_tag, (void **)&sc->arge_rdata.arge_rx_ring, BUS_DMA_WAITOK | - BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->arge_cdata.arge_rx_ring_map); + BUS_DMA_COHERENT | BUS_DMA_ZERO, + &sc->arge_cdata.arge_rx_ring_map); if (error != 0) { device_printf(sc->arge_dev, "failed to allocate DMA'able memory for Rx ring\n"); @@ -1632,7 +1649,8 @@ arge_tx_locked(struct arge_softc *sc) cons = sc->arge_cdata.arge_tx_cons; prod = sc->arge_cdata.arge_tx_prod; - ARGEDEBUG(sc, ARGE_DBG_TX, "%s: cons=%d, prod=%d\n", __func__, cons, prod); + ARGEDEBUG(sc, ARGE_DBG_TX, "%s: cons=%d, prod=%d\n", __func__, cons, + prod); if (cons == prod) return; @@ -1835,7 +1853,8 @@ arge_intr(void *arg) if (status & DMA_INTR_TX_UNDERRUN) { ARGE_WRITE(sc, AR71XX_DMA_TX_STATUS, DMA_TX_STATUS_UNDERRUN); sc->stats.tx_underflow++; - ARGEDEBUG(sc, ARGE_DBG_TX, "%s: TX underrun; tx_cnt=%d\n", __func__, sc->arge_cdata.arge_tx_cnt); + ARGEDEBUG(sc, ARGE_DBG_TX, "%s: TX underrun; tx_cnt=%d\n", + __func__, sc->arge_cdata.arge_tx_cnt); if (sc->arge_cdata.arge_tx_cnt > 0 ) { ARGE_WRITE(sc, AR71XX_DMA_TX_CONTROL, DMA_TX_CONTROL_EN); From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 22:58:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D4D01065673; Tue, 6 Mar 2012 22:58:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF6088FC18; Tue, 6 Mar 2012 22:58: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 q26MwDZY061232; Tue, 6 Mar 2012 22:58:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26MwDI6061226; Tue, 6 Mar 2012 22:58:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201203062258.q26MwDI6061226@svn.freebsd.org> From: Andrew Thompson Date: Tue, 6 Mar 2012 22:58: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: r232629 - in head: sbin/ifconfig sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 22:58:14 -0000 Author: thompsa Date: Tue Mar 6 22:58:13 2012 New Revision: 232629 URL: http://svn.freebsd.org/changeset/base/232629 Log: Add the ability to set which packet layers are used for the load balance hash calculation. Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/iflagg.c head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Tue Mar 6 22:45:54 2012 (r232628) +++ head/sbin/ifconfig/ifconfig.8 Tue Mar 6 22:58:13 2012 (r232629) @@ -2309,6 +2309,21 @@ Set the aggregation protocol. The default is failover. The available options are failover, fec, lacp, loadbalance, roundrobin and none. +.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc +Set the packet layers to hash for aggregation protocols which load balance. +The default is +.Dq l2,l3,l4 . +The options can be combined using commas. +.Pp +.Bl -tag -width ".Cm l2" -compact +.It Cm l2 +src/dst mac address and optional vlan number. +.It Cm l3 +src/dst address for IPv4 or IPv6. +.It Cm l4 +src/dst port for TCP/UCP/SCTP. +.El +.Pp .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Tue Mar 6 22:45:54 2012 (r232628) +++ head/sbin/ifconfig/iflagg.c Tue Mar 6 22:58:13 2012 (r232629) @@ -81,6 +81,36 @@ setlaggproto(const char *val, int d, int err(1, "SIOCSLAGG"); } +static void +setlagghash(const char *val, int d, int s, const struct afswtch *afp) +{ + struct lagg_reqflags rf; + char *str, *tmp, *tok; + + + rf.rf_flags = 0; + str = tmp = strdup(val); + while ((tok = strsep(&tmp, ",")) != NULL) { + if (strcmp(tok, "l2") == 0) + rf.rf_flags |= LAGG_F_HASHL2; + else if (strcmp(tok, "l3") == 0) + rf.rf_flags |= LAGG_F_HASHL3; + else if (strcmp(tok, "l4") == 0) + rf.rf_flags |= LAGG_F_HASHL4; + else { + free(str); + errx(1, "Invalid lagghash option: %s", tok); + } + } + free(str); + if (rf.rf_flags == 0) + errx(1, "No lagghash options supplied"); + + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); + if (ioctl(s, SIOCSLAGGHASH, &rf)) + err(1, "SIOCSLAGGHASH"); +} + static char * lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen) { @@ -115,6 +145,7 @@ lagg_status(int s) struct lagg_protos lpr[] = LAGG_PROTOS; struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS]; struct lagg_reqall ra; + struct lagg_reqflags rf; struct lacp_opreq *lp; const char *proto = ""; int i, isport = 0; @@ -132,6 +163,10 @@ lagg_status(int s) ra.ra_size = sizeof(rpbuf); ra.ra_port = rpbuf; + strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); + if (ioctl(s, SIOCGLAGGFLAGS, &rf) != 0) + rf.rf_flags = 0; + if (ioctl(s, SIOCGLAGG, &ra) == 0) { lp = (struct lacp_opreq *)&ra.ra_lacpreq; @@ -143,6 +178,23 @@ lagg_status(int s) } printf("\tlaggproto %s", proto); + if (rf.rf_flags & LAGG_F_HASHMASK) { + const char *sep = ""; + + printf(" lagghash "); + if (rf.rf_flags & LAGG_F_HASHL2) { + printf("%sl2", sep); + sep = ","; + } + if (rf.rf_flags & LAGG_F_HASHL3) { + printf("%sl3", sep); + sep = ","; + } + if (rf.rf_flags & LAGG_F_HASHL4) { + printf("%sl4", sep); + sep = ","; + } + } if (isport) printf(" laggdev %s", rp.rp_ifname); putchar('\n'); @@ -174,6 +226,7 @@ static struct cmd lagg_cmds[] = { DEF_CMD_ARG("laggport", setlaggport), DEF_CMD_ARG("-laggport", unsetlaggport), DEF_CMD_ARG("laggproto", setlaggproto), + DEF_CMD_ARG("lagghash", setlagghash), }; static struct afswtch af_lagg = { .af_name = "af_lagg", Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Tue Mar 6 22:45:54 2012 (r232628) +++ head/sys/net/ieee8023ad_lacp.c Tue Mar 6 22:58:13 2012 (r232629) @@ -815,7 +815,7 @@ lacp_select_tx_port(struct lagg_softc *s if (sc->use_flowid && (m->m_flags & M_FLOWID)) hash = m->m_pkthdr.flowid; else - hash = lagg_hashmbuf(m, lsc->lsc_hashkey); + hash = lagg_hashmbuf(sc, m, lsc->lsc_hashkey); hash %= pm->pm_count; lp = pm->pm_map[hash]; Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Mar 6 22:45:54 2012 (r232628) +++ head/sys/net/if_lagg.c Tue Mar 6 22:58:13 2012 (r232629) @@ -285,6 +285,8 @@ lagg_clone_create(struct if_clone *ifc, SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, "Use flow id for load sharing"); + /* Hash all layers by default */ + sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; sc->sc_proto = LAGG_PROTO_NONE; for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) { @@ -895,6 +897,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; struct lagg_reqall *ra = (struct lagg_reqall *)data; struct lagg_reqport *rp = (struct lagg_reqport *)data, rpbuf; + struct lagg_reqflags *rf = (struct lagg_reqflags *)data; struct ifreq *ifr = (struct ifreq *)data; struct lagg_port *lp; struct ifnet *tpif; @@ -984,6 +987,22 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd } error = EPROTONOSUPPORT; break; + case SIOCGLAGGFLAGS: + rf->rf_flags = sc->sc_flags; + break; + case SIOCSLAGGHASH: + error = priv_check(td, PRIV_NET_LAGG); + if (error) + break; + if ((rf->rf_flags & LAGG_F_HASHMASK) == 0) { + error = EINVAL; + break; + } + LAGG_WLOCK(sc); + sc->sc_flags &= ~LAGG_F_HASHMASK; + sc->sc_flags |= rf->rf_flags & LAGG_F_HASHMASK; + LAGG_WUNLOCK(sc); + break; case SIOCGLAGGPORT: if (rp->rp_portname[0] == '\0' || (tpif = ifunit(rp->rp_portname)) == NULL) { @@ -1413,34 +1432,46 @@ lagg_gethdr(struct mbuf *m, u_int off, u } uint32_t -lagg_hashmbuf(struct mbuf *m, uint32_t key) +lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key) { uint16_t etype; - uint32_t p = 0; + uint32_t p = key; int off; struct ether_header *eh; struct ether_vlan_header vlanbuf; const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; - struct ip ipbuf; + const uint32_t *ports; + int iphlen; #endif #ifdef INET6 const struct ip6_hdr *ip6; - struct ip6_hdr ip6buf; uint32_t flow; #endif + union { +#ifdef INET + struct ip ip; +#endif +#ifdef INET6 + struct ip6_hdr ip6; +#endif + uint32_t port; + } buf; + off = sizeof(*eh); if (m->m_len < off) goto out; eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); - p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, key); - p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + if (sc->sc_flags & LAGG_F_HASHL2) { + p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); + p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + } /* Special handling for encapsulating VLAN frames */ - if (m->m_flags & M_VLANTAG) { + if ((m->m_flags & M_VLANTAG) && (sc->sc_flags & LAGG_F_HASHL2)) { p = hash32_buf(&m->m_pkthdr.ether_vtag, sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { @@ -1448,7 +1479,8 @@ lagg_hashmbuf(struct mbuf *m, uint32_t k if (vlan == NULL) goto out; - p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); + if (sc->sc_flags & LAGG_F_HASHL2) + p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); etype = ntohs(vlan->evl_proto); off += sizeof(*vlan) - sizeof(*eh); } @@ -1456,17 +1488,37 @@ lagg_hashmbuf(struct mbuf *m, uint32_t k switch (etype) { #ifdef INET case ETHERTYPE_IP: - ip = lagg_gethdr(m, off, sizeof(*ip), &ipbuf); + ip = lagg_gethdr(m, off, sizeof(*ip), &buf); if (ip == NULL) goto out; - p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); - p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + if (sc->sc_flags & LAGG_F_HASHL3) { + p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); + p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + } + if (!(sc->sc_flags & LAGG_F_HASHL4)) + break; + switch (ip->ip_p) { + case IPPROTO_TCP: + case IPPROTO_UDP: + case IPPROTO_SCTP: + iphlen = ip->ip_hl << 2; + if (iphlen < sizeof(*ip)) + break; + off += iphlen; + ports = lagg_gethdr(m, off, sizeof(*ports), &buf); + if (ports == NULL) + break; + p = hash32_buf(ports, sizeof(*ports), p); + break; + } break; #endif #ifdef INET6 case ETHERTYPE_IPV6: - ip6 = lagg_gethdr(m, off, sizeof(*ip6), &ip6buf); + if (!(sc->sc_flags & LAGG_F_HASHL3)) + break; + ip6 = lagg_gethdr(m, off, sizeof(*ip6), &buf); if (ip6 == NULL) goto out; @@ -1696,7 +1748,7 @@ lagg_lb_start(struct lagg_softc *sc, str if (sc->use_flowid && (m->m_flags & M_FLOWID)) p = m->m_pkthdr.flowid; else - p = lagg_hashmbuf(m, lb->lb_key); + p = lagg_hashmbuf(sc, m, lb->lb_key); p %= sc->sc_count; lp = lb->lb_ports[p]; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Tue Mar 6 22:45:54 2012 (r232628) +++ head/sys/net/if_lagg.h Tue Mar 6 22:58:13 2012 (r232629) @@ -31,6 +31,12 @@ #define LAGG_MAX_NAMESIZE 32 /* name of a protocol */ #define LAGG_MAX_STACKING 4 /* maximum number of stacked laggs */ +/* Lagg flags */ +#define LAGG_F_HASHL2 0x00000001 /* hash layer 2 */ +#define LAGG_F_HASHL3 0x00000002 /* hash layer 3 */ +#define LAGG_F_HASHL4 0x00000004 /* hash layer 4 */ +#define LAGG_F_HASHMASK 0x00000007 + /* Port flags */ #define LAGG_PORT_SLAVE 0x00000000 /* normal enslaved port */ #define LAGG_PORT_MASTER 0x00000001 /* primary port */ @@ -122,6 +128,14 @@ struct lagg_reqall { #define SIOCGLAGG _IOWR('i', 143, struct lagg_reqall) #define SIOCSLAGG _IOW('i', 144, struct lagg_reqall) +struct lagg_reqflags { + char rf_ifname[IFNAMSIZ]; /* name of the lagg */ + uint32_t rf_flags; /* lagg protocol */ +}; + +#define SIOCGLAGGFLAGS _IOWR('i', 145, struct lagg_reqflags) +#define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags) + #ifdef _KERNEL /* * Internal kernel part @@ -179,6 +193,7 @@ struct lagg_softc { struct ifmedia sc_media; /* media config */ caddr_t sc_psc; /* protocol data */ uint32_t sc_seq; /* sequence counter */ + uint32_t sc_flags; SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ SLIST_ENTRY(lagg_softc) sc_entries; @@ -244,7 +259,7 @@ extern struct mbuf *(*lagg_input_p)(stru extern void (*lagg_linkstate_p)(struct ifnet *, int ); int lagg_enqueue(struct ifnet *, struct mbuf *); -uint32_t lagg_hashmbuf(struct mbuf *, uint32_t); +uint32_t lagg_hashmbuf(struct lagg_softc *, struct mbuf *, uint32_t); #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 23:08:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A456A106566C; Tue, 6 Mar 2012 23:08:03 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 930AF8FC1B; Tue, 6 Mar 2012 23:08: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 q26N83EU061577; Tue, 6 Mar 2012 23:08:03 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q26N83i3061573; Tue, 6 Mar 2012 23:08:03 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203062308.q26N83i3061573@svn.freebsd.org> From: Juli Mallett Date: Tue, 6 Mar 2012 23:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232630 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 23:08:03 -0000 Author: jmallett Date: Tue Mar 6 23:08:02 2012 New Revision: 232630 URL: http://svn.freebsd.org/changeset/base/232630 Log: Get rid of duplicated versions of the KSU bits. Modified: head/sys/mips/include/cpu.h head/sys/mips/mips/exception.S head/sys/mips/mips/mpboot.S Modified: head/sys/mips/include/cpu.h ============================================================================== --- head/sys/mips/include/cpu.h Tue Mar 6 22:58:13 2012 (r232629) +++ head/sys/mips/include/cpu.h Tue Mar 6 23:08:02 2012 (r232630) @@ -51,11 +51,6 @@ /* BEGIN: these are going away */ -#define SR_KSU_MASK 0x00000018 -#define SR_KSU_USER 0x00000010 -#define SR_KSU_SUPER 0x00000008 -#define SR_KSU_KERNEL 0x00000000 - #define soft_int_mask(softintr) (1 << ((softintr) + 8)) #define hard_int_mask(hardintr) (1 << ((hardintr) + 10)) @@ -69,7 +64,7 @@ #include #include -#define TRAPF_USERMODE(framep) (((framep)->sr & SR_KSU_USER) != 0) +#define TRAPF_USERMODE(framep) (((framep)->sr & MIPS_SR_KSU_USER) != 0) #define TRAPF_PC(framep) ((framep)->pc) #define cpu_getstack(td) ((td)->td_frame->sp) #define cpu_setstack(td, nsp) ((td)->td_frame->sp = (nsp)) Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Tue Mar 6 22:58:13 2012 (r232629) +++ head/sys/mips/mips/exception.S Tue Mar 6 23:08:02 2012 (r232630) @@ -162,7 +162,7 @@ VECTOR(MipsException, unknown) .set noat mfc0 k0, MIPS_COP_0_STATUS # Get the status register mfc0 k1, MIPS_COP_0_CAUSE # Get the cause register value. - and k0, k0, SR_KSU_USER # test for user mode + and k0, k0, MIPS_SR_KSU_USER # test for user mode # sneaky but the bits are # with us........ sll k0, k0, 3 # shift user bit for cause index @@ -193,7 +193,7 @@ SlowFault: .set noat mfc0 k0, MIPS_COP_0_STATUS nop - and k0, k0, SR_KSU_USER + and k0, k0, MIPS_SR_KSU_USER bne k0, zero, _C_LABEL(MipsUserGenException) nop .set at @@ -224,7 +224,7 @@ SlowFault: mfc0 a0, MIPS_COP_0_STATUS ;\ li a2, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) ; \ or a0, a0, a2 ; \ - li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER) ; \ + li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | MIPS_SR_KSU_USER) ; \ and a0, a0, a2 ; \ mtc0 a0, MIPS_COP_0_STATUS ; \ ITLBNOPFIX @@ -233,14 +233,14 @@ SlowFault: mfc0 a0, MIPS_COP_0_STATUS ;\ li a2, (MIPS_SR_KX | MIPS_SR_UX | MIPS_SR_COP_2_BIT) ; \ or a0, a0, a2 ; \ - li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER) ; \ + li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | MIPS_SR_KSU_USER) ; \ and a0, a0, a2 ; \ mtc0 a0, MIPS_COP_0_STATUS ; \ ITLBNOPFIX #else #define CLEAR_STATUS \ mfc0 a0, MIPS_COP_0_STATUS ;\ - li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER) ; \ + li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | MIPS_SR_KSU_USER) ; \ and a0, a0, a2 ; \ mtc0 a0, MIPS_COP_0_STATUS ; \ ITLBNOPFIX @@ -929,7 +929,7 @@ tlb_insert_random: * Branch to the comprehensive exception processing. */ mfc0 k1, MIPS_COP_0_STATUS - andi k1, k1, SR_KSU_USER + andi k1, k1, MIPS_SR_KSU_USER bnez k1, _C_LABEL(MipsUserGenException) nop Modified: head/sys/mips/mips/mpboot.S ============================================================================== --- head/sys/mips/mips/mpboot.S Tue Mar 6 22:58:13 2012 (r232629) +++ head/sys/mips/mips/mpboot.S Tue Mar 6 23:08:02 2012 (r232630) @@ -42,7 +42,7 @@ mfc0 a0, MIPS_COP_0_STATUS ;\ li a2, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) ; \ or a0, a0, a2 ; \ - li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER | MIPS_SR_BEV) ; \ + li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | MIPS_SR_KSU_USER | MIPS_SR_BEV) ; \ and a0, a0, a2 ; \ mtc0 a0, MIPS_COP_0_STATUS #elif defined(__mips_n64) From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 03:29:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4D09106564A; Wed, 7 Mar 2012 03:29:37 +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 113F98FC18; Wed, 7 Mar 2012 03:29:36 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q273TSsI021296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 7 Mar 2012 14:29:29 +1100 Date: Wed, 7 Mar 2012 14:29:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <201203062015.q26KFNJA055743@svn.freebsd.org> Message-ID: <20120307120126.K969@besplex.bde.org> References: <201203062015.q26KFNJA055743@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: r232620 - in head/include: . xlocale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 03:29:37 -0000 On Tue, 6 Mar 2012, Dimitry Andric wrote: > Log: > After r232498, programs built with -ansi or -std=c89 including > would not compile anymore, due to plain 'inline' keywords. Fix this by > using __inline instead. > > Reported by: Jia-Shiun Li > Discussed with: theraven Any chance of also fixing the style bugs? Old ctype was one of the most carefully written headers, so it was almost free of style bugs. > Modified: head/include/runetype.h > ============================================================================== > --- head/include/runetype.h Tue Mar 6 20:01:25 2012 (r232619) > +++ head/include/runetype.h Tue Mar 6 20:15:23 2012 (r232620) > @@ -90,7 +90,7 @@ extern const _RuneLocale *_CurrentRuneLo > extern const _RuneLocale *__getCurrentRuneLocale(void); Old ctype had no style bugs like declaring prototypes as extern. Old ctype carefully indented prototypes. > #else > extern _Thread_local const _RuneLocale *_ThreadRuneLocale; > -static inline const _RuneLocale *__getCurrentRuneLocale(void) > +static __inline const _RuneLocale *__getCurrentRuneLocale(void) > { > > if (_ThreadRuneLocale) > > Modified: head/include/xlocale/_ctype.h > ============================================================================== > --- head/include/xlocale/_ctype.h Tue Mar 6 20:01:25 2012 (r232619) > +++ head/include/xlocale/_ctype.h Tue Mar 6 20:15:23 2012 (r232620) > @@ -55,11 +55,11 @@ _RuneLocale *__runes_for_locale(locale_t > #ifndef _XLOCALE_INLINE > #if __GNUC__ && !__GNUC_STDC_INLINE__ > /* GNU89 inline has nonstandard semantics. */ > -#define _XLOCALE_INLINE extern inline > +#define _XLOCALE_INLINE extern __inline Old ctype always used a tab after #define. Old ctype even used a tab after macro names. > #else > /* Hack to work around people who define inline away */ Old ctype mostly terminated its comments. This comment now doesn't match the code. The code is now supposed to use __inline, so it isn't affected by defining away inline. > #ifdef inline This part of the code was nonsense and hasn't really changed. The code should be using __inline, so it shouldn't be affected by any definition of inline. defines both inline and __inline to support old compilers. FreeBSD headers should not have their own ifdefs for this. > -#define _XLOCALE_INLINE __inline static > +#define _XLOCALE_INLINE static __inline This change is just a partial style fix. __inline was already used here, and still is, but in a different order. 2 style bugs remain in this line (same 2 as above). > #else > /* Define with C++ / C99 compatible semantics */ > #define _XLOCALE_INLINE inline This still doesn't use __inline, so it is still broken in most cases where it is reached at all, if any. `inline' not being defined has very little to do with whether it actually works here. There are some complications for old gcc extern inline vs C99 extern inline, but otherwise this code should just use __inline as defined in and not add its own ifdef tangle to the one there. Or better yet, use only static __inline like old ctype does. I once hoped to replace the static inlines in ctype.h by extern inline ones, but that was before changing the semantics of extern inline made it evern harder to use. Using it in libm mainly gives unportability to C90. Repeating the above, with the ifdefs untangled a bit: > Modified: head/include/xlocale/_ctype.h > ============================================================================== > --- head/include/xlocale/_ctype.h Tue Mar 6 20:01:25 2012 (r232619) > +++ head/include/xlocale/_ctype.h Tue Mar 6 20:15:23 2012 (r232620) > @@ -55,11 +55,11 @@ _RuneLocale *__runes_for_locale(locale_t > #ifndef _XLOCALE_INLINE > #if __GNUC__ && !__GNUC_STDC_INLINE__ The first part of this should be written as defined(__GNUC__), to support broken compilers that warn about an undefined identifier being used in an ifdef. Unfortunately, the simpler test 'ifdef __GNUC_GNU_INLINE__' seems to be unusable, since old versions of gcc that only have gnu inline also don't have a feature test for it. > /* GNU89 inline has nonstandard semantics. */ > -#define _XLOCALE_INLINE extern inline > +#define _XLOCALE_INLINE extern __inline I'm not sure if this actually works. Old gnu extern inline is quite different from C99 plain inline. Anyway, the above seems to fix the main bug. Old version of gcc have both inline and __inline, but -ansi or -std=c89 kills both. Except, very old versions of gcc (gcc-1?) have neither. These are partially handled by killing __inline. normally doesn't kill inline; it takes the namespace pollution NO_ANSI_KEYWORDS to do that; the semantics of this are even subtler. The fix seems to be only partial, since "extern inline" in any spelling simply doesn't work for compilers that don't support inline in any form. Here we have slightly wrong ifdefs that lead gcc-1 being misclassified and then mishandled in this clause of the ifdef tangle. The non-working spelling is now "extern" instead of "extern inline". The "extern" has been reduced to a style bug, since without a non-null "inline", it has no effect, but it needs to have an effect to work. > #else Now we have classified the compiler as either non-gcc, or gcc with STDC extern inline. > /* Hack to work around people who define inline away */ > #ifdef inline > -#define _XLOCALE_INLINE __inline static > +#define _XLOCALE_INLINE static __inline > #else > /* Define with C++ / C99 compatible semantics */ > #define _XLOCALE_INLINE inline It is now clearer that the inline ifdef has almost no effect. `inline' should never be defined. only defines it under weird obsolete conditions, and the application shouldn't define it. But if it might be defined, then we get the following behaviour from its ifdef: - if it is defined, then we use static __inline. If this actually works, then it is what we should use, without ifdefs, in all cases. - if it is not defined, then we assume C99 extern inline semantics (with implicit extern (IIRC, the extern is still needed, but is placed weirdly, not in the header file but in the C file; thus it is not part of the public interface and needs slightly different ifdefs). This assumption is invalid, since we haven't done a full classification of the compiler. We only know that the compiler supports C99 extern semantics if it is gcc. This leaves the following broken cases: - any C90 compiler that is not gcc - any K&R compiler In both of the cases, the compiler won't support inline in any form, so the only chance for working is to use "static __inline" where kills __inline, or to not have any inline functions in headers. Old did the latter, and still works with sources installed on 19 Feb 2012. Now it declares bazillions of inline functions. Most kernel headers do the former. Differences between the results of cc -E and cc -E -I on the file #undef __GNUC__ #include % diff -c2 a~ a % *** a~ Wed Mar 7 02:30:02 2012 % --- a Wed Mar 7 02:30:11 2012 % *************** % *** 4,11 **** % # 1 "a.c" % % ! # 1 "/usr/include/ctype.h" 1 3 4 % ! # 44 "/usr/include/ctype.h" 3 4 % # 1 "/usr/include/sys/cdefs.h" 1 3 4 % ! # 45 "/usr/include/ctype.h" 2 3 4 % # 1 "/usr/include/sys/_types.h" 1 3 4 % # 33 "/usr/include/sys/_types.h" 3 4 % --- 4,11 ---- % # 1 "a.c" % % ! # 1 "include/ctype.h" 1 % ! # 44 "include/ctype.h" % # 1 "/usr/include/sys/cdefs.h" 1 3 4 % ! # 45 "include/ctype.h" 2 % # 1 "/usr/include/sys/_types.h" 1 3 4 % # 33 "/usr/include/sys/_types.h" 3 4 % *************** % *** 136,142 **** % __int64_t _mbstateL; % } __mbstate_t; % ! # 46 "/usr/include/ctype.h" 2 3 4 % ! # 1 "/usr/include/_ctype.h" 1 3 4 % ! # 70 "/usr/include/_ctype.h" 3 4 % % unsigned long ___runetype(__ct_rune_t) ; % --- 136,142 ---- % __int64_t _mbstateL; % } __mbstate_t; % ! # 46 "include/ctype.h" 2 % ! # 1 "include/_ctype.h" 1 % ! # 70 "include/_ctype.h" % % unsigned long ___runetype(__ct_rune_t) ; % *************** % *** 144,150 **** % __ct_rune_t ___toupper(__ct_rune_t) ; % % ! # 86 "/usr/include/_ctype.h" 3 4 % extern int __mb_sb_limit; % ! # 172 "/usr/include/_ctype.h" 3 4 % % int __maskrune(__ct_rune_t, unsigned long); % --- 144,150 ---- % __ct_rune_t ___toupper(__ct_rune_t) ; % % ! # 86 "include/_ctype.h" % extern int __mb_sb_limit; % ! # 172 "include/_ctype.h" % % int __maskrune(__ct_rune_t, unsigned long); % *************** % *** 159,163 **** % int __wcwidth(__ct_rune_t); % % ! # 47 "/usr/include/ctype.h" 2 3 4 % % % --- 159,163 ---- % int __wcwidth(__ct_rune_t); % % ! # 47 "include/ctype.h" 2 % % % *************** % *** 195,197 **** % --- 195,274 ---- % % % + % + # 1 "include/xlocale/_ctype.h" 1 % + # 44 "include/xlocale/_ctype.h" This include is about the only change in ctype.h. % + typedef struct _xlocale *locale_t; xlocale also gives massive namespace pollution. locale_t isn't in C90. Compiling with -std=c89 -pedantic doesn't change the output at all. % + % + % + % + % + unsigned long ___runetype_l(__ct_rune_t, locale_t) ; The strange formatting (space before semicolon) is due to a __pure being there. __pure is correctly ifdefed, so my #undef of __GNUC__ kills it % + __ct_rune_t ___tolower_l(__ct_rune_t, locale_t) ; % + __ct_rune_t ___toupper_l(__ct_rune_t, locale_t) ; % + _RuneLocale *__runes_for_locale(locale_t, int*); The misformatting of "int*" is in the source code. The ifdefs are broken in other ways. _RuneLocale is not declared here. Without the #undef of __GNUC__, it is declared, and the preprocessed output is 132 lines longer and all compile, and the extra lines seem to be mostly correct too, since they are careful about namespaces and don't declare any new APIs. % + # 91 "include/xlocale/_ctype.h" % + static int __inline was corrctly killed here. % + __sbmaskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) Namespace pollution (parameter name `locale' in the application namesspace. The other arg names are from old ctype code which is missing such bugs. % + { % + int mb_sb_limit; More namespace pollution. % + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); More namespace pollution. Style bugs: initialization in declaration; no blank line after declarations). % + return (_c < 0 || _c >= mb_sb_limit) ? 0 : % + runes->__runetype[_c] & _f; Style bugs: unnecessary line splitting; weird continuation indent of 7 spaces (4 would be KNF and 1 tab would be gnu). % + } % + % + static int % + __sbistype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) % + { % + return (!!__sbmaskrune_l(_c, _f, locale)); % + } Similarly. % + % + % + % + % + % + % + % + inline int isalnum_l(int c, locale_t l); inline int isalnum_l(int c, locale_t l) { return __sbistype_l(c, 0x00000100L|0x00000400L, l); } Now since we misclassified the compiler and don't use __inline, we have syntax errors from `inline'. We also have namespace pollution in almost every indentifier: - isalnum_l, locale_t: not in C89 - c, l: in application namespace We also have a redundant forward declaration. This seems to be technically necessary in some cases, to avoid warnings from -Wmissing-prototypes. But surely any such warnings are bugs for inline functions, and the compilers that don't support inline functions also don't support such warnings? In the source code, the 'inline' part is spelled _XLOCALE_INLINE, and it should reduce to the missing-prototype case, except I faked the compiler not being gcc and with a real non-gcc there would be no warning. The style bugs of hard explicit long constants and no space around the binary operator '|' seem to be in old ctype code. % + inline int isalpha_l(int c, locale_t l); inline int isalpha_l(int c, locale_t l) { return __sbistype_l(c, 0x00000100L, l); } % + inline int isblank_l(int c, locale_t l); inline int isblank_l(int c, locale_t l) { return __sbistype_l(c, 0x00020000L, l); } % + inline int iscntrl_l(int c, locale_t l); inline int iscntrl_l(int c, locale_t l) { return __sbistype_l(c, 0x00000200L, l); } % + inline int isdigit_l(int c, locale_t l); inline int isdigit_l(int c, locale_t l) { return __sbistype_l(c, 0x00000400L, l); } % + inline int isgraph_l(int c, locale_t l); inline int isgraph_l(int c, locale_t l) { return __sbistype_l(c, 0x00000800L, l); } % + inline int ishexnumber_l(int c, locale_t l); inline int ishexnumber_l(int c, locale_t l) { return __sbistype_l(c, 0x00010000L, l); } % + inline int isideogram_l(int c, locale_t l); inline int isideogram_l(int c, locale_t l) { return __sbistype_l(c, 0x00080000L, l); } % + inline int islower_l(int c, locale_t l); inline int islower_l(int c, locale_t l) { return __sbistype_l(c, 0x00001000L, l); } % + inline int isnumber_l(int c, locale_t l); inline int isnumber_l(int c, locale_t l) { return __sbistype_l(c, 0x00000400L, l); } % + inline int isphonogram_l(int c, locale_t l); inline int isphonogram_l(int c, locale_t l) { return __sbistype_l(c, 0x00200000L, l); } % + inline int isprint_l(int c, locale_t l); inline int isprint_l(int c, locale_t l) { return __sbistype_l(c, 0x00040000L, l); } % + inline int ispunct_l(int c, locale_t l); inline int ispunct_l(int c, locale_t l) { return __sbistype_l(c, 0x00002000L, l); } % + inline int isrune_l(int c, locale_t l); inline int isrune_l(int c, locale_t l) { return __sbistype_l(c, 0xFFFFFF00L, l); } % + inline int isspace_l(int c, locale_t l); inline int isspace_l(int c, locale_t l) { return __sbistype_l(c, 0x00004000L, l); } % + inline int isspecial_l(int c, locale_t l); inline int isspecial_l(int c, locale_t l) { return __sbistype_l(c, 0x00100000L, l); } % + inline int isupper_l(int c, locale_t l); inline int isupper_l(int c, locale_t l) { return __sbistype_l(c, 0x00008000L, l); } % + inline int isxdigit_l(int c, locale_t l); inline int isxdigit_l(int c, locale_t l) { return __sbistype_l(c, 0x00010000L, l); } These bugs are easy to fix since they are all generated by 1 macro. % + # 170 "include/xlocale/_ctype.h" % + inline int digittoint_l(int, locale_t); % + inline int tolower_l(int, locale_t); % + inline int toupper_l(int, locale_t); % + % + inline int digittoint_l(int __c, locale_t __l) % + { return __sbmaskrune_l((__c), 0xFF, __l); } Mounds of style bugs here. % + % + inline int tolower_l(int __c, locale_t __l) % + { % + int __limit; % + _RuneLocale *__runes = __runes_for_locale(__l, &__limit); % + return (__c < 0 || __c >= __limit) ? __c : % + __runes->__maplower[__c]; % + } % + inline int toupper_l(int __c, locale_t __l) % + { % + int __limit; % + _RuneLocale *__runes = __runes_for_locale(__l, &__limit); % + return (__c < 0 || __c >= __limit) ? __c : % + __runes->__mapupper[__c]; % + } As above, but is more careful about namespaces. This uses ugly unecessary double underscores instead of the necessary single underscores and the broken no underscores. Now the only namespace pollution is the non-C90 interfaces. % + # 84 "include/ctype.h" 2 % + % + % # 2 "a.c" 2 Next I tried defining inline as 'glorp'. This worked as correctly as possible -- it changed all the plain inlines to `static' (according to the ifdefs that avoid using inline if someone is hacking on it) and didn't cause any syntax errors. Of course the glorp would cause syntax errors in anything that uses plain inline. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 06:07:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E05E106568A for ; Wed, 7 Mar 2012 06:07:09 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id D7AFF8FC18 for ; Wed, 7 Mar 2012 06:07:07 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so6576183bkc.13 for ; Tue, 06 Mar 2012 22:07:06 -0800 (PST) Received: by 10.204.129.23 with SMTP id m23mr287688bks.134.1331100426686; Tue, 06 Mar 2012 22:07:06 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-129-214.pppoe.spdop.ru. [95.165.129.214]) by mx.google.com with ESMTPS id k13sm177644bky.10.2012.03.06.22.07.05 (version=SSLv3 cipher=OTHER); Tue, 06 Mar 2012 22:07:06 -0800 (PST) Message-ID: <4F56FB08.2070508@zonov.org> Date: Wed, 07 Mar 2012 10:07:04 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Andrew Thompson References: <201203062258.q26MwDI6061226@svn.freebsd.org> In-Reply-To: <201203062258.q26MwDI6061226@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQniSpK8NYiC5xZOYJAdCaHm4RRJSnGXvzOttJ0LxMEjxbRKwNYoGKJLwfTr7FiO+2JLJUZf Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232629 - in head: sbin/ifconfig sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 06:07:09 -0000 On 07.03.2012 2:58, Andrew Thompson wrote: [snip] > Modified: head/sbin/ifconfig/ifconfig.8 > ============================================================================== > --- head/sbin/ifconfig/ifconfig.8 Tue Mar 6 22:45:54 2012 (r232628) > +++ head/sbin/ifconfig/ifconfig.8 Tue Mar 6 22:58:13 2012 (r232629) > @@ -2309,6 +2309,21 @@ Set the aggregation protocol. > The default is failover. > The available options are failover, fec, lacp, loadbalance, roundrobin and > none. > +.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc > +Set the packet layers to hash for aggregation protocols which load balance. > +The default is > +.Dq l2,l3,l4 . > +The options can be combined using commas. > +.Pp > +.Bl -tag -width ".Cm l2" -compact > +.It Cm l2 > +src/dst mac address and optional vlan number. > +.It Cm l3 > +src/dst address for IPv4 or IPv6. > +.It Cm l4 > +src/dst port for TCP/UCP/SCTP. s/UCP/UDP/? > +.El > +.Pp > .El > .Pp > The following parameters are specific to IP tunnel interfaces, > [snip] -- Andrey Zonov From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 06:23:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E817B1065676 for ; Wed, 7 Mar 2012 06:23:03 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id C2AB68FC15 for ; Wed, 7 Mar 2012 06:23:03 +0000 (UTC) Received: by dakl33 with SMTP id l33so22415107dak.17 for ; Tue, 06 Mar 2012 22:23:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.212.232 with SMTP id nn8mr1874184pbc.156.1331101383112; Tue, 06 Mar 2012 22:23:03 -0800 (PST) Sender: andy@fud.org.nz Received: by 10.68.2.229 with HTTP; Tue, 6 Mar 2012 22:23:03 -0800 (PST) In-Reply-To: <4F56FB08.2070508@zonov.org> References: <201203062258.q26MwDI6061226@svn.freebsd.org> <4F56FB08.2070508@zonov.org> Date: Wed, 7 Mar 2012 19:23:03 +1300 X-Google-Sender-Auth: QZA0d1cw1AaHbpukLgiyIaJCeMw Message-ID: From: Andrew Thompson To: Andrey Zonov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQk4M4AdwxGGdKid+kEqg4c+JGP2BXRablT39Yd91XhyuuOY70FPv9KDApQ1POoVgdhHDBGQ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232629 - in head: sbin/ifconfig sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 06:23:04 -0000 On 7 March 2012 19:07, Andrey Zonov wrote: > On 07.03.2012 2:58, Andrew Thompson wrote: > [snip] > >> Modified: head/sbin/ifconfig/ifconfig.8 >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sbin/ifconfig/ifconfig.8 =A0 =A0 =A0 Tue Mar =A06 22:45:54 2012 >> =A0(r232628) >> +++ head/sbin/ifconfig/ifconfig.8 =A0 =A0 =A0 Tue Mar =A06 22:58:13 2012 >> =A0(r232629) >> @@ -2309,6 +2309,21 @@ Set the aggregation protocol. >> =A0The default is failover. >> =A0The available options are failover, fec, lacp, loadbalance, roundrobi= n >> and >> =A0none. >> +.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc >> +Set the packet layers to hash for aggregation protocols which load >> balance. >> +The default is >> +.Dq l2,l3,l4 . >> +The options can be combined using commas. >> +.Pp >> +.Bl -tag -width ".Cm l2" -compact >> +.It Cm l2 >> +src/dst mac address and optional vlan number. >> +.It Cm l3 >> +src/dst address for IPv4 or IPv6. >> +.It Cm l4 >> +src/dst port for TCP/UCP/SCTP. > > > s/UCP/UDP/? Oops, thanks. From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 06:25:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC0FC106564A; Wed, 7 Mar 2012 06:25:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9725E8FC17; Wed, 7 Mar 2012 06:25: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 q276PHEU078492; Wed, 7 Mar 2012 06:25:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q276PHPq078490; Wed, 7 Mar 2012 06:25:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201203070625.q276PHPq078490@svn.freebsd.org> From: Andrew Thompson Date: Wed, 7 Mar 2012 06:25: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: r232638 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 06:25:17 -0000 Author: thompsa Date: Wed Mar 7 06:25:17 2012 New Revision: 232638 URL: http://svn.freebsd.org/changeset/base/232638 Log: Fix typo and bump the document date which I also forgot. Spotted by: Andrey Zonov Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Mar 7 03:16:45 2012 (r232637) +++ head/sbin/ifconfig/ifconfig.8 Wed Mar 7 06:25:17 2012 (r232638) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd February 29, 2012 +.Dd March 7, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2321,7 +2321,7 @@ src/dst mac address and optional vlan nu .It Cm l3 src/dst address for IPv4 or IPv6. .It Cm l4 -src/dst port for TCP/UCP/SCTP. +src/dst port for TCP/UDP/SCTP. .El .Pp .El From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 06:42:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE4FE106564A; Wed, 7 Mar 2012 06:42:21 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAF5E8FC13; Wed, 7 Mar 2012 06:42: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 q276gLwv079030; Wed, 7 Mar 2012 06:42:21 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q276gLjW079028; Wed, 7 Mar 2012 06:42:21 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201203070642.q276gLjW079028@svn.freebsd.org> From: Remko Lodder Date: Wed, 7 Mar 2012 06:42: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: r232639 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 06:42:22 -0000 Author: remko Date: Wed Mar 7 06:42:21 2012 New Revision: 232639 URL: http://svn.freebsd.org/changeset/base/232639 Log: Add support for the MosChip MCS9904 four serial ports controller. PR: 165804 Submitted by: Eugene Grosbein MFC after: 1 week Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Wed Mar 7 06:25:17 2012 (r232638) +++ head/sys/dev/uart/uart_bus_pci.c Wed Mar 7 06:42:21 2012 (r232639) @@ -126,6 +126,8 @@ static struct pci_id pci_ns8250_ids[] = "MosChip MCS9900 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9901, 0xa000, 0x1000, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, +{ 0x9710, 0x9904, 0xa000, 0x1000, + "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 07:01:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90986106564A; Wed, 7 Mar 2012 07:01:42 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4DE8FC08; Wed, 7 Mar 2012 07:01:41 +0000 (UTC) Received: by lagv3 with SMTP id v3so9791774lag.13 for ; Tue, 06 Mar 2012 23:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 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=+D+k8oRJUcnfWPXyker5NpArCDuK3p01CRDj2ewzmJM=; b=gFXPhbgDNHCh90HIDBe1oHr7XnC+EGnnmqsDOc2V2EKzk02U+kkCVWPetYIa9hdUzq PLVqSkdo5VE+HPia3ezBBi9Ib1ogLUp5L66moeSa8AFLVYb3Ta8dX7x6FzTRgyeQOVIP Jlx0NpLbJ/EhbuESa7YMz1CREfFpCfhJWUmFwdJwhoS7uRbsy8ubCAoT6X3kfNlYnHDc S+LMWQwJa2UWebKMs8pMWoIYV9BqEl9quCLsjV422ERb2Gbs5mmae4w8tv/mfIcpKL1a 9hteTZp3WSx04vffVH8MrmOhVlv0sHOIwlShoV0WwxhVl/pFnYvCy9nyfoX0Cucjm4On lagA== MIME-Version: 1.0 Received: by 10.112.102.161 with SMTP id fp1mr279551lbb.71.1331103700061; Tue, 06 Mar 2012 23:01:40 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Tue, 6 Mar 2012 23:01:37 -0800 (PST) In-Reply-To: <201203062258.q26MwDI6061226@svn.freebsd.org> References: <201203062258.q26MwDI6061226@svn.freebsd.org> Date: Wed, 7 Mar 2012 10:01:37 +0300 X-Google-Sender-Auth: DQckszJ9E0051U1uMQtCXk52scU Message-ID: From: Sergey Kandaurov To: Andrew Thompson 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: r232629 - in head: sbin/ifconfig sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 07:01:42 -0000 On 7 March 2012 02:58, Andrew Thompson wrote: > Author: thompsa > Date: Tue Mar =A06 22:58:13 2012 > New Revision: 232629 > URL: http://svn.freebsd.org/changeset/base/232629 > > Log: > =A0Add the ability to set which packet layers are used for the load balan= ce hash > =A0calculation. > > Modified: > =A0head/sbin/ifconfig/ifconfig.8 > =A0head/sbin/ifconfig/iflagg.c > =A0head/sys/net/ieee8023ad_lacp.c > =A0head/sys/net/if_lagg.c > =A0head/sys/net/if_lagg.h HI. This change breaks LINT-NOIP. Something like this shoud fix it: Index: sys/net/if_lagg.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 --- sys/net/if_lagg.c (revision 232637) +++ sys/net/if_lagg.c (working copy) @@ -1449,6 +1449,7 @@ const struct ip6_hdr *ip6; uint32_t flow; #endif +#if defined(INET) || defined(INET6) union { #ifdef INET struct ip ip; @@ -1458,8 +1459,8 @@ #endif uint32_t port; } buf; +#endif - off =3D sizeof(*eh); if (m->m_len < off) goto out; > Modified: head/sys/net/if_lagg.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/net/if_lagg.c =A0 =A0 =A0Tue Mar =A06 22:45:54 2012 =A0 =A0 = =A0 =A0(r232628) > +++ head/sys/net/if_lagg.c =A0 =A0 =A0Tue Mar =A06 22:58:13 2012 =A0 =A0 = =A0 =A0(r232629) [..] > @@ -1413,34 +1432,46 @@ lagg_gethdr(struct mbuf *m, u_int off, u > =A0} > > =A0uint32_t > -lagg_hashmbuf(struct mbuf *m, uint32_t key) > +lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key) > =A0{ > =A0 =A0 =A0 =A0uint16_t etype; > - =A0 =A0 =A0 uint32_t p =3D 0; > + =A0 =A0 =A0 uint32_t p =3D key; > =A0 =A0 =A0 =A0int off; > =A0 =A0 =A0 =A0struct ether_header *eh; > =A0 =A0 =A0 =A0struct ether_vlan_header vlanbuf; > =A0 =A0 =A0 =A0const struct ether_vlan_header *vlan; > =A0#ifdef INET > =A0 =A0 =A0 =A0const struct ip *ip; > - =A0 =A0 =A0 struct ip ipbuf; > + =A0 =A0 =A0 const uint32_t *ports; > + =A0 =A0 =A0 int iphlen; > =A0#endif > =A0#ifdef INET6 > =A0 =A0 =A0 =A0const struct ip6_hdr *ip6; > - =A0 =A0 =A0 struct ip6_hdr ip6buf; > =A0 =A0 =A0 =A0uint32_t flow; > =A0#endif > + =A0 =A0 =A0 union { > +#ifdef INET > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct ip ip; > +#endif > +#ifdef INET6 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct ip6_hdr ip6; > +#endif > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 uint32_t port; > + =A0 =A0 =A0 } buf; > + > [..] --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 07:22:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1B1D106566B; Wed, 7 Mar 2012 07:22:53 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5398FC0A; Wed, 7 Mar 2012 07:22: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 q277Mrf5080592; Wed, 7 Mar 2012 07:22:53 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q277MrwJ080590; Wed, 7 Mar 2012 07:22:53 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201203070722.q277MrwJ080590@svn.freebsd.org> From: Andrew Thompson Date: Wed, 7 Mar 2012 07:22: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: r232640 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 07:22:53 -0000 Author: thompsa Date: Wed Mar 7 07:22:53 2012 New Revision: 232640 URL: http://svn.freebsd.org/changeset/base/232640 Log: Move the vlan buffer space into the union which also fixes an unused variable warning with !INET & !INET6. Spotted by: pluknet Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Mar 7 06:42:21 2012 (r232639) +++ head/sys/net/if_lagg.c Wed Mar 7 07:22:53 2012 (r232640) @@ -1438,7 +1438,6 @@ lagg_hashmbuf(struct lagg_softc *sc, str uint32_t p = key; int off; struct ether_header *eh; - struct ether_vlan_header vlanbuf; const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; @@ -1456,6 +1455,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str #ifdef INET6 struct ip6_hdr ip6; #endif + struct ether_vlan_header vlan; uint32_t port; } buf; @@ -1475,7 +1475,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str p = hash32_buf(&m->m_pkthdr.ether_vtag, sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { - vlan = lagg_gethdr(m, off, sizeof(*vlan), &vlanbuf); + vlan = lagg_gethdr(m, off, sizeof(*vlan), &buf); if (vlan == NULL) goto out; From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 07:30:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D574106566B; Wed, 7 Mar 2012 07:30:44 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1EB8FC08; Wed, 7 Mar 2012 07:30:42 +0000 (UTC) Received: by lagv3 with SMTP id v3so9817646lag.13 for ; Tue, 06 Mar 2012 23:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 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=ogktaXZT/Io6UW+HYsdLgqXFuNoAtOv/z5IWSYd1gO4=; b=J0jw7Z9/3htYz9IR8A2KkR6n9tJ9sHNqS3eq5727O8uOn5ZFhp7++qSrGaSEEZ+Qa2 5QeI0XSSBHar3hW5vAU/5bweJuzg060aB2mDq+jZ95duoByB/6Iub6oqLs13UYGQopJT iWrbJChDkI6LCvnZpcQc3GMuDaoMwv8n3UbyDZLKbNEQC75WL2JxEJ6hSuNCXUJ/+XmL bBPG8cEeTJKmyi4csUo7OBleQxROhsS8+qz0LdewLAljnPByJnNUhUrliWN6tzNOGyVX jOwK6gHS0bBlEpKvmoZqw/lCYGqceTJgp3OMU+QDIin+1Gno8GZFpJFNoYzYkWF2OfnO CnZw== MIME-Version: 1.0 Received: by 10.112.102.161 with SMTP id fp1mr301395lbb.71.1331105442077; Tue, 06 Mar 2012 23:30:42 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Tue, 6 Mar 2012 23:30:41 -0800 (PST) In-Reply-To: <201203070722.q277MrwJ080590@svn.freebsd.org> References: <201203070722.q277MrwJ080590@svn.freebsd.org> Date: Wed, 7 Mar 2012 10:30:41 +0300 X-Google-Sender-Auth: bEBmBimoViHcKj4ybQOpPY4vXbY Message-ID: From: Sergey Kandaurov To: Andrew Thompson 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: r232640 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 07:30:44 -0000 On 7 March 2012 11:22, Andrew Thompson wrote: > Author: thompsa > Date: Wed Mar =A07 07:22:53 2012 > New Revision: 232640 > URL: http://svn.freebsd.org/changeset/base/232640 > > Log: > =A0Move the vlan buffer space into the union which also fixes an unused v= ariable > =A0warning with !INET & !INET6. > > =A0Spotted by: =A0 pluknet > > Modified: > =A0head/sys/net/if_lagg.c Thank you. BTW, how do you like this change? Index: 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 --- Makefile (revision 232637) +++ Makefile (working copy) @@ -7,8 +7,10 @@ SRCS=3D if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} !=3D "no" opt_inet.h: echo "#define INET 1" > ${.TARGET} +.endif .if ${MK_INET6_SUPPORT} !=3D "no" opt_inet6.h: > > Modified: head/sys/net/if_lagg.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/net/if_lagg.c =A0 =A0 =A0Wed Mar =A07 06:42:21 2012 =A0 =A0 = =A0 =A0(r232639) > +++ head/sys/net/if_lagg.c =A0 =A0 =A0Wed Mar =A07 07:22:53 2012 =A0 =A0 = =A0 =A0(r232640) > @@ -1438,7 +1438,6 @@ lagg_hashmbuf(struct lagg_softc *sc, str > =A0 =A0 =A0 =A0uint32_t p =3D key; > =A0 =A0 =A0 =A0int off; > =A0 =A0 =A0 =A0struct ether_header *eh; > - =A0 =A0 =A0 struct ether_vlan_header vlanbuf; > =A0 =A0 =A0 =A0const struct ether_vlan_header *vlan; > =A0#ifdef INET > =A0 =A0 =A0 =A0const struct ip *ip; > @@ -1456,6 +1455,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str > =A0#ifdef INET6 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct ip6_hdr ip6; > =A0#endif > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct ether_vlan_header vlan; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0uint32_t port; > =A0 =A0 =A0 =A0} buf; > > @@ -1475,7 +1475,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0p =3D hash32_buf(&m->m_pkthdr.ether_vtag, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sizeof(m->m_pkthdr.ether_vtag), p)= ; > =A0 =A0 =A0 =A0} else if (etype =3D=3D ETHERTYPE_VLAN) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 vlan =3D lagg_gethdr(m, off, =A0sizeof(*vla= n), &vlanbuf); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 vlan =3D lagg_gethdr(m, off, =A0sizeof(*vla= n), &buf); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (vlan =3D=3D NULL) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out; > --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 07:31:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD7F4106566C; Wed, 7 Mar 2012 07:31:50 +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 A84E08FC12; Wed, 7 Mar 2012 07:31: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 q277VopH080884; Wed, 7 Mar 2012 07:31:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q277VoDY080879; Wed, 7 Mar 2012 07:31:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203070731.q277VoDY080879@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 7 Mar 2012 07:31: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: r232641 - in head/sys: fs/fifofs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 07:31:50 -0000 Author: kib Date: Wed Mar 7 07:31:50 2012 New Revision: 232641 URL: http://svn.freebsd.org/changeset/base/232641 Log: The pipe_poll() performs lockless access to the vnode to test fifo_iseof() condition, allowing the v_fifoinfo to be reset and freed by fifo_cleanup(). Precalculate EOF at the places were fo_wgen is changed, and cache the state in a new pipe state flag PIPE_SAMEWGEN. Reported and tested by: bf Submitted by: gianni MFC after: 1 week (a backport) Modified: head/sys/fs/fifofs/fifo.h head/sys/fs/fifofs/fifo_vnops.c head/sys/kern/sys_pipe.c head/sys/sys/pipe.h Modified: head/sys/fs/fifofs/fifo.h ============================================================================== --- head/sys/fs/fifofs/fifo.h Wed Mar 7 07:22:53 2012 (r232640) +++ head/sys/fs/fifofs/fifo.h Wed Mar 7 07:31:50 2012 (r232641) @@ -33,7 +33,6 @@ /* * Prototypes for fifo operations on vnodes. */ -int fifo_iseof(struct file *); int fifo_vnoperate(struct vop_generic_args *); int fifo_printinfo(struct vnode *); Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Wed Mar 7 07:22:53 2012 (r232640) +++ head/sys/fs/fifofs/fifo_vnops.c Wed Mar 7 07:31:50 2012 (r232641) @@ -67,8 +67,16 @@ struct fifoinfo { long fi_readers; long fi_writers; int fi_wgen; + int fi_seqcount; }; +#define FIFO_UPDWGEN(fip, pip) do { \ + if ((fip)->fi_wgen == (fip)->fi_seqcount) \ + (pip)->pipe_state |= PIPE_SAMEWGEN; \ + else \ + (pip)->pipe_state &= ~PIPE_SAMEWGEN; \ +} while (0) + static vop_print_t fifo_print; static vop_open_t fifo_open; static vop_close_t fifo_close; @@ -174,7 +182,8 @@ fifo_open(ap) if (fip->fi_writers > 0) wakeup(&fip->fi_writers); } - fp->f_seqcount = fip->fi_wgen - fip->fi_writers; + fip->fi_seqcount = fip->fi_wgen - fip->fi_writers; + FIFO_UPDWGEN(fip, fpipe); } if (ap->a_mode & FWRITE) { if ((ap->a_mode & O_NONBLOCK) && fip->fi_readers == 0) { @@ -228,6 +237,7 @@ fifo_open(ap) if (fpipe->pipe_state & PIPE_WANTR) wakeup(fpipe); fip->fi_wgen++; + FIFO_UPDWGEN(fip, fpipe); PIPE_UNLOCK(fpipe); fifo_cleanup(vp); } @@ -287,6 +297,7 @@ fifo_close(ap) if (cpipe->pipe_state & PIPE_WANTR) wakeup(cpipe); fip->fi_wgen++; + FIFO_UPDWGEN(fip, cpipe); PIPE_UNLOCK(cpipe); } } @@ -373,15 +384,3 @@ fifo_advlock(ap) return (ap->a_flags & F_FLOCK ? EOPNOTSUPP : EINVAL); } -int -fifo_iseof(struct file *fp) -{ - struct fifoinfo *fip; - - KASSERT(fp->f_vnode != NULL, ("fifo_iseof: no vnode info")); - KASSERT(fp->f_vnode->v_fifoinfo != NULL, ("fifo_iseof: no fifoinfo")); - fip = fp->f_vnode->v_fifoinfo; - PIPE_LOCK_ASSERT(fip->fi_pipe, MA_OWNED); - return (fp->f_seqcount == fip->fi_wgen); -} - Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Wed Mar 7 07:22:53 2012 (r232640) +++ head/sys/kern/sys_pipe.c Wed Mar 7 07:31:50 2012 (r232641) @@ -1430,7 +1430,7 @@ pipe_poll(fp, events, active_cred, td) levents = events & (POLLIN | POLLINIGNEOF | POLLPRI | POLLRDNORM | POLLRDBAND); if (rpipe->pipe_state & PIPE_NAMED && fp->f_flag & FREAD && levents && - fifo_iseof(fp)) + rpipe->pipe_state & PIPE_SAMEWGEN) events |= POLLINIGNEOF; if ((events & POLLINIGNEOF) == 0) { Modified: head/sys/sys/pipe.h ============================================================================== --- head/sys/sys/pipe.h Wed Mar 7 07:22:53 2012 (r232640) +++ head/sys/sys/pipe.h Wed Mar 7 07:31:50 2012 (r232641) @@ -96,6 +96,7 @@ struct pipemapping { #define PIPE_DIRECTW 0x400 /* Pipe direct write active. */ #define PIPE_DIRECTOK 0x800 /* Direct mode ok. */ #define PIPE_NAMED 0x1000 /* Is a named pipe. */ +#define PIPE_SAMEWGEN 0x2000 /* same write generation for named pipes. */ /* * Per-pipe data structure. From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 09:42:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 203E51065674; Wed, 7 Mar 2012 09:42:20 +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 0A8F38FC15; Wed, 7 Mar 2012 09:42: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 q279gJXH085447; Wed, 7 Mar 2012 09:42:19 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q279gJm8085445; Wed, 7 Mar 2012 09:42:19 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203070942.q279gJm8085445@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 7 Mar 2012 09:42: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: r232651 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 09:42:20 -0000 Author: pluknet Date: Wed Mar 7 09:42:19 2012 New Revision: 232651 URL: http://svn.freebsd.org/changeset/base/232651 Log: Update ifa_rtrequest() description after post-4.4BSD change made in r85074. 3rd argument of ifa->ifa_rtrequest is now ``rt_addrinfo *'' instead of ``sockaddr *''. While here, un-document RTM_RESOLVE cmd argument for ifa_rtrequest() that became a stub after separating L2 tables in r186119. MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Wed Mar 7 08:24:48 2012 (r232650) +++ head/share/man/man9/ifnet.9 Wed Mar 7 09:42:19 2012 (r232651) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2012 +.Dd March 7, 2012 .Dt IFNET 9 .Os .Sh NAME @@ -122,7 +122,7 @@ .Ss "struct ifaddr member function" .Ft void .Fo \*(lp*ifa_rtrequest\*(rp -.Fa "int cmd" "struct rtentry *rt" "struct sockaddr *dst" +.Fa "int cmd" "struct rtentry *rt" "struct rt_addrinfo *info" .Fc .\" .Ss "Global Variables" @@ -1016,22 +1016,19 @@ function. is a pointer to a function which receives callouts from the routing code .Pq Fn rtrequest -to perform link-layer-specific actions upon requests to add, resolve, +to perform link-layer-specific actions upon requests to add, or delete routes. The .Fa cmd argument indicates the request in question: -.Dv RTM_ADD , RTM_RESOLVE , +.Dv RTM_ADD , or .Dv RTM_DELETE . The .Fa rt argument is the route in question; the -.Fa dst -argument is the specific destination being manipulated -for -.Dv RTM_RESOLVE , -or a null pointer otherwise. +.Fa info +argument contains the specific destination being manipulated. .Sh FUNCTIONS The functions provided by the generic interface code can be divided into two groups: those which manipulate interfaces, and those which From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 10:49:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E73D0106564A; Wed, 7 Mar 2012 10:49:20 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 7088E8FC16; Wed, 7 Mar 2012 10:49:20 +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 53A7925D3A9A; Wed, 7 Mar 2012 10:49:19 +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 8040DBDCE0F; Wed, 7 Mar 2012 10:49:18 +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 Xe-fffibhjfI; Wed, 7 Mar 2012 10:49:17 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 5CCAFBDCE0E; Wed, 7 Mar 2012 10:49:17 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201203050240.q252eI3J062834@svn.freebsd.org> Date: Wed, 7 Mar 2012 10:49:16 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <14EF0623-D07F-4BCC-BFE0-FDF9CAD66C8A@lists.zabbadoz.net> References: <201203050240.q252eI3J062834@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232531 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 10:49:21 -0000 On 5. Mar 2012, at 02:40 , Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Mon Mar 5 02:40:18 2012 > New Revision: 232531 > URL: http://svn.freebsd.org/changeset/base/232531 >=20 > Log: > Make the chroot shell more functional by providing devfs. I am just replying to your last bsdinstall commit. I am on r232627 and = when I press "guided install" the installer aborts and restarts from = the keyboard menu. Do you have any idea what causes this. I cannot = easily switch to alternate consoles as our vty switching key bindings = don't go well with some virtualization technology:( /bz --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 11:29:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 827771065673; Wed, 7 Mar 2012 11:29:43 +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 6BFAC8FC20; Wed, 7 Mar 2012 11:29: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 q27BThIW090883; Wed, 7 Mar 2012 11:29:43 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27BThKp090881; Wed, 7 Mar 2012 11:29:43 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203071129.q27BThKp090881@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 7 Mar 2012 11:29: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: r232654 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 11:29:43 -0000 Author: pluknet Date: Wed Mar 7 11:29:43 2012 New Revision: 232654 URL: http://svn.freebsd.org/changeset/base/232654 Log: Reflect that if_output changed to take a struct route as its fourth argument (r191148). MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Wed Mar 7 11:18:38 2012 (r232653) +++ head/share/man/man9/ifnet.9 Wed Mar 7 11:29:43 2012 (r232654) @@ -103,7 +103,7 @@ .Ft int .Fo \*(lp*if_output\*(rp .Fa "struct ifnet *ifp" "struct mbuf *m" -.Fa "struct sockaddr *dst" "struct rtentry *rt" +.Fa "struct sockaddr *dst" "struct route *ro" .Fc .Ft void .Fn \*(lp*if_start\*(rp "struct ifnet *ifp" From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 14:11:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FF41106564A; Wed, 7 Mar 2012 14:11:12 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 18E038FC15; Wed, 7 Mar 2012 14:11:11 +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 CDD7425D3A9A; Wed, 7 Mar 2012 14:11:10 +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 06040BDCE36; Wed, 7 Mar 2012 14:11:10 +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 bCAKKiPUsF2B; Wed, 7 Mar 2012 14:11:09 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0E691BDCE33; Wed, 7 Mar 2012 14:11:09 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <14EF0623-D07F-4BCC-BFE0-FDF9CAD66C8A@lists.zabbadoz.net> Date: Wed, 7 Mar 2012 14:11:08 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <22C4960D-2E99-4969-853A-E05B8C777BBF@lists.zabbadoz.net> References: <201203050240.q252eI3J062834@svn.freebsd.org> <14EF0623-D07F-4BCC-BFE0-FDF9CAD66C8A@lists.zabbadoz.net> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232531 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 14:11:12 -0000 On 7. Mar 2012, at 10:49 , Bjoern A. Zeeb wrote: > On 5. Mar 2012, at 02:40 , Nathan Whitehorn wrote: >=20 >> Author: nwhitehorn >> Date: Mon Mar 5 02:40:18 2012 >> New Revision: 232531 >> URL: http://svn.freebsd.org/changeset/base/232531 >>=20 >> Log: >> Make the chroot shell more functional by providing devfs. >=20 > I am just replying to your last bsdinstall commit. I am on r232627 = and when I press "guided install" the installer aborts and restarts = from the keyboard menu. Do you have any idea what causes this. I = cannot easily switch to alternate consoles as our vty switching key = bindings don't go well with some virtualization technology:( Got to console. On a re-run it logged: Running installation step: keymap Running installation step: hostname rm: /tmp/bsdinstall_etc/fstab: No such file or directory Running installation step: autopart Segmentation fault Running installation step: umount --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 14:20:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA66E1065670; Wed, 7 Mar 2012 14:20:52 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 595868FC1C; Wed, 7 Mar 2012 14:20:52 +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 69B3425D3A9A; Wed, 7 Mar 2012 14:20:51 +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 92137BDCE39; Wed, 7 Mar 2012 14:20:50 +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 kDNL8s-RlXAy; Wed, 7 Mar 2012 14:20:49 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 683C2BDCE37; Wed, 7 Mar 2012 14:20:49 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <22C4960D-2E99-4969-853A-E05B8C777BBF@lists.zabbadoz.net> Date: Wed, 7 Mar 2012 14:20:43 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201203050240.q252eI3J062834@svn.freebsd.org> <14EF0623-D07F-4BCC-BFE0-FDF9CAD66C8A@lists.zabbadoz.net> <22C4960D-2E99-4969-853A-E05B8C777BBF@lists.zabbadoz.net> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232531 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 14:20:52 -0000 On 7. Mar 2012, at 14:11 , Bjoern A. Zeeb wrote: >=20 > On 7. Mar 2012, at 10:49 , Bjoern A. Zeeb wrote: >=20 >> On 5. Mar 2012, at 02:40 , Nathan Whitehorn wrote: >>=20 >>> Author: nwhitehorn >>> Date: Mon Mar 5 02:40:18 2012 >>> New Revision: 232531 >>> URL: http://svn.freebsd.org/changeset/base/232531 >>>=20 >>> Log: >>> Make the chroot shell more functional by providing devfs. >>=20 >> I am just replying to your last bsdinstall commit. I am on r232627 = and when I press "guided install" the installer aborts and restarts = from the keyboard menu. Do you have any idea what causes this. I = cannot easily switch to alternate consoles as our vty switching key = bindings don't go well with some virtualization technology:( >=20 > Got to console. On a re-run it logged: >=20 > Running installation step: keymap > Running installation step: hostname > rm: /tmp/bsdinstall_etc/fstab: No such file or directory > Running installation step: autopart > Segmentation fault > Running installation step: umount Ok, the real error mesasge there should not be "Segmentation fault" but = "No disk found". By the time I added a HDD to the machine as well, the = installer proceeded; so much for trying to install into a big piece of = memory for testing;-) Should I file a PR for both features to be = added? /bz --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 14:50:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0356C106564A; Wed, 7 Mar 2012 14:50:15 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8ABF8FC17; Wed, 7 Mar 2012 14:50: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 q27EoEtd097951; Wed, 7 Mar 2012 14:50:14 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27EoELr097949; Wed, 7 Mar 2012 14:50:14 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201203071450.q27EoELr097949@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 7 Mar 2012 14:50: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: r232658 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 14:50:15 -0000 Author: maxim Date: Wed Mar 7 14:50:14 2012 New Revision: 232658 URL: http://svn.freebsd.org/changeset/base/232658 Log: o Sync LOCK_PROFILING manpage with the current code: remove unexistent sysctls, add new ones. Reviewed by: gjb Sponsored by: Nginx, Inc. Modified: head/share/man/man9/LOCK_PROFILING.9 Modified: head/share/man/man9/LOCK_PROFILING.9 ============================================================================== --- head/share/man/man9/LOCK_PROFILING.9 Wed Mar 7 13:17:27 2012 (r232657) +++ head/share/man/man9/LOCK_PROFILING.9 Wed Mar 7 14:50:14 2012 (r232658) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2006 +.Dd March 7, 2012 .Dt LOCK_PROFILING 9 .Os .Sh NAME @@ -82,32 +82,6 @@ Enable or disable the lock profiling cod This defaults to 0 (off). .It Va debug.lock.prof.reset Reset the current lock profiling buffers. -.It Va debug.lock.prof.acquisitions -The total number of lock acquisitions recorded. -.It Va debug.lock.prof.records -The total number of acquisition points recorded. -Note that only active acquisition points (i.e., points that have been -reached at least once) are counted. -.It Va debug.lock.prof.maxrecords -The maximum number of acquisition points the profiling code is capable -of monitoring. -Since it would not be possible to call -.Xr malloc 9 -from within the lock profiling code, this is a static limit. -The number of records can be changed with the -.Dv LPROF_BUFFERS -kernel option. -.It Va debug.lock.prof.rejected -The number of acquisition points that were ignored after the table -filled up. -.It Va debug.lock.prof.hashsize -The size of the hash table used to map acquisition points to -statistics records. -The hash size can be changed with the -.Dv LPROF_HASH_SIZE -kernel option. -.It Va debug.lock.prof.collisions -The number of hash collisions in the acquisition point hash table. .It Va debug.lock.prof.stats The actual profiling statistics in plain text. The columns are as follows, from left to right: @@ -138,6 +112,14 @@ reached. The name of the acquisition point, derived from the source file name and line number, followed by the name of the lock in parentheses. .El +.It Va debug.lock.prof.rejected +The number of acquisition points that were ignored after the table +filled up. +.It Va debug.lock.prof.skipspin +Disable or enable the lock profiling code for the spin locks. +This defaults to 0 (do profiling for the spin locks). +.It Va debug.lock.prof.skipcount +Do sampling approximately every N lock acquisitions. .El .Sh SEE ALSO .Xr sysctl 8 , From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 14:53:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4149F1065670; Wed, 7 Mar 2012 14:53:54 +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 2CEE98FC13; Wed, 7 Mar 2012 14: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 q27Ersfd098092; Wed, 7 Mar 2012 14:53:54 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27Errq5098090; Wed, 7 Mar 2012 14:53:53 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203071453.q27Errq5098090@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 7 Mar 2012 14:53: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: r232659 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 14:53:54 -0000 Author: pluknet Date: Wed Mar 7 14:53:53 2012 New Revision: 232659 URL: http://svn.freebsd.org/changeset/base/232659 Log: Move struct if_data basic description to a more suitable place, and remove a bit of .Bx 4.4 history. MFC after: 1 week Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Wed Mar 7 14:50:14 2012 (r232658) +++ head/share/man/man9/ifnet.9 Wed Mar 7 14:53:53 2012 (r232659) @@ -181,13 +181,7 @@ return pointers to these structures. Each interface structure contains an .Vt if_data -structure, which contains statistics and identifying information used -by management programs, and which is exported to user programs by way -of the -.Xr ifmib 4 -branch of the -.Xr sysctl 3 -MIB. +structure used for statistics and information. Each interface also has a .Li TAILQ of interface addresses, described by @@ -734,14 +728,15 @@ is marked or cleared in the interface's .Va if_flags to indicate the current mode of the interface. .Ss The Vt if_data Ss Structure -In -.Bx 4.4 , -a subset of the interface information believed to be of interest to -management stations was segregated from the -.Vt ifnet -structure and moved into its own +The .Vt if_data -structure to facilitate its use by user programs. +structure contains statistics and identifying information used +by management programs, and which is exported to user programs by way +of the +.Xr ifmib 4 +branch of the +.Xr sysctl 3 +MIB. The following elements of the .Vt if_data structure are initialized by the interface and are not expected to change From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 15:41:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23A55106564A; Wed, 7 Mar 2012 15:41:38 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id E6AE68FC08; Wed, 7 Mar 2012 15:41:37 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed; delsp=yes Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M0I0050KU97P800@smtpauth1.wiscmail.wisc.edu>; Wed, 07 Mar 2012 09:41:31 -0600 (CST) Received: from [10.0.2.93] ([unknown] [76.210.73.151]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M0I00IWRU945P30@smtpauth1.wiscmail.wisc.edu>; Wed, 07 Mar 2012 09:41:30 -0600 (CST) Date: Wed, 07 Mar 2012 09:41:28 -0600 From: Nathan Whitehorn In-reply-to: To: "Bjoern A. Zeeb" Message-id: <9687CDF1-11B1-4DB1-914C-149E8DF6DF4D@freebsd.org> X-Mailer: Apple Mail (2.936) X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.73.151 X-Spam-PmxInfo: Server=avs-16, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.7.153333, SenderIP=76.210.73.151 References: <201203050240.q252eI3J062834@svn.freebsd.org> <14EF0623-D07F-4BCC-BFE0-FDF9CAD66C8A@lists.zabbadoz.net> <22C4960D-2E99-4969-853A-E05B8C777BBF@lists.zabbadoz.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232531 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 15:41:38 -0000 On Mar 7, 2012, at 8:20 AM, Bjoern A. Zeeb wrote: > > On 7. Mar 2012, at 14:11 , Bjoern A. Zeeb wrote: > >> >> On 7. Mar 2012, at 10:49 , Bjoern A. Zeeb wrote: >> >>> On 5. Mar 2012, at 02:40 , Nathan Whitehorn wrote: >>> >>>> Author: nwhitehorn >>>> Date: Mon Mar 5 02:40:18 2012 >>>> New Revision: 232531 >>>> URL: http://svn.freebsd.org/changeset/base/232531 >>>> >>>> Log: >>>> Make the chroot shell more functional by providing devfs. >>> >>> I am just replying to your last bsdinstall commit. I am on >>> r232627 and when I press "guided install" the installer aborts >>> and restarts from the keyboard menu. Do you have any idea what >>> causes this. I cannot easily switch to alternate consoles as our >>> vty switching key bindings don't go well with some virtualization >>> technology:( >> >> Got to console. On a re-run it logged: >> >> Running installation step: keymap >> Running installation step: hostname >> rm: /tmp/bsdinstall_etc/fstab: No such file or directory >> Running installation step: autopart >> Segmentation fault >> Running installation step: umount > > Ok, the real error mesasge there should not be "Segmentation fault" > but "No disk found". By the time I added a HDD to the machine as > well, the installer proceeded; so much for trying to install into a > big piece of memory for testing;-) Should I file a PR for both > features to be added? It should have already handled that case correctly -- please file a PR. One of the features I can't add, though :) -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 18:05:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35AFA106564A; Wed, 7 Mar 2012 18:05:46 +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 25AD28FC08; Wed, 7 Mar 2012 18:05: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 q27I5joS004190; Wed, 7 Mar 2012 18:05:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27I5jFg004188; Wed, 7 Mar 2012 18:05:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203071805.q27I5jFg004188@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 7 Mar 2012 18:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232660 - head/contrib/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 18:05:46 -0000 Author: kib Date: Wed Mar 7 18:05:45 2012 New Revision: 232660 URL: http://svn.freebsd.org/changeset/base/232660 Log: In batch mode, exit after receiving SIGINT, instead of immediate output of the next display. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/contrib/top/top.c Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Wed Mar 7 14:53:53 2012 (r232659) +++ head/contrib/top/top.c Wed Mar 7 18:05:45 2012 (r232660) @@ -723,6 +723,10 @@ restart: if (!interactive) { sleep(delay); + if (leaveflag) { + end_screen(); + exit(0); + } } else while (no_command) { From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 18:46:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9600510656EE; Wed, 7 Mar 2012 18:46:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8608F8FC12; Wed, 7 Mar 2012 18:46: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 q27IkLh9005864; Wed, 7 Mar 2012 18:46:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27IkL9I005862; Wed, 7 Mar 2012 18:46:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203071846.q27IkL9I005862@svn.freebsd.org> From: Ed Maste Date: Wed, 7 Mar 2012 18:46: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: r232666 - head/usr.sbin/crashinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 18:46:21 -0000 Author: emaste Date: Wed Mar 7 18:46:21 2012 New Revision: 232666 URL: http://svn.freebsd.org/changeset/base/232666 Log: Improve multi-line kernel ident parsing Instead of blindly grabbing the line with 'Version string' and the following one from the core info file, take all lines after 'Version string' until the one one that matches the field format in the core info file. This provides compatibility with VendorBSD modifications that have a different kernel ident format. Reviewed by: jhb Modified: head/usr.sbin/crashinfo/crashinfo.sh Modified: head/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.sh Wed Mar 7 18:33:11 2012 (r232665) +++ head/usr.sbin/crashinfo/crashinfo.sh Wed Mar 7 18:46:21 2012 (r232666) @@ -45,10 +45,11 @@ find_kernel() nextline=1 next } - // { - if (nextline) { - print + nextline==1 { + if ($0 ~ "^ [A-Za-z ]+: ") { nextline=0 + } else { + print } }' $INFO) From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 18:50:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 694C8106564A; Wed, 7 Mar 2012 18:50:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE828FC15; Wed, 7 Mar 2012 18:50: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 q27IoYVG006023; Wed, 7 Mar 2012 18:50:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27IoYTS006020; Wed, 7 Mar 2012 18:50:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203071850.q27IoYTS006020@svn.freebsd.org> From: John Baldwin Date: Wed, 7 Mar 2012 18:50: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: r232667 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 18:50:34 -0000 Author: jhb Date: Wed Mar 7 18:50:33 2012 New Revision: 232667 URL: http://svn.freebsd.org/changeset/base/232667 Log: Simplify the PCI bus dma tag code a bit. First, don't create a tag at all for platforms that only have 32-bit bus addresses. Second, remove the 'tag_valid' flag from the softc. Instead, if we don't create a tag in pci_attach_common(), just cache the value of our parent's tag so that we always have a valid tag to return. Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Mar 7 18:46:21 2012 (r232666) +++ head/sys/dev/pci/pci.c Wed Mar 7 18:50:33 2012 (r232667) @@ -77,10 +77,12 @@ __FBSDID("$FreeBSD$"); * However, in the case of PAE, DMA addresses can cross a 4GB * boundary, so as a workaround use a 2GB boundary. */ +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) #ifdef PAE -#define PCI_DMA_BOUNDARY (1u << 31) +#define PCI_DMA_BOUNDARY 0x80000000 #else -#define PCI_DMA_BOUNDARY ((bus_size_t)((uint64_t)1 << 32)) +#define PCI_DMA_BOUNDARY 0x100000000 +#endif #endif #define PCIR_IS_BIOS(cfg, reg) \ @@ -3232,7 +3234,10 @@ int pci_attach_common(device_t dev) { struct pci_softc *sc; - int busno, domain, error; + int busno, domain; +#ifdef PCI_DMA_BOUNDARY + int error, tag_valid; +#endif sc = device_get_softc(dev); domain = pcib_get_domain(dev); @@ -3240,6 +3245,8 @@ pci_attach_common(device_t dev) if (bootverbose) device_printf(dev, "domain=%d, physical bus=%d\n", domain, busno); +#ifdef PCI_DMA_BOUNDARY + tag_valid = 0; if (device_get_devclass(device_get_parent(device_get_parent(dev))) != devclass_find("pci")) { error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, @@ -3250,8 +3257,11 @@ pci_attach_common(device_t dev) device_printf(dev, "Failed to create DMA tag: %d\n", error); else - sc->sc_dma_tag_valid = 1; + tag_valid = 1; } + if (!tag_valid) +#endif + sc->sc_dma_tag = bus_get_dma_tag(dev); return (0); } @@ -4363,9 +4373,7 @@ pci_get_dma_tag(device_t bus, device_t d { struct pci_softc *sc = device_get_softc(bus); - if (sc->sc_dma_tag_valid) - return (sc->sc_dma_tag); - return (bus_generic_get_dma_tag(bus, dev)); + return (sc->sc_dma_tag); } uint32_t Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Wed Mar 7 18:46:21 2012 (r232666) +++ head/sys/dev/pci/pci_private.h Wed Mar 7 18:50:33 2012 (r232667) @@ -40,7 +40,6 @@ DECLARE_CLASS(pci_driver); struct pci_softc { bus_dma_tag_t sc_dma_tag; - int sc_dma_tag_valid; }; extern int pci_do_power_resume; From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 18:52:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B77A9106564A; Wed, 7 Mar 2012 18:52:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A78E98FC16; Wed, 7 Mar 2012 18:52: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 q27Iqkui006135; Wed, 7 Mar 2012 18:52:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27IqkaF006133; Wed, 7 Mar 2012 18:52:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203071852.q27IqkaF006133@svn.freebsd.org> From: John Baldwin Date: Wed, 7 Mar 2012 18:52: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: r232668 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 18:52:46 -0000 Author: jhb Date: Wed Mar 7 18:52:46 2012 New Revision: 232668 URL: http://svn.freebsd.org/changeset/base/232668 Log: Use bus_get_dma_tag() to inherit the PCI bus' 4G boundary constraint. Tested by: emaste Modified: head/sys/dev/aac/aac_pci.c Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Wed Mar 7 18:50:33 2012 (r232667) +++ head/sys/dev/aac/aac_pci.c Wed Mar 7 18:52:46 2012 (r232668) @@ -402,7 +402,7 @@ aac_pci_attach(device_t dev) * * Note that some of these controllers are 64-bit capable. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(sc->aac_dev), /* parent */ PAGE_SIZE, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 18:53:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5426F106564A; Wed, 7 Mar 2012 18:53:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 444438FC16; Wed, 7 Mar 2012 18:53: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 q27Irvg7006202; Wed, 7 Mar 2012 18:53:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27IrvHJ006199; Wed, 7 Mar 2012 18:53:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203071853.q27IrvHJ006199@svn.freebsd.org> From: John Baldwin Date: Wed, 7 Mar 2012 18:53: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: r232669 - head/sys/dev/twa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 18:53:57 -0000 Author: jhb Date: Wed Mar 7 18:53:56 2012 New Revision: 232669 URL: http://svn.freebsd.org/changeset/base/232669 Log: Use bus_get_dma_tag() to inherit the 4G boundary restriction from the parent PCI bus and remove the home-grown version in this driver. Modified: head/sys/dev/twa/tw_osl.h head/sys/dev/twa/tw_osl_freebsd.c Modified: head/sys/dev/twa/tw_osl.h ============================================================================== --- head/sys/dev/twa/tw_osl.h Wed Mar 7 18:52:46 2012 (r232668) +++ head/sys/dev/twa/tw_osl.h Wed Mar 7 18:53:56 2012 (r232669) @@ -55,12 +55,6 @@ #define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) #define TW_OSLI_MAX_NUM_AENS 0x100 -#ifdef PAE -#define TW_OSLI_DMA_BOUNDARY (1u << 31) -#else -#define TW_OSLI_DMA_BOUNDARY ((bus_size_t)((uint64_t)1 << 32)) -#endif - /* Possible values of req->state. */ #define TW_OSLI_REQ_STATE_INIT 0x0 /* being initialized */ #define TW_OSLI_REQ_STATE_BUSY 0x1 /* submitted to CL */ Modified: head/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- head/sys/dev/twa/tw_osl_freebsd.c Wed Mar 7 18:52:46 2012 (r232668) +++ head/sys/dev/twa/tw_osl_freebsd.c Wed Mar 7 18:53:56 2012 (r232669) @@ -562,9 +562,9 @@ tw_osli_alloc_mem(struct twa_softc *sc) } /* Create the parent dma tag. */ - if (bus_dma_tag_create(NULL, /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(sc->bus_dev), /* parent */ sc->alignment, /* alignment */ - TW_OSLI_DMA_BOUNDARY, /* boundary */ + 0, /* boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 18:57:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C16751065676; Wed, 7 Mar 2012 18:57:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1AC48FC2F; Wed, 7 Mar 2012 18:57: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 q27Iv9wD006359; Wed, 7 Mar 2012 18:57:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27Iv9W0006357; Wed, 7 Mar 2012 18:57:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203071857.q27Iv9W0006357@svn.freebsd.org> From: John Baldwin Date: Wed, 7 Mar 2012 18: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: r232670 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 18:57:09 -0000 Author: jhb Date: Wed Mar 7 18:57:09 2012 New Revision: 232670 URL: http://svn.freebsd.org/changeset/base/232670 Log: Remove the PAE-specific 2GB DMA boundary since HEAD now supports a proper 4G boundary for PAE. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Mar 7 18:53:56 2012 (r232669) +++ head/sys/dev/pci/pci.c Wed Mar 7 18:57:09 2012 (r232670) @@ -70,20 +70,9 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #include "pci_if.h" -/* - * XXX: Due to a limitation of the bus_dma_tag_create() API, we cannot - * specify a 4GB boundary on 32-bit targets. Usually this does not - * matter as it is ok to use a boundary of 0 on these systems. - * However, in the case of PAE, DMA addresses can cross a 4GB - * boundary, so as a workaround use a 2GB boundary. - */ #if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) -#ifdef PAE -#define PCI_DMA_BOUNDARY 0x80000000 -#else #define PCI_DMA_BOUNDARY 0x100000000 #endif -#endif #define PCIR_IS_BIOS(cfg, reg) \ (((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \ From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 20:46:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C337E106564A; Wed, 7 Mar 2012 20:46:59 +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 B300E8FC0A; Wed, 7 Mar 2012 20:46:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q27KkxXr009848; Wed, 7 Mar 2012 20:46:59 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27KkxFr009846; Wed, 7 Mar 2012 20:46:59 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201203072046.q27KkxFr009846@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 7 Mar 2012 20:46: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: r232671 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 20:46:59 -0000 Author: pluknet Date: Wed Mar 7 20:46:59 2012 New Revision: 232671 URL: http://svn.freebsd.org/changeset/base/232671 Log: Add lib32 part for libutil after its version bump to 9. PR: misc/165523 Submitted by: Andrey Zonov MFC after: 1 week Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Mar 7 18:57:09 2012 (r232670) +++ head/ObsoleteFiles.inc Wed Mar 7 20:46:59 2012 (r232671) @@ -417,6 +417,9 @@ OLD_FILES+=usr/share/man/man5/lastlog.5. OLD_FILES+=usr/share/man/man5/utmp.5.gz OLD_FILES+=usr/share/man/man5/wtmp.5.gz OLD_LIBS+=lib/libutil.so.8 +.if ${TARGET_ARCH} == "amd64" +OLB_LIBS+=usr/lib32/libutil.so.8 +.endif # 20100105: new userland semaphore implementation OLD_FILES+=usr/include/sys/semaphore.h # 20100103: ntptrace(8) removed From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 20:49:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F5881065670; Wed, 7 Mar 2012 20:49:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 31A968FC08; Wed, 7 Mar 2012 20:49:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M0J0020C8I4MQ00@smtpauth1.wiscmail.wisc.edu>; Wed, 07 Mar 2012 14:49:16 -0600 (CST) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M0J00AG58I17Y30@smtpauth1.wiscmail.wisc.edu>; Wed, 07 Mar 2012 14:49:13 -0600 (CST) Date: Wed, 07 Mar 2012 14:49:12 -0600 From: Nathan Whitehorn In-reply-to: <201203072046.q27KkxFr009846@svn.freebsd.org> To: Sergey Kandaurov Message-id: <4F57C9C8.80907@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.7.203320, SenderIP=128.104.160.176 References: <201203072046.q27KkxFr009846@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.25) Gecko/20120130 Thunderbird/3.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232671 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 20:49:17 -0000 On 03/07/12 14:46, Sergey Kandaurov wrote: > Author: pluknet > Date: Wed Mar 7 20:46:59 2012 > New Revision: 232671 > URL: http://svn.freebsd.org/changeset/base/232671 > > Log: > Add lib32 part for libutil after its version bump to 9. > > PR: misc/165523 > Submitted by: Andrey Zonov > MFC after: 1 week > > Modified: > head/ObsoleteFiles.inc > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Wed Mar 7 18:57:09 2012 (r232670) > +++ head/ObsoleteFiles.inc Wed Mar 7 20:46:59 2012 (r232671) > @@ -417,6 +417,9 @@ OLD_FILES+=usr/share/man/man5/lastlog.5. > OLD_FILES+=usr/share/man/man5/utmp.5.gz > OLD_FILES+=usr/share/man/man5/wtmp.5.gz > OLD_LIBS+=lib/libutil.so.8 > +.if ${TARGET_ARCH} == "amd64" > +OLB_LIBS+=usr/lib32/libutil.so.8 > +.endif > # 20100105: new userland semaphore implementation > OLD_FILES+=usr/include/sys/semaphore.h > # 20100103: ntptrace(8) removed This should also check for powerpc64. Or, better, do it unconditionally, since it will only remove files that actually exist and there's no harm trying to remove /usr/lib32/blah on 32-bit systems. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 20:53:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B652110656D9; Wed, 7 Mar 2012 20:53:52 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A360C8FC18; Wed, 7 Mar 2012 20:53:51 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so7569264bkc.13 for ; Wed, 07 Mar 2012 12:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 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=VA7jemCzHs9xThm/GsX31HiHPzaVlCXYkhKvOxvEoLE=; b=w3w69Htlbe8lJfVbqZydYW6qJ9YlPMWZkbnW7lYVMmXxwXn8ItoLgulYLXIHvCCEM1 AZuCMKxeYf/xVqb0/2kCd3YtsKQKC2UVeru2E+YKLZJz0jqyrsXSYsm4H4lEw/9666BH Ge1Y1eGB76pDa5XECDrmGrGWcSj5swZ8W7KH0y9PorbfCtGcdyMWGFDu1g7kADWTd0R0 P7erWAz+TZtBdhzFlM2eMn706+MEEkI8H1O0Vbms5Krl7FwO94/zNxqMLCwp/n8jqeue DxxM6ebonrSwqrSd/tDhOEtd/8jV618YdMMXVcj2XJic8T5uDPYh0gbTb0yXceoU5B5K F7+w== MIME-Version: 1.0 Received: by 10.112.44.232 with SMTP id h8mr1238070lbm.85.1331153630423; Wed, 07 Mar 2012 12:53:50 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Wed, 7 Mar 2012 12:53:50 -0800 (PST) In-Reply-To: <4F57C9C8.80907@freebsd.org> References: <201203072046.q27KkxFr009846@svn.freebsd.org> <4F57C9C8.80907@freebsd.org> Date: Wed, 7 Mar 2012 23:53:50 +0300 X-Google-Sender-Auth: lZzHKCPHM4_B8E-FO445LQy9sGE Message-ID: From: Sergey Kandaurov To: Nathan Whitehorn 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: r232671 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 20:53:52 -0000 On 8 March 2012 00:49, Nathan Whitehorn wrote: > On 03/07/12 14:46, Sergey Kandaurov wrote: >> >> Author: pluknet >> Date: Wed Mar =A07 20:46:59 2012 >> New Revision: 232671 >> URL: http://svn.freebsd.org/changeset/base/232671 >> >> Log: >> =A0 Add lib32 part for libutil after its version bump to 9. >> >> =A0 PR: =A0 =A0 =A0 =A0 =A0misc/165523 >> =A0 Submitted by: =A0 =A0 =A0 =A0Andrey Zonov >> =A0 MFC after: =A0 1 week >> >> Modified: >> =A0 head/ObsoleteFiles.inc >> >> 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 =A0Wed Mar =A07 18:57:09 2012 =A0 =A0= =A0 =A0(r232670) >> +++ head/ObsoleteFiles.inc =A0 =A0 =A0Wed Mar =A07 20:46:59 2012 =A0 =A0= =A0 =A0(r232671) >> @@ -417,6 +417,9 @@ OLD_FILES+=3Dusr/share/man/man5/lastlog.5. >> =A0OLD_FILES+=3Dusr/share/man/man5/utmp.5.gz >> =A0OLD_FILES+=3Dusr/share/man/man5/wtmp.5.gz >> =A0OLD_LIBS+=3Dlib/libutil.so.8 >> +.if ${TARGET_ARCH} =3D=3D "amd64" >> +OLB_LIBS+=3Dusr/lib32/libutil.so.8 >> +.endif >> =A0# 20100105: new userland semaphore implementation >> =A0OLD_FILES+=3Dusr/include/sys/semaphore.h >> =A0# 20100103: ntptrace(8) removed > > > This should also check for powerpc64. Or, better, do it unconditionally, > since it will only remove files that actually exist and there's no harm > trying to remove /usr/lib32/blah on 32-bit systems. > -Nathan Ok. so there are two way to go. - add .if for powerpc64 (btw, does this arch exist in RELENG_8?) - remove all lib32 related conditions throughout the file. The latter looks easier to maintain. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 21:05:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D316C1065674; Wed, 7 Mar 2012 21:05:34 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id A2E258FC16; Wed, 7 Mar 2012 21:05:34 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M0J0040M99AXL00@smtpauth1.wiscmail.wisc.edu>; Wed, 07 Mar 2012 15:05:34 -0600 (CST) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M0J0046X998JY00@smtpauth1.wiscmail.wisc.edu>; Wed, 07 Mar 2012 15:05:32 -0600 (CST) Date: Wed, 07 Mar 2012 15:05:31 -0600 From: Nathan Whitehorn In-reply-to: To: Sergey Kandaurov Message-id: <4F57CD9B.5010600@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-15, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.7.205414, SenderIP=128.104.160.176 References: <201203072046.q27KkxFr009846@svn.freebsd.org> <4F57C9C8.80907@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.25) Gecko/20120130 Thunderbird/3.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232671 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 21:05:34 -0000 On 03/07/12 14:53, Sergey Kandaurov wrote: > On 8 March 2012 00:49, Nathan Whitehorn wrote: >> On 03/07/12 14:46, Sergey Kandaurov wrote: >>> Author: pluknet >>> Date: Wed Mar 7 20:46:59 2012 >>> New Revision: 232671 >>> URL: http://svn.freebsd.org/changeset/base/232671 >>> >>> Log: >>> Add lib32 part for libutil after its version bump to 9. >>> >>> PR: misc/165523 >>> Submitted by: Andrey Zonov >>> MFC after: 1 week >>> >>> Modified: >>> head/ObsoleteFiles.inc >>> >>> Modified: head/ObsoleteFiles.inc >>> >>> ============================================================================== >>> --- head/ObsoleteFiles.inc Wed Mar 7 18:57:09 2012 (r232670) >>> +++ head/ObsoleteFiles.inc Wed Mar 7 20:46:59 2012 (r232671) >>> @@ -417,6 +417,9 @@ OLD_FILES+=usr/share/man/man5/lastlog.5. >>> OLD_FILES+=usr/share/man/man5/utmp.5.gz >>> OLD_FILES+=usr/share/man/man5/wtmp.5.gz >>> OLD_LIBS+=lib/libutil.so.8 >>> +.if ${TARGET_ARCH} == "amd64" >>> +OLB_LIBS+=usr/lib32/libutil.so.8 >>> +.endif >>> # 20100105: new userland semaphore implementation >>> OLD_FILES+=usr/include/sys/semaphore.h >>> # 20100103: ntptrace(8) removed >> >> This should also check for powerpc64. Or, better, do it unconditionally, >> since it will only remove files that actually exist and there's no harm >> trying to remove /usr/lib32/blah on 32-bit systems. >> -Nathan > Ok. so there are two way to go. > - add .if for powerpc64 (btw, does this arch exist in RELENG_8?) powerpc64 is new in RELENG_9. > - remove all lib32 related conditions throughout the file. > > The latter looks easier to maintain. I think that's a better way to go, especially with the addition of COMPAT_FREEBSD32 on mips. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 21:18:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A4DB106564A; Wed, 7 Mar 2012 21:18:06 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 621D38FC08; Wed, 7 Mar 2012 21:18:05 +0000 (UTC) Received: by lagv3 with SMTP id v3so10945416lag.13 for ; Wed, 07 Mar 2012 13:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 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=4WZ5gw7M2rhRuqNJRXeMeuQ42xNIev5p5FN2dt5Lx8U=; b=ODhRQzECBqt/2Pb/9ELnwksemdCaSu6M2iHxHruZr1aclJxP2IAH5nbOqSL7klK/XL 1xlEEqfEc/I0yY+PwdqOyCPKIc/YrxSAgGQPUd6SXQ9s4SxkiUyaXaGbs0HhYkrAyIp/ 6OKiGO5/Lu+E/jmubkReqJ9bZhoMHZE4Ule8yL2Lijt6vmMrsnYSfkuye0enk9dVivv7 J61uxVHzU7OsWc3dGpXCbAdOQOJj5LG1qTjc2vFYQGR4ophJernZ3E2POvTCxwH6za8B dR63aV6WwUZ5ZX8hlyBtICQRWTsRCDhWOA9m6yrG9TpT05CTJQ8bAmZ98D77YEZtCbUx KXlQ== MIME-Version: 1.0 Received: by 10.112.99.231 with SMTP id et7mr1253412lbb.57.1331155084215; Wed, 07 Mar 2012 13:18:04 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Wed, 7 Mar 2012 13:18:04 -0800 (PST) In-Reply-To: <4F57CD9B.5010600@freebsd.org> References: <201203072046.q27KkxFr009846@svn.freebsd.org> <4F57C9C8.80907@freebsd.org> <4F57CD9B.5010600@freebsd.org> Date: Thu, 8 Mar 2012 00:18:04 +0300 X-Google-Sender-Auth: deIS5awmPeBAqWyv_OSRRdFhObo Message-ID: From: Sergey Kandaurov To: Nathan Whitehorn 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: r232671 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 21:18:06 -0000 On 8 March 2012 01:05, Nathan Whitehorn wrote: > On 03/07/12 14:53, Sergey Kandaurov wrote: >> >> On 8 March 2012 00:49, Nathan Whitehorn =A0wrote= : >>> >>> On 03/07/12 14:46, Sergey Kandaurov wrote: >>>> >>>> Author: pluknet >>>> Date: Wed Mar =A07 20:46:59 2012 >>>> New Revision: 232671 >>>> URL: http://svn.freebsd.org/changeset/base/232671 >>>> >>>> Log: >>>> =A0 Add lib32 part for libutil after its version bump to 9. >>>> >>>> =A0 PR: =A0 =A0 =A0 =A0 =A0misc/165523 >>>> =A0 Submitted by: =A0 =A0 =A0 =A0Andrey Zonov >>>> =A0 MFC after: =A0 1 week >>>> >>>> Modified: >>>> =A0 head/ObsoleteFiles.inc >>>> >>>> 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 =A0Wed Mar =A07 18:57:09 2012 >>>> =A0(r232670) >>>> +++ head/ObsoleteFiles.inc =A0 =A0 =A0Wed Mar =A07 20:46:59 2012 >>>> =A0(r232671) >>>> @@ -417,6 +417,9 @@ OLD_FILES+=3Dusr/share/man/man5/lastlog.5. >>>> =A0OLD_FILES+=3Dusr/share/man/man5/utmp.5.gz >>>> =A0OLD_FILES+=3Dusr/share/man/man5/wtmp.5.gz >>>> =A0OLD_LIBS+=3Dlib/libutil.so.8 >>>> +.if ${TARGET_ARCH} =3D=3D "amd64" >>>> +OLB_LIBS+=3Dusr/lib32/libutil.so.8 >>>> +.endif >>>> =A0# 20100105: new userland semaphore implementation >>>> =A0OLD_FILES+=3Dusr/include/sys/semaphore.h >>>> =A0# 20100103: ntptrace(8) removed >>> >>> >>> This should also check for powerpc64. Or, better, do it unconditionally= , >>> since it will only remove files that actually exist and there's no harm >>> trying to remove /usr/lib32/blah on 32-bit systems. >>> -Nathan >> >> Ok. so there are two way to go. >> - add .if for powerpc64 (btw, does this arch exist in RELENG_8?) > > > powerpc64 is new in RELENG_9. > > >> - remove all lib32 related conditions throughout the file. >> >> The latter looks easier to maintain. > > > I think that's a better way to go, especially with the addition of > COMPAT_FREEBSD32 on mips. > -Nathan Does this patch look good for you? Index: 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 --- ObsoleteFiles.inc (revision 232672) +++ ObsoleteFiles.inc (working copy) @@ -56,9 +56,7 @@ usr/share/man/man3/archive_write_set_compression_none.3.gz \ usr/share/man/man3/archive_write_set_compression_program.3.gz OLD_LIBS+=3Dusr/lib/libarchive.so.5 -.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" OLD_LIBS+=3Dusr/lib32/libarchive.so.5 -.endif # 20120113: removal of wtmpcvt(1) OLD_FILES+=3Dusr/bin/wtmpcvt OLD_FILES+=3Dusr/share/man/man1/wtmpcvt.1.gz @@ -71,12 +69,10 @@ 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 # 20110930: sysinstall removed OLD_FILES+=3Dusr/sbin/sysinstall OLD_FILES+=3Dusr/share/man/man8/sysinstall.8.gz @@ -84,12 +80,10 @@ OLD_FILES+=3Dusr/lib/libftpio.so OLD_LIBS+=3Dusr/lib/libftpio.so.8 OLD_FILES+=3Dusr/lib/libftpio_p.a -.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" OLD_FILES+=3Dusr/lib32/libftpio.a OLD_FILES+=3Dusr/lib32/libftpio.so OLD_LIBS+=3Dusr/lib32/libftpio.so.8 OLD_FILES+=3Dusr/lib32/libftpio_p.a -.endif OLD_FILES+=3Dusr/include/ftpio.h OLD_FILES+=3Dusr/share/man/man3/ftpio.3.gz # 20110915: rename congestion control manpages @@ -108,7 +102,6 @@ OLD_LIBS+=3Dusr/lib/libopie.so.6 OLD_LIBS+=3Dusr/lib/librtld_db.so.1 OLD_LIBS+=3Dusr/lib/libtacplus.so.4 -.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" OLD_LIBS+=3Dusr/lib32/libcam.so.5 OLD_LIBS+=3Dusr/lib32/libpcap.so.7 OLD_LIBS+=3Dusr/lib32/libufs.so.5 @@ -117,7 +110,6 @@ OLD_LIBS+=3Dusr/lib32/libopie.so.6 OLD_LIBS+=3Dusr/lib32/librtld_db.so.1 OLD_LIBS+=3Dusr/lib32/libtacplus.so.4 -.endif # 20110817: no more acd.4, ad.4, afd.4 and ast.4 OLD_FILES+=3Dusr/share/man/man4/acd.4.gz OLD_FILES+=3Dusr/share/man/man4/ad.4.gz @@ -157,17 +149,13 @@ OLD_FILES+=3Dusr/lib/libpkg.so OLD_LIBS+=3Dusr/lib/libpkg.so.0 OLD_FILES+=3Dusr/lib/libpkg_p.a -.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" OLD_FILES+=3Dusr/lib32/libpkg.a OLD_FILES+=3Dusr/lib32/libpkg.so OLD_LIBS+=3Dusr/lib32/libpkg.so.0 OLD_FILES+=3Dusr/lib32/libpkg_p.a -.endif # 20110517: libsbuf version bump OLD_LIBS+=3Dlib/libsbuf.so.5 -.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" OLD_LIBS+=3Dusr/lib32/libsbuf.so.5 -.endif # 20110502: new clang import which bumps version from 2.9 to 3.0 OLD_FILES+=3Dusr/include/clang/2.9/emmintrin.h OLD_FILES+=3Dusr/include/clang/2.9/mm_malloc.h @@ -196,12 +184,10 @@ OLD_FILES+=3Dusr/libexec/cc1obj OLD_LIBS+=3Dusr/lib/libobjc.so.4 OLD_DIRS+=3Dusr/include/objc -.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" OLD_FILES+=3Dusr/lib32/libobjc.a OLD_FILES+=3Dusr/lib32/libobjc.so OLD_FILES+=3Dusr/lib32/libobjc_p.a OLD_LIBS+=3Dusr/lib32/libobjc.so.4 -.endif # 20110331: firmware.img created at build time OLD_FILES+=3Dusr/share/examples/kld/firmware/fwimage/firmware.img # 20110224: sticky.8 -> sticky.7 @@ -323,9 +309,7 @@ .endif # 20100514: library version bump for versioned symbols for liblzma OLD_LIBS+=3Dusr/lib/liblzma.so.0 -.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" OLD_LIBS+=3Dusr/lib32/liblzma.so.0 -.endif # 20100511: move GCC-specific headers to /usr/include/gcc .if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "i386" OLD_FILES+=3Dusr/include/emmintrin.h @@ -366,9 +350,7 @@ OLD_FILES+=3Dusr/share/man/man1/gcpio.1.gz # 20100322: libz update OLD_LIBS+=3Dlib/libz.so.5 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libz.so.5 -.endif # 20100314: removal of regexp.h OLD_FILES+=3Dusr/include/regexp.h OLD_FILES+=3Dusr/share/man/man3/regexp.3.gz @@ -417,9 +399,7 @@ OLD_FILES+=3Dusr/share/man/man5/utmp.5.gz OLD_FILES+=3Dusr/share/man/man5/wtmp.5.gz OLD_LIBS+=3Dlib/libutil.so.8 -.if ${TARGET_ARCH} =3D=3D "amd64" OLB_LIBS+=3Dusr/lib32/libutil.so.8 -.endif # 20100105: new userland semaphore implementation OLD_FILES+=3Dusr/include/sys/semaphore.h # 20100103: ntptrace(8) removed @@ -627,7 +607,6 @@ OLD_LIBS+=3Dusr/lib/snmp_mibII.so.5 OLD_LIBS+=3Dusr/lib/snmp_netgraph.so.5 OLD_LIBS+=3Dusr/lib/snmp_pf.so.5 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libalias.so.6 OLD_LIBS+=3Dusr/lib32/libarchive.so.4 OLD_LIBS+=3Dusr/lib32/libauditd.so.4 @@ -728,7 +707,6 @@ OLD_LIBS+=3Dusr/lib32/pam_ssh.so.4 OLD_LIBS+=3Dusr/lib32/pam_tacplus.so.4 OLD_LIBS+=3Dusr/lib32/pam_unix.so.4 -.endif # 20090718: the gdm pam.d file is no longer required. OLD_FILES+=3Detc/pam.d/gdm # 20090714: net_add_domain(9) renamed to domain_add(9) @@ -915,9 +893,7 @@ OLD_FILES+=3Dusr/share/man/man8/slstat.8.gz # 20090321: libpcap upgraded to 1.0.0 OLD_LIBS+=3Dlib/libpcap.so.5 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libpcap.so.5 -.endif # 20090319: uscanner(4) has been removed OLD_FILES+=3Dusr/share/man/man4/uscanner.4.gz # 20090313: k8temp(4) renamed to amdtemp(4) @@ -929,17 +905,13 @@ OLD_FILES+=3Dusr/lib/libusb20_p.a OLD_FILES+=3Dusr/include/libusb20_compat01.h OLD_FILES+=3Dusr/include/libusb20_compat10.h -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libusb20.so.1 OLD_FILES+=3Dusr/lib32/libusb20.a OLD_FILES+=3Dusr/lib32/libusb20.so OLD_FILES+=3Dusr/lib32/libusb20_p.a -.endif # 20090226: libmp(3) functions renamed OLD_LIBS+=3Dusr/lib/libmp.so.6 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libmp.so.6 -.endif # 20090223: changeover of USB stacks OLD_FILES+=3Dusr/include/dev/usb2/include/ufm2_ioctl.h OLD_FILES+=3Dusr/include/dev/usb2/include/urio2_ioctl.h @@ -1242,9 +1214,7 @@ OLD_LIBS+=3Dusr/lib/libkafs5.so.9 OLD_LIBS+=3Dusr/lib/libkrb5.so.9 OLD_LIBS+=3Dusr/lib/libroken.so.9 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libgssapi.so.9 -.endif # 20080420: Symbol card support dropped OLD_FILES+=3Dusr/include/dev/wi/spectrum24t_cf.h # 20080420: awi removal @@ -1271,10 +1241,8 @@ OLD_FILES+=3Dusr/share/man/man2/kse_switchin.2.gz OLD_FILES+=3Dusr/share/man/man2/kse_thr_interrupt.2.gz OLD_FILES+=3Dusr/share/man/man2/kse_wakeup.2.gz -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_FILES+=3Dusr/lib32/libkse.so OLD_LIBS+=3Dusr/lib32/libkse.so.3 -.endif # 20080220: geom_lvm rename to geom_linux_lvm OLD_FILES+=3Dusr/share/man/man4/geom_lvm.4.gz # 20080126: oldcard.4 removal @@ -1294,11 +1262,9 @@ OLD_FILES+=3Dusr/lib/libkse.a OLD_FILES+=3Dusr/lib/libkse_p.a OLD_FILES+=3Dusr/lib/libkse_pic.a -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_FILES+=3Dusr/lib32/libkse.a OLD_FILES+=3Dusr/lib32/libkse_p.a OLD_FILES+=3Dusr/lib32/libkse_pic.a -.endif # 20071129: Removed a Solaris compatibility header OLD_FILES+=3Dusr/include/sys/_elf_solaris.h # 20071125: Renamed to pmc_get_msr() @@ -1398,12 +1364,10 @@ OLD_DIRS+=3Dusr/include/netatm/uni OLD_DIRS+=3Dusr/include/netatm OLD_DIRS+=3Dusr/share/examples/atm -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_FILES+=3Dusr/lib32/libatm.a OLD_FILES+=3Dusr/lib32/libatm.so OLD_LIBS+=3Dusr/lib32/libatm.so.5 OLD_FILES+=3Dusr/lib32/libatm_p.a -.endif # 20070705: I4B headers repo-copied to include/i4b/ .if ${TARGET_ARCH} =3D=3D "i386" OLD_FILES+=3Dusr/include/machine/i4b_cause.h @@ -1488,7 +1452,6 @@ OLD_LIBS+=3Dusr/lib/snmp_mibII.so.4 OLD_LIBS+=3Dusr/lib/snmp_netgraph.so.4 OLD_LIBS+=3Dusr/lib/snmp_pf.so.4 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libalias.so.5 OLD_LIBS+=3Dusr/lib32/libbsnmp.so.3 OLD_LIBS+=3Dusr/lib32/libdialog.so.5 @@ -1523,7 +1486,6 @@ OLD_LIBS+=3Dusr/lib32/pam_ssh.so.3 OLD_LIBS+=3Dusr/lib32/pam_tacplus.so.3 OLD_LIBS+=3Dusr/lib32/pam_unix.so.3 -.endif # 20070613: IPX over IP tunnel removal OLD_FILES+=3Dusr/include/netipx/ipx_ip.h # 20070605: sched_core removal @@ -1593,7 +1555,6 @@ OLD_LIBS+=3Dusr/lib/libypclnt.so.2 OLD_LIBS+=3Dusr/lib/snmp_bridge.so.3 OLD_LIBS+=3Dusr/lib/snmp_hostres.so.3 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libatm.so.4 OLD_LIBS+=3Dusr/lib32/libbegemot.so.2 OLD_LIBS+=3Dusr/lib32/libbluetooth.so.2 @@ -1652,7 +1613,6 @@ OLD_LIBS+=3Dusr/lib32/libwrap.so.4 OLD_LIBS+=3Dusr/lib32/libypclnt.so.2 OLD_LIBS+=3Dusr/lib32/libz.so.3 -.endif # 20070519: GCC 4.2 OLD_FILES+=3Dusr/bin/f77 OLD_FILES+=3Dusr/bin/protoize @@ -1899,9 +1859,7 @@ OLD_FILES+=3Dusr/share/info/bzip2.info.gz # 20070303: libarchive 2.0 OLD_LIBS+=3Dusr/lib/libarchive.so.3 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libarchive.so.3 -.endif # 20070301: remove addr2ascii and ascii2addr OLD_FILES+=3Dusr/share/man/man3/addr2ascii.3.gz OLD_FILES+=3Dusr/share/man/man3/ascii2addr.3.gz @@ -1918,14 +1876,12 @@ OLD_FILES+=3Dusr/lib/libmytinfow.a OLD_FILES+=3Dusr/lib/libmytinfow.so OLD_FILES+=3Dusr/lib/libmytinfow_p.a -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_FILES+=3Dusr/lib32/libmytinfo.a OLD_FILES+=3Dusr/lib32/libmytinfo.so OLD_FILES+=3Dusr/lib32/libmytinfo_p.a OLD_FILES+=3Dusr/lib32/libmytinfow.a OLD_FILES+=3Dusr/lib32/libmytinfow.so OLD_FILES+=3Dusr/lib32/libmytinfow_p.a -.endif # 20070128: remove vnconfig OLD_FILES+=3Dusr/sbin/vnconfig # 20070127: remove bpf_compat.h @@ -5269,40 +5225,32 @@ OLD_LIBS+=3Dusr/lib/libkafs5.so.8 OLD_LIBS+=3Dusr/lib/libkrb5.so.8 OLD_LIBS+=3Dusr/lib/libobjc.so.2 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libgssapi.so.8 OLD_LIBS+=3Dusr/lib32/libobjc.so.2 -.endif # 20070519: GCC 4.2 OLD_LIBS+=3Dusr/lib/libg2c.a OLD_LIBS+=3Dusr/lib/libg2c.so OLD_LIBS+=3Dusr/lib/libg2c.so.2 OLD_LIBS+=3Dusr/lib/libg2c_p.a OLD_LIBS+=3Dusr/lib/libgcc_pic.a -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libg2c.a OLD_LIBS+=3Dusr/lib32/libg2c.so OLD_LIBS+=3Dusr/lib32/libg2c.so.2 OLD_LIBS+=3Dusr/lib32/libg2c_p.a OLD_LIBS+=3Dusr/lib32/libgcc_pic.a -.endif # 20060729: OpenSSL 0.9.7e -> 0.9.8b upgrade OLD_LIBS+=3Dlib/libcrypto.so.4 OLD_LIBS+=3Dusr/lib/libssl.so.4 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libcrypto.so.4 OLD_LIBS+=3Dusr/lib32/libssl.so.4 -.endif # 20060521: gethostbyaddr(3) ABI change OLD_LIBS+=3Dusr/lib/libroken.so.8 OLD_LIBS+=3Dlib/libatm.so.3 OLD_LIBS+=3Dlib/libc.so.6 OLD_LIBS+=3Dlib/libutil.so.5 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libatm.so.3 OLD_LIBS+=3Dusr/lib32/libc.so.6 OLD_LIBS+=3Dusr/lib32/libutil.so.5 -.endif # 20060413: shared library moved to /usr/lib OLD_LIBS+=3Dlib/libgpib.so.1 # 20060413: libpcap.so.4 moved to /lib/ @@ -5316,12 +5264,10 @@ OLD_LIBS+=3Dusr/lib/libc_r.so OLD_LIBS+=3Dusr/lib/libc_r.so.7 OLD_LIBS+=3Dusr/lib/libc_r_p.a -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libc_r.a OLD_LIBS+=3Dusr/lib32/libc_r.so OLD_LIBS+=3Dusr/lib32/libc_r.so.7 OLD_LIBS+=3Dusr/lib32/libc_r_p.a -.endif # 20050722: bump for 6.0-RELEASE OLD_LIBS+=3Dlib/libalias.so.4 OLD_LIBS+=3Dlib/libatm.so.2 @@ -5533,10 +5479,8 @@ OLD_LIBS+=3Dusr/lib/libarchive.so.2 OLD_LIBS+=3Dusr/lib/libbsnmp.so.1 OLD_LIBS+=3Dusr/lib/libc_r.so.6 -.if ${TARGET_ARCH} =3D=3D "amd64" OLD_LIBS+=3Dusr/lib32/libarchive.so.2 OLD_LIBS+=3Dusr/lib32/libc_r.so.6 -.endif OLD_LIBS+=3Dusr/lib/libcipher.so.2 OLD_LIBS+=3Dusr/lib/libgssapi.so.6 OLD_LIBS+=3Dusr/lib/libkse.so.1 --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 21:27:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21FCC10656DB; Wed, 7 Mar 2012 21:27:54 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id E40B58FC13; Wed, 7 Mar 2012 21:27:53 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M0J0080EAAH3V00@smtpauth1.wiscmail.wisc.edu>; Wed, 07 Mar 2012 15:27:53 -0600 (CST) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M0J0035BAAB4E10@smtpauth1.wiscmail.wisc.edu>; Wed, 07 Mar 2012 15:27:47 -0600 (CST) Date: Wed, 07 Mar 2012 15:27:47 -0600 From: Nathan Whitehorn In-reply-to: To: Sergey Kandaurov Message-id: <4F57D2D3.60409@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.7.211521, SenderIP=128.104.160.176 References: <201203072046.q27KkxFr009846@svn.freebsd.org> <4F57C9C8.80907@freebsd.org> <4F57CD9B.5010600@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.25) Gecko/20120130 Thunderbird/3.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232671 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 21:27:54 -0000 On 03/07/12 15:18, Sergey Kandaurov wrote: > On 8 March 2012 01:05, Nathan Whitehorn wrote: >> On 03/07/12 14:53, Sergey Kandaurov wrote: >>> On 8 March 2012 00:49, Nathan Whitehorn wrote: >>>> On 03/07/12 14:46, Sergey Kandaurov wrote: >>>>> Author: pluknet >>>>> Date: Wed Mar 7 20:46:59 2012 >>>>> New Revision: 232671 >>>>> URL: http://svn.freebsd.org/changeset/base/232671 >>>>> >>>>> Log: >>>>> Add lib32 part for libutil after its version bump to 9. >>>>> >>>>> PR: misc/165523 >>>>> Submitted by: Andrey Zonov >>>>> MFC after: 1 week >>>>> >>>>> Modified: >>>>> head/ObsoleteFiles.inc >>>>> >>>>> Modified: head/ObsoleteFiles.inc >>>>> >>>>> >>>>> ============================================================================== >>>>> --- head/ObsoleteFiles.inc Wed Mar 7 18:57:09 2012 >>>>> (r232670) >>>>> +++ head/ObsoleteFiles.inc Wed Mar 7 20:46:59 2012 >>>>> (r232671) >>>>> @@ -417,6 +417,9 @@ OLD_FILES+=usr/share/man/man5/lastlog.5. >>>>> OLD_FILES+=usr/share/man/man5/utmp.5.gz >>>>> OLD_FILES+=usr/share/man/man5/wtmp.5.gz >>>>> OLD_LIBS+=lib/libutil.so.8 >>>>> +.if ${TARGET_ARCH} == "amd64" >>>>> +OLB_LIBS+=usr/lib32/libutil.so.8 >>>>> +.endif >>>>> # 20100105: new userland semaphore implementation >>>>> OLD_FILES+=usr/include/sys/semaphore.h >>>>> # 20100103: ntptrace(8) removed >>>> >>>> This should also check for powerpc64. Or, better, do it unconditionally, >>>> since it will only remove files that actually exist and there's no harm >>>> trying to remove /usr/lib32/blah on 32-bit systems. >>>> -Nathan >>> Ok. so there are two way to go. >>> - add .if for powerpc64 (btw, does this arch exist in RELENG_8?) >> >> powerpc64 is new in RELENG_9. >> >> >>> - remove all lib32 related conditions throughout the file. >>> >>> The latter looks easier to maintain. >> >> I think that's a better way to go, especially with the addition of >> COMPAT_FREEBSD32 on mips. >> -Nathan > Does this patch look good for you? > > Index: ObsoleteFiles.inc > =================================================================== > --- ObsoleteFiles.inc (revision 232672) > +++ ObsoleteFiles.inc (working copy) > @@ -56,9 +56,7 @@ > usr/share/man/man3/archive_write_set_compression_none.3.gz \ > usr/share/man/man3/archive_write_set_compression_program.3.gz > OLD_LIBS+=usr/lib/libarchive.so.5 > -.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" > OLD_LIBS+=usr/lib32/libarchive.so.5 > -.endif I like it. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 21:34:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC9241065675; Wed, 7 Mar 2012 21:34:50 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id B1E128FC14; Wed, 7 Mar 2012 21:34:49 +0000 (UTC) Received: by lagv3 with SMTP id v3so10968529lag.13 for ; Wed, 07 Mar 2012 13:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 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=RVbF9X7AH9nWuXKichmT2HsJtoFCovi7AyoQmuB+16w=; b=izsAzU+h7X02JSD1myt+tl0LVNE/fhYCmzfGYd7yFZccP7v62m8+Wf1YGxaBC08g1s Re8nLIu4/o5Wcdv4XQoSvi5P3uo1M5Qqkn+ubBp4eGtnk8/axdDXn0t4XKASKGE2ss23 lLvaBhaFT7TS54oiXLE82o3DVjhcOhv3/ixkJacUKpbt1y09Ou6ze3hgVdzGsCArxvVP DGTBkym++q+Z0B0i8kaowmilim5M5MBI1VqSz6eD2eW8PdQ30s8UfulH1HeeI8QFsL0x aaKL/ckimg9dBcA3raB7yePgK82jCEN5+P5KKIDs63uY8hzmbp4YmoDLW2W7v4UvAX0r Ud3g== MIME-Version: 1.0 Received: by 10.152.145.135 with SMTP id su7mr2632552lab.5.1331156088371; Wed, 07 Mar 2012 13:34:48 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.21.73 with HTTP; Wed, 7 Mar 2012 13:34:48 -0800 (PST) In-Reply-To: <4F57D2D3.60409@freebsd.org> References: <201203072046.q27KkxFr009846@svn.freebsd.org> <4F57C9C8.80907@freebsd.org> <4F57CD9B.5010600@freebsd.org> <4F57D2D3.60409@freebsd.org> Date: Thu, 8 Mar 2012 00:34:48 +0300 X-Google-Sender-Auth: pikcR8bHfdRPETEwdZ0GpsI0NOI Message-ID: From: Sergey Kandaurov To: Nathan Whitehorn 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: r232671 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 21:34:50 -0000 On 8 March 2012 01:27, Nathan Whitehorn wrote: > On 03/07/12 15:18, Sergey Kandaurov wrote: >> >> On 8 March 2012 01:05, Nathan Whitehorn =A0wrote= : >>> >>> On 03/07/12 14:53, Sergey Kandaurov wrote: >>>> >>>> On 8 March 2012 00:49, Nathan Whitehorn >>>> =A0wrote: >>>>> >>>>> On 03/07/12 14:46, Sergey Kandaurov wrote: >>>>>> >>>>>> Author: pluknet >>>>>> Date: Wed Mar =A07 20:46:59 2012 >>>>>> New Revision: 232671 >>>>>> URL: http://svn.freebsd.org/changeset/base/232671 >>>>>> >>>>>> Log: >>>>>> =A0 Add lib32 part for libutil after its version bump to 9. >>>>>> >>>>>> =A0 PR: =A0 =A0 =A0 =A0 =A0misc/165523 >>>>>> =A0 Submitted by: =A0 =A0 =A0 =A0Andrey Zonov >>>>>> =A0 MFC after: =A0 1 week >>>>>> >>>>>> Modified: >>>>>> =A0 head/ObsoleteFiles.inc >>>>>> >>>>>> 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 =A0Wed Mar =A07 18:57:09 2012 >>>>>> =A0(r232670) >>>>>> +++ head/ObsoleteFiles.inc =A0 =A0 =A0Wed Mar =A07 20:46:59 2012 >>>>>> =A0(r232671) >>>>>> @@ -417,6 +417,9 @@ OLD_FILES+=3Dusr/share/man/man5/lastlog.5. >>>>>> =A0OLD_FILES+=3Dusr/share/man/man5/utmp.5.gz >>>>>> =A0OLD_FILES+=3Dusr/share/man/man5/wtmp.5.gz >>>>>> =A0OLD_LIBS+=3Dlib/libutil.so.8 >>>>>> +.if ${TARGET_ARCH} =3D=3D "amd64" >>>>>> +OLB_LIBS+=3Dusr/lib32/libutil.so.8 >>>>>> +.endif >>>>>> =A0# 20100105: new userland semaphore implementation >>>>>> =A0OLD_FILES+=3Dusr/include/sys/semaphore.h >>>>>> =A0# 20100103: ntptrace(8) removed >>>>> >>>>> >>>>> This should also check for powerpc64. Or, better, do it >>>>> unconditionally, >>>>> since it will only remove files that actually exist and there's no ha= rm >>>>> trying to remove /usr/lib32/blah on 32-bit systems. >>>>> -Nathan >>>> >>>> Ok. so there are two way to go. >>>> - add .if for powerpc64 (btw, does this arch exist in RELENG_8?) >>> >>> >>> powerpc64 is new in RELENG_9. >>> >>> >>>> - remove all lib32 related conditions throughout the file. >>>> >>>> The latter looks easier to maintain. >>> >>> >>> I think that's a better way to go, especially with the addition of >>> COMPAT_FREEBSD32 on mips. >>> -Nathan >> >> Does this patch look good for you? >> >> Index: 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 >> --- ObsoleteFiles.inc =A0 (revision 232672) >> +++ ObsoleteFiles.inc =A0 (working copy) >> @@ -56,9 +56,7 @@ >> =A0 =A0 =A0 =A0 usr/share/man/man3/archive_write_set_compression_none.3.= gz \ >> =A0 =A0 =A0 =A0 usr/share/man/man3/archive_write_set_compression_program= .3.gz >> =A0OLD_LIBS+=3Dusr/lib/libarchive.so.5 >> -.if ${TARGET_ARCH} =3D=3D "amd64" || ${TARGET_ARCH} =3D=3D "powerpc64" >> =A0OLD_LIBS+=3Dusr/lib32/libarchive.so.5 >> -.endif > > > I like it. > -Nathan I will commit the patch tomorrow then if no one else will object against it= . Thanks for review. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 22:00:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id D3B63106564A; Wed, 7 Mar 2012 22:00:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Wed, 7 Mar 2012 17:00:19 -0500 User-Agent: KMail/1.6.2 References: <201203051953.q25JrIS1002269@svn.freebsd.org> In-Reply-To: <201203051953.q25JrIS1002269@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203071700.21259.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin Subject: Re: svn commit: r232570 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 22:00:35 -0000 On Monday 05 March 2012 02:53 pm, John Baldwin wrote: > Author: jhb > Date: Mon Mar 5 19:53:17 2012 > New Revision: 232570 > URL: http://svn.freebsd.org/changeset/base/232570 > > Log: > Fix boot2 to handle boot config files that only contain a custom > path to a loader or kernel. Specifically, kname cannot be pointed > at cmd[] since it's value is change to be an empty string after the > initial call to parse, and cmd[]'s value can be changed (thus > losing a prior setting for kname) due to user input at the boot > prompt. While here, ensure that that initial boot config file text > is nul-terminated, that ops is initialized to zero, and that kname > is always initialized to a valid string. As many people pointed out, Clang overflows boot2 again after this commit. Long long time ago, I asked this question on arch@: http://docs.freebsd.org/cgi/mid.cgi?200509081418.47794.jkim Why can't we do that now? Can't we build separate ufs1-only and ufs2-only boot2's, at least? Having ufs1+ufs2 boot block is great but I see very little benefit to support that in 2012. :-/ Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 22:39:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 626A5106566C; Wed, 7 Mar 2012 22:39:12 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 521368FC12; Wed, 7 Mar 2012 22:39: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 q27MdCeT013630; Wed, 7 Mar 2012 22:39:12 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27MdCj1013628; Wed, 7 Mar 2012 22:39:12 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201203072239.q27MdCj1013628@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 7 Mar 2012 22:39: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: r232675 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 22:39:12 -0000 Author: ken Date: Wed Mar 7 22:39:11 2012 New Revision: 232675 URL: http://svn.freebsd.org/changeset/base/232675 Log: Make the mps(4) module depend on the cam module. Submitted by: Mykola Dzham MFC after: 3 days Modified: head/sys/dev/mps/mps_pci.c Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Wed Mar 7 22:19:43 2012 (r232674) +++ head/sys/dev/mps/mps_pci.c Wed Mar 7 22:39:11 2012 (r232675) @@ -87,6 +87,7 @@ static driver_t mps_pci_driver = { static devclass_t mps_devclass; DRIVER_MODULE(mps, pci, mps_pci_driver, mps_devclass, 0, 0); +MODULE_DEPEND(mps, cam, 1, 1, 1); struct mps_ident { uint16_t vendor; From owner-svn-src-head@FreeBSD.ORG Wed Mar 7 23:57:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 594D71065670; Wed, 7 Mar 2012 23:57: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 48DE58FC14; Wed, 7 Mar 2012 23:57: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 q27Nvorx016186; Wed, 7 Mar 2012 23:57:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q27NvoDJ016184; Wed, 7 Mar 2012 23:57:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203072357.q27NvoDJ016184@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 7 Mar 2012 23:57: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: r232676 - head/usr.sbin/acpi/iasl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2012 23:57:50 -0000 Author: jkim Date: Wed Mar 7 23:57:49 2012 New Revision: 232676 URL: http://svn.freebsd.org/changeset/base/232676 Log: Make parallel build more safer. Reviewed by: tijl Modified: head/usr.sbin/acpi/iasl/Makefile Modified: head/usr.sbin/acpi/iasl/Makefile ============================================================================== --- head/usr.sbin/acpi/iasl/Makefile Wed Mar 7 22:39:11 2012 (r232675) +++ head/usr.sbin/acpi/iasl/Makefile Wed Mar 7 23:57:49 2012 (r232676) @@ -75,19 +75,21 @@ CLEANFILES= aslcompiler.y.h aslcompilerl aslcompilerlex.c: aslcompiler.l ${LEX} ${LFLAGS} -PAslCompiler -o${.TARGET} ${.ALLSRC} -aslcompilerparse.c: aslcompiler.y - ${YACC} ${YFLAGS} -pAslCompiler -o${.TARGET} ${.ALLSRC} +.ORDER: aslcompilerparse.c aslcompilerparse.h +aslcompilerparse.c aslcompilerparse.h: aslcompiler.y + ${YACC} ${YFLAGS} -pAslCompiler -oaslcompilerparse.c ${.ALLSRC} -aslcompiler.y.h: aslcompilerparse.c - mv -f aslcompilerparse.h ${.TARGET} +aslcompiler.y.h: aslcompilerparse.h + ln -f ${.ALLSRC} ${.TARGET} dtparserlex.c: dtparser.l ${LEX} ${LFLAGS} -PDtParser -o${.TARGET} ${.ALLSRC} -dtparserparse.c: dtparser.y - ${YACC} ${YFLAGS} -pDtParser -o${.TARGET} ${.ALLSRC} +.ORDER: dtparserparse.c dtparserparse.h +dtparserparse.c dtparserparse.h: dtparser.y + ${YACC} ${YFLAGS} -pDtParser -odtparserparse.c ${.ALLSRC} -dtparser.y.h: dtparserparse.c - mv -f dtparserparse.h ${.TARGET} +dtparser.y.h: dtparserparse.h + ln -f ${.ALLSRC} ${.TARGET} .include From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 00:03:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 9564B106566B; Thu, 8 Mar 2012 00:03:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: "src-committers@freebsd.org" Date: Wed, 7 Mar 2012 19:03:23 -0500 User-Agent: KMail/1.6.2 References: <201203051953.q25JrIS1002269@svn.freebsd.org> <201203071700.21259.jkim@FreeBSD.org> In-Reply-To: <201203071700.21259.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_Yd/VPakYDBLxXp2" Message-Id: <201203071903.36731.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , John Baldwin Subject: Re: svn commit: r232570 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 00:03:42 -0000 --Boundary-00=_Yd/VPakYDBLxXp2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 07 March 2012 05:00 pm, Jung-uk Kim wrote: > On Monday 05 March 2012 02:53 pm, John Baldwin wrote: > > Author: jhb > > Date: Mon Mar 5 19:53:17 2012 > > New Revision: 232570 > > URL: http://svn.freebsd.org/changeset/base/232570 > > > > Log: > > Fix boot2 to handle boot config files that only contain a > > custom path to a loader or kernel. Specifically, kname cannot be > > pointed at cmd[] since it's value is change to be an empty string > > after the initial call to parse, and cmd[]'s value can be changed > > (thus losing a prior setting for kname) due to user input at the > > boot prompt. While here, ensure that that initial boot config > > file text is nul-terminated, that ops is initialized to zero, and > > that kname is always initialized to a valid string. > > As many people pointed out, Clang overflows boot2 again after this > commit. Long long time ago, I asked this question on arch@: > > http://docs.freebsd.org/cgi/mid.cgi?200509081418.47794.jkim > > Why can't we do that now? Can't we build separate ufs1-only and > ufs2-only boot2's, at least? Having ufs1+ufs2 boot block is great > but I see very little benefit to support that in 2012. :-/ FYI, this patch does the separation. Also available from here: http://people.freebsd.org/~jkim/boot2.diff Jung-uk Kim --Boundary-00=_Yd/VPakYDBLxXp2 Content-Type: text/plain; charset="iso-8859-1"; name="boot2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="boot2.diff" Index: sys/boot/i386/Makefile =================================================================== --- sys/boot/i386/Makefile (revision 232670) +++ sys/boot/i386/Makefile (working copy) @@ -2,8 +2,8 @@ .include -SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot kgzldr \ - libi386 libfirewire loader +SUBDIR= mbr pmbr boot0 boot0sio btx boot2 boot2ufs1 cdboot gptboot \ + kgzldr libi386 libfirewire loader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr Index: sys/boot/i386/boot2/Makefile =================================================================== --- sys/boot/i386/boot2/Makefile (revision 232670) +++ sys/boot/i386/boot2/Makefile (working copy) @@ -2,8 +2,10 @@ .include -FILES= boot boot1 boot2 +FILES= boot${BOOT_SUFFIX} boot2${BOOT2_SUFFIX} +SRCDIR= ${.CURDIR}/../boot2 + NM?= nm # A value of 0x80 enables LBA support. @@ -18,10 +20,22 @@ ORG1= 0x7c00 ORG2= 0x2000 # Decide level of UFS support. -BOOT2_UFS?= UFS1_AND_UFS2 -#BOOT2_UFS?= UFS2_ONLY -#BOOT2_UFS?= UFS1_ONLY +BOOT2_UFS?= UFS2_ONLY +#BOOT2_UFS?= UFS1_AND_UFS2 +.if ${BOOT2_UFS} != UFS1_ONLY +FILES+= boot1 +.endif +.if ${BOOT2_UFS} == UFS1_ONLY +BOOT_SUFFIX= .ufs1 +BOOT2_SUFFIX= ufs1 +.elif ${BOOT2_UFS} == UFS2_ONLY +BOOT_SUFFIX= .ufs2 +BOOT2_SUFFIX= ufs2 +LINKS= ${BINDIR}/boot${BOOT_SUFFIX} ${BINDIR}/boot \ + ${BINDIR}/boot2${BOOT2_SUFFIX} ${BINDIR}/boot2 +.endif + CFLAGS= -Os \ -fno-guess-branch-probability \ -fomit-frame-pointer \ @@ -50,8 +64,8 @@ LDFLAGS=-static -N --gc-sections CLEANFILES= boot -boot: boot1 boot2 - cat boot1 boot2 > boot +boot${BOOT_SUFFIX}: boot1 boot2${BOOT2_SUFFIX} + cat ${.ALLSRC} > ${.TARGET} CLEANFILES+= boot1 boot1.out boot1.o @@ -64,7 +78,7 @@ boot1.out: boot1.o CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ boot2.s boot2.s.tmp boot2.h sio.o -boot2: boot2.ld +boot2${BOOT2_SUFFIX}: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync @@ -88,7 +102,7 @@ boot2.o: boot2.s SRCS= boot2.c boot2.h boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c - ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c + ${CC} ${CFLAGS} -S -o boot2.s.tmp ${SRCDIR}/boot2.c sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s rm -f boot2.s.tmp Index: sys/boot/i386/boot2ufs1/Makefile =================================================================== --- sys/boot/i386/boot2ufs1/Makefile (revision 0) +++ sys/boot/i386/boot2ufs1/Makefile (working copy) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../boot2 + +BOOT2_UFS= UFS1_ONLY + +.include "${.CURDIR}/../boot2/Makefile" Property changes on: sys/boot/i386/boot2ufs1/Makefile ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property --Boundary-00=_Yd/VPakYDBLxXp2-- From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 01:37:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20FD31065677; Thu, 8 Mar 2012 01:37:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE6938FC12; Thu, 8 Mar 2012 01:37: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 q281b1X0019576; Thu, 8 Mar 2012 01:37:01 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q281b1cg019574; Thu, 8 Mar 2012 01:37:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203080137.q281b1cg019574@svn.freebsd.org> From: Ed Maste Date: Thu, 8 Mar 2012 01:37: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: r232678 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 01:37:02 -0000 Author: emaste Date: Thu Mar 8 01:37:01 2012 New Revision: 232678 URL: http://svn.freebsd.org/changeset/base/232678 Log: Inbound TCP-MD5 digest validation is now supported Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Thu Mar 8 01:10:23 2012 (r232677) +++ head/share/man/man4/tcp.4 Thu Mar 8 01:37:01 2012 (r232678) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 5, 2012 +.Dd March 7, 2012 .Dt TCP 4 .Os .Sh NAME @@ -255,8 +255,9 @@ or the internal send buffer is filled. .It Dv TCP_MD5SIG This option enables the use of MD5 digests (also known as TCP-MD5) on writes to the specified socket. -In the current release, only outgoing traffic is digested; -digests on incoming traffic are not verified. +Outgoing traffic is digested; +digests on incoming traffic are verified +if the net.inet.tcp.signature_verify_input sysctl is nonzero. The current default behavior for the system is to respond to a system advertising this option with TCP-MD5; this may change. .Pp From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 01:47:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38B2D106564A; Thu, 8 Mar 2012 01:47:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27D958FC12; Thu, 8 Mar 2012 01:47: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 q281lDDP019911; Thu, 8 Mar 2012 01:47:13 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q281lCGN019909; Thu, 8 Mar 2012 01:47:12 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201203080147.q281lCGN019909@svn.freebsd.org> From: Hiroki Sato Date: Thu, 8 Mar 2012 01:47: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: r232679 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 01:47:13 -0000 Author: hrs Date: Thu Mar 8 01:47:12 2012 New Revision: 232679 URL: http://svn.freebsd.org/changeset/base/232679 Log: - Clean up extra ${.OBJDIR}. - Add ${IMAGE} for the supported image files. This fixes the install target on FreeBSD/pc98. - Use "mkdir -p" instead of "-mkdir" consistently. Reviewed by: nwhitehorn Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu Mar 8 01:37:01 2012 (r232678) +++ head/release/Makefile Thu Mar 8 01:47:12 2012 (r232679) @@ -32,7 +32,7 @@ TARGET_ARCH?= ${MACHINE_ARCH} TARGET_ARCH?= ${TARGET} .endif IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} -DISTDIR= ${.OBJDIR}/dist +DISTDIR= dist .if !exists(${DOCDIR}) NODOC= true @@ -53,38 +53,41 @@ EXTRA_PACKAGES+= reldoc .endif RELEASE_TARGETS= ftp +IMAGES= .if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) RELEASE_TARGETS+= cdrom +IMAGES+= release.iso bootonly.iso .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) RELEASE_TARGETS+= memstick +IMAGES+= memstick .endif .include base.txz: - -mkdir ${DISTDIR} - cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${DISTDIR} + mkdir -p ${DISTDIR} + cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${.OBJDIR}/${DISTDIR} # Set up mergemaster root database sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \ - "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${DISTDIR}/base" + "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${.OBJDIR}/${DISTDIR}/base" # Package all components - cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${DISTDIR} - mv ${DISTDIR}/*.txz ${.OBJDIR} + cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR} + mv ${DISTDIR}/*.txz . kernel.txz: - -mkdir ${DISTDIR} - cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${DISTDIR} - mv ${DISTDIR}/kernel*.txz ${.OBJDIR} + mkdir -p ${DISTDIR} + cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${.OBJDIR}/${DISTDIR} + mv ${DISTDIR}/kernel*.txz . src.txz: - -mkdir -p ${DISTDIR}/usr + mkdir -p ${DISTDIR}/usr ln -fs ${WORLDDIR} ${DISTDIR}/usr/src cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn \ --exclude CVS usr/src ports.txz: - -mkdir -p ${DISTDIR}/usr + mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \ --exclude usr/ports/distfiles --exclude usr/ports/packages \ @@ -93,38 +96,35 @@ ports.txz: reldoc: cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \ INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc - -mkdir ${.OBJDIR}/reldoc + mkdir -p reldoc .for i in hardware readme relnotes errata - ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/${i}/article.txt \ - ${.OBJDIR}/reldoc/${i:U}.TXT - ln -f ${.OBJDIR}/rdoc/${RELNOTES_LANG}/${i}/article.html \ - ${.OBJDIR}/reldoc/${i:U}.HTM + ln -f rdoc/${RELNOTES_LANG}/${i}/article.txt reldoc/${i:U}.TXT + ln -f rdoc/${RELNOTES_LANG}/${i}/article.html reldoc/${i:U}.HTM .endfor - cp ${.OBJDIR}/rdoc/${RELNOTES_LANG}/readme/docbook.css ${.OBJDIR}/reldoc + cp rdoc/${RELNOTES_LANG}/readme/docbook.css reldoc system: packagesystem # Install system - -mkdir ${.OBJDIR}/release + mkdir -p release cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 # Copy distfiles - mkdir ${.OBJDIR}/release/usr/freebsd-dist - cp ${.OBJDIR}/*.txz ${.OBJDIR}/MANIFEST \ - ${.OBJDIR}/release/usr/freebsd-dist + mkdir -p release/usr/freebsd-dist + cp *.txz MANIFEST release/usr/freebsd-dist # Copy documentation, if generated .if !defined(NODOC) - cp ${.OBJDIR}/reldoc/* ${.OBJDIR}/release + cp reldoc/* release .endif # Set up installation environment - ln -s /tmp/bsdinstall_etc/resolv.conf ${.OBJDIR}/release/etc/resolv.conf - echo sendmail_enable=\"NONE\" > ${.OBJDIR}/release/etc/rc.conf - echo hostid_enable=\"NO\" >> ${.OBJDIR}/release/etc/rc.conf - cp ${.CURDIR}/rc.local ${.OBJDIR}/release/etc - touch ${.OBJDIR}/${.TARGET} + ln -s /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf + echo sendmail_enable=\"NONE\" > release/etc/rc.conf + echo hostid_enable=\"NO\" >> release/etc/rc.conf + cp ${.CURDIR}/rc.local release/etc + touch ${.TARGET} bootonly: packagesystem # Install system - mkdir ${.OBJDIR}/bootonly + mkdir -p bootonly cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/bootonly WITHOUT_AMD=1 WITHOUT_AT=1 \ WITHOUT_BIND_DNSSEC=1 WITHOUT_BIND_ETC=1 WITHOUT_BIND_MTREE=1 \ @@ -134,35 +134,35 @@ bootonly: packagesystem WITHOUT_INSTALLIB=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 \ WITHOUT_KERNEL_SYMBOLS=1 # Copy manifest only (no distfiles) to get checksums - mkdir ${.OBJDIR}/bootonly/usr/freebsd-dist - cp ${.OBJDIR}/MANIFEST ${.OBJDIR}/bootonly/usr/freebsd-dist + mkdir -p bootonly/usr/freebsd-dist + cp MANIFEST bootonly/usr/freebsd-dist # Copy documentation, if generated .if !defined(NODOC) - cp ${.OBJDIR}/reldoc/* ${.OBJDIR}/bootonly + cp reldoc/* bootonly .endif # Set up installation environment - ln -s /tmp/bsdinstall_etc/resolv.conf ${.OBJDIR}/bootonly/etc/resolv.conf - echo sendmail_enable=\"NONE\" > ${.OBJDIR}/bootonly/etc/rc.conf - echo hostid_enable=\"NO\" >> ${.OBJDIR}/bootonly/etc/rc.conf - cp ${.CURDIR}/rc.local ${.OBJDIR}/bootonly/etc + ln -s /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf + echo sendmail_enable=\"NONE\" > bootonly/etc/rc.conf + echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf + cp ${.CURDIR}/rc.local bootonly/etc release.iso: system - sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.OBJDIR}/release.iso ${.OBJDIR}/release + sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} release bootonly.iso: bootonly - sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.OBJDIR}/bootonly.iso ${.OBJDIR}/bootonly + sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} bootonly memstick: system - sh ${.CURDIR}/${TARGET}/make-memstick.sh ${.OBJDIR}/release ${.OBJDIR}/memstick + sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET} packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} - sh ${.CURDIR}/scripts/make-manifest.sh ${.OBJDIR}/*.txz > ${.OBJDIR}/MANIFEST + sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} cdrom: release.iso bootonly.iso ftp: packagesystem rm -rf ftp - mkdir ftp + mkdir -p ftp cp *.txz MANIFEST ftp release: @@ -170,7 +170,7 @@ release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} clean: - chflags -R noschg ${.OBJDIR} + chflags -R noschg . rm -rf dist ftp rm -f packagesystem rm -f *.txz MANIFEST @@ -179,6 +179,7 @@ clean: rm -f release.iso bootonly.iso memstick install: - -mkdir ${DESTDIR} - cp -a *.iso memstick ftp ${DESTDIR}/ - +.if defined(DESTDIR) && !empty(DESTDIR) + mkdir -p ${DESTDIR} +.endif + cp -a ${IMAGES} ftp ${DESTDIR}/ From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 01:48:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA39D1065670; Thu, 8 Mar 2012 01:48:44 +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 DA06B8FC12; Thu, 8 Mar 2012 01:48: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 q281migb020002; Thu, 8 Mar 2012 01:48:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q281miii020000; Thu, 8 Mar 2012 01:48:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203080148.q281miii020000@svn.freebsd.org> From: Ed Maste Date: Thu, 8 Mar 2012 01:48: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: r232680 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 01:48:45 -0000 Author: emaste Date: Thu Mar 8 01:48:44 2012 New Revision: 232680 URL: http://svn.freebsd.org/changeset/base/232680 Log: Remove unactionable message about label geometry It's not clear to a user what they should do after seeing the "geometry does not match label" kernel message, and it does not appear to present a problem in practice. Thus, just remove the messages. Approved by: marcel Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Thu Mar 8 01:47:12 2012 (r232679) +++ head/sys/geom/part/g_part_bsd.c Thu Mar 8 01:48:44 2012 (r232680) @@ -389,10 +389,6 @@ g_part_bsd_read(struct g_part_table *bas goto invalid_label; if (heads != basetable->gpt_heads && !basetable->gpt_fixgeom) basetable->gpt_heads = heads; - if (sectors != basetable->gpt_sectors || heads != basetable->gpt_heads) - printf("GEOM: %s: geometry does not match label" - " (%uh,%us != %uh,%us).\n", pp->name, heads, sectors, - basetable->gpt_heads, basetable->gpt_sectors); chs = le32dec(buf + 60); if (chs < 1) @@ -402,9 +398,6 @@ g_part_bsd_read(struct g_part_table *bas chs = msize; le32enc(buf + 60, msize); } - if (chs != msize) - printf("GEOM: %s: media size does not match label.\n", - pp->name); basetable->gpt_first = 0; basetable->gpt_last = msize - 1; From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 02:00:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 873491065677; Thu, 8 Mar 2012 02:00:53 +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 766FA8FC13; Thu, 8 Mar 2012 02:00: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 q2820r6I020449; Thu, 8 Mar 2012 02:00:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2820rQP020447; Thu, 8 Mar 2012 02:00:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203080200.q2820rQP020447@svn.freebsd.org> From: Ed Maste Date: Thu, 8 Mar 2012 02:00: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: r232681 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 02:00:53 -0000 Author: emaste Date: Thu Mar 8 02:00:52 2012 New Revision: 232681 URL: http://svn.freebsd.org/changeset/base/232681 Log: Work around broken BIOS memory reporting Andrzej has a machine with 32GB of RAM, but only 16GB is reported by the smbios.memory.enabled. Thus, use the greater of hw.realmem and the smbios value. Reported by: Andrzej Tobola Modified: head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Thu Mar 8 01:48:44 2012 (r232680) +++ head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Thu Mar 8 02:00:52 2012 (r232681) @@ -26,7 +26,14 @@ # $FreeBSD$ if smbios_mem=$(kenv -q smbios.memory.enabled); then - expr $smbios_mem / 1024 + smbios_mem=$(expr $smbios_mem / 1024) else - expr $(sysctl -n hw.realmem) / 1048576 + smbios_mem=0 +fi +realmem=$(expr $(sysctl -n hw.realmem) / 1048576) + +if [ $smbios_mem -gt $realmem ]; then + echo $smbios_mem +else + echo $realmem fi From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 07:22:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B7C106564A; Thu, 8 Mar 2012 07:22:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D07C8FC12; Thu, 8 Mar 2012 07:22: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 q287MgxW031093; Thu, 8 Mar 2012 07:22:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q287Mff6031089; Thu, 8 Mar 2012 07:22:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203080722.q287Mff6031089@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 8 Mar 2012 07:22: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: r232684 - in head: share/man/man4 sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 07:22:42 -0000 Author: hselasky Date: Thu Mar 8 07:22:41 2012 New Revision: 232684 URL: http://svn.freebsd.org/changeset/base/232684 Log: Add new USB device IDs. PR: usb/165815 MFC after: 1 week Modified: head/share/man/man4/u3g.4 head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Thu Mar 8 03:02:48 2012 (r232683) +++ head/share/man/man4/u3g.4 Thu Mar 8 07:22:41 2012 (r232684) @@ -63,6 +63,8 @@ Option GT 3G, GT 3G Quad, etc. .It Vodafone Mobile Connect Card 3G .It +Vodafone Mobile Broadband K3772-Z +.It Qualcomm Inc. CDMA MSM .It Huawei B190, E180v, E220 ('') Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Mar 8 03:02:48 2012 (r232683) +++ head/sys/dev/usb/serial/u3g.c Thu Mar 8 07:22:41 2012 (r232684) @@ -423,6 +423,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, SURFSTICK, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), + U3G_DEV(QUALCOMMINC, K3772_Z, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Mar 8 03:02:48 2012 (r232683) +++ head/sys/dev/usb/usbdevs Thu Mar 8 07:22:41 2012 (r232684) @@ -2750,6 +2750,7 @@ product QUALCOMMINC E0078 0x0078 3G mode product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick +product QUALCOMMINC K3772_Z 0x1179 3G modem product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 09:20:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6978D106566B; Thu, 8 Mar 2012 09:20:01 +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 501E78FC12; Thu, 8 Mar 2012 09:20:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q289K1nR035205; Thu, 8 Mar 2012 09:20:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q289K10S035203; Thu, 8 Mar 2012 09:20:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203080920.q289K10S035203@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 8 Mar 2012 09:20: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: r232685 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 09:20:01 -0000 Author: glebius Date: Thu Mar 8 09:20:00 2012 New Revision: 232685 URL: http://svn.freebsd.org/changeset/base/232685 Log: Merge from OpenBSD: revision 1.146 date: 2010/05/12 08:11:11; author: claudio; state: Exp; lines: +2 -3 bzero() the full compressed update struct before setting the values. This is needed because pf_state_peer_hton() skips some fields in certain situations which could result in garbage beeing sent to the other peer. This seems to fix the pfsync storms seen by stephan@ and so dlg owes me a whiskey. I didn't see any storms, but this definitely fixes a useless memory allocation on the receiving side, due to non zero scrub_flags field in a pfsync_state_peer structure. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Thu Mar 8 07:22:41 2012 (r232684) +++ head/sys/contrib/pf/net/if_pfsync.c Thu Mar 8 09:20:00 2012 (r232685) @@ -48,6 +48,7 @@ * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions * 1.128 - cleanups + * 1.146 - bzero() mbuf before sparsely filling it with data * 1.170 - SIOCSIFMTU checks */ @@ -2011,6 +2012,7 @@ pfsync_out_upd_c(struct pf_state *st, st { struct pfsync_upd_c *up = (struct pfsync_upd_c *)(m->m_data + offset); + bzero(up, sizeof(*up)); up->id = st->id; pf_state_peer_hton(&st->src, &up->src); pf_state_peer_hton(&st->dst, &up->dst); @@ -2023,8 +2025,6 @@ pfsync_out_upd_c(struct pf_state *st, st up->expire = htonl(up->expire - time_second); up->timeout = st->timeout; - bzero(up->_pad, sizeof(up->_pad)); /* XXX */ - return (sizeof(*up)); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 12:49:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59EEA1065672; Thu, 8 Mar 2012 12:49:09 +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 34E628FC0C; Thu, 8 Mar 2012 12:49: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 q28Cn9m4045650; Thu, 8 Mar 2012 12:49:09 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28Cn9ed045648; Thu, 8 Mar 2012 12:49:09 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201203081249.q28Cn9ed045648@svn.freebsd.org> From: Peter Holm Date: Thu, 8 Mar 2012 12:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232692 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 12:49:09 -0000 Author: pho Date: Thu Mar 8 12:49:08 2012 New Revision: 232692 URL: http://svn.freebsd.org/changeset/base/232692 Log: syscall() fuzzing can trigger this panic. Return EINVAL instead. MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Thu Mar 8 11:05:53 2012 (r232691) +++ head/sys/ufs/ffs/ffs_vnops.c Thu Mar 8 12:49:08 2012 (r232692) @@ -464,11 +464,11 @@ ffs_read(ap) } else if (vp->v_type != VREG && vp->v_type != VDIR) panic("ffs_read: type %d", vp->v_type); #endif + if (uio->uio_resid < 0 || uio->uio_offset < 0) + return (EINVAL); orig_resid = uio->uio_resid; - KASSERT(orig_resid >= 0, ("ffs_read: uio->uio_resid < 0")); if (orig_resid == 0) return (0); - KASSERT(uio->uio_offset >= 0, ("ffs_read: uio->uio_offset < 0")); fs = ip->i_fs; if (uio->uio_offset < ip->i_size && uio->uio_offset >= fs->fs_maxfilesize) From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 13:00:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 467A41065672; Thu, 8 Mar 2012 13:00:50 +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 317D68FC13; Thu, 8 Mar 2012 13:00: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 q28D0ore046092; Thu, 8 Mar 2012 13:00:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28D0nZo046090; Thu, 8 Mar 2012 13:00:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203081300.q28D0nZo046090@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Mar 2012 13:00: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: r232694 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 13:00:50 -0000 Author: kib Date: Thu Mar 8 13:00:49 2012 New Revision: 232694 URL: http://svn.freebsd.org/changeset/base/232694 Log: Document P_ORPHAN. MFC after: 3 days Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Thu Mar 8 12:54:26 2012 (r232693) +++ head/bin/ps/ps.1 Thu Mar 8 13:00:49 2012 (r232694) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd November 22, 2011 +.Dd March 8, 2012 .Dt PS 1 .Os .Sh NAME @@ -317,6 +317,7 @@ the include file .It Dv "P_SINGLE_BOUNDARY" Ta No "0x400000 Threads should suspend at user boundary" .It Dv "P_HWPMC" Ta No "0x800000 Process is using HWPMCs" .It Dv "P_JAILED" Ta No "0x1000000 Process is in jail" +.It Dv "P_ORPHAN" Ta No "0x2000000 Orphaned by original parent, reparented to debugger" .It Dv "P_INEXEC" Ta No "0x4000000 Process is in execve()" .It Dv "P_STATCHILD" Ta No "0x8000000 Child process stopped or exited" .It Dv "P_INMEM" Ta No "0x10000000 Loaded into memory" From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 15:27:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 501B8106564A; Thu, 8 Mar 2012 15:27:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A99C8FC14; Thu, 8 Mar 2012 15:27: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 q28FRUJK050524; Thu, 8 Mar 2012 15:27:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28FRUSm050522; Thu, 8 Mar 2012 15:27:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203081527.q28FRUSm050522@svn.freebsd.org> From: Ed Maste Date: Thu, 8 Mar 2012 15:27: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: r232695 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 15:27:30 -0000 Author: emaste Date: Thu Mar 8 15:27:29 2012 New Revision: 232695 URL: http://svn.freebsd.org/changeset/base/232695 Log: Correct markup, use proper reference for sysctl(3) Submitted by: brueffer@ Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Thu Mar 8 13:00:49 2012 (r232694) +++ head/share/man/man4/tcp.4 Thu Mar 8 15:27:29 2012 (r232695) @@ -256,8 +256,10 @@ or the internal send buffer is filled. This option enables the use of MD5 digests (also known as TCP-MD5) on writes to the specified socket. Outgoing traffic is digested; -digests on incoming traffic are verified -if the net.inet.tcp.signature_verify_input sysctl is nonzero. +digests on incoming traffic are verified if the +.Va net.inet.tcp.signature_verify_input +.Xr sysctl 3 +is nonzero. The current default behavior for the system is to respond to a system advertising this option with TCP-MD5; this may change. .Pp From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 19:26:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10DEA106564A; Thu, 8 Mar 2012 19:26:30 +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 9C9528FC15; Thu, 8 Mar 2012 19:26:29 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 5565A46B0A; Thu, 8 Mar 2012 14:26:29 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B8E72B94D; Thu, 8 Mar 2012 14:26:28 -0500 (EST) From: John Baldwin To: "Jung-uk Kim" Date: Thu, 8 Mar 2012 11:05:32 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201203051953.q25JrIS1002269@svn.freebsd.org> <201203071700.21259.jkim@FreeBSD.org> In-Reply-To: <201203071700.21259.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203081105.32334.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 08 Mar 2012 14:26:28 -0500 (EST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers@freebsd.org Subject: Re: svn commit: r232570 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 19:26:30 -0000 On Wednesday, March 07, 2012 5:00:19 pm Jung-uk Kim wrote: > On Monday 05 March 2012 02:53 pm, John Baldwin wrote: > > Author: jhb > > Date: Mon Mar 5 19:53:17 2012 > > New Revision: 232570 > > URL: http://svn.freebsd.org/changeset/base/232570 > > > > Log: > > Fix boot2 to handle boot config files that only contain a custom > > path to a loader or kernel. Specifically, kname cannot be pointed > > at cmd[] since it's value is change to be an empty string after the > > initial call to parse, and cmd[]'s value can be changed (thus > > losing a prior setting for kname) due to user input at the boot > > prompt. While here, ensure that that initial boot config file text > > is nul-terminated, that ops is initialized to zero, and that kname > > is always initialized to a valid string. > > As many people pointed out, Clang overflows boot2 again after this > commit. Long long time ago, I asked this question on arch@: > > http://docs.freebsd.org/cgi/mid.cgi?200509081418.47794.jkim > > Why can't we do that now? Can't we build separate ufs1-only and > ufs2-only boot2's, at least? Having ufs1+ufs2 boot block is great > but I see very little benefit to support that in 2012. :-/ As I said on the reply to current@, I think having separate boot blocks will be a headache and PITA for our users. Let's see if we can get boot2 to fit without breaking functionality first. It is a shame that gcc outperforms clang so drastically in this case (gcc's boot2 is about 250 bytes smaller than clang's). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 19:41:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75C40106566B; Thu, 8 Mar 2012 19:41:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64CD08FC15; Thu, 8 Mar 2012 19:41: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 q28Jf6al061877; Thu, 8 Mar 2012 19:41:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28Jf6X6061869; Thu, 8 Mar 2012 19:41:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203081941.q28Jf6X6061869@svn.freebsd.org> From: John Baldwin Date: Thu, 8 Mar 2012 19:41: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: r232700 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 19:41:06 -0000 Author: jhb Date: Thu Mar 8 19:41:05 2012 New Revision: 232700 URL: http://svn.freebsd.org/changeset/base/232700 Log: Add a new sched_clear_name() method to the scheduler interface to clear the cached name used for KTR_SCHED traces when a thread's name changes. This way KTR_SCHED traces (and thus schedgraph) will notice when a thread's name changes, most commonly via execve(). MFC after: 2 weeks Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_intr.c head/sys/kern/kern_kthread.c head/sys/kern/kern_thr.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/sys/sched.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Mar 8 19:17:02 2012 (r232699) +++ head/sys/kern/kern_exec.c Thu Mar 8 19:41:05 2012 (r232700) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -636,6 +637,9 @@ interpret: else if (vn_commname(binvp, p->p_comm, sizeof(p->p_comm)) != 0) bcopy(fexecv_proc_title, p->p_comm, sizeof(fexecv_proc_title)); bcopy(p->p_comm, td->td_name, sizeof(td->td_name)); +#ifdef KTR + sched_clear_tdname(td); +#endif /* * mark as execed, wakeup the process that vforked (if any) and tell Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Thu Mar 8 19:17:02 2012 (r232699) +++ head/sys/kern/kern_intr.c Thu Mar 8 19:41:05 2012 (r232700) @@ -180,6 +180,9 @@ ithread_update(struct intr_thread *ithd) /* Update name and priority. */ strlcpy(td->td_name, ie->ie_fullname, sizeof(td->td_name)); +#ifdef KTR + sched_clear_tdname(td); +#endif thread_lock(td); sched_prio(td, pri); thread_unlock(td); Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Thu Mar 8 19:17:02 2012 (r232699) +++ head/sys/kern/kern_kthread.c Thu Mar 8 19:41:05 2012 (r232700) @@ -115,6 +115,9 @@ kproc_create(void (*func)(void *), void va_start(ap, fmt); vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap); va_end(ap); +#ifdef KTR + sched_clear_tdname(td); +#endif /* call the processes' main()... */ cpu_set_fork_handler(td, func, arg); @@ -453,6 +456,9 @@ kproc_kthread_add(void (*func)(void *), va_start(ap, fmt); vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap); va_end(ap); +#ifdef KTR + sched_clear_tdname(td); +#endif return (0); } va_start(ap, fmt); Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Thu Mar 8 19:17:02 2012 (r232699) +++ head/sys/kern/kern_thr.c Thu Mar 8 19:41:05 2012 (r232700) @@ -548,6 +548,9 @@ sys_thr_set_name(struct thread *td, stru if (ttd == NULL) return (ESRCH); strcpy(ttd->td_name, name); +#ifdef KTR + sched_clear_tdname(ttd); +#endif PROC_UNLOCK(p); return (error); } Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Mar 8 19:17:02 2012 (r232699) +++ head/sys/kern/sched_4bsd.c Thu Mar 8 19:41:05 2012 (r232700) @@ -1614,6 +1614,17 @@ sched_tdname(struct thread *td) #endif } +#ifdef KTR +void +sched_clear_tdname(struct thread *td) +{ + struct td_sched *ts; + + ts = td->td_sched; + ts->ts_name[0] = '\0'; +} +#endif + void sched_affinity(struct thread *td) { Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Mar 8 19:17:02 2012 (r232699) +++ head/sys/kern/sched_ule.c Thu Mar 8 19:41:05 2012 (r232700) @@ -2684,6 +2684,17 @@ sched_tdname(struct thread *td) #endif } +#ifdef KTR +void +sched_clear_tdname(struct thread *td) +{ + struct td_sched *ts; + + ts = td->td_sched; + ts->ts_name[0] = '\0'; +} +#endif + #ifdef SMP /* Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Thu Mar 8 19:17:02 2012 (r232699) +++ head/sys/sys/sched.h Thu Mar 8 19:41:05 2012 (r232700) @@ -138,6 +138,9 @@ int sched_sizeof_thread(void); * functions. */ char *sched_tdname(struct thread *td); +#ifdef KTR +void sched_clear_tdname(struct thread *td); +#endif static __inline void sched_pin(void) From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 19:57:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 010D2106566C for ; Thu, 8 Mar 2012 19:57:18 +0000 (UTC) (envelope-from dchisnall@pathscale.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7EE0D8FC12 for ; Thu, 8 Mar 2012 19:57:17 +0000 (UTC) Received: by eekd17 with SMTP id d17so279394eek.13 for ; Thu, 08 Mar 2012 11:57:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=FecBPFE5szP5zFoXHadRD3idtPehnZnW1M99hZHjMBI=; b=BDa7eOZ0ix3A9Ilomysk8zV407ju58PnewB5V64+ZaDNtQWXT0n0jgU3CtcPq5vngd sNgAYW4yD9+t1sNvp4ji92IRmnoJtQmN/8x8l9wkVRGQz+KBPZ8eSYMFjaCpxSLEKZdp RRMfSJ47zV+z5bh4K8e0Fl2ENZaLfRZI7s5S+WLEqPE3N3W1jdL3acZC1xL0ZdeF2veC HVJbZ15yXkEpnSgHpXYtun4tlokeCYW6yG1bRTtlNI9EbSZnw6PcDT5x5S56STYhi9i1 VC8n9zztsR971Tmbl7IrU7H8A/d+GwZGdnXbiG5jMcYIzAr/JODCcrR9WeEu6W1a1wLM xONA== Received: by 10.213.105.147 with SMTP id t19mr3639ebo.170.1331235131199; Thu, 08 Mar 2012 11:32:11 -0800 (PST) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com. [82.20.153.2]) by mx.google.com with ESMTPS id h47sm9432016eea.10.2012.03.08.11.32.08 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Mar 2012 11:32:10 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: David Chisnall In-Reply-To: <201203081105.32334.jhb@freebsd.org> Date: Thu, 8 Mar 2012 19:32:07 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <09C8D743-8295-4F92-9332-D83F73B5F86D@FreeBSD.org> References: <201203051953.q25JrIS1002269@svn.freebsd.org> <201203071700.21259.jkim@FreeBSD.org> <201203081105.32334.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1257) X-Gm-Message-State: ALoCoQl01+dxxnw2V0bKdQoo2lNlGDBduMFeohSzuoX36zryOZC6XG5u4Qm+YON/pfoxk6NabMym Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r232570 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 19:57:18 -0000 On 8 Mar 2012, at 16:05, John Baldwin wrote: > On Wednesday, March 07, 2012 5:00:19 pm Jung-uk Kim wrote: >> On Monday 05 March 2012 02:53 pm, John Baldwin wrote: >>> Author: jhb >>> Date: Mon Mar 5 19:53:17 2012 >>> New Revision: 232570 >>> URL: http://svn.freebsd.org/changeset/base/232570 >>>=20 >>> Log: >>> Fix boot2 to handle boot config files that only contain a custom >>> path to a loader or kernel. Specifically, kname cannot be pointed >>> at cmd[] since it's value is change to be an empty string after the >>> initial call to parse, and cmd[]'s value can be changed (thus >>> losing a prior setting for kname) due to user input at the boot >>> prompt. While here, ensure that that initial boot config file text >>> is nul-terminated, that ops is initialized to zero, and that kname >>> is always initialized to a valid string. >>=20 >> As many people pointed out, Clang overflows boot2 again after this=20 >> commit. Long long time ago, I asked this question on arch@: >>=20 >> http://docs.freebsd.org/cgi/mid.cgi?200509081418.47794.jkim >>=20 >> Why can't we do that now? Can't we build separate ufs1-only and=20 >> ufs2-only boot2's, at least? Having ufs1+ufs2 boot block is great=20 >> but I see very little benefit to support that in 2012. :-/ >=20 > As I said on the reply to current@, I think having separate boot = blocks will=20 > be a headache and PITA for our users. Let's see if we can get boot2 = to fit=20 > without breaking functionality first. It is a shame that gcc = outperforms=20 > clang so drastically in this case (gcc's boot2 is about 250 bytes = smaller than=20 > clang's). I'm going to take a look at the sequence of optimisations that are run = with -Os. It's currently mostly the same as -O2, which is probably not = ideal. I'll also see if I can create a .ll from boot2 that we can add = to the LLVM unit tests so that anyone who pushes it over the size = boundary will get a buildbot failure. David= From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 20:27:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2257F106564A; Thu, 8 Mar 2012 20:27:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F55A8FC17; Thu, 8 Mar 2012 20:27: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 q28KRKp8063344; Thu, 8 Mar 2012 20:27:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28KRKri063338; Thu, 8 Mar 2012 20:27:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203082027.q28KRKri063338@svn.freebsd.org> From: John Baldwin Date: Thu, 8 Mar 2012 20:27: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: r232701 - in head/sys: fs/unionfs kern ufs/ufs vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 20:27:21 -0000 Author: jhb Date: Thu Mar 8 20:27:20 2012 New Revision: 232701 URL: http://svn.freebsd.org/changeset/base/232701 Log: Add KTR_VFS traces to track modifications to a vnode's writecount. Modified: head/sys/fs/unionfs/union_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/ufs/ufs/ufs_extattr.c head/sys/vm/vnode_pager.c Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Thu Mar 8 19:41:05 2012 (r232700) +++ head/sys/fs/unionfs/union_subr.c Thu Mar 8 20:27:20 2012 (r232701) @@ -952,6 +952,8 @@ unionfs_vn_create_on_upper(struct vnode goto unionfs_vn_create_on_upper_free_out1; } vp->v_writecount++; + CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, + vp->v_writecount); *vpp = vp; unionfs_vn_create_on_upper_free_out1: @@ -1087,6 +1089,8 @@ unionfs_copyfile(struct unionfs_node *un } VOP_CLOSE(uvp, FWRITE, cred, td); uvp->v_writecount--; + CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, uvp, + uvp->v_writecount); vn_finished_write(mp); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Mar 8 19:41:05 2012 (r232700) +++ head/sys/kern/vfs_syscalls.c Thu Mar 8 20:27:20 2012 (r232701) @@ -4591,16 +4591,22 @@ sys_fhopen(td, uap) if (error) goto bad; - if (fmode & FWRITE) + if (fmode & FWRITE) { vp->v_writecount++; + CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", + __func__, vp, vp->v_writecount); + } /* * end of vn_open code */ if ((error = falloc(td, &nfp, &indx, fmode)) != 0) { - if (fmode & FWRITE) + if (fmode & FWRITE) { vp->v_writecount--; + CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", + __func__, vp, vp->v_writecount); + } goto bad; } /* An extra reference on `nfp' has been held for us by falloc(). */ Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Mar 8 19:41:05 2012 (r232700) +++ head/sys/kern/vfs_vnops.c Thu Mar 8 20:27:20 2012 (r232701) @@ -245,8 +245,11 @@ restart: if ((error = VOP_OPEN(vp, fmode, cred, td, fp)) != 0) goto bad; - if (fmode & FWRITE) + if (fmode & FWRITE) { vp->v_writecount++; + CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", + __func__, vp, vp->v_writecount); + } *flagp = fmode; ASSERT_VOP_LOCKED(vp, "vn_open_cred"); if (!mpsafe) @@ -309,6 +312,8 @@ vn_close(vp, flags, file_cred, td) VNASSERT(vp->v_writecount > 0, vp, ("vn_close: negative writecount")); vp->v_writecount--; + CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", + __func__, vp, vp->v_writecount); } error = VOP_CLOSE(vp, flags, file_cred, td); vput(vp); Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Thu Mar 8 19:41:05 2012 (r232700) +++ head/sys/ufs/ufs/ufs_extattr.c Thu Mar 8 20:27:20 2012 (r232701) @@ -335,6 +335,8 @@ ufs_extattr_enable_with_open(struct ufsm } vp->v_writecount++; + CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, + vp->v_writecount); vref(vp); Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Thu Mar 8 19:41:05 2012 (r232700) +++ head/sys/vm/vnode_pager.c Thu Mar 8 20:27:20 2012 (r232701) @@ -272,6 +272,8 @@ vnode_pager_dealloc(object) if (object->un_pager.vnp.writemappings > 0) { object->un_pager.vnp.writemappings = 0; vp->v_writecount--; + CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", + __func__, vp, vp->v_writecount); } vp->v_object = NULL; vp->v_vflag &= ~VV_TEXT; @@ -1241,9 +1243,13 @@ vnode_pager_update_writecount(vm_object_ if (old_wm == 0 && object->un_pager.vnp.writemappings != 0) { ASSERT_VOP_ELOCKED(vp, "v_writecount inc"); vp->v_writecount++; + CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", + __func__, vp, vp->v_writecount); } else if (old_wm != 0 && object->un_pager.vnp.writemappings == 0) { ASSERT_VOP_ELOCKED(vp, "v_writecount dec"); vp->v_writecount--; + CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", + __func__, vp, vp->v_writecount); } VM_OBJECT_UNLOCK(object); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 20:34:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 11753106566B; Thu, 8 Mar 2012 20:34:14 +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 0139A8FC16; Thu, 8 Mar 2012 20:34: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 q28KYDnb063705; Thu, 8 Mar 2012 20:34:13 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28KYDwq063702; Thu, 8 Mar 2012 20:34:13 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201203082034.q28KYDwq063702@svn.freebsd.org> From: Peter Holm Date: Thu, 8 Mar 2012 20:34: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: r232702 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 20:34:14 -0000 Author: pho Date: Thu Mar 8 20:34:13 2012 New Revision: 232702 URL: http://svn.freebsd.org/changeset/base/232702 Log: Free up allocated memory used by posix_fadvise(2). Modified: head/sys/kern/kern_descrip.c head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Mar 8 20:27:20 2012 (r232701) +++ head/sys/kern/kern_descrip.c Thu Mar 8 20:34:13 2012 (r232702) @@ -104,6 +104,8 @@ static MALLOC_DEFINE(M_FILEDESC_TO_LEADE "file desc to leader structures"); static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures"); +MALLOC_DECLARE(M_FADVISE); + static uma_zone_t file_zone; @@ -2577,6 +2579,7 @@ _fdrop(struct file *fp, struct thread *t error = fo_close(fp, td); atomic_subtract_int(&openfiles, 1); crfree(fp->f_cred); + free(fp->f_advice, M_FADVISE); uma_zfree(file_zone, fp); return (error); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Mar 8 20:27:20 2012 (r232701) +++ head/sys/kern/vfs_syscalls.c Thu Mar 8 20:34:13 2012 (r232702) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); #include -static MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); +MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); SDT_PROVIDER_DEFINE(vfs); SDT_PROBE_DEFINE(vfs, , stat, mode, mode); From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 21:06:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41D96106564A; Thu, 8 Mar 2012 21:06:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 308848FC15; Thu, 8 Mar 2012 21:06: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 q28L6638064882; Thu, 8 Mar 2012 21:06:06 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28L65Bw064874; Thu, 8 Mar 2012 21:06:05 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201203082106.q28L65Bw064874@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 8 Mar 2012 21:06: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: r232703 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 21:06:06 -0000 Author: pfg Date: Thu Mar 8 21:06:05 2012 New Revision: 232703 URL: http://svn.freebsd.org/changeset/base/232703 Log: Add support for ns timestamps and birthtime to the ext2/3 driver. When using big inodes there is sufficient space in ext3 to keep extra resolution and birthtime (creation) timestamps. The appropriate fields in the on-disk inode have been approved for a long time but support for this in ext3 has not been widely distributed. In preparation for ext4 most linux distributions have enabled by default such bigger inodes and some people use nanosecond timestamps in ext3. We now support those when the inode is big enough and while we do recognize the EXT4F_ROCOMPAT_EXTRA_ISIZE, we maintain the extra timestamps even when they are not used. An additional note by Bruce Evans: We blindly accept unrepresentable tv_nsec in VOP_SETATTR(), but all file systems have always done that. When POSIX gets around to specifying the behaviour, it will probably require certain rounding to the fs's resolution and not rejecting the request. This unfortunately means that syscalls that set times can't really tell if they succeeded without reading back the times using stat() or similar and checking that they were set close enough. Reviewed by: bde Approved by: jhb (mentor) MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Thu Mar 8 20:34:13 2012 (r232702) +++ head/sys/fs/ext2fs/ext2_alloc.c Thu Mar 8 21:06:05 2012 (r232703) @@ -344,6 +344,7 @@ ext2_valloc(pvp, mode, cred, vpp) struct ucred *cred; struct vnode **vpp; { + struct timespec ts; struct inode *pip; struct m_ext2fs *fs; struct inode *ip; @@ -385,14 +386,14 @@ ext2_valloc(pvp, mode, cred, vpp) } ip = VTOI(*vpp); - /* - the question is whether using VGET was such good idea at all - - Linux doesn't read the old inode in when it's allocating a - new one. I will set at least i_size & i_blocks the zero. - */ - ip->i_mode = 0; + /* + * The question is whether using VGET was such good idea at all: + * Linux doesn't read the old inode in when it is allocating a + * new one. I will set at least i_size and i_blocks to zero. + */ ip->i_size = 0; ip->i_blocks = 0; + ip->i_mode = 0; ip->i_flags = 0; /* now we want to make sure that the block pointers are zeroed out */ for (i = 0; i < NDADDR; i++) @@ -406,6 +407,11 @@ ext2_valloc(pvp, mode, cred, vpp) */ if (ip->i_gen == 0 || ++ip->i_gen == 0) ip->i_gen = random() / 2 + 1; + + vfs_timestamp(&ts); + ip->i_birthtime = ts.tv_sec; + ip->i_birthnsec = ts.tv_nsec; + /* printf("ext2_valloc: allocated inode %d\n", ino); */ Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Thu Mar 8 20:34:13 2012 (r232702) +++ head/sys/fs/ext2fs/ext2_dinode.h Thu Mar 8 21:06:05 2012 (r232703) @@ -61,6 +61,16 @@ #define EXT2_NODUMP 0x00000040 /* do not dump file */ #define EXT2_NOATIME 0x00000080 /* do not update atime */ +/* + * Definitions for nanosecond timestamps. + * Ext3 inode versioning, 2006-12-13. + */ +#define EXT3_EPOCH_BITS 2 +#define EXT3_EPOCH_MASK ((1 << EXT3_EPOCH_BITS) - 1) +#define EXT3_NSEC_MASK (~0UL << EXT3_EPOCH_BITS) + +#define E2DI_HAS_XTIME(ip) (EXT2_INODE_SIZE((ip)->i_e2fs) > \ + E2FS_REV0_INODE_SIZE) /* * Structure of an inode on the disk @@ -77,7 +87,7 @@ struct ext2fs_dinode { uint16_t e2di_nlink; /* 26: File link count */ uint32_t e2di_nblock; /* 28: Blocks count */ uint32_t e2di_flags; /* 32: Status flags (chflags) */ - uint32_t e2di_linux_reserved1; /* 36 */ + uint32_t e2di_version; /* 36: Low 32 bits inode version */ uint32_t e2di_blocks[EXT2_N_BLOCKS]; /* 40: disk blocks */ uint32_t e2di_gen; /* 100: generation number */ uint32_t e2di_facl; /* 104: file ACL (not implemented) */ @@ -91,6 +101,12 @@ struct ext2fs_dinode { uint32_t e2di_linux_reserved3; /* 124 */ uint16_t e2di_extra_isize; uint16_t e2di_pad1; + uint32_t e2di_ctime_extra; /* Extra change time */ + uint32_t e2di_mtime_extra; /* Extra modification time */ + uint32_t e2di_atime_extra; /* Extra access time */ + uint32_t e2di_crtime; /* Creation (birth)time */ + uint32_t e2di_crtime_extra; /* Extra creation (birth)time */ + uint32_t e2di_version_hi; /* High 30 bits of inode version */ }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Thu Mar 8 20:34:13 2012 (r232702) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Thu Mar 8 21:06:05 2012 (r232703) @@ -36,6 +36,9 @@ #include #include +#define XTIME_TO_NSEC(x) ((x & EXT3_NSEC_MASK) >> 2) +#define NSEC_TO_XTIME(t) ((t << 2) & EXT3_NSEC_MASK) + void ext2_print_inode( in ) struct inode *in; @@ -83,6 +86,13 @@ ext2_ei2i(ei, ip) ip->i_atime = ei->e2di_atime; ip->i_mtime = ei->e2di_mtime; ip->i_ctime = ei->e2di_ctime; + if (E2DI_HAS_XTIME(ip)) { + ip->i_atimensec = XTIME_TO_NSEC(ei->e2di_atime_extra); + ip->i_mtimensec = XTIME_TO_NSEC(ei->e2di_mtime_extra); + ip->i_ctimensec = XTIME_TO_NSEC(ei->e2di_ctime_extra); + ip->i_birthtime = ei->e2di_crtime; + ip->i_birthnsec = XTIME_TO_NSEC(ei->e2di_crtime_extra); + } ip->i_flags = 0; ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0; ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0; @@ -121,6 +131,13 @@ ext2_i2ei(ip, ei) ei->e2di_atime = ip->i_atime; ei->e2di_mtime = ip->i_mtime; ei->e2di_ctime = ip->i_ctime; + if (E2DI_HAS_XTIME(ip)) { + ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec); + ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec); + ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec); + ei->e2di_crtime = ip->i_birthtime; + ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec); + } ei->e2di_flags = ip->i_flags; ei->e2di_flags = 0; ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Thu Mar 8 20:34:13 2012 (r232702) +++ head/sys/fs/ext2fs/ext2_vfsops.c Thu Mar 8 21:06:05 2012 (r232703) @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -339,14 +340,21 @@ compute_sb_data(struct vnode *devvp, str /* * Simple sanity check for superblock inode size value. */ - if (fs->e2fs_isize < E2FS_REV0_INODE_SIZE || - fs->e2fs_isize > fs->e2fs_bsize || + if (EXT2_INODE_SIZE(fs) < E2FS_REV0_INODE_SIZE || + EXT2_INODE_SIZE(fs) > fs->e2fs_bsize || (fs->e2fs_isize & (fs->e2fs_isize - 1)) != 0) { - printf("EXT2-fs: invalid inode size %d\n", + printf("ext2fs: invalid inode size %d\n", fs->e2fs_isize); return (EIO); } } + /* Check for extra isize in big inodes. */ + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT4F_ROCOMPAT_EXTRA_ISIZE) && + EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) { + printf("ext2fs: no space for extra inode timestamps\n"); + return (EINVAL); + } + fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs_ipg /fs->e2fs_ipb; fs->e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); @@ -358,8 +366,8 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); - fs->e2fs_contigdirs = malloc(fs->e2fs_gcount * sizeof(*fs->e2fs_contigdirs), - M_EXT2MNT, M_WAITOK); + fs->e2fs_contigdirs = malloc(fs->e2fs_gcount * + sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK); /* * Adjust logic_sb_block. @@ -390,7 +398,7 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_contigdirs[i] = 0; } if (es->e2fs_rev == E2FS_REV0 || - (es->e2fs_features_rocompat & EXT2F_ROCOMPAT_LARGEFILE) == 0) + !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_LARGEFILE)) fs->e2fs_maxfilesize = 0x7fffffff; else fs->e2fs_maxfilesize = 0x7fffffffffffffff; @@ -967,8 +975,6 @@ ext2_vget(struct mount *mp, ino_t ino, i ip->i_block_group = ino_to_cg(fs, ino); ip->i_next_alloc_block = 0; ip->i_next_alloc_goal = 0; - ip->i_prealloc_count = 0; - ip->i_prealloc_block = 0; /* * Now we want to make sure that block pointers for unused Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Thu Mar 8 20:34:13 2012 (r232702) +++ head/sys/fs/ext2fs/ext2_vnops.c Thu Mar 8 21:06:05 2012 (r232703) @@ -360,11 +360,15 @@ ext2_getattr(ap) vap->va_rdev = ip->i_rdev; vap->va_size = ip->i_size; vap->va_atime.tv_sec = ip->i_atime; - vap->va_atime.tv_nsec = ip->i_atimensec; + vap->va_atime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_atimensec : 0; vap->va_mtime.tv_sec = ip->i_mtime; - vap->va_mtime.tv_nsec = ip->i_mtimensec; + vap->va_mtime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_mtimensec : 0; vap->va_ctime.tv_sec = ip->i_ctime; - vap->va_ctime.tv_nsec = ip->i_ctimensec; + vap->va_ctime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_ctimensec : 0; + if E2DI_HAS_XTIME(ip) { + vap->va_birthtime.tv_sec = ip->i_birthtime; + vap->va_birthtime.tv_nsec = ip->i_birthnsec; + } vap->va_flags = ip->i_flags; vap->va_gen = ip->i_gen; vap->va_blocksize = vp->v_mount->mnt_stat.f_iosize; @@ -501,6 +505,8 @@ ext2_setattr(ap) ip->i_mtime = vap->va_mtime.tv_sec; ip->i_mtimensec = vap->va_mtime.tv_nsec; } + ip->i_birthtime = vap->va_birthtime.tv_sec; + ip->i_birthnsec = vap->va_birthtime.tv_nsec; error = ext2_update(vp, 0); if (error) return (error); Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Thu Mar 8 20:34:13 2012 (r232702) +++ head/sys/fs/ext2fs/ext2fs.h Thu Mar 8 21:06:05 2012 (r232703) @@ -129,7 +129,7 @@ struct ext2fs { uint32_t e4fs_rbcount_hi; /* reserved blocks count */ uint32_t e4fs_fbcount_hi; /* free blocks count */ uint16_t e4fs_min_extra_isize;/* all inodes have at least some bytes */ - uint16_t e4fs_want_extra_isize; /* new inodes should reserve some bytes */ + uint16_t e4fs_want_extra_isize; /* inodes must reserve some bytes */ uint32_t e4fs_flags; /* miscellaneous flags */ uint16_t e4fs_raid_stride; /* RAID stride */ uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ @@ -214,6 +214,7 @@ struct m_ext2fs { #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 #define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT4F_ROCOMPAT_EXTRA_ISIZE 0x0040 #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 @@ -227,8 +228,9 @@ struct m_ext2fs { * - EXT2F_INCOMPAT_FTYPE */ #define EXT2F_COMPAT_SUPP 0x0000 -#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER \ - | EXT2F_ROCOMPAT_LARGEFILE) +#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ + EXT2F_ROCOMPAT_LARGEFILE | \ + EXT4F_ROCOMPAT_EXTRA_ISIZE) #define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE /* Assume that user mode programs are passing in an ext2fs superblock, not Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Thu Mar 8 20:34:13 2012 (r232702) +++ head/sys/fs/ext2fs/inode.h Thu Mar 8 21:06:05 2012 (r232703) @@ -77,8 +77,6 @@ struct inode { uint32_t i_block_group; uint32_t i_next_alloc_block; uint32_t i_next_alloc_goal; - uint32_t i_prealloc_block; - uint32_t i_prealloc_count; /* Fields from struct dinode in UFS. */ uint16_t i_mode; /* IFMT, permissions; see below. */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 21:09:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D55141065670; Thu, 8 Mar 2012 21:09:34 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C426A8FC14; Thu, 8 Mar 2012 21: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 q28L9Yj7065021; Thu, 8 Mar 2012 21:09:34 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28L9YIp065017; Thu, 8 Mar 2012 21:09:34 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201203082109.q28L9YIp065017@svn.freebsd.org> From: Alexander Kabaev Date: Thu, 8 Mar 2012 21: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: r232704 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 21:09:34 -0000 Author: kan Date: Thu Mar 8 21:09:34 2012 New Revision: 232704 URL: http://svn.freebsd.org/changeset/base/232704 Log: Save more of config space for PCI Express and PCI-X devices. Expand pci_save_state and pci_restore_state to save more of the config state for PCI Express and PCI-X devices. Various writable control registers are present in PCI Express that can potentially be lost over suspend/resume cycle. This change is modeled after similar functionality in Linux. Reviewed by: wlosh,jhb MFC after: 1 month Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pcireg.h head/sys/dev/pci/pcivar.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Mar 8 21:06:05 2012 (r232703) +++ head/sys/dev/pci/pci.c Thu Mar 8 21:09:34 2012 (r232704) @@ -723,6 +723,7 @@ pci_read_cap(device_t pcib, pcicfgregs * if ((cfg->hdrtype & PCIM_HDRTYPE) == PCIM_HDRTYPE_BRIDGE) pcix_chipset = 1; + cfg->pcix.pcix_location = ptr; break; case PCIY_EXPRESS: /* PCI-express */ /* @@ -4444,6 +4445,49 @@ pci_modevent(module_t mod, int what, voi return (0); } +static void +pci_cfg_restore_pcie(device_t dev, struct pci_devinfo *dinfo) +{ +#define WREG(n, v) pci_write_config(dev, pos + (n), (v), 2) + struct pcicfg_pcie *cfg; + int version, pos; + + cfg = &dinfo->cfg.pcie; + pos = cfg->pcie_location; + + version = cfg->pcie_flags & PCIM_EXP_FLAGS_VERSION; + + WREG(PCIR_EXPRESS_DEVICE_CTL, cfg->pcie_device_ctl); + + if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || + cfg->pcie_type == PCIM_EXP_TYPE_ENDPOINT || + cfg->pcie_type == PCIM_EXP_TYPE_LEGACY_ENDPOINT) + WREG(PCIR_EXPRESS_LINK_CTL, cfg->pcie_link_ctl); + + if (version > 1 || (cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || + (cfg->pcie_type == PCIM_EXP_TYPE_DOWNSTREAM_PORT && + (cfg->pcie_flags & PCIM_EXP_FLAGS_SLOT)))) + WREG(PCIR_EXPRESS_SLOT_CTL, cfg->pcie_slot_ctl); + + if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || + cfg->pcie_type == PCIM_EXP_TYPE_ROOT_EC) + WREG(PCIR_EXPRESS_ROOT_CTL, cfg->pcie_root_ctl); + + if (version > 1) { + WREG(PCIR_EXPRESS_DEVICE_CTL2, cfg->pcie_device_ctl2); + WREG(PCIR_EXPRESS_LINK_CTL2, cfg->pcie_link_ctl2); + WREG(PCIR_EXPRESS_SLOT_CTL2, cfg->pcie_slot_ctl2); + } +#undef WREG +} + +static void +pci_cfg_restore_pcix(device_t dev, struct pci_devinfo *dinfo) +{ + pci_write_config(dev, dinfo->cfg.pcix.pcix_location + PCIXR_COMMAND, + dinfo->cfg.pcix.pcix_command, 2); +} + void pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo) { @@ -4479,6 +4523,14 @@ pci_cfg_restore(device_t dev, struct pci pci_write_config(dev, PCIR_PROGIF, dinfo->cfg.progif, 1); pci_write_config(dev, PCIR_REVID, dinfo->cfg.revid, 1); + /* + * Restore extended capabilities for PCI-Express and PCI-X + */ + if (dinfo->cfg.pcie.pcie_location != 0) + pci_cfg_restore_pcie(dev, dinfo); + if (dinfo->cfg.pcix.pcix_location != 0) + pci_cfg_restore_pcix(dev, dinfo); + /* Restore MSI and MSI-X configurations if they are present. */ if (dinfo->cfg.msi.msi_location != 0) pci_resume_msi(dev); @@ -4486,6 +4538,51 @@ pci_cfg_restore(device_t dev, struct pci pci_resume_msix(dev); } +static void +pci_cfg_save_pcie(device_t dev, struct pci_devinfo *dinfo) +{ +#define RREG(n) pci_read_config(dev, pos + (n), 2) + struct pcicfg_pcie *cfg; + int version, pos; + + cfg = &dinfo->cfg.pcie; + pos = cfg->pcie_location; + + cfg->pcie_flags = RREG(PCIR_EXPRESS_FLAGS); + + version = cfg->pcie_flags & PCIM_EXP_FLAGS_VERSION; + + cfg->pcie_device_ctl = RREG(PCIR_EXPRESS_DEVICE_CTL); + + if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || + cfg->pcie_type == PCIM_EXP_TYPE_ENDPOINT || + cfg->pcie_type == PCIM_EXP_TYPE_LEGACY_ENDPOINT) + cfg->pcie_link_ctl = RREG(PCIR_EXPRESS_LINK_CTL); + + if (version > 1 || (cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || + (cfg->pcie_type == PCIM_EXP_TYPE_DOWNSTREAM_PORT && + (cfg->pcie_flags & PCIM_EXP_FLAGS_SLOT)))) + cfg->pcie_slot_ctl = RREG(PCIR_EXPRESS_SLOT_CTL); + + if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || + cfg->pcie_type == PCIM_EXP_TYPE_ROOT_EC) + cfg->pcie_root_ctl = RREG(PCIR_EXPRESS_ROOT_CTL); + + if (version > 1) { + cfg->pcie_device_ctl2 = RREG(PCIR_EXPRESS_DEVICE_CTL2); + cfg->pcie_link_ctl2 = RREG(PCIR_EXPRESS_LINK_CTL2); + cfg->pcie_slot_ctl2 = RREG(PCIR_EXPRESS_SLOT_CTL2); + } +#undef RREG +} + +static void +pci_cfg_save_pcix(device_t dev, struct pci_devinfo *dinfo) +{ + dinfo->cfg.pcix.pcix_command = pci_read_config(dev, + dinfo->cfg.pcix.pcix_location + PCIXR_COMMAND, 2); +} + void pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate) { @@ -4528,6 +4625,12 @@ pci_cfg_save(device_t dev, struct pci_de dinfo->cfg.progif = pci_read_config(dev, PCIR_PROGIF, 1); dinfo->cfg.revid = pci_read_config(dev, PCIR_REVID, 1); + if (dinfo->cfg.pcie.pcie_location != 0) + pci_cfg_save_pcie(dev, dinfo); + + if (dinfo->cfg.pcix.pcix_location != 0) + pci_cfg_save_pcix(dev, dinfo); + /* * don't set the state for display devices, base peripherals and * memory devices since bad things happen when they are powered down. Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Thu Mar 8 21:06:05 2012 (r232703) +++ head/sys/dev/pci/pcireg.h Thu Mar 8 21:09:34 2012 (r232704) @@ -667,6 +667,16 @@ #define PCIR_EXPRESS_SLOT_STA 0x1a #define PCIR_EXPRESS_ROOT_CTL 0x1c #define PCIR_EXPRESS_ROOT_STA 0x20 +#define PCIR_EXPRESS_DEVICE_CTL2 40 +#define PCIM_EXPRESS_DEVICE_CTL2_ARI 0x20 +#define PCIM_EXPRESS_ID_ORDERED_REQ_EN 0x100 +#define PCIM_EXPRESS_ID_ORDERED_CMP_EN 0x200 +#define PCIM_EXPRESS_LTR_ENABLE 0x400 +#define PCIM_EXPRESS_OBFF_MSGA_ENABLE 0x2000 +#define PCIM_EXPRESS_OBFF_MSGB_ENABLE 0x4000 +#define PCIM_EXPRESS_OBFF_WAKE_ENABLE 0x6000 +#define PCIR_EXPRESS_LINK_CTL2 48 +#define PCIR_EXPRESS_SLOT_CTL2 56 /* MSI-X definitions */ #define PCIR_MSIX_CTRL 0x2 Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Thu Mar 8 21:06:05 2012 (r232703) +++ head/sys/dev/pci/pcivar.h Thu Mar 8 21:09:34 2012 (r232704) @@ -127,6 +127,19 @@ struct pcicfg_ht { struct pcicfg_pcie { uint8_t pcie_location; /* Offset of PCI-e capability registers. */ uint8_t pcie_type; /* Device type. */ + uint16_t pcie_flags; /* Device capabilities register. */ + uint16_t pcie_device_ctl; /* Device control register. */ + uint16_t pcie_link_ctl; /* Link control register. */ + uint16_t pcie_slot_ctl; /* Slot control register. */ + uint16_t pcie_root_ctl; /* Root control register. */ + uint16_t pcie_device_ctl2; /* Second device control register. */ + uint16_t pcie_link_ctl2; /* Second link control register. */ + uint16_t pcie_slot_ctl2; /* Second slot control register. */ +}; + +struct pcicfg_pcix { + uint16_t pcix_command; + uint8_t pcix_location; /* Offset of PCI-X capability registers. */ }; /* config header information common to all header types */ @@ -171,6 +184,7 @@ typedef struct pcicfg { struct pcicfg_msix msix; /* PCI MSI-X */ struct pcicfg_ht ht; /* HyperTransport */ struct pcicfg_pcie pcie; /* PCI Express */ + struct pcicfg_pcix pcix; /* PCI-X */ } pcicfgregs; /* additional type 1 device config header information (PCI to PCI bridge) */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 23:46:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CC421065673; Thu, 8 Mar 2012 23:46: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 7C32C8FC15; Thu, 8 Mar 2012 23:46: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 q28NkhYR069890; Thu, 8 Mar 2012 23:46:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28NkhCL069888; Thu, 8 Mar 2012 23:46:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203082346.q28NkhCL069888@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Mar 2012 23:46: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: r232705 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 23:46:43 -0000 Author: adrian Date: Thu Mar 8 23:46:42 2012 New Revision: 232705 URL: http://svn.freebsd.org/changeset/base/232705 Log: Add missing \n's. This showed up when testing the wtap module, as it attaches with no radiotap tx/rx configuration. Modified: head/sys/net80211/ieee80211_radiotap.c Modified: head/sys/net80211/ieee80211_radiotap.c ============================================================================== --- head/sys/net80211/ieee80211_radiotap.c Thu Mar 8 21:09:34 2012 (r232704) +++ head/sys/net80211/ieee80211_radiotap.c Thu Mar 8 23:46:42 2012 (r232705) @@ -67,7 +67,7 @@ ieee80211_radiotap_attach(struct ieee802 else if (tx_radiotap & B(IEEE80211_RADIOTAP_XCHANNEL)) off = radiotap_offset(th, IEEE80211_RADIOTAP_XCHANNEL); if (off == -1) { - if_printf(ic->ic_ifp, "%s: no tx channel, radiotap 0x%x", + if_printf(ic->ic_ifp, "%s: no tx channel, radiotap 0x%x\n", __func__, tx_radiotap); /* NB: we handle this case but data will have no chan spec */ } else @@ -83,7 +83,7 @@ ieee80211_radiotap_attach(struct ieee802 else if (rx_radiotap & B(IEEE80211_RADIOTAP_XCHANNEL)) off = radiotap_offset(rh, IEEE80211_RADIOTAP_XCHANNEL); if (off == -1) { - if_printf(ic->ic_ifp, "%s: no rx channel, radiotap 0x%x", + if_printf(ic->ic_ifp, "%s: no rx channel, radiotap 0x%x\n", __func__, rx_radiotap); /* NB: we handle this case but data will have no chan spec */ } else From owner-svn-src-head@FreeBSD.ORG Thu Mar 8 23:53:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29147106564A; Thu, 8 Mar 2012 23:53:39 +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 186A58FC0C; Thu, 8 Mar 2012 23:53: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 q28NrciO070156; Thu, 8 Mar 2012 23:53:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q28Nrc5k070154; Thu, 8 Mar 2012 23:53:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203082353.q28Nrc5k070154@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Mar 2012 23:53: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: r232707 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2012 23:53:39 -0000 Author: adrian Date: Thu Mar 8 23:53:38 2012 New Revision: 232707 URL: http://svn.freebsd.org/changeset/base/232707 Log: Correctly initialise the TXQ link pointer to the last descriptor in the last buffer in the list. The current behaviour (due to me, so pointy hat is firmly on my head here) was incorrect - it was setting the link pointer to the last descriptor of the _first_ buffer in the TXQ. Instead, it should have set it to the last descriptor in the _last_ buffer in the TXQ. This showed up as occasional TX stalls with frames in the TXQ but no TX progress being made. Further inspection showed the TXQ looked like it contained multiple "lists" of frames - there'd be a list of correct frames, then a NULL link pointer, but there'd be a next buffer in the list. Since this code is only called upon an interface reset, it's likely this only began showing up when I started doing stress testing in environments which annoy the radios enough to cause lockups. I've not yet any TX stalls with this patch applied. PR: kern/165866 Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Mar 8 23:52:22 2012 (r232706) +++ head/sys/dev/ath/if_ath_tx.c Thu Mar 8 23:53:38 2012 (r232707) @@ -623,19 +623,22 @@ void ath_txq_restart_dma(struct ath_softc *sc, struct ath_txq *txq) { struct ath_hal *ah = sc->sc_ah; - struct ath_buf *bf; + struct ath_buf *bf, *bf_last; ATH_TXQ_LOCK_ASSERT(txq); /* This is always going to be cleared, empty or not */ txq->axq_flags &= ~ATH_TXQ_PUTPENDING; + /* XXX make this ATH_TXQ_FIRST */ bf = TAILQ_FIRST(&txq->axq_q); + bf_last = ATH_TXQ_LAST(txq, axq_q_s); + if (bf == NULL) return; ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); - txq->axq_link = &bf->bf_lastds->ds_link; + txq->axq_link = &bf_last->bf_lastds->ds_link; ath_hal_txstart(ah, txq->axq_qnum); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 00:12:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E617106564A; Fri, 9 Mar 2012 00:12: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 0D6478FC08; Fri, 9 Mar 2012 00:12: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 q290C5SI070820; Fri, 9 Mar 2012 00:12:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q290C51M070815; Fri, 9 Mar 2012 00:12:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203090012.q290C51M070815@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 9 Mar 2012 00:12: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: r232709 - in head/sys: kern sys ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 00:12:06 -0000 Author: kib Date: Fri Mar 9 00:12:05 2012 New Revision: 232709 URL: http://svn.freebsd.org/changeset/base/232709 Log: Decomission mnt_noasync. Introduce MNTK_NOASYNC mnt_kern_flag which allows a filesystem to request VFS to not allow MNTK_ASYNC. MFC after: 1 week Modified: head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/sys/mount.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Mar 8 23:59:49 2012 (r232708) +++ head/sys/kern/vfs_mount.c Fri Mar 9 00:12:05 2012 (r232709) @@ -851,7 +851,8 @@ vfs_domount_first( mp->mnt_optnew = NULL; MNT_ILOCK(mp); - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) + if ((mp->mnt_flag & MNT_ASYNC) != 0 && + (mp->mnt_kern_flag & MNTK_NOASYNC) == 0) mp->mnt_kern_flag |= MNTK_ASYNC; else mp->mnt_kern_flag &= ~MNTK_ASYNC; @@ -991,7 +992,8 @@ vfs_domount_update( */ mp->mnt_flag = (mp->mnt_flag & MNT_QUOTA) | (flag & ~MNT_QUOTA); } - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) + if ((mp->mnt_flag & MNT_ASYNC) != 0 && + (mp->mnt_kern_flag & MNTK_NOASYNC) == 0) mp->mnt_kern_flag |= MNTK_ASYNC; else mp->mnt_kern_flag &= ~MNTK_ASYNC; @@ -1351,7 +1353,8 @@ dounmount(mp, flags, td) } mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_UNMOUNTF); mp->mnt_flag |= async_flag; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) + if ((mp->mnt_flag & MNT_ASYNC) != 0 && + (mp->mnt_kern_flag & MNTK_NOASYNC) == 0) mp->mnt_kern_flag |= MNTK_ASYNC; if (mp->mnt_kern_flag & MNTK_MWAIT) { mp->mnt_kern_flag &= ~MNTK_MWAIT; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Mar 8 23:59:49 2012 (r232708) +++ head/sys/kern/vfs_subr.c Fri Mar 9 00:12:05 2012 (r232709) @@ -2942,6 +2942,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_REFEXPIRE); MNT_KERN_FLAG(MNTK_EXTENDED_SHARED); MNT_KERN_FLAG(MNTK_SHARED_WRITES); + MNT_KERN_FLAG(MNTK_NOASYNC); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); MNT_KERN_FLAG(MNTK_SUSPEND); @@ -2994,7 +2995,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) db_printf(" mnt_gen = %d\n", mp->mnt_gen); db_printf(" mnt_nvnodelistsize = %d\n", mp->mnt_nvnodelistsize); db_printf(" mnt_writeopcount = %d\n", mp->mnt_writeopcount); - db_printf(" mnt_noasync = %u\n", mp->mnt_noasync); db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen); db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max); db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Thu Mar 8 23:59:49 2012 (r232708) +++ head/sys/sys/mount.h Fri Mar 9 00:12:05 2012 (r232709) @@ -167,7 +167,6 @@ struct mount { int mnt_writeopcount; /* (i) write syscalls pending */ int mnt_kern_flag; /* (i) kernel only flags */ uint64_t mnt_flag; /* (i) flags shared with user */ - u_int mnt_noasync; /* (i) # noasync overrides */ struct vfsoptlist *mnt_opt; /* current mount options */ struct vfsoptlist *mnt_optnew; /* new options passed to fs */ int mnt_maxsymlinklen; /* max size of short symlink */ @@ -325,6 +324,7 @@ void __mnt_vnode_markerfree(str #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ #define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ +#define MNTK_NOASYNC 0x00800000 /* disable async */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Mar 8 23:59:49 2012 (r232708) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Mar 9 00:12:05 2012 (r232709) @@ -2368,8 +2368,7 @@ softdep_mount(devvp, mp, fs, cred) mp->mnt_flag = (mp->mnt_flag & ~MNT_ASYNC) | MNT_SOFTDEP; if ((mp->mnt_kern_flag & MNTK_SOFTDEP) == 0) { mp->mnt_kern_flag = (mp->mnt_kern_flag & ~MNTK_ASYNC) | - MNTK_SOFTDEP; - mp->mnt_noasync++; + MNTK_SOFTDEP | MNTK_NOASYNC; } MNT_IUNLOCK(mp); ump = VFSTOUFS(mp); From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 01:32:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 759BC106566B; Fri, 9 Mar 2012 01:32:06 +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 5B0E88FC0A; Fri, 9 Mar 2012 01:32: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 q291W62v073699; Fri, 9 Mar 2012 01:32:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q291W6TG073697; Fri, 9 Mar 2012 01:32:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203090132.q291W6TG073697@svn.freebsd.org> From: Eitan Adler Date: Fri, 9 Mar 2012 01:32: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: r232712 - head/sbin/adjkerntz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 01:32:06 -0000 Author: eadler Date: Fri Mar 9 01:32:05 2012 New Revision: 232712 URL: http://svn.freebsd.org/changeset/base/232712 Log: Fix a variety of grammar and style nits PR: docs/165841 Submitted by: Robert Simmons Approved by: brd MFC after: 1 week Modified: head/sbin/adjkerntz/adjkerntz.8 Modified: head/sbin/adjkerntz/adjkerntz.8 ============================================================================== --- head/sbin/adjkerntz/adjkerntz.8 Fri Mar 9 00:53:54 2012 (r232711) +++ head/sbin/adjkerntz/adjkerntz.8 Fri Mar 9 01:32:05 2012 (r232712) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 1996 +.Dd March 8, 2012 .Dt ADJKERNTZ 8 .Os .Sh NAME .Nm adjkerntz -.Nd "adjust local time CMOS clock to reflect time zone changes and keep current timezone offset for the kernel" +.Nd adjust the local time CMOS clock to reflect time zone changes and keep the current timezone offset for the kernel .Sh SYNOPSIS .Nm .Fl i @@ -39,23 +39,21 @@ The .Nm utility maintains the proper relationship between the kernel clock, which -is always set to UTC, and the CMOS clock, which may be set to local -time. +is always set to UTC and the CMOS clock, which may be set to local time. The .Nm -utility also informs the kernel about machine timezone shifts to +utility also informs the kernel about machine timezone shifts in order to maintain proper timestamps for local time file systems such as the MS-DOS file system. -The main purpose of this thing is not general fixing of -initially broken MS-DOS file timestamp idea but keeping -the same timestamps between +The main purpose of maintaining these timestamps properly is to keep the +timestamps of a .Fx -MS-DOS file system -and MS-DOS operating system installed on the same -machine. +MS-DOS file system and an MS-DOS operating system synchronized when they are +installed on the same system rather than fixing broken MS-DOS file +timestamps. If the file .Pa /etc/wall_cmos_clock -exists, it means that CMOS clock keeps local time (MS-DOS and MS-Windows +exists, it means that the CMOS clock keeps local time (MS-DOS and MS-Windows compatible mode). If that file does not exist, it means that the CMOS clock keeps UTC time. The @@ -86,7 +84,7 @@ reads the local time from it and sets the kernel clock to the corresponding UTC time. The .Nm -utility also stores the local time zone offset into the +utility also stores the local time zone offset in the .Pa machdep.adjkerntz kernel variable, for use by subsequent invocations of .Em "'adjkerntz -a'" @@ -94,7 +92,7 @@ and by local time file systems. .Pp For a local time CMOS clock .Em "'adjkerntz -i'" -pauses, and remains inactive as a background daemon until it +pauses and remains inactive as a background daemon until it receives a SIGTERM. The SIGTERM will normally be sent by .Xr init 8 @@ -120,7 +118,7 @@ time zone offset, and the changed time z calculate a new time zone offset. It stores the new offset into the .Pa machdep.adjkerntz -kernel variable, and updates the wall CMOS clock to the new local time. +kernel variable and updates the wall CMOS clock to the new local time. If .Em "'adjkerntz -a'" was started at a nonexistent time (during a timezone change), it exits From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 02:23:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9C941065670; Fri, 9 Mar 2012 02:23:03 +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 C92AC8FC1A; Fri, 9 Mar 2012 02:23: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 q292N36j075287; Fri, 9 Mar 2012 02:23:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q292N3Ij075285; Fri, 9 Mar 2012 02:23:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201203090223.q292N3Ij075285@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 9 Mar 2012 02:23: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: r232714 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 02:23:03 -0000 Author: nwhitehorn Date: Fri Mar 9 02:23:03 2012 New Revision: 232714 URL: http://svn.freebsd.org/changeset/base/232714 Log: Make sure not to tar up CVS directories if this ports tree is a CVS checkout. PR: bin/165868 MFC after: 5 days Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Fri Mar 9 02:13:47 2012 (r232713) +++ head/release/Makefile Fri Mar 9 02:23:03 2012 (r232714) @@ -90,6 +90,7 @@ ports.txz: mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \ + --exclude CVS --exclude .svn \ --exclude usr/ports/distfiles --exclude usr/ports/packages \ --exclude 'usr/ports/INDEX*' --exclude work usr/ports From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 04:51:43 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60BC4106566B; Fri, 9 Mar 2012 04:51:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail28.syd.optusnet.com.au (mail28.syd.optusnet.com.au [211.29.133.169]) by mx1.freebsd.org (Postfix) with ESMTP id F188E8FC12; Fri, 9 Mar 2012 04:51:42 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail28.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q294pYWE013258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Mar 2012 15:51:35 +1100 Date: Fri, 9 Mar 2012 15:51:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Peter Holm In-Reply-To: <201203081249.q28Cn9ed045648@svn.freebsd.org> Message-ID: <20120309145110.D1365@besplex.bde.org> References: <201203081249.q28Cn9ed045648@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: r232692 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 04:51:43 -0000 On Thu, 8 Mar 2012, Peter Holm wrote: > Log: > syscall() fuzzing can trigger this panic. Return EINVAL instead. > > MFC after: 1 week If so, then, this is not the place to hide the bug. > Modified: head/sys/ufs/ffs/ffs_vnops.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_vnops.c Thu Mar 8 11:05:53 2012 (r232691) > +++ head/sys/ufs/ffs/ffs_vnops.c Thu Mar 8 12:49:08 2012 (r232692) > @@ -464,11 +464,11 @@ ffs_read(ap) > } else if (vp->v_type != VREG && vp->v_type != VDIR) > panic("ffs_read: type %d", vp->v_type); > #endif > + if (uio->uio_resid < 0 || uio->uio_offset < 0) > + return (EINVAL); > orig_resid = uio->uio_resid; > - KASSERT(orig_resid >= 0, ("ffs_read: uio->uio_resid < 0")); > if (orig_resid == 0) > return (0); > - KASSERT(uio->uio_offset >= 0, ("ffs_read: uio->uio_offset < 0")); > fs = ip->i_fs; > if (uio->uio_offset < ip->i_size && > uio->uio_offset >= fs->fs_maxfilesize) All file systems are supposed to copy ffs here. The ones that actually do are still correct here. The code that enforces a non-negative uio_resid for read(2) is: % #ifndef _SYS_SYSPROTO_H_ % struct read_args { % int fd; % void *buf; % size_t nbyte; % }; % #endif % int % sys_read(td, uap) % struct thread *td; % struct read_args *uap; % { % struct uio auio; % struct iovec aiov; % int error; % % if (uap->nbyte > IOSIZE_MAX) % return (EINVAL); uap->nbyte is unsigned, so it is never negative. IOSIZE_MAX is either INT_MAX or SSIZE_MAX. % aiov.iov_base = uap->buf; % aiov.iov_len = uap->nbyte; iov_len has type size_t, so it can represent any value of nbytes, since that has type size_t too. % auio.uio_iov = &aiov; % auio.uio_iovcnt = 1; % auio.uio_resid = uap->nbyte; uio_resid has type ssize_t, so it can represent any value of nbyte less than IOSIZE_MAX. Thus no overflow occurs on this assignment, else there would be undefined behaviour and perhaps a negative value here. % auio.uio_segflg = UIO_USERSPACE; % error = kern_readv(td, uap->fd, &auio); % return(error); % } kib is supposed to have been careful converting the old int types and INT_MAX limit to ssize_t types and SSIZE_MAX limit, so that negative values remain impossible. They should be so impossible that asserting that they don't happen in VOPs is as useful as asserting that parity errors in the CPU don't happen, but if one happens then the fix is not to remove the assertion. Negative offsets seem to be disallowed correctly in sys_lseek() and sys_preadv(). syscall() can be used to pass weirder args than usual, but I don't know any way to reach ffs_read() without going through the checking in sys_lseek() or sys_preadv(). A stack trace of the panic would be useful for showing how it got through. There seems to be no checking of the non-negativeness of the arg for mmap(). That is almost correct, since the offset for mmap() is for memory, so off_t and its signedness are bogus anyway. sys_sendfile() checks. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 05:14:59 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6454A1065672; Fri, 9 Mar 2012 05:14:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 007378FC14; Fri, 9 Mar 2012 05:14:58 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q295EoRe009405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Mar 2012 16:14:51 +1100 Date: Fri, 9 Mar 2012 16:14:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste In-Reply-To: <201203081527.q28FRUSm050522@svn.freebsd.org> Message-ID: <20120309155320.W1588@besplex.bde.org> References: <201203081527.q28FRUSm050522@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: r232695 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 05:14:59 -0000 On Thu, 8 Mar 2012, Ed Maste wrote: > Log: > Correct markup, use proper reference for sysctl(3) This is sort of backwards. > Submitted by: brueffer@ > > Modified: > head/share/man/man4/tcp.4 > > Modified: head/share/man/man4/tcp.4 > ============================================================================== > --- head/share/man/man4/tcp.4 Thu Mar 8 13:00:49 2012 (r232694) > +++ head/share/man/man4/tcp.4 Thu Mar 8 15:27:29 2012 (r232695) > @@ -256,8 +256,10 @@ or the internal send buffer is filled. > This option enables the use of MD5 digests (also known as TCP-MD5) > on writes to the specified socket. > Outgoing traffic is digested; > -digests on incoming traffic are verified > -if the net.inet.tcp.signature_verify_input sysctl is nonzero. > +digests on incoming traffic are verified if the > +.Va net.inet.tcp.signature_verify_input > +.Xr sysctl 3 sysctl(3) is a man page for sysctls. The (3) in it is part of its name. It is not part of the name of any sysctl. > +is nonzero. > The current default behavior for the system is to respond to a system > advertising this option with TCP-MD5; this may change. > .Pp Normal abuse of language is "the foo sysctl". This is a to avoid writing out a full description, which would be something like "the foo feature, which is controlled in the usual way by sysctl(3) at the programmer level and by sysctl(8) at the sysadmin level". For most sysctls (_not_ for most sysctl(3)s or sysctl(8)s), their man page is not the place to reference sysctl(3) or sysctl(8). The reference to sysctl(3) is negatively useful here, as in most places: - except for a few style inconsistencies, sysctl(3) contains no documentation about any sysctl by name. It mainly documents a very incomplete set of sysctls by number. It doesn't document even 1 tcp sysctl by either name or number. - sysctl(8) mainly documents a very incomplete set of sysctls by name. However, it too doesn't document even 1 tcp sysctl. - this sysctl actually is documented, in tcp(4). But that's where we already are. It would be more useful to refer to red_herring(3), since everyone knows how much time they should spend reading that. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 06:40:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 051CE106566C for ; Fri, 9 Mar 2012 06:40:40 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay03.pair.com (relay03.pair.com [209.68.5.17]) by mx1.freebsd.org (Postfix) with SMTP id C19658FC14 for ; Fri, 9 Mar 2012 06:40:39 +0000 (UTC) Received: (qmail 2802 invoked from network); 9 Mar 2012 06:40:38 -0000 Received: from 87.58.144.241 (HELO x2.osted.lan) (87.58.144.241) by relay03.pair.com with SMTP; 9 Mar 2012 06:40:38 -0000 X-pair-Authenticated: 87.58.144.241 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.4/8.14.4) with ESMTP id q296eb5J040101; Fri, 9 Mar 2012 07:40:37 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.4/8.14.4/Submit) id q296eaOY040100; Fri, 9 Mar 2012 07:40:36 +0100 (CET) (envelope-from pho) Date: Fri, 9 Mar 2012 07:40:36 +0100 From: Peter Holm To: Bruce Evans Message-ID: <20120309064036.GA40029@x2.osted.lan> References: <201203081249.q28Cn9ed045648@svn.freebsd.org> <20120309145110.D1365@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120309145110.D1365@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232692 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 06:40:40 -0000 On Fri, Mar 09, 2012 at 03:51:30PM +1100, Bruce Evans wrote: > On Thu, 8 Mar 2012, Peter Holm wrote: > > >Log: > > syscall() fuzzing can trigger this panic. Return EINVAL instead. > > > > MFC after: 1 week > > If so, then, this is not the place to hide the bug. > OK > >Modified: head/sys/ufs/ffs/ffs_vnops.c > >============================================================================== > >--- head/sys/ufs/ffs/ffs_vnops.c Thu Mar 8 11:05:53 2012 (r232691) > >+++ head/sys/ufs/ffs/ffs_vnops.c Thu Mar 8 12:49:08 2012 (r232692) > >@@ -464,11 +464,11 @@ ffs_read(ap) > > } else if (vp->v_type != VREG && vp->v_type != VDIR) > > panic("ffs_read: type %d", vp->v_type); > >#endif > >+ if (uio->uio_resid < 0 || uio->uio_offset < 0) > >+ return (EINVAL); > > orig_resid = uio->uio_resid; > >- KASSERT(orig_resid >= 0, ("ffs_read: uio->uio_resid < 0")); > > if (orig_resid == 0) > > return (0); > >- KASSERT(uio->uio_offset >= 0, ("ffs_read: uio->uio_offset < 0")); > > fs = ip->i_fs; > > if (uio->uio_offset < ip->i_size && > > uio->uio_offset >= fs->fs_maxfilesize) > > All file systems are supposed to copy ffs here. The ones that actually > do are still correct here. > > The code that enforces a non-negative uio_resid for read(2) is: > > % #ifndef _SYS_SYSPROTO_H_ > % struct read_args { > % int fd; > % void *buf; > % size_t nbyte; > % }; > % #endif > % int > % sys_read(td, uap) > % struct thread *td; > % struct read_args *uap; > % { > % struct uio auio; > % struct iovec aiov; > % int error; > % > % if (uap->nbyte > IOSIZE_MAX) > % return (EINVAL); > > uap->nbyte is unsigned, so it is never negative. IOSIZE_MAX is either > INT_MAX or SSIZE_MAX. > > % aiov.iov_base = uap->buf; > % aiov.iov_len = uap->nbyte; > > iov_len has type size_t, so it can represent any value of nbytes, since > that has type size_t too. > > % auio.uio_iov = &aiov; > % auio.uio_iovcnt = 1; > % auio.uio_resid = uap->nbyte; > > uio_resid has type ssize_t, so it can represent any value of nbyte less > than IOSIZE_MAX. Thus no overflow occurs on this assignment, else there > would be undefined behaviour and perhaps a negative value here. > > % auio.uio_segflg = UIO_USERSPACE; > % error = kern_readv(td, uap->fd, &auio); > % return(error); > % } > > kib is supposed to have been careful converting the old int types and > INT_MAX limit to ssize_t types and SSIZE_MAX limit, so that negative > values remain impossible. They should be so impossible that asserting > that they don't happen in VOPs is as useful as asserting that parity > errors in the CPU don't happen, but if one happens then the fix is not > to remove the assertion. > > Negative offsets seem to be disallowed correctly in sys_lseek() and > sys_preadv(). > > syscall() can be used to pass weirder args than usual, but I don't > know any way to reach ffs_read() without going through the checking > in sys_lseek() or sys_preadv(). A stack trace of the panic would be > useful for showing how it got through. > This specific problem here was discover by: for (i = 0; i < 2000; i++) { if ((dirp = opendir(path)) == NULL) break; bcopy(dirp, &fuzz, sizeof(fuzz)); fuzz.dd_len = arc4random(); readdir(&fuzz); closedir(dirp); } http://people.freebsd.org/~pho/stress/log/kostik478.txt > There seems to be no checking of the non-negativeness of the arg for > mmap(). That is almost correct, since the offset for mmap() is for > memory, so off_t and its signedness are bogus anyway. > > sys_sendfile() checks. > > Bruce -- Peter From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 07:30:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C08FC1065670; Fri, 9 Mar 2012 07:30:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B02C58FC14; Fri, 9 Mar 2012 07:30: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 q297UmHl085026; Fri, 9 Mar 2012 07:30:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q297UmYb085024; Fri, 9 Mar 2012 07:30:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203090730.q297UmYb085024@svn.freebsd.org> From: Alexander Motin Date: Fri, 9 Mar 2012 07:30: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: r232717 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 07:30:48 -0000 Author: mav Date: Fri Mar 9 07:30:48 2012 New Revision: 232717 URL: http://svn.freebsd.org/changeset/base/232717 Log: Be more polite when setting state->nextevent inside cpu_new_callout(). Hardclock is not the only who wakes idle CPU since kdtrace cyclic addition. MFC after: 2 weeks Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Fri Mar 9 05:43:08 2012 (r232716) +++ head/sys/kern/kern_clocksource.c Fri Mar 9 07:30:48 2012 (r232717) @@ -854,10 +854,11 @@ cpu_new_callout(int cpu, int ticks) * If timer is global - there is chance it is already programmed. */ if (periodic || (timer->et_flags & ET_FLAGS_PERCPU) == 0) { - state->nextevent = state->nexthard; tmp = hardperiod; bintime_mul(&tmp, ticks - 1); - bintime_add(&state->nextevent, &tmp); + bintime_add(&tmp, &state->nexthard); + if (bintime_cmp(&tmp, &state->nextevent, <)) + state->nextevent = tmp; if (periodic || bintime_cmp(&state->nextevent, &nexttick, >=)) { ET_HW_UNLOCK(state); From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 07:53:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 292B3106566B; Fri, 9 Mar 2012 07:53:45 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18A8E8FC0C; Fri, 9 Mar 2012 07:53: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 q297ribh085717; Fri, 9 Mar 2012 07:53:44 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q297riiK085715; Fri, 9 Mar 2012 07:53:44 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203090753.q297riiK085715@svn.freebsd.org> From: Juli Mallett Date: Fri, 9 Mar 2012 07:53: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: r232718 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 07:53:45 -0000 Author: jmallett Date: Fri Mar 9 07:53:44 2012 New Revision: 232718 URL: http://svn.freebsd.org/changeset/base/232718 Log: Enable COMPAT_FREEBSD32 for the Octeon kernel config by default. Modified: head/sys/mips/conf/OCTEON1 Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Fri Mar 9 07:30:48 2012 (r232717) +++ head/sys/mips/conf/OCTEON1 Fri Mar 9 07:53:44 2012 (r232718) @@ -61,7 +61,7 @@ options PROCFS # Process filesystem ( options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization -#options COMPAT_FREEBSD32 # Compatible with o32 binaries (not yet) +options COMPAT_FREEBSD32 # Compatible with o32 binaries (not yet) options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 08:36:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6058C106564A; Fri, 9 Mar 2012 08:36:31 +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 4FE868FC15; Fri, 9 Mar 2012 08:36: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 q298aV8u087074; Fri, 9 Mar 2012 08:36:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q298aVOg087072; Fri, 9 Mar 2012 08:36:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203090836.q298aVOg087072@svn.freebsd.org> From: Adrian Chadd Date: Fri, 9 Mar 2012 08:36: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: r232719 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 08:36:31 -0000 Author: adrian Date: Fri Mar 9 08:36:30 2012 New Revision: 232719 URL: http://svn.freebsd.org/changeset/base/232719 Log: Insert extra paranoia into the ath(4) driver. This function must be called with both the source and destination TXQs locked or things will get hairy. I added this as part of some debugging in a PR but it turned out to not be the cause. I still think it's -correct- so, here it is. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Mar 9 07:53:44 2012 (r232718) +++ head/sys/dev/ath/if_ath.c Fri Mar 9 08:36:30 2012 (r232719) @@ -2908,6 +2908,10 @@ ath_beacon_update(struct ieee80211vap *v static void ath_txqmove(struct ath_txq *dst, struct ath_txq *src) { + + ATH_TXQ_LOCK_ASSERT(dst); + ATH_TXQ_LOCK_ASSERT(src); + TAILQ_CONCAT(&dst->axq_q, &src->axq_q, bf_list); dst->axq_link = src->axq_link; src->axq_link = NULL; From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 09:32:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BBE0106566C; Fri, 9 Mar 2012 09:32:20 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 873A78FC13; Fri, 9 Mar 2012 09:32: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 q299WKSI088899; Fri, 9 Mar 2012 09:32:20 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q299WK4c088897; Fri, 9 Mar 2012 09:32:20 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203090932.q299WK4c088897@svn.freebsd.org> From: Juli Mallett Date: Fri, 9 Mar 2012 09:32: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: r232720 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 09:32:20 -0000 Author: jmallett Date: Fri Mar 9 09:32:20 2012 New Revision: 232720 URL: http://svn.freebsd.org/changeset/base/232720 Log: "Did you still want the not yet? I think we just arrived at yet." Submitted by: thompsa Modified: head/sys/mips/conf/OCTEON1 Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Fri Mar 9 08:36:30 2012 (r232719) +++ head/sys/mips/conf/OCTEON1 Fri Mar 9 09:32:20 2012 (r232720) @@ -61,7 +61,7 @@ options PROCFS # Process filesystem ( options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization -options COMPAT_FREEBSD32 # Compatible with o32 binaries (not yet) +options COMPAT_FREEBSD32 # Compatible with o32 binaries options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 11:48:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE0BD106564A; Fri, 9 Mar 2012 11:48:56 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A86B08FC18; Fri, 9 Mar 2012 11:48: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 q29Bmuoi005153; Fri, 9 Mar 2012 11:48:56 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29BmuIp005151; Fri, 9 Mar 2012 11:48:56 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203091148.q29BmuIp005151@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 9 Mar 2012 11:48: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: r232721 - head/sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 11:48:56 -0000 Author: tijl Date: Fri Mar 9 11:48:56 2012 New Revision: 232721 URL: http://svn.freebsd.org/changeset/base/232721 Log: Clean up x86 endian.h: - Remove extern "C". There are no functions with external linkage here. [1] - Rename bswapNN_const(x) to bswapNN_gen(x) to indicate that these macros are generic implementations that can take non-constant arguments. [1] - Split up __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P and deal with each separately. - Replace _LP64 with __amd64__ because asm instructions are machine dependent, not ABI dependent. Submitted by: bde [1] Reviewed by: bde Modified: head/sys/x86/include/endian.h Modified: head/sys/x86/include/endian.h ============================================================================== --- head/sys/x86/include/endian.h Fri Mar 9 09:32:20 2012 (r232720) +++ head/sys/x86/include/endian.h Fri Mar 9 11:48:56 2012 (r232721) @@ -36,10 +36,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* * Define the order of 32-bit words in 64-bit words. */ @@ -67,51 +63,63 @@ extern "C" { #define BYTE_ORDER _BYTE_ORDER #endif -#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE_BUILTIN_CONSTANT_P) - -#define __bswap16_const(_x) (__uint16_t)((_x) << 8 | (_x) >> 8) - -#define __bswap16(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x)) - -#define __bswap32_const(_x) \ - (((__uint32_t)__bswap16(_x) << 16) | __bswap16((_x) >> 16)) - -#define __bswap32(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) - -#define __bswap64_const(_x) \ - (((__uint64_t)__bswap32(_x) << 32) | __bswap32((_x) >> 32)) +#define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) +#define __bswap32_gen(x) \ + (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16)) +#define __bswap64_gen(x) \ + (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) + +#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P +#define __bswap16(x) \ + (__builtin_constant_p(x) ? \ + __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)) +#define __bswap32(x) \ + (__builtin_constant_p(x) ? \ + __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) +#define __bswap64(x) \ + (__builtin_constant_p(x) ? \ + __bswap64_gen((__uint64_t)(x)) : __bswap64_var(x)) +#else +/* XXX these are broken for use in static initializers. */ +#define __bswap16(x) __bswap16_var(x) +#define __bswap32(x) __bswap32_var(x) +#define __bswap64(x) __bswap64_var(x) +#endif -#define __bswap64(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap64_const((__uint64_t)(_x)) : __bswap64_var(_x)) +/* These are defined as functions to avoid multiple evaluation of x. */ static __inline __uint16_t __bswap16_var(__uint16_t _x) { - return (__bswap16_const(_x)); + return (__bswap16_gen(_x)); } static __inline __uint32_t __bswap32_var(__uint32_t _x) { - __asm ("bswap %0" : "+r" (_x)); +#ifdef __GNUCLIKE_ASM + __asm("bswap %0" : "+r" (_x)); return (_x); +#else + return (__bswap32_gen(_x)); +#endif } static __inline __uint64_t __bswap64_var(__uint64_t _x) { -#ifdef _LP64 - __asm ("bswap %0" : "+r" (_x)); + +#if defined(__amd64__) && defined(__GNUCLIKE_ASM) + __asm("bswap %0" : "+r" (_x)); return (_x); #else - return (__bswap64_const(_x)); + /* + * It is important for the optimizations that the following is not + * really generic, but expands to 2 __bswap32_var()'s. + */ + return (__bswap64_gen(_x)); #endif } @@ -120,19 +128,4 @@ __bswap64_var(__uint64_t _x) #define __ntohl(x) __bswap32(x) #define __ntohs(x) __bswap16(x) -#else /* !(__GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P) */ - -/* - * No optimizations are available for this compiler. Fall back to - * non-optimized functions by defining the constant usually used to prevent - * redefinition. - */ -#define _BYTEORDER_FUNC_DEFINED - -#endif /* __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P */ - -#ifdef __cplusplus -} -#endif - #endif /* !_MACHINE_ENDIAN_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 12:58:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0351106566B; Fri, 9 Mar 2012 12:58:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9AB718FC0A; Fri, 9 Mar 2012 12:58:55 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:21e7:1ad:882:b366] (unknown [IPv6:2001:7b8:3a7:0:21e7:1ad:882:b366]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id DF2355C37; Fri, 9 Mar 2012 13:58:54 +0100 (CET) Message-ID: <4F59FE93.2040401@FreeBSD.org> Date: Fri, 09 Mar 2012 13:58:59 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120229 Thunderbird/11.0 MIME-Version: 1.0 To: Tijl Coosemans References: <201203091148.q29BmuIp005151@svn.freebsd.org> In-Reply-To: <201203091148.q29BmuIp005151@svn.freebsd.org> X-Enigmail-Version: 1.4a1pre 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: r232721 - head/sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 12:58:56 -0000 On 2012-03-09 12:48, Tijl Coosemans wrote: > Author: tijl > Date: Fri Mar 9 11:48:56 2012 > New Revision: 232721 > URL: http://svn.freebsd.org/changeset/base/232721 > > Log: > Clean up x86 endian.h: > - Remove extern "C". There are no functions with external linkage here. [1] > - Rename bswapNN_const(x) to bswapNN_gen(x) to indicate that these macros > are generic implementations that can take non-constant arguments. [1] > - Split up __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P and deal with > each separately. > - Replace _LP64 with __amd64__ because asm instructions are machine > dependent, not ABI dependent. ... > +#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P > +#define __bswap16(x) \ > + (__builtin_constant_p(x) ? \ > + __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)) Shall we now add a cast to __uint16_t to this ternary expression? That should solve the problems with clang warnings about ntohs() etc once and for all. From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 13:12:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E5E5106564A; Fri, 9 Mar 2012 13:12:34 +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 EE3618FC12; Fri, 9 Mar 2012 13:12: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 q29DCXV0008315; Fri, 9 Mar 2012 13:12:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29DCXLJ008313; Fri, 9 Mar 2012 13:12:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203091312.q29DCXLJ008313@svn.freebsd.org> From: Michael Tuexen Date: Fri, 9 Mar 2012 13:12: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: r232723 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 13:12:34 -0000 Author: tuexen Date: Fri Mar 9 13:12:33 2012 New Revision: 232723 URL: http://svn.freebsd.org/changeset/base/232723 Log: Fix a bug reported by Peter Holm which results in a crash: Verify in sctp_peeloff() that the socket is a one-to-many style SCTP socket. MFC after: 3 days. Modified: head/sys/netinet/sctp_peeloff.c Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Fri Mar 9 13:06:24 2012 (r232722) +++ head/sys/netinet/sctp_peeloff.c Fri Mar 9 13:12:33 2012 (r232723) @@ -55,6 +55,15 @@ sctp_can_peel_off(struct socket *head, s struct sctp_tcb *stcb; uint32_t state; + if (head == NULL) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EBADF); + return (EBADF); + } + if ((head->so_proto->pr_protocol != IPPROTO_SCTP) || + (head->so_type != SOCK_SEQPACKET)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); + return (EOPNOTSUPP); + } inp = (struct sctp_inpcb *)head->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 13:15:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E3BC106566C; Fri, 9 Mar 2012 13:15:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED96B8FC16; Fri, 9 Mar 2012 13:15: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 q29DFeF8008442; Fri, 9 Mar 2012 13:15:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29DFeeu008440; Fri, 9 Mar 2012 13:15:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203091315.q29DFeeu008440@svn.freebsd.org> From: Michael Tuexen Date: Fri, 9 Mar 2012 13:15: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: r232724 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 13:15:41 -0000 Author: tuexen Date: Fri Mar 9 13:15:40 2012 New Revision: 232724 URL: http://svn.freebsd.org/changeset/base/232724 Log: Add support for stf interfaces. MFC after: 3days. Modified: head/sys/netinet/sctp_bsd_addr.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Fri Mar 9 13:12:33 2012 (r232723) +++ head/sys/netinet/sctp_bsd_addr.c Fri Mar 9 13:15:40 2012 (r232724) @@ -180,6 +180,7 @@ sctp_is_desired_interface_type(struct if case IFT_SLIP: case IFT_GIF: case IFT_L2VLAN: + case IFT_STF: case IFT_IP: case IFT_IPOVERCDLC: case IFT_IPOVERCLAW: From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 14:08:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA670106566B; Fri, 9 Mar 2012 14:08:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 73A9F8FC08; Fri, 9 Mar 2012 14:08:46 +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 F144725D3893; Fri, 9 Mar 2012 14:08:44 +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 ECE1ABDD076; Fri, 9 Mar 2012 14:08:43 +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 Ke+7pW-tadTJ; Fri, 9 Mar 2012 14:08:42 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B2932BDD075; Fri, 9 Mar 2012 14:08:42 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201203091312.q29DCXLJ008313@svn.freebsd.org> Date: Fri, 9 Mar 2012 14:08:41 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <6E2D25B4-B9BC-4D51-98BF-FDE1EDDED7CB@lists.zabbadoz.net> References: <201203091312.q29DCXLJ008313@svn.freebsd.org> To: Michael Tuexen X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232723 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 14:08:47 -0000 On 9. Mar 2012, at 13:12 , Michael Tuexen wrote: > Author: tuexen > Date: Fri Mar 9 13:12:33 2012 > New Revision: 232723 > URL: http://svn.freebsd.org/changeset/base/232723 >=20 > Log: > Fix a bug reported by Peter Holm which results in a crash: > Verify in sctp_peeloff() that the socket is a one-to-many > style SCTP socket. /scratch/tmp/bz/head.svn/sys/netinet/sctp_peeloff.c: In function = 'sctp_can_peel_off': /scratch/tmp/bz/head.svn/sys/netinet/sctp_peeloff.c:59: warning: 'inp' = is used uninitialized in this function >=20 > MFC after: 3 days. >=20 > Modified: > head/sys/netinet/sctp_peeloff.c >=20 > Modified: head/sys/netinet/sctp_peeloff.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/sctp_peeloff.c Fri Mar 9 13:06:24 2012 = (r232722) > +++ head/sys/netinet/sctp_peeloff.c Fri Mar 9 13:12:33 2012 = (r232723) > @@ -55,6 +55,15 @@ sctp_can_peel_off(struct socket *head, s > struct sctp_tcb *stcb; > uint32_t state; >=20 > + if (head =3D=3D NULL) { > + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, = SCTP_FROM_SCTP_PEELOFF, EBADF); > + return (EBADF); > + } > + if ((head->so_proto->pr_protocol !=3D IPPROTO_SCTP) || > + (head->so_type !=3D SOCK_SEQPACKET)) { > + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, = SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); > + return (EOPNOTSUPP); > + } > inp =3D (struct sctp_inpcb *)head->so_pcb; > if (inp =3D=3D NULL) { > SCTP_LTRACE_ERR_RET(inp, NULL, NULL, = SCTP_FROM_SCTP_PEELOFF, EFAULT); --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 14:48:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2C1106566C; Fri, 9 Mar 2012 14:48:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail26.syd.optusnet.com.au (mail26.syd.optusnet.com.au [211.29.133.167]) by mx1.freebsd.org (Postfix) with ESMTP id 5394D8FC16; Fri, 9 Mar 2012 14:48:36 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail26.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q29EmPHS006290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Mar 2012 01:48:28 +1100 Date: Sat, 10 Mar 2012 01:48:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Peter Holm In-Reply-To: <20120309064036.GA40029@x2.osted.lan> Message-ID: <20120310012432.Y3108@besplex.bde.org> References: <201203081249.q28Cn9ed045648@svn.freebsd.org> <20120309145110.D1365@besplex.bde.org> <20120309064036.GA40029@x2.osted.lan> 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: r232692 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 14:48:37 -0000 On Fri, 9 Mar 2012, Peter Holm wrote: > On Fri, Mar 09, 2012 at 03:51:30PM +1100, Bruce Evans wrote: >> On Thu, 8 Mar 2012, Peter Holm wrote: >> >>> Log: >>> syscall() fuzzing can trigger this panic. Return EINVAL instead. >>> >>> MFC after: 1 week >> >> If so, then, this is not the place to hide the bug. > > OK > > This specific problem here was discover by: > > for (i = 0; i < 2000; i++) { > if ((dirp = opendir(path)) == NULL) > break; > bcopy(dirp, &fuzz, sizeof(fuzz)); > fuzz.dd_len = arc4random(); > readdir(&fuzz); > closedir(dirp); > } Try this fix. You already fixed getdirentries() in 2008, but it was broken recently. % Index: vfs_syscalls.c % =================================================================== % RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v % retrieving revision 1.522 % diff -u -2 -r1.522 vfs_syscalls.c % --- vfs_syscalls.c 21 Feb 2012 01:05:12 -0000 1.522 % +++ vfs_syscalls.c 9 Mar 2012 14:22:57 -0000 % @@ -4154,7 +4154,7 @@ % % AUDIT_ARG_FD(fd); % - auio.uio_resid = count; % - if (auio.uio_resid > IOSIZE_MAX) % + if (count > IOSIZE_MAX) % return (EINVAL); % + auio.uio_resid = count; % if ((error = getvnode(td->td_proc->p_fd, fd, CAP_READ | CAP_SEEK, % &fp)) != 0) The broken version checked `count' only after possibly clobbering it. Clobbering occurs in practice on 32-bit arches, since then uio_resid has type int so it cannot hold a value of INT_MAX + 1U. The behaviour was undefined. The actual behaviour was normally to store a negative value in uio_resid. Comparing this with IOSIZE_MAX then always passed, since IOSIZE_MAX is a large int. `count' only has type u_int, not the usual size_t. It would be safer to keep comparing it with INT_MAX. Supporting directory reads of more than INT_MAX bytes is even more useless bloat than supporting regular files reads of more than INT_MAX bytes. But it seems safe enough. The limit is still INT_MAX on 32-bit arches. On 64-bit arches, it is now UINT_MAX = 2**32-1, not actually IOSIZE_MAX = 2**63-1 like the code checks for, since u_int can't go nearly as high as IOSIZE_MAX. At least after the above change, the compiler should see that the check always passes, and not generate any code for it, and maybe complain about it. Perhaps this is why it was broken. However, the compiler can't see this now, since IOSIZE_MAX is actually a macro that depends on a configuration variable, so it isn't always > UINT_MAX on 64-bit arches. Without the dynamic configuration, the broken check would obviously always pass on 32-bit arches, and the compiler complaining about it would be just what was required to avoid the bug. And even with dynamic configuration, it is almost obvious that the check always passed, since IOSIZE_MAX is (var ? INT_MAX : SSIZE_MAX), which is always INT_MAX. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 15:25:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F6611065670; Fri, 9 Mar 2012 15:25:28 +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 EE31C8FC0A; Fri, 9 Mar 2012 15:25: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 q29FPRTU013129; Fri, 9 Mar 2012 15:25:27 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29FPRrK013127; Fri, 9 Mar 2012 15:25:27 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201203091525.q29FPRrK013127@svn.freebsd.org> From: Ed Maste Date: Fri, 9 Mar 2012 15:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232725 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 15:25:28 -0000 Author: emaste Date: Fri Mar 9 15:25:27 2012 New Revision: 232725 URL: http://svn.freebsd.org/changeset/base/232725 Log: Remove undesired sysctl(3) xref Submitted by: bde Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Fri Mar 9 13:15:40 2012 (r232724) +++ head/share/man/man4/tcp.4 Fri Mar 9 15:25:27 2012 (r232725) @@ -258,8 +258,7 @@ on writes to the specified socket. Outgoing traffic is digested; digests on incoming traffic are verified if the .Va net.inet.tcp.signature_verify_input -.Xr sysctl 3 -is nonzero. +sysctl is nonzero. The current default behavior for the system is to respond to a system advertising this option with TCP-MD5; this may change. .Pp From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 15:42:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F216106568B; Fri, 9 Mar 2012 15:42: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 6B20A8FC1B; Fri, 9 Mar 2012 15:42: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 q29FgmYQ013696; Fri, 9 Mar 2012 15:42:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29FgmgD013694; Fri, 9 Mar 2012 15:42:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201203091542.q29FgmgD013694@svn.freebsd.org> From: Michael Tuexen Date: Fri, 9 Mar 2012 15:42: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: r232726 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 15:42:48 -0000 Author: tuexen Date: Fri Mar 9 15:42:47 2012 New Revision: 232726 URL: http://svn.freebsd.org/changeset/base/232726 Log: Fix a warning reported by bz@ MFC after: 3 days. Modified: head/sys/netinet/sctp_peeloff.c Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Fri Mar 9 15:25:27 2012 (r232725) +++ head/sys/netinet/sctp_peeloff.c Fri Mar 9 15:42:47 2012 (r232726) @@ -56,17 +56,17 @@ sctp_can_peel_off(struct socket *head, s uint32_t state; if (head == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EBADF); + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EBADF); return (EBADF); } if ((head->so_proto->pr_protocol != IPPROTO_SCTP) || (head->so_type != SOCK_SEQPACKET)) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); return (EOPNOTSUPP); } inp = (struct sctp_inpcb *)head->so_pcb; if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); return (EFAULT); } stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 15:45:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 470161065675; Fri, 9 Mar 2012 15:45:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id A97F68FC14; Fri, 9 Mar 2012 15:45:01 +0000 (UTC) Received: from [192.168.1.103] (p508FA066.dip.t-dialin.net [80.143.160.102]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id E96391C0C0BCC; Fri, 9 Mar 2012 16:44:58 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: <6E2D25B4-B9BC-4D51-98BF-FDE1EDDED7CB@lists.zabbadoz.net> Date: Fri, 9 Mar 2012 16:44:57 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201203091312.q29DCXLJ008313@svn.freebsd.org> <6E2D25B4-B9BC-4D51-98BF-FDE1EDDED7CB@lists.zabbadoz.net> To: Bjoern A. Zeeb X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232723 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 15:45:02 -0000 On Mar 9, 2012, at 3:08 PM, Bjoern A. Zeeb wrote: >=20 > On 9. Mar 2012, at 13:12 , Michael Tuexen wrote: >=20 >> Author: tuexen >> Date: Fri Mar 9 13:12:33 2012 >> New Revision: 232723 >> URL: http://svn.freebsd.org/changeset/base/232723 >>=20 >> Log: >> Fix a bug reported by Peter Holm which results in a crash: >> Verify in sctp_peeloff() that the socket is a one-to-many >> style SCTP socket. >=20 > /scratch/tmp/bz/head.svn/sys/netinet/sctp_peeloff.c: In function = 'sctp_can_peel_off': > /scratch/tmp/bz/head.svn/sys/netinet/sctp_peeloff.c:59: warning: 'inp' = is used uninitialized in this function Fixed in http://svn.freebsd.org/changeset/base/232726 Thanks for the report. Best regards Michael >=20 >=20 >>=20 >> MFC after: 3 days. >>=20 >> Modified: >> head/sys/netinet/sctp_peeloff.c >>=20 >> Modified: head/sys/netinet/sctp_peeloff.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/sctp_peeloff.c Fri Mar 9 13:06:24 2012 = (r232722) >> +++ head/sys/netinet/sctp_peeloff.c Fri Mar 9 13:12:33 2012 = (r232723) >> @@ -55,6 +55,15 @@ sctp_can_peel_off(struct socket *head, s >> struct sctp_tcb *stcb; >> uint32_t state; >>=20 >> + if (head =3D=3D NULL) { >> + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, = SCTP_FROM_SCTP_PEELOFF, EBADF); >> + return (EBADF); >> + } >> + if ((head->so_proto->pr_protocol !=3D IPPROTO_SCTP) || >> + (head->so_type !=3D SOCK_SEQPACKET)) { >> + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, = SCTP_FROM_SCTP_PEELOFF, EOPNOTSUPP); >> + return (EOPNOTSUPP); >> + } >> inp =3D (struct sctp_inpcb *)head->so_pcb; >> if (inp =3D=3D NULL) { >> SCTP_LTRACE_ERR_RET(inp, NULL, NULL, = SCTP_FROM_SCTP_PEELOFF, EFAULT); >=20 > --=20 > Bjoern A. Zeeb You have to have = visions! > It does not matter how good you are. It matters what good you do! >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 15:47:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6AD38106564A; Fri, 9 Mar 2012 15:47:09 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 030668FC12; Fri, 9 Mar 2012 15:47:08 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id DDF6F2A28CD3; Fri, 9 Mar 2012 16:47:07 +0100 (CET) Date: Fri, 9 Mar 2012 16:47:07 +0100 From: Ed Schouten To: Tijl Coosemans Message-ID: <20120309154707.GB27469@hoeg.nl> References: <201203091148.q29BmuIp005151@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pvezYHf7grwyp3Bc" Content-Disposition: inline In-Reply-To: <201203091148.q29BmuIp005151@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: r232721 - head/sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 15:47:09 -0000 --pvezYHf7grwyp3Bc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Tijl, * Tijl Coosemans , 20120309 12:48: > Clean up x86 endian.h: Wouldn't it be possible to simply place these macros in and only let define the assembly versions for the non-constant cases? Thanks, --=20 Ed Schouten WWW: http://80386.nl/ --pvezYHf7grwyp3Bc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iQIcBAEBAgAGBQJPWiX7AAoJEG5e2P40kaK7OzUQAJv5D/M76NZwuztc4M1Z5fZd 7cdS9nQMeeQDLpEcEZdWj+44+8MvM3JNp8dNKZySJHdRW5SCHxCJIchFonQepVxB e9VV4xVez51oM/Wd17TOYsZP6wzH6j30QAOzZ1W2tZN5FsP9WE4i78rh+TcZVtOA 9Ayt2I8vQGOY9TAQIqOmJPcdT9Y8T7VIHcj2gnEbOvSRoi9mYYJZYB7HZDQv/69c wVycLuodexMGx6hBfSFx/By/ElX5v0q+O3f3f/+gWwpDYnGW8nqZ72Danx33U3R7 jLJpApY1cTL5SGN1A9Ug3cevCzFWy9puBeX6Oezw+MVJx/K4Yy64WSk0jXW/Ab4d riLIoGPvIO0ZT57FTcDEwnV9rQdBQvDMDxc+KLWlYFuSJ1flveE4CWCFUUwx0yIO TizGDaUxIbGyhaDWSYocGDEIB7CUQfy5nbuKQ09bEfSVn0Dabd9FE8ivS65Vqsf1 HAuYM0f4jFxqkc1F3Zhxs6ls8trFef0HZkUvX6FEQYF3ZVKIq5XiR7vhYm4l8ZTs 9/hfohTvYP5EcXAlLsiEBn0p0PeO2OfH6K5lJG+RpuvGfPOigN8AeKOMKUFJ8QXL 6LvHyBknZHvoitT49CDhe8DN7DzpDNtQGF4Bo1sqNsJh11pc0mq+5GjxoOZ5xeQn edGkbBHY4ZtjDN2luSxk =08z8 -----END PGP SIGNATURE----- --pvezYHf7grwyp3Bc-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 16:05:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFA6C1065670; Fri, 9 Mar 2012 16:05:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B10C8FC14; Fri, 9 Mar 2012 16:05: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 q29G5BDP014416; Fri, 9 Mar 2012 16:05:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29G5B5i014414; Fri, 9 Mar 2012 16:05:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203091605.q29G5B5i014414@svn.freebsd.org> From: John Baldwin Date: Fri, 9 Mar 2012 16:05: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: r232727 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 16:05:11 -0000 Author: jhb Date: Fri Mar 9 16:05:11 2012 New Revision: 232727 URL: http://svn.freebsd.org/changeset/base/232727 Log: Remove PAE special-case 2GB DMA boundary and always use a 4GB boundary now that DMA tags in PAE kernels support 4GB boundaries. Reviewed by: yongari Modified: head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Fri Mar 9 15:42:47 2012 (r232726) +++ head/sys/dev/bge/if_bgereg.h Fri Mar 9 16:05:11 2012 (r232727) @@ -2691,15 +2691,11 @@ struct bge_gib { #define BGE_DMA_MAXADDR 0xFFFFFFFFFF #endif -#ifdef PAE -#define BGE_DMA_BNDRY 0x80000000 -#else #if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) #define BGE_DMA_BNDRY 0x100000000 #else #define BGE_DMA_BNDRY 0 #endif -#endif /* * Ring structures. Most of these reside in host memory and we tell From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 16:11:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 568731065672; Fri, 9 Mar 2012 16:11:57 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be [195.238.6.51]) by mx1.freebsd.org (Postfix) with ESMTP id 8235B8FC14; Fri, 9 Mar 2012 16:11:56 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EADUrWk9bsWTD/2dsb2JhbABDtTGBCIIKAQEFViMQCxguOR4GE4gOuyGQWgSlZYJk Received: from 195.100-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.100.195]) by relay.skynet.be with ESMTP; 09 Mar 2012 17:11:48 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q29GBlk2004248; Fri, 9 Mar 2012 17:11:47 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: Ed Schouten Date: Fri, 9 Mar 2012 17:11:41 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201203091148.q29BmuIp005151@svn.freebsd.org> <20120309154707.GB27469@hoeg.nl> In-Reply-To: <20120309154707.GB27469@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1552931.9rx4fqYbL6"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201203091711.45604.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232721 - head/sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 16:11:57 -0000 --nextPart1552931.9rx4fqYbL6 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable On Friday 09 March 2012 16:47:07 Ed Schouten wrote: > * Tijl Coosemans , 20120309 12:48: >> Clean up x86 endian.h: >=20 > Wouldn't it be possible to simply place these macros in > and only let define the assembly versions for the > non-constant cases? Several things could be moved to sys, not just endian.h, but I'd like to finish merging amd64/i386 headers first. Also, for clang and gcc >=3D 4.3 it's better to use __builtin_bswapNN(x), because it can use movbe rather than mov+bswap when x is a memory operand. --nextPart1552931.9rx4fqYbL6 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk9aK8EACgkQfoCS2CCgtisQSgD/bSh41FegN7GHd4WS5+iDrzdD l3yIqGbg7l7kX9j4E18A/jZsccCrNAkYFJeqzyVz7H82/8e2tVZ+u+ePDEi2BqOc =GTf0 -----END PGP SIGNATURE----- --nextPart1552931.9rx4fqYbL6-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 16:21:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2973A1065673; Fri, 9 Mar 2012 16:21:41 +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 148498FC19; Fri, 9 Mar 2012 16:21: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 q29GLePZ015056; Fri, 9 Mar 2012 16:21:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29GLecE015054; Fri, 9 Mar 2012 16:21:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203091621.q29GLecE015054@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 9 Mar 2012 16:21: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: r232729 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 16:21:41 -0000 Author: kib Date: Fri Mar 9 16:21:40 2012 New Revision: 232729 URL: http://svn.freebsd.org/changeset/base/232729 Log: Remove the use of toupper() from rtld_printf.c. Use of the libc function relies on working TLS, which is particulary not true for LD_DEBUG uses. MFC after: 1 week Modified: head/libexec/rtld-elf/rtld_printf.c Modified: head/libexec/rtld-elf/rtld_printf.c ============================================================================== --- head/libexec/rtld-elf/rtld_printf.c Fri Mar 9 16:17:46 2012 (r232728) +++ head/libexec/rtld-elf/rtld_printf.c Fri Mar 9 16:21:40 2012 (r232729) @@ -36,7 +36,6 @@ */ #include -#include #include #include #include @@ -90,8 +89,10 @@ snprintf_func(int ch, struct snprintf_ar } } -static char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz"; -#define hex2ascii(hex) (hex2ascii_data[hex]) +static char const hex2ascii_lower[] = "0123456789abcdefghijklmnopqrstuvwxyz"; +static char const hex2ascii_upper[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +#define hex2ascii(hex) (hex2ascii_lower[hex]) +#define hex2ascii_upper(hex) (hex2ascii_upper[hex]) static __inline int imax(int a, int b) @@ -108,8 +109,9 @@ ksprintn(char *nbuf, uintmax_t num, int p = nbuf; *p = '\0'; do { - c = hex2ascii(num % base); - *++p = upper ? toupper(c) : c; + c = upper ? hex2ascii_upper(num % base) : + hex2ascii(num % base); + *++p = c; } while (num /= base); if (lenp) *lenp = p - nbuf; From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 16:39:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3EFB106566B; Fri, 9 Mar 2012 16:39:34 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F62F8FC0C; Fri, 9 Mar 2012 16:39: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 q29GdYms015759; Fri, 9 Mar 2012 16:39:34 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29GdYIl015757; Fri, 9 Mar 2012 16:39:34 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201203091639.q29GdYIl015757@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 9 Mar 2012 16:39: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: r232730 - head/sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 16:39:34 -0000 Author: tijl Date: Fri Mar 9 16:39:34 2012 New Revision: 232730 URL: http://svn.freebsd.org/changeset/base/232730 Log: Cast the expression in __bswap16(x) to __uint16_t because it is promoted to int. Reviewed by: dim Modified: head/sys/x86/include/endian.h Modified: head/sys/x86/include/endian.h ============================================================================== --- head/sys/x86/include/endian.h Fri Mar 9 16:21:40 2012 (r232729) +++ head/sys/x86/include/endian.h Fri Mar 9 16:39:34 2012 (r232730) @@ -70,8 +70,8 @@ (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32)) #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P -#define __bswap16(x) \ - (__builtin_constant_p(x) ? \ +#define __bswap16(x) \ + (__uint16_t)(__builtin_constant_p(x) ? \ __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)) #define __bswap32(x) \ (__builtin_constant_p(x) ? \ From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 17:18:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3C5F106566B for ; Fri, 9 Mar 2012 17:18:20 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id B34FF8FC16 for ; Fri, 9 Mar 2012 17:18:20 +0000 (UTC) Received: (qmail 25424 invoked from network); 9 Mar 2012 17:18:13 -0000 Received: from 87.58.144.241 (HELO x2.osted.lan) (87.58.144.241) by relay00.pair.com with SMTP; 9 Mar 2012 17:18:13 -0000 X-pair-Authenticated: 87.58.144.241 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.4/8.14.4) with ESMTP id q29HICwh052814; Fri, 9 Mar 2012 18:18:12 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.4/8.14.4/Submit) id q29HICgU052813; Fri, 9 Mar 2012 18:18:12 +0100 (CET) (envelope-from pho) Date: Fri, 9 Mar 2012 18:18:12 +0100 From: Peter Holm To: Bruce Evans Message-ID: <20120309171812.GA52767@x2.osted.lan> References: <201203081249.q28Cn9ed045648@svn.freebsd.org> <20120309145110.D1365@besplex.bde.org> <20120309064036.GA40029@x2.osted.lan> <20120310012432.Y3108@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120310012432.Y3108@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232692 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 17:18:21 -0000 On Sat, Mar 10, 2012 at 01:48:20AM +1100, Bruce Evans wrote: > On Fri, 9 Mar 2012, Peter Holm wrote: > > >On Fri, Mar 09, 2012 at 03:51:30PM +1100, Bruce Evans wrote: > >>On Thu, 8 Mar 2012, Peter Holm wrote: > >> > >>>Log: > >>>syscall() fuzzing can trigger this panic. Return EINVAL instead. > >>> > >>>MFC after: 1 week > >> > >>If so, then, this is not the place to hide the bug. > > > >OK > > > >This specific problem here was discover by: > > > > for (i = 0; i < 2000; i++) { > > if ((dirp = opendir(path)) == NULL) > > break; > > bcopy(dirp, &fuzz, sizeof(fuzz)); > > fuzz.dd_len = arc4random(); > > readdir(&fuzz); > > closedir(dirp); > > } > > Try this fix. You already fixed getdirentries() in 2008, but it was > broken recently. > > % Index: vfs_syscalls.c > % =================================================================== > % RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v > % retrieving revision 1.522 > % diff -u -2 -r1.522 vfs_syscalls.c > % --- vfs_syscalls.c 21 Feb 2012 01:05:12 -0000 1.522 > % +++ vfs_syscalls.c 9 Mar 2012 14:22:57 -0000 > % @@ -4154,7 +4154,7 @@ > % > % AUDIT_ARG_FD(fd); > % - auio.uio_resid = count; > % - if (auio.uio_resid > IOSIZE_MAX) > % + if (count > IOSIZE_MAX) > % return (EINVAL); > % + auio.uio_resid = count; > % if ((error = getvnode(td->td_proc->p_fd, fd, CAP_READ | CAP_SEEK, > % &fp)) != 0) > > The broken version checked `count' only after possibly clobbering it. > Clobbering occurs in practice on 32-bit arches, since then uio_resid > has type int so it cannot hold a value of INT_MAX + 1U. The behaviour > was undefined. The actual behaviour was normally to store a negative > value in uio_resid. Comparing this with IOSIZE_MAX then always passed, > since IOSIZE_MAX is a large int. > > `count' only has type u_int, not the usual size_t. It would be safer > to keep comparing it with INT_MAX. Supporting directory reads of more > than INT_MAX bytes is even more useless bloat than supporting regular > files reads of more than INT_MAX bytes. But it seems safe enough. > The limit is still INT_MAX on 32-bit arches. On 64-bit arches, it is > now UINT_MAX = 2**32-1, not actually IOSIZE_MAX = 2**63-1 like the code > checks for, since u_int can't go nearly as high as IOSIZE_MAX. At least > after the above change, the compiler should see that the check always > passes, and not generate any code for it, and maybe complain about it. > Perhaps this is why it was broken. However, the compiler can't see this > now, since IOSIZE_MAX is actually a macro that depends on a configuration > variable, so it isn't always > UINT_MAX on 64-bit arches. Without the > dynamic configuration, the broken check would obviously always pass on > 32-bit arches, and the compiler complaining about it would be just what > was required to avoid the bug. And even with dynamic configuration, it > is almost obvious that the check always passed, since IOSIZE_MAX is > (var ? INT_MAX : SSIZE_MAX), which is always INT_MAX. > > Bruce Thank you for the analysis. I have tested your patch, without r232692 and it works as expected. I'll back out r232692. Thank you. -- Peter From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 17:19:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61E801065674; Fri, 9 Mar 2012 17:19:51 +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 4C1C18FC0A; Fri, 9 Mar 2012 17:19: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 q29HJouY017101; Fri, 9 Mar 2012 17:19:50 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29HJoXH017099; Fri, 9 Mar 2012 17:19:50 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201203091719.q29HJoXH017099@svn.freebsd.org> From: Peter Holm Date: Fri, 9 Mar 2012 17:19: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: r232732 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 17:19:51 -0000 Author: pho Date: Fri Mar 9 17:19:50 2012 New Revision: 232732 URL: http://svn.freebsd.org/changeset/base/232732 Log: Revert r232692 as the correct place to fix this is at the syscall level. Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Fri Mar 9 17:13:08 2012 (r232731) +++ head/sys/ufs/ffs/ffs_vnops.c Fri Mar 9 17:19:50 2012 (r232732) @@ -464,11 +464,11 @@ ffs_read(ap) } else if (vp->v_type != VREG && vp->v_type != VDIR) panic("ffs_read: type %d", vp->v_type); #endif - if (uio->uio_resid < 0 || uio->uio_offset < 0) - return (EINVAL); orig_resid = uio->uio_resid; + KASSERT(orig_resid >= 0, ("ffs_read: uio->uio_resid < 0")); if (orig_resid == 0) return (0); + KASSERT(uio->uio_offset >= 0, ("ffs_read: uio->uio_offset < 0")); fs = ip->i_fs; if (uio->uio_offset < ip->i_size && uio->uio_offset >= fs->fs_maxfilesize) From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 18:34:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 376F91065670; Fri, 9 Mar 2012 18:34:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21ECA8FC1A; Fri, 9 Mar 2012 18:34: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 q29IYEZj019713; Fri, 9 Mar 2012 18:34:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29IYEoc019711; Fri, 9 Mar 2012 18:34:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201203091834.q29IYEoc019711@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 9 Mar 2012 18:34: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: r232738 - head/usr.sbin/diskinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 18:34:15 -0000 Author: trasz Date: Fri Mar 9 18:34:14 2012 New Revision: 232738 URL: http://svn.freebsd.org/changeset/base/232738 Log: Improve error reporting in diskinfo(8) by not displaying errno when it doesn't make sense. Modified: head/usr.sbin/diskinfo/diskinfo.c Modified: head/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- head/usr.sbin/diskinfo/diskinfo.c Fri Mar 9 18:26:35 2012 (r232737) +++ head/usr.sbin/diskinfo/diskinfo.c Fri Mar 9 18:34:14 2012 (r232738) @@ -99,13 +99,13 @@ main(int argc, char **argv) } error = ioctl(fd, DIOCGMEDIASIZE, &mediasize); if (error) { - warn("%s: ioctl(DIOCGMEDIASIZE) failed, probably not a disk.", argv[i]); + warnx("%s: ioctl(DIOCGMEDIASIZE) failed, probably not a disk.", argv[i]); exitval = 1; goto out; } error = ioctl(fd, DIOCGSECTORSIZE, §orsize); if (error) { - warn("%s: DIOCGSECTORSIZE failed, probably not a disk.", argv[i]); + warnx("%s: ioctl(DIOCGSECTORSIZE) failed, probably not a disk.", argv[i]); exitval = 1; goto out; } @@ -178,8 +178,10 @@ rdsect(int fd, off_t blockno, u_int sect lseek(fd, (off_t)blockno * sectorsize, SEEK_SET); error = read(fd, sector, sectorsize); + if (error == -1) + err(1, "read"); if (error != (int)sectorsize) - err(1, "read error or disk too small for test."); + errx(1, "disk too small for test."); } static void @@ -188,8 +190,10 @@ rdmega(int fd) int error; error = read(fd, mega, sizeof(mega)); + if (error == -1) + err(1, "read"); if (error != sizeof(mega)) - err(1, "read error or disk too small for test."); + errx(1, "disk too small for test."); } static struct timeval tv1, tv2; From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 19:09:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940F01065674; Fri, 9 Mar 2012 19:09:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8139D8FC23; Fri, 9 Mar 2012 19:09: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 q29J99mY020919; Fri, 9 Mar 2012 19:09:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29J99jZ020917; Fri, 9 Mar 2012 19:09:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203091909.q29J99jZ020917@svn.freebsd.org> From: Alexander Motin Date: Fri, 9 Mar 2012 19:09: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: r232740 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 19:09:09 -0000 Author: mav Date: Fri Mar 9 19:09:08 2012 New Revision: 232740 URL: http://svn.freebsd.org/changeset/base/232740 Log: Make kern.sched.idlespinthresh default value adaptive depending of HZ. Otherwise with HZ above 8000 CPU may never skip timer ticks on idle. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Fri Mar 9 18:50:49 2012 (r232739) +++ head/sys/kern/sched_ule.c Fri Mar 9 19:09:08 2012 (r232740) @@ -212,7 +212,7 @@ static int preempt_thresh = 0; #endif static int static_boost = PRI_MIN_BATCH; static int sched_idlespins = 10000; -static int sched_idlespinthresh = 16; +static int sched_idlespinthresh = -1; /* * tdq - per processor runqs and statistics. All fields are protected by the @@ -1390,6 +1390,8 @@ sched_initticks(void *dummy) steal_thresh = min(fls(mp_ncpus) - 1, 3); affinity = SCHED_AFFINITY_DEFAULT; #endif + if (sched_idlespinthresh < 0) + sched_idlespinthresh = max(16, 2 * hz / realstathz); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 19:20:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E3221065672; Fri, 9 Mar 2012 19:20:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FD978FC14; Fri, 9 Mar 2012 19:20: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 q29JKKBx021408; Fri, 9 Mar 2012 19:20:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29JKJh7021406; Fri, 9 Mar 2012 19:20:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203091920.q29JKJh7021406@svn.freebsd.org> From: John Baldwin Date: Fri, 9 Mar 2012 19:20: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: r232742 - head/sys/i386/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 19:20:20 -0000 Author: jhb Date: Fri Mar 9 19:20:19 2012 New Revision: 232742 URL: http://svn.freebsd.org/changeset/base/232742 Log: MFamd64: - Return failure for a suspend attempt if we have no wake address. - Use intr_disable()/intr_restore() instead of ACPI_DISABLE_IRQS(). - Invoke intr_suspend() earlier and call intr_resume() if suspend fails. - Use pause in the loop waiting for CPU to suspend. - Restore PAT MSR, switchtime, switchticks, and MTRRs on resume. Reviewed by: jkim (earlier version) MFC after: 2 weeks Modified: head/sys/i386/acpica/acpi_wakeup.c Modified: head/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- head/sys/i386/acpica/acpi_wakeup.c Fri Mar 9 19:18:31 2012 (r232741) +++ head/sys/i386/acpica/acpi_wakeup.c Fri Mar 9 19:20:19 2012 (r232742) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -200,13 +202,14 @@ acpi_sleep_machdep(struct acpi_softc *sc uint32_t cr3; u_long ef; - ret = 0; + ret = -1; if (sc->acpi_wakeaddr == 0) - return (0); + return (ret); AcpiSetFirmwareWakingVector(sc->acpi_wakephys); - ef = read_eflags(); + ef = intr_disable(); + intr_suspend(); /* * Temporarily switch to the kernel pmap because it provides an @@ -222,10 +225,8 @@ acpi_sleep_machdep(struct acpi_softc *sc #endif ret_addr = 0; - ACPI_DISABLE_IRQS(); if (acpi_savecpu()) { /* Execute Sleep */ - intr_suspend(); p_gdt = (struct region_descriptor *) (sc->acpi_wakeaddr + physical_gdt); @@ -267,25 +268,31 @@ acpi_sleep_machdep(struct acpi_softc *sc device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status)); - ret = -1; goto out; } - for (;;) ; + for (;;) + ia32_pause(); } else { - /* Execute Wakeup */ - mca_resume(); - intr_resume(); - + pmap_init_pat(); + PCPU_SET(switchtime, 0); + PCPU_SET(switchticks, ticks); if (bootverbose) { acpi_savecpu(); acpi_printcpu(); } + ret = 0; } out: load_cr3(cr3); - write_eflags(ef); + mca_resume(); + intr_resume(); + intr_restore(ef); + + if (ret == 0 && mem_range_softc.mr_op != NULL && + mem_range_softc.mr_op->reinit != NULL) + mem_range_softc.mr_op->reinit(&mem_range_softc); /* If we beeped, turn it off after a delay. */ if (acpi_resume_beep) From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 19:42:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A2B4106566C; Fri, 9 Mar 2012 19:42:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440748FC0A; Fri, 9 Mar 2012 19:42: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 q29JgnW0022238; Fri, 9 Mar 2012 19:42:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29Jgmj1022231; Fri, 9 Mar 2012 19:42:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203091942.q29Jgmj1022231@svn.freebsd.org> From: John Baldwin Date: Fri, 9 Mar 2012 19:42: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: r232744 - in head/sys: conf i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 19:42:49 -0000 Author: jhb Date: Fri Mar 9 19:42:48 2012 New Revision: 232744 URL: http://svn.freebsd.org/changeset/base/232744 Log: Allow a native i386 kernel to be built with 'nodevice atpic'. Just as on amd64, if 'device isa' is present quiesce the 8259A's during boot and resume from suspend. While here, be more selective on amd64 about which kernel configurations need elcr.c. MFC after: 2 weeks Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/i386/exception.s head/sys/i386/i386/intr_machdep.c head/sys/i386/i386/machdep.c head/sys/i386/include/intr_machdep.h Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Mar 9 19:22:31 2012 (r232743) +++ head/sys/conf/files.amd64 Fri Mar 9 19:42:48 2012 (r232744) @@ -466,7 +466,7 @@ x86/cpufreq/p4tcc.c optional cpufreq x86/isa/atpic.c optional atpic isa x86/isa/atrtc.c standard x86/isa/clock.c standard -x86/isa/elcr.c standard +x86/isa/elcr.c optional atpic isa | mptable x86/isa/isa.c standard x86/isa/isa_dma.c standard x86/isa/nmi.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Mar 9 19:22:31 2012 (r232743) +++ head/sys/conf/files.i386 Fri Mar 9 19:42:48 2012 (r232744) @@ -516,9 +516,9 @@ x86/cpufreq/p4tcc.c optional cpufreq x86/cpufreq/powernow.c optional cpufreq x86/cpufreq/smist.c optional cpufreq x86/isa/atpic.c optional atpic -x86/isa/atrtc.c optional atpic +x86/isa/atrtc.c optional native x86/isa/clock.c optional native -x86/isa/elcr.c standard +x86/isa/elcr.c optional atpic | apic native x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Fri Mar 9 19:22:31 2012 (r232743) +++ head/sys/i386/i386/exception.s Fri Mar 9 19:42:48 2012 (r232744) @@ -35,6 +35,7 @@ */ #include "opt_apic.h" +#include "opt_atpic.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" #include "opt_npx.h" @@ -299,14 +300,18 @@ ENTRY(fork_trampoline) SUPERALIGN_TEXT MCOUNT_LABEL(bintr) +#ifdef DEV_ATPIC #include +#endif -#ifdef DEV_APIC +#if defined(DEV_APIC) && defined(DEV_ATPIC) .data .p2align 4 .text SUPERALIGN_TEXT +#endif +#ifdef DEV_APIC #include #endif Modified: head/sys/i386/i386/intr_machdep.c ============================================================================== --- head/sys/i386/i386/intr_machdep.c Fri Mar 9 19:22:31 2012 (r232743) +++ head/sys/i386/i386/intr_machdep.c Fri Mar 9 19:42:48 2012 (r232744) @@ -37,6 +37,7 @@ * that source. */ +#include "opt_atpic.h" #include "opt_ddb.h" #include @@ -57,6 +58,14 @@ #include #endif +#ifndef DEV_ATPIC +#include +#include +#include +#include +#include +#endif + #define MAX_STRAY_LOG 5 typedef void (*mask_fn)(void *); @@ -270,6 +279,9 @@ intr_resume(void) { struct pic *pic; +#ifndef DEV_ATPIC + atpic_reset(); +#endif mtx_lock(&intr_table_lock); STAILQ_FOREACH(pic, &pics, pics) { if (pic->pic_resume != NULL) @@ -371,6 +383,28 @@ intr_init(void *dummy __unused) } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); +#ifndef DEV_ATPIC +/* Initialize the two 8259A's to a known-good shutdown state. */ +void +atpic_reset(void) +{ + + outb(IO_ICU1, ICW1_RESET | ICW1_IC4); + outb(IO_ICU1 + ICU_IMR_OFFSET, IDT_IO_INTS); + outb(IO_ICU1 + ICU_IMR_OFFSET, 1 << 2); + outb(IO_ICU1 + ICU_IMR_OFFSET, ICW4_8086); + outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff); + outb(IO_ICU1, OCW3_SEL | OCW3_RR); + + outb(IO_ICU2, ICW1_RESET | ICW1_IC4); + outb(IO_ICU2 + ICU_IMR_OFFSET, IDT_IO_INTS + 8); + outb(IO_ICU2 + ICU_IMR_OFFSET, 2); + outb(IO_ICU2 + ICU_IMR_OFFSET, ICW4_8086); + outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff); + outb(IO_ICU2, OCW3_SEL | OCW3_RR); +} +#endif + /* Add a description to an active interrupt handler. */ int intr_describe(u_int vector, void *ih, const char *descr) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Mar 9 19:22:31 2012 (r232743) +++ head/sys/i386/i386/machdep.c Fri Mar 9 19:42:48 2012 (r232744) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include "opt_atalk.h" +#include "opt_atpic.h" #include "opt_compat.h" #include "opt_cpu.h" #include "opt_ddb.h" @@ -2712,8 +2713,22 @@ init386(first) printf("WARNING: loader(8) metadata is missing!\n"); #ifdef DEV_ISA +#ifdef DEV_ATPIC elcr_probe(); atpic_startup(); +#else + /* Reset and mask the atpics and leave them shut down. */ + atpic_reset(); + + /* + * Point the ICU spurious interrupt vectors at the APIC spurious + * interrupt handler. + */ + setidt(IDT_IO_INTS + 7, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL, + GSEL(GCODE_SEL, SEL_KPL)); + setidt(IDT_IO_INTS + 15, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif #endif #ifdef DDB @@ -2971,8 +2986,22 @@ init386(first) printf("WARNING: loader(8) metadata is missing!\n"); #ifdef DEV_ISA +#ifdef DEV_ATPIC elcr_probe(); atpic_startup(); +#else + /* Reset and mask the atpics and leave them shut down. */ + atpic_reset(); + + /* + * Point the ICU spurious interrupt vectors at the APIC spurious + * interrupt handler. + */ + setidt(IDT_IO_INTS + 7, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL, + GSEL(GCODE_SEL, SEL_KPL)); + setidt(IDT_IO_INTS + 15, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif #endif #ifdef DDB Modified: head/sys/i386/include/intr_machdep.h ============================================================================== --- head/sys/i386/include/intr_machdep.h Fri Mar 9 19:22:31 2012 (r232743) +++ head/sys/i386/include/intr_machdep.h Fri Mar 9 19:42:48 2012 (r232744) @@ -123,6 +123,9 @@ struct trapframe; extern struct mtx icu_lock; extern int elcr_found; +#ifndef DEV_ATPIC +void atpic_reset(void); +#endif /* XXX: The elcr_* prototypes probably belong somewhere else. */ int elcr_probe(void); enum intr_trigger elcr_read_trigger(u_int irq); From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 20:34:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFFA01065674; Fri, 9 Mar 2012 20:34:31 +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 B17C98FC0C; Fri, 9 Mar 2012 20:34: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 q29KYVxm024018; Fri, 9 Mar 2012 20:34:31 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29KYVjv024014; Fri, 9 Mar 2012 20:34:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203092034.q29KYVjv024014@svn.freebsd.org> From: Dimitry Andric Date: Fri, 9 Mar 2012 20:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232745 - in head/sys: powerpc/include sparc64/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 20:34:32 -0000 Author: dim Date: Fri Mar 9 20:34:31 2012 New Revision: 232745 URL: http://svn.freebsd.org/changeset/base/232745 Log: Add casts to __uint16_t to the __bswap16() macros on all arches which didn't already have them. This is because the ternary expression will return int, due to the Usual Arithmetic Conversions. Such casts are not needed for the 32 and 64 bit variants. While here, add additional parentheses around the x86 variant, to protect against unintended consequences. MFC after: 2 weeks Modified: head/sys/powerpc/include/endian.h head/sys/sparc64/include/endian.h head/sys/x86/include/endian.h Modified: head/sys/powerpc/include/endian.h ============================================================================== --- head/sys/powerpc/include/endian.h Fri Mar 9 19:42:48 2012 (r232744) +++ head/sys/powerpc/include/endian.h Fri Mar 9 20:34:31 2012 (r232745) @@ -124,8 +124,8 @@ __bswap64_var(__uint64_t _x) ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); } -#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x)) +#define __bswap16(x) ((__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \ + __bswap16_var(x))) #define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ __bswap32_var(x)) #define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ Modified: head/sys/sparc64/include/endian.h ============================================================================== --- head/sys/sparc64/include/endian.h Fri Mar 9 19:42:48 2012 (r232744) +++ head/sys/sparc64/include/endian.h Fri Mar 9 20:34:31 2012 (r232745) @@ -109,8 +109,8 @@ __bswap64_var(__uint64_t _x) ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); } -#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x)) +#define __bswap16(x) ((__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \ + __bswap16_var(x))) #define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ __bswap32_var(x)) #define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ Modified: head/sys/x86/include/endian.h ============================================================================== --- head/sys/x86/include/endian.h Fri Mar 9 19:42:48 2012 (r232744) +++ head/sys/x86/include/endian.h Fri Mar 9 20:34:31 2012 (r232745) @@ -71,8 +71,8 @@ #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P #define __bswap16(x) \ - (__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)) + ((__uint16_t)(__builtin_constant_p(x) ? \ + __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) #define __bswap32(x) \ (__builtin_constant_p(x) ? \ __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 20:43:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C01C106564A; Fri, 9 Mar 2012 20:43:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85DBA8FC18; Fri, 9 Mar 2012 20:43: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 q29KhUZe024378; Fri, 9 Mar 2012 20:43:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29KhUWF024372; Fri, 9 Mar 2012 20:43:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201203092043.q29KhUWF024372@svn.freebsd.org> From: John Baldwin Date: Fri, 9 Mar 2012 20:43: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: r232747 - in head/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 20:43:30 -0000 Author: jhb Date: Fri Mar 9 20:43:29 2012 New Revision: 232747 URL: http://svn.freebsd.org/changeset/base/232747 Log: Move i386's intr_machdep.c to the x86 tree and share it with amd64. Added: head/sys/x86/x86/intr_machdep.c - copied, changed from r232744, head/sys/i386/i386/intr_machdep.c Deleted: head/sys/amd64/amd64/intr_machdep.c head/sys/i386/i386/intr_machdep.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Mar 9 20:41:42 2012 (r232746) +++ head/sys/conf/files.amd64 Fri Mar 9 20:43:29 2012 (r232747) @@ -112,7 +112,6 @@ amd64/amd64/gdb_machdep.c optional gdb amd64/amd64/identcpu.c standard amd64/amd64/in_cksum.c optional inet | inet6 amd64/amd64/initcpu.c standard -amd64/amd64/intr_machdep.c standard amd64/amd64/io.c optional io amd64/amd64/legacy.c standard amd64/amd64/locore.S standard no-obj @@ -475,6 +474,7 @@ x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard +x86/x86/intr_machdep.c standard x86/x86/io_apic.c standard x86/x86/local_apic.c standard x86/x86/mca.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Mar 9 20:41:42 2012 (r232746) +++ head/sys/conf/files.i386 Fri Mar 9 20:43:29 2012 (r232747) @@ -405,7 +405,6 @@ i386/i386/i686_mem.c optional mem i386/i386/identcpu.c standard i386/i386/in_cksum.c optional inet | inet6 i386/i386/initcpu.c standard -i386/i386/intr_machdep.c standard i386/i386/io.c optional io i386/i386/k6_mem.c optional mem i386/i386/legacy.c optional native @@ -527,6 +526,7 @@ x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard +x86/x86/intr_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Fri Mar 9 20:41:42 2012 (r232746) +++ head/sys/conf/files.pc98 Fri Mar 9 20:43:29 2012 (r232747) @@ -144,7 +144,6 @@ i386/i386/i686_mem.c optional mem i386/i386/identcpu.c standard i386/i386/in_cksum.c optional inet | inet6 i386/i386/initcpu.c standard -i386/i386/intr_machdep.c standard i386/i386/io.c optional io i386/i386/k6_mem.c optional mem i386/i386/legacy.c standard @@ -251,6 +250,7 @@ x86/isa/isa.c optional isa x86/pci/pci_bus.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard +x86/x86/intr_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard Copied and modified: head/sys/x86/x86/intr_machdep.c (from r232744, head/sys/i386/i386/intr_machdep.c) ============================================================================== --- head/sys/i386/i386/intr_machdep.c Fri Mar 9 19:42:48 2012 (r232744, copy source) +++ head/sys/x86/x86/intr_machdep.c Fri Mar 9 20:43:29 2012 (r232747) @@ -30,7 +30,7 @@ */ /* - * Machine dependent interrupt code for i386. For the i386, we have to + * Machine dependent interrupt code for x86. For x86, we have to * deal with different PICs. Thus, we use the passed in vector to lookup * an interrupt source associated with that vector. The interrupt source * describes which PIC the source belongs to and includes methods to handle From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 20:50:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57C43106566C; Fri, 9 Mar 2012 20:50:16 +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 4425A8FC0C; Fri, 9 Mar 2012 20:50: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 q29KoGNN024710; Fri, 9 Mar 2012 20:50:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29KoGHI024708; Fri, 9 Mar 2012 20:50:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203092050.q29KoGHI024708@svn.freebsd.org> From: Dimitry Andric Date: Fri, 9 Mar 2012 20:50: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: r232748 - head/usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 20:50:16 -0000 Author: dim Date: Fri Mar 9 20:50:15 2012 New Revision: 232748 URL: http://svn.freebsd.org/changeset/base/232748 Log: After r232745, which makes sure __bswap16(), ntohs() and htons() return __uint16_t, we can partially undo r228668. Note the remark "Work around a clang false positive with format string warnings and ntohs macros (see LLVM PR 11313)" was actually incorrect. Before r232745, on some arches, the ntohs() macros did in fact return int, not uint16_t, so clang was right in warning about the %hu format string. MFC after: 2 weeks Modified: head/usr.bin/netstat/Makefile Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Fri Mar 9 20:43:29 2012 (r232747) +++ head/usr.bin/netstat/Makefile Fri Mar 9 20:50:15 2012 (r232748) @@ -8,9 +8,6 @@ SRCS= if.c inet.c main.c mbuf.c mroute.c unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 -# XXX: Work around a clang false positive with format string warnings -# and ntohs macros (see LLVM PR 11313). -NO_WFORMAT.clang= CFLAGS+=-fno-strict-aliasing CFLAGS+=-DIPSEC From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 21:02:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B244106566B; Fri, 9 Mar 2012 21:02:40 +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 076768FC12; Fri, 9 Mar 2012 21:02: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 q29L2dj9025157; Fri, 9 Mar 2012 21:02:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29L2d3T025154; Fri, 9 Mar 2012 21:02:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201203092102.q29L2d3T025154@svn.freebsd.org> From: Dimitry Andric Date: Fri, 9 Mar 2012 21: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: r232749 - head/sbin/fsdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 21:02:40 -0000 Author: dim Date: Fri Mar 9 21:02:39 2012 New Revision: 232749 URL: http://svn.freebsd.org/changeset/base/232749 Log: Partially undo r228693, by removing NO_WFORMAT.clang in fsdb's Makefile, and fixing the format string in sbin/fsdb/fsdbutil.c instead. Note the remark "Work around a problem with format string warnings and ntohs macros" was actually incorrect. The DIP(dp, di_nlink) macro invocation actually returned an int, due to its ternary expression, even though the di_nlink members of struct ufs1_dinode and struct ufs2_dinode are both defined as int16_t. MFC after: 2 weeks Modified: head/sbin/fsdb/Makefile head/sbin/fsdb/fsdbutil.c Modified: head/sbin/fsdb/Makefile ============================================================================== --- head/sbin/fsdb/Makefile Fri Mar 9 20:50:15 2012 (r232748) +++ head/sbin/fsdb/Makefile Fri Mar 9 21:02:39 2012 (r232749) @@ -9,8 +9,6 @@ SRCS= fsdb.c fsdbutil.c \ pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c CFLAGS+= -I${.CURDIR}/../fsck_ffs WARNS?= 2 -# Work around a problem with format string warnings and ntohs macros. -NO_WFORMAT.clang= LDADD= -ledit -ltermcap DPADD= ${LIBEDIT} ${LIBTERMCAP} .PATH: ${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Fri Mar 9 20:50:15 2012 (r232748) +++ head/sbin/fsdb/fsdbutil.c Fri Mar 9 21:02:39 2012 (r232749) @@ -193,7 +193,7 @@ printstat(const char *cp, ino_t inum, un blocks = DIP(dp, di_blocks); gen = DIP(dp, di_gen); - printf("LINKCNT=%hd FLAGS=%#x BLKCNT=%jx GEN=%jx\n", DIP(dp, di_nlink), + printf("LINKCNT=%d FLAGS=%#x BLKCNT=%jx GEN=%jx\n", DIP(dp, di_nlink), DIP(dp, di_flags), (intmax_t)blocks, (intmax_t)gen); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 21:31:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 683D21065670; Fri, 9 Mar 2012 21:31:13 +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 540278FC17; Fri, 9 Mar 2012 21:31: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 q29LVD3w026113; Fri, 9 Mar 2012 21:31:13 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29LVDBa026111; Fri, 9 Mar 2012 21:31:13 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201203092131.q29LVDBa026111@svn.freebsd.org> From: Peter Holm Date: Fri, 9 Mar 2012 21:31: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: r232750 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 21:31:13 -0000 Author: pho Date: Fri Mar 9 21:31:12 2012 New Revision: 232750 URL: http://svn.freebsd.org/changeset/base/232750 Log: Perform the parameter validation before assigning it to a signed int variable. This fixes the problem seen with readdir(3) fuzzing. Submitted by: bde MFC after: 1 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Mar 9 21:02:39 2012 (r232749) +++ head/sys/kern/vfs_syscalls.c Fri Mar 9 21:31:12 2012 (r232750) @@ -4153,9 +4153,9 @@ kern_getdirentries(struct thread *td, in int error, eofflag; AUDIT_ARG_FD(fd); - auio.uio_resid = count; - if (auio.uio_resid > IOSIZE_MAX) + if (count > IOSIZE_MAX) return (EINVAL); + auio.uio_resid = count; if ((error = getvnode(td->td_proc->p_fd, fd, CAP_READ | CAP_SEEK, &fp)) != 0) return (error); From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 21:34:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BC91106564A; Fri, 9 Mar 2012 21:34:41 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id B830E8FC08; Fri, 9 Mar 2012 21:34:40 +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 AA7A725D3A05; Fri, 9 Mar 2012 21:34:39 +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 E6844BDD0CF; Fri, 9 Mar 2012 21:34:38 +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 gAZIYddTgI7N; Fri, 9 Mar 2012 21:34:37 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 9C592BDD0CE; Fri, 9 Mar 2012 21:34:37 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201203091605.q29G5B5i014414@svn.freebsd.org> Date: Fri, 9 Mar 2012 21:34:36 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <81876B03-323E-43FC-BB99-4F1BECECD9AD@lists.zabbadoz.net> References: <201203091605.q29G5B5i014414@svn.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232727 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 21:34:41 -0000 On 9. Mar 2012, at 16:05 , John Baldwin wrote: > Author: jhb > Date: Fri Mar 9 16:05:11 2012 > New Revision: 232727 > URL: http://svn.freebsd.org/changeset/base/232727 >=20 > Log: > Remove PAE special-case 2GB DMA boundary and always use a 4GB = boundary > now that DMA tags in PAE kernels support 4GB boundaries. >=20 > Reviewed by: yongari >=20 > Modified: > head/sys/dev/bge/if_bgereg.h >=20 ie63 XEN and PAE at least failed. /scratch/tmp/bz/head.svn/sys/modules/bge/../../dev/bge/if_bge.c: In = function 'bge_dma_alloc': /scratch/tmp/bz/head.svn/sys/modules/bge/../../dev/bge/if_bge.c:2607: = warning: large integer implicitly truncated to unsigned type = [-Woverflow] > Modified: head/sys/dev/bge/if_bgereg.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/bge/if_bgereg.h Fri Mar 9 15:42:47 2012 = (r232726) > +++ head/sys/dev/bge/if_bgereg.h Fri Mar 9 16:05:11 2012 = (r232727) > @@ -2691,15 +2691,11 @@ struct bge_gib { > #define BGE_DMA_MAXADDR 0xFFFFFFFFFF > #endif >=20 > -#ifdef PAE > -#define BGE_DMA_BNDRY 0x80000000 > -#else > #if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) > #define BGE_DMA_BNDRY 0x100000000 > #else > #define BGE_DMA_BNDRY 0 > #endif > -#endif >=20 > /* > * Ring structures. Most of these reside in host memory and we tell --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 22:30:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 744161065672; Fri, 9 Mar 2012 22:30:55 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F71D8FC17; Fri, 9 Mar 2012 22:30:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q29MUtnB027919; Fri, 9 Mar 2012 22:30:55 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29MUttU027917; Fri, 9 Mar 2012 22:30:55 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203092230.q29MUttU027917@svn.freebsd.org> From: Juli Mallett Date: Fri, 9 Mar 2012 22:30: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: r232751 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 22:30:55 -0000 Author: jmallett Date: Fri Mar 9 22:30:54 2012 New Revision: 232751 URL: http://svn.freebsd.org/changeset/base/232751 Log: Export intrcnt correctly when running under 32-bit compatibility. Reviewed by: gonzo, nwhitehorn Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Fri Mar 9 21:31:12 2012 (r232750) +++ head/sys/kern/kern_intr.c Fri Mar 9 22:30:54 2012 (r232751) @@ -1881,6 +1881,24 @@ SYSCTL_PROC(_hw, OID_AUTO, intrnames, CT static int sysctl_intrcnt(SYSCTL_HANDLER_ARGS) { +#ifdef SCTL_MASK32 + uint32_t *intrcnt32; + unsigned i; + int error; + + if (req->flags & SCTL_MASK32) { + if (!req->oldptr) + return (sysctl_handle_opaque(oidp, NULL, sintrcnt / 2, req)); + intrcnt32 = malloc(sintrcnt / 2, M_TEMP, M_NOWAIT); + if (intrcnt32 == NULL) + return (ENOMEM); + for (i = 0; i < sintrcnt / sizeof (u_long); i++) + intrcnt32[i] = intrcnt[i]; + error = sysctl_handle_opaque(oidp, intrcnt32, sintrcnt / 2, req); + free(intrcnt32, M_TEMP); + return (error); + } +#endif return (sysctl_handle_opaque(oidp, intrcnt, sintrcnt, req)); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 22:35:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5CA1106564A; Fri, 9 Mar 2012 22:35:06 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from groupware.itac.at (groupware.itac.at [91.205.172.99]) by mx1.freebsd.org (Postfix) with ESMTP id 6DB8A8FC19; Fri, 9 Mar 2012 22:35:06 +0000 (UTC) Received: from home.bluelife.at (93.104.210.95) by groupware.itac.at (Axigen) with (AES256-SHA encrypted) ESMTPSA id 358E0C; Fri, 9 Mar 2012 23:20:11 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 09 Mar 2012 23:19:59 +0100 From: Bernhard Froehlich To: Tijl Coosemans In-Reply-To: <201203051350.09141.tijl@freebsd.org> References: <201202281838.q1SIcYhE082928@svn.freebsd.org> <201203041351.22847.jhb@freebsd.org> <4F53DF10.5080303@gmail.com> <201203051350.09141.tijl@freebsd.org> Message-ID: <5e7563232fffb2ad1181f8d942a5b585@bluelife.at> X-Sender: decke@FreeBSD.org User-Agent: Roundcube Webmail/0.7.1 X-AxigenSpam-Level: 1 X-CTCH-RefID: str=0001.0A0B020B.4F5A820F.008C,ss=1,fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown Cc: svn-src-head@freebsd.org, Andrey Kosachenko , svn-src-all@freebsd.org, emulation@freebsd.org, src-committers@freebsd.org Subject: Re: virtualbox fix for recent current (was Re: svn commit: r232264 - in head/sys: amd64/include i386/include pc98/include x86/include) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 22:35:07 -0000 On 05.03.2012 13:50, Tijl Coosemans wrote: >> >> -Wp,-MD,/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o.dep >> >> -Wp,-MT,/usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o >> -Wp,-MP -o >> >> /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/out/freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.o >> >> /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.1.8_OSE/src/VBox/VMM/testcase/tstVMStructRC.cpp >> kmk: *** Waiting for unfinished jobs.... >> kmk: *** Exiting with status 2 >> *** [do-build] Error code 2 >> >> Stop in /usr/ports/emulators/virtualbox-ose. >> *** [build] Error code 1 >> >> Stop in /usr/ports/emulators/virtualbox-ose. >> --- Thanks! The patch has been committed now. -- Bernhard Froehlich http://www.bluelife.at/ From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 22:41:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46EEC1065674; Fri, 9 Mar 2012 22:41:10 +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 31DAD8FC14; Fri, 9 Mar 2012 22:41: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 q29MfAZs028347; Fri, 9 Mar 2012 22:41:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29Mf9V1028345; Fri, 9 Mar 2012 22:41:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203092241.q29Mf9V1028345@svn.freebsd.org> From: Adrian Chadd Date: Fri, 9 Mar 2012 22:41: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: r232752 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 22:41:10 -0000 Author: adrian Date: Fri Mar 9 22:41:09 2012 New Revision: 232752 URL: http://svn.freebsd.org/changeset/base/232752 Log: Should the mcast queue be locked here? In case more multicast traffic comes along? This commit was brought to you via an Atheros AR5210, associated to an 3x3 HT40 11na access point. Yes, this driver still works with it. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Mar 9 22:30:54 2012 (r232751) +++ head/sys/dev/ath/if_ath.c Fri Mar 9 22:41:09 2012 (r232752) @@ -3059,7 +3059,9 @@ ath_beacon_generate(struct ath_softc *sc */ bf = avp->av_bcbuf; m = bf->bf_m; + /* XXX lock mcastq? */ nmcastq = avp->av_mcastq.axq_depth; + if (ieee80211_beacon_update(bf->bf_node, &avp->av_boff, m, nmcastq)) { /* XXX too conservative? */ bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 22:58:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8203B106566C; Fri, 9 Mar 2012 22:58:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 542A58FC08; Fri, 9 Mar 2012 22:58: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 q29MwZBn028904; Fri, 9 Mar 2012 22:58:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29MwZBX028902; Fri, 9 Mar 2012 22:58:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203092258.q29MwZBX028902@svn.freebsd.org> From: Adrian Chadd Date: Fri, 9 Mar 2012 22:58: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: r232753 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 22:58:35 -0000 Author: adrian Date: Fri Mar 9 22:58:34 2012 New Revision: 232753 URL: http://svn.freebsd.org/changeset/base/232753 Log: Document that we may end up with some suboptimal handling of data frames with stations in power saving mode. I'm not (yet) sure how to handle TX'ing aggregates frames to stations that are in power saving mode, or whether that's even a feasible thing to do. So in order to (mostly) not forget, leave a couple of comments in the code. The code presently assumes that the aggregation TID state for an ath_node is locked not by the ath_node lock or a node+TID lock, but behind the hardware queue said TID maps to. This assumption is going to be incorrect for stations in power saving mode as we'll be TX'ing frames on the multicast queue. In any case, I'm afraid its a "later problem". :/ Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Fri Mar 9 22:41:09 2012 (r232752) +++ head/sys/dev/ath/if_ath_tx.c Fri Mar 9 22:58:34 2012 (r232753) @@ -1162,6 +1162,11 @@ ath_tx_normal_setup(struct ath_softc *sc * (or) if there is some mcast data waiting on the mcast * queue (to prevent out of order delivery) multicast * frames must be buffered until after the beacon. + * + * XXX This likely means that if there's a station in power + * save mode, we won't be doing any kind of aggregation towards + * anyone. This is likely a very suboptimal way of dealing + * with things. */ if (ismcast && (vap->iv_ps_sta || avp->av_mcastq.axq_depth)) txq = &avp->av_mcastq; @@ -1409,6 +1414,12 @@ ath_tx_start(struct ath_softc *sc, struc if (ismcast) txq = &avp->av_mcastq; + /* + * XXX This likely means that if there's a station in power + * save mode, we won't be doing any kind of aggregation towards + * anyone. This is likely a very suboptimal way of dealing + * with things. + */ if ((! is_ampdu) && (vap->iv_ps_sta || avp->av_mcastq.axq_depth)) txq = &avp->av_mcastq; From owner-svn-src-head@FreeBSD.ORG Fri Mar 9 23:30:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4A971065670; Fri, 9 Mar 2012 23:30:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3F278FC0A; Fri, 9 Mar 2012 23:30: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 q29NUU64029982; Fri, 9 Mar 2012 23:30:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q29NUUWl029979; Fri, 9 Mar 2012 23:30:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201203092330.q29NUUWl029979@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 9 Mar 2012 23:30: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: r232754 - in head: share/mk sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2012 23:30:30 -0000 Author: jkim Date: Fri Mar 9 23:30:30 2012 New Revision: 232754 URL: http://svn.freebsd.org/changeset/base/232754 Log: Make boot2 build with Clang again. Submitted by: dim (bsd.sys.mk) Reviewed by: dim, jhb Modified: head/share/mk/bsd.sys.mk head/sys/boot/i386/boot2/boot2.c Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Mar 9 22:58:34 2012 (r232753) +++ head/share/mk/bsd.sys.mk Fri Mar 9 23:30:30 2012 (r232754) @@ -100,8 +100,10 @@ CWARNFLAGS += -Wno-unknown-pragmas .if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" CLANG_NO_IAS = -no-integrated-as -CLANG_OPT_SMALL = -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 \ - -mllvm -enable-load-pre=false +CLANG_OPT_SMALL = -mllvm -stack-alignment=8 \ + -mllvm -inline-threshold=3 \ + -mllvm -enable-load-pre=false \ + -mllvm -simplifycfg-dup-ret .endif .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Fri Mar 9 22:58:34 2012 (r232753) +++ head/sys/boot/i386/boot2/boot2.c Fri Mar 9 23:30:30 2012 (r232754) @@ -129,8 +129,8 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname; -static uint32_t opts; +static const char *kname = NULL; +static uint32_t opts = 0; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -225,8 +225,6 @@ main(void) ino_t ino; size_t nbyte; - opts = 0; - kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 04:02:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4F831065670; Sat, 10 Mar 2012 04:02:52 +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 C46C68FC0C; Sat, 10 Mar 2012 04:02: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 q2A42qVv038832; Sat, 10 Mar 2012 04:02:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A42qwA038830; Sat, 10 Mar 2012 04:02:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203100402.q2A42qwA038830@svn.freebsd.org> From: Adrian Chadd Date: Sat, 10 Mar 2012 04:02: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: r232763 - head/sys/dev/wtap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 04:02:52 -0000 Author: adrian Date: Sat Mar 10 04:02:52 2012 New Revision: 232763 URL: http://svn.freebsd.org/changeset/base/232763 Log: Enforce that wtap requires VIMAGE to be useful. Modified: head/sys/dev/wtap/if_wtap.c Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Sat Mar 10 02:58:15 2012 (r232762) +++ head/sys/dev/wtap/if_wtap.c Sat Mar 10 04:02:52 2012 (r232763) @@ -40,6 +40,13 @@ #include #include "if_medium.h" +/* + * This _requires_ vimage to be useful. + */ +#ifndef VIMAGE +#error if_wtap requires VIMAGE. +#endif /* VIMAGE */ + /* device for IOCTL and read/write for debuggin purposes */ /* Function prototypes */ static d_open_t wtap_node_open; From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 04:14:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B363106564A; Sat, 10 Mar 2012 04:14: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 89CBE8FC19; Sat, 10 Mar 2012 04:14: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 q2A4E4FN039201; Sat, 10 Mar 2012 04:14:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A4E4n5039195; Sat, 10 Mar 2012 04:14:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203100414.q2A4E4n5039195@svn.freebsd.org> From: Adrian Chadd Date: Sat, 10 Mar 2012 04:14: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: r232764 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 04:14:04 -0000 Author: adrian Date: Sat Mar 10 04:14:04 2012 New Revision: 232764 URL: http://svn.freebsd.org/changeset/base/232764 Log: Don't flood the cabq/mcastq with frames. In a very noisy 2.4GHz environment (with HT/40 enabled, making it worse) I saw the following occur: * the air was considered "busy" a lot of the time; * the cabq time is quite short due to staggered beacons being enabled; * it just wasn't able to keep up TX'ing CABQ frames; * .. and the cabq would swallow up all the TX ath_buf's. This patch introduces a twiddle which allows the maximum cabq depth to be set, forcing further frames to be dropped. It defaults to the TX buffer count at the moment, so the default behaviour isn't changed. I've also started fleshing out a similar setup for the data path, so it doesn't swallow up all the available TX buffers and preventing management frames (such as ADDBA) out. PR: kern/165895 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athioctl.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Mar 10 04:02:52 2012 (r232763) +++ head/sys/dev/ath/if_ath.c Sat Mar 10 04:14:04 2012 (r232764) @@ -637,6 +637,19 @@ ath_attach(u_int16_t devid, struct ath_s #endif /* + * TODO: enforce that at least this many frames are available + * in the txbuf list before allowing data frames (raw or + * otherwise) to be transmitted. + */ + sc->sc_txq_data_minfree = 10; + /* + * Leave this as default to maintain legacy behaviour. + * Shortening the cabq/mcastq may end up causing some + * undesirable behaviour. + */ + sc->sc_txq_mcastq_maxdepth = ath_txbuf; + + /* * Allow the TX and RX chainmasks to be overridden by * environment variables and/or device.hints. * Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Sat Mar 10 04:02:52 2012 (r232763) +++ head/sys/dev/ath/if_ath_sysctl.c Sat Mar 10 04:14:04 2012 (r232764) @@ -605,6 +605,17 @@ ath_sysctlattach(struct ath_softc *sc) "tid_hwq_hi", CTLFLAG_RW, &sc->sc_tid_hwq_hi, 0, ""); +#if 0 + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "txq_data_minfree", CTLFLAG_RW, &sc->sc_txq_data_minfree, + 0, "Minimum free buffers before adding a data frame" + " to the TX queue"); +#endif + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "txq_mcastq_maxdepth", CTLFLAG_RW, + &sc->sc_txq_mcastq_maxdepth, 0, + "Maximum buffer depth for multicast/broadcast frames"); + #ifdef IEEE80211_SUPPORT_TDMA if (ath_hal_macversion(ah) > 0x78) { sc->sc_tdmadbaprep = 2; @@ -885,7 +896,10 @@ ath_sysctl_stats_attach(struct ath_softc &sc->sc_stats.ast_rx_intr, 0, "RX interrupts"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_intr", CTLFLAG_RD, &sc->sc_stats.ast_tx_intr, 0, "TX interrupts"); - + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_mcastq_overflow", + CTLFLAG_RD, &sc->sc_stats.ast_tx_mcastq_overflow, 0, + "Number of multicast frames exceeding maximum mcast queue depth"); + /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); } Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Mar 10 04:02:52 2012 (r232763) +++ head/sys/dev/ath/if_ath_tx.c Sat Mar 10 04:14:04 2012 (r232764) @@ -1369,7 +1369,7 @@ ath_tx_start(struct ath_softc *sc, struc { struct ieee80211vap *vap = ni->ni_vap; struct ath_vap *avp = ATH_VAP(vap); - int r; + int r = 0; u_int pri; int tid; struct ath_txq *txq; @@ -1402,6 +1402,30 @@ ath_tx_start(struct ath_softc *sc, struc type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + /* + * Enforce how deep the multicast queue can grow. + * + * XXX duplicated in ath_raw_xmit(). + */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + ATH_TXQ_LOCK(sc->sc_cabq); + ATH_TXQ_LOCK(&avp->av_mcastq); + + if ((sc->sc_cabq->axq_depth + avp->av_mcastq.axq_depth) > + sc->sc_txq_mcastq_maxdepth) { + sc->sc_stats.ast_tx_mcastq_overflow++; + r = ENOBUFS; + } + + ATH_TXQ_UNLOCK(&avp->av_mcastq); + ATH_TXQ_UNLOCK(sc->sc_cabq); + + if (r != 0) { + m_freem(m0); + return r; + } + } + /* A-MPDU TX */ is_ampdu_tx = ath_tx_ampdu_running(sc, ATH_NODE(ni), tid); is_ampdu_pending = ath_tx_ampdu_pending(sc, ATH_NODE(ni), tid); @@ -1734,7 +1758,10 @@ ath_raw_xmit(struct ieee80211_node *ni, struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; struct ath_buf *bf; - int error; + struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); + struct ieee80211vap *vap = ni->ni_vap; + struct ath_vap *avp = ATH_VAP(vap); + int error = 0; ATH_PCU_LOCK(sc); if (sc->sc_inreset_cnt > 0) { @@ -1755,6 +1782,31 @@ ath_raw_xmit(struct ieee80211_node *ni, error = ENETDOWN; goto bad; } + + /* + * Enforce how deep the multicast queue can grow. + * + * XXX duplicated in ath_tx_start(). + */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + ATH_TXQ_LOCK(sc->sc_cabq); + ATH_TXQ_LOCK(&avp->av_mcastq); + + if ((sc->sc_cabq->axq_depth + avp->av_mcastq.axq_depth) > + sc->sc_txq_mcastq_maxdepth) { + sc->sc_stats.ast_tx_mcastq_overflow++; + error = ENOBUFS; + } + + ATH_TXQ_UNLOCK(&avp->av_mcastq); + ATH_TXQ_UNLOCK(sc->sc_cabq); + + if (error != 0) { + m_freem(m); + goto bad; + } + } + /* * Grab a TX buffer and associated resources. */ Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Sat Mar 10 04:02:52 2012 (r232763) +++ head/sys/dev/ath/if_athioctl.h Sat Mar 10 04:14:04 2012 (r232764) @@ -155,7 +155,8 @@ struct ath_stats { u_int32_t ast_rx_intr; 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]; + u_int32_t ast_tx_mcastq_overflow; /* multicast queue overflow */ + u_int32_t ast_pad[1]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Mar 10 04:02:52 2012 (r232763) +++ head/sys/dev/ath/if_athvar.h Sat Mar 10 04:14:04 2012 (r232764) @@ -530,6 +530,31 @@ struct ath_softc { int sc_txchainmask; /* currently configured TX chainmask */ int sc_rxchainmask; /* currently configured RX chainmask */ + /* Queue limits */ + + /* + * To avoid queue starvation in congested conditions, + * these parameters tune the maximum number of frames + * queued to the data/mcastq before they're dropped. + * + * This is to prevent: + * + a single destination overwhelming everything, including + * management/multicast frames; + * + multicast frames overwhelming everything (when the + * air is sufficiently busy that cabq can't drain.) + * + * These implement: + * + data_minfree is the maximum number of free buffers + * overall to successfully allow a data frame. + * + * + mcastq_maxdepth is the maximum depth allowe dof the avp+cabq + * queue. The avp is included in each comparison just to be + * a little overly conservative and this may end up being + * unhelpful with multiple VAPs. + */ + int sc_txq_data_minfree; + int sc_txq_mcastq_maxdepth; + /* * Aggregation twiddles * From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 05:38:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BBB54106566B; Sat, 10 Mar 2012 05:38:04 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA8848FC14; Sat, 10 Mar 2012 05:38: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 q2A5c4HX041838; Sat, 10 Mar 2012 05:38:04 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A5c4XF041836; Sat, 10 Mar 2012 05:38:04 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203100538.q2A5c4XF041836@svn.freebsd.org> From: Juli Mallett Date: Sat, 10 Mar 2012 05:38: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: r232765 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 05:38:04 -0000 Author: jmallett Date: Sat Mar 10 05:38:04 2012 New Revision: 232765 URL: http://svn.freebsd.org/changeset/base/232765 Log: o) Bump INTRCOUNT_COUNT to 256, since Octeon already has >128. XXX It would be good to use a better way to size intrcnt. o) Fix literal 4s that are supposed to be sizeof (u_long). XXX Why the * 2 here? Is this an artifact of a different system that this code came from? We seem to allocate twice as much space for intrcnt as we admit to in sintrcnt. Modified: head/sys/mips/mips/exception.S Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Sat Mar 10 04:14:04 2012 (r232764) +++ head/sys/mips/mips/exception.S Sat Mar 10 05:38:04 2012 (r232765) @@ -71,7 +71,7 @@ /* * Reasonable limit */ -#define INTRCNT_COUNT 128 +#define INTRCNT_COUNT 256 /* @@ -1188,14 +1188,14 @@ sintrnames: .int INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 #endif - .align 4 + .align (_MIPS_SZLONG / 8) intrcnt: - .space INTRCNT_COUNT * 4 * 2 + .space INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 sintrcnt: #ifdef __mips_n64 - .quad INTRCNT_COUNT * 4 * 2 + .quad INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 #else - .int INTRCNT_COUNT * 4 * 2 + .int INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 #endif From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 06:12:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7410106568B; Sat, 10 Mar 2012 06:12:14 +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 A5EE48FC15; Sat, 10 Mar 2012 06:12: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 q2A6CEb0042892; Sat, 10 Mar 2012 06:12:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A6CE1I042889; Sat, 10 Mar 2012 06:12:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201203100612.q2A6CE1I042889@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 10 Mar 2012 06:12: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: r232766 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 06:12:14 -0000 Author: yongari Date: Sat Mar 10 06:12:14 2012 New Revision: 232766 URL: http://svn.freebsd.org/changeset/base/232766 Log: After r232403, DMA transactions does not cross 4GB boundary for all PCI devices. Remove driver workaround for 4GB boundary issue. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sat Mar 10 05:38:04 2012 (r232765) +++ head/sys/dev/bge/if_bge.c Sat Mar 10 06:12:14 2012 (r232766) @@ -2457,14 +2457,10 @@ bge_dma_ring_alloc(struct bge_softc *sc, bus_addr_t *paddr, const char *msg) { struct bge_dmamap_arg ctx; - bus_addr_t lowaddr; - bus_size_t ring_end; int error; - lowaddr = BUS_SPACE_MAXADDR; -again: error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - alignment, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, + alignment, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, maxsize, 1, maxsize, 0, NULL, NULL, tag); if (error != 0) { device_printf(sc->bge_dev, @@ -2489,25 +2485,6 @@ again: return (ENOMEM); } *paddr = ctx.bge_busaddr; - ring_end = *paddr + maxsize; - if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0 && - BGE_ADDR_HI(*paddr) != BGE_ADDR_HI(ring_end)) { - /* - * 4GB boundary crossed. Limit maximum allowable DMA - * address space to 32bit and try again. - */ - bus_dmamap_unload(*tag, *map); - bus_dmamem_free(*tag, *ring, *map); - bus_dma_tag_destroy(*tag); - if (bootverbose) - device_printf(sc->bge_dev, "4GB boundary crossed, " - "limit DMA address space to 32bit for %s\n", msg); - *ring = NULL; - *tag = NULL; - *map = NULL; - lowaddr = BUS_SPACE_MAXADDR_32BIT; - goto again; - } return (0); } @@ -2515,7 +2492,7 @@ static int bge_dma_alloc(struct bge_softc *sc) { bus_addr_t lowaddr; - bus_size_t boundary, sbsz, rxmaxsegsz, txsegsz, txmaxsegsz; + bus_size_t rxmaxsegsz, sbsz, txsegsz, txmaxsegsz; int i, error; lowaddr = BUS_SPACE_MAXADDR; @@ -2602,9 +2579,7 @@ bge_dma_alloc(struct bge_softc *sc) } /* Create parent tag for buffers. */ - boundary = 0; if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) { - boundary = BGE_DMA_BNDRY; /* * XXX * watchdog timeout issue was observed on BCM5704 which @@ -2615,10 +2590,10 @@ bge_dma_alloc(struct bge_softc *sc) if (sc->bge_flags & BGE_FLAG_PCIX) lowaddr = BUS_SPACE_MAXADDR_32BIT; } - error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), - 1, boundary, lowaddr, BUS_SPACE_MAXADDR, NULL, - NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, - 0, NULL, NULL, &sc->bge_cdata.bge_buffer_tag); + error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), 1, 0, lowaddr, + BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, + &sc->bge_cdata.bge_buffer_tag); if (error != 0) { device_printf(sc->bge_dev, "could not allocate buffer dma tag\n"); Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Sat Mar 10 05:38:04 2012 (r232765) +++ head/sys/dev/bge/if_bgereg.h Sat Mar 10 06:12:14 2012 (r232766) @@ -2691,12 +2691,6 @@ struct bge_gib { #define BGE_DMA_MAXADDR 0xFFFFFFFFFF #endif -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) -#define BGE_DMA_BNDRY 0x100000000 -#else -#define BGE_DMA_BNDRY 0 -#endif - /* * Ring structures. Most of these reside in host memory and we tell * the NIC where they are via the ring control blocks. The exceptions From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 06:31:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E3E61065672; Sat, 10 Mar 2012 06:31:29 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F17708FC0C; Sat, 10 Mar 2012 06:31: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 q2A6VSpi043549; Sat, 10 Mar 2012 06:31:28 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A6VS0t043547; Sat, 10 Mar 2012 06:31:28 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203100631.q2A6VS0t043547@svn.freebsd.org> From: Juli Mallett Date: Sat, 10 Mar 2012 06:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232767 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 06:31:29 -0000 Author: jmallett Date: Sat Mar 10 06:31:28 2012 New Revision: 232767 URL: http://svn.freebsd.org/changeset/base/232767 Log: Reduce diffs with freebsd32_sysarch. Modified: head/sys/mips/mips/sys_machdep.c Modified: head/sys/mips/mips/sys_machdep.c ============================================================================== --- head/sys/mips/mips/sys_machdep.c Sat Mar 10 06:12:14 2012 (r232766) +++ head/sys/mips/mips/sys_machdep.c Sat Mar 10 06:31:28 2012 (r232767) @@ -53,25 +53,21 @@ struct sysarch_args { #endif int -sysarch(td, uap) - struct thread *td; - register struct sysarch_args *uap; +sysarch(struct thread *td, struct sysarch_args *uap) { int error; void *tlsbase; switch (uap->op) { - case MIPS_SET_TLS : - td->td_md.md_tls = (void*)uap->parms; - error = 0; - break; - - case MIPS_GET_TLS : + case MIPS_SET_TLS: + td->td_md.md_tls = uap->parms; + return (0); + case MIPS_GET_TLS: tlsbase = td->td_md.md_tls; error = copyout(&tlsbase, uap->parms, sizeof(tlsbase)); - break; + return (error); default: - error = EINVAL; + break; } - return (error); + return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 06:43:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AB4C1065673; Sat, 10 Mar 2012 06:43:42 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19F168FC12; Sat, 10 Mar 2012 06:43: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 q2A6hf67043940; Sat, 10 Mar 2012 06:43:41 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A6hfEp043938; Sat, 10 Mar 2012 06:43:41 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203100643.q2A6hfEp043938@svn.freebsd.org> From: Juli Mallett Date: Sat, 10 Mar 2012 06:43: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: r232768 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 06:43:42 -0000 Author: jmallett Date: Sat Mar 10 06:43:41 2012 New Revision: 232768 URL: http://svn.freebsd.org/changeset/base/232768 Log: Don't truncate physical addresses to 32-bits. Modified: head/sys/mips/mips/nexus.c Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Sat Mar 10 06:31:28 2012 (r232767) +++ head/sys/mips/mips/nexus.c Sat Mar 10 06:43:41 2012 (r232768) @@ -383,11 +383,11 @@ nexus_activate_resource(device_t bus, de struct resource *r) { void *vaddr; - u_int32_t paddr, psize; - + vm_paddr_t paddr; + vm_size_t psize; + /* - * If this is a memory resource, track the direct mapping - * in the uncached MIPS KSEG1 segment. + * If this is a memory resource, use pmap_mapdev to map it. */ if (type == SYS_RES_MEMORY) { paddr = rman_get_start(r); From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 06:45:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D201106566B; Sat, 10 Mar 2012 06:45:22 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C14F8FC14; Sat, 10 Mar 2012 06:45: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 q2A6jMaR044069; Sat, 10 Mar 2012 06:45:22 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A6jLXd044067; Sat, 10 Mar 2012 06:45:22 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203100645.q2A6jLXd044067@svn.freebsd.org> From: Juli Mallett Date: Sat, 10 Mar 2012 06:45: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: r232769 - in head/sys: conf mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 06:45:22 -0000 Author: jmallett Date: Sat Mar 10 06:45:21 2012 New Revision: 232769 URL: http://svn.freebsd.org/changeset/base/232769 Log: Get rid of mainbus.c. The version in nexus.c is being used and is perfectly-sufficient and equally-crufty. Deleted: head/sys/mips/mips/mainbus.c Modified: head/sys/conf/files.mips Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sat Mar 10 06:43:41 2012 (r232768) +++ head/sys/conf/files.mips Sat Mar 10 06:45:21 2012 (r232769) @@ -30,7 +30,6 @@ mips/mips/cpu.c standard mips/mips/elf_machdep.c standard mips/mips/exception.S standard mips/mips/gdb_machdep.c standard -# mips/mips/mainbus.c standard mips/mips/pmap.c standard mips/mips/trap.c standard mips/mips/vm_machdep.c standard From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 06:54:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8E791065676; Sat, 10 Mar 2012 06:54:37 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB0A8FC0C; Sat, 10 Mar 2012 06:54: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 q2A6sbna044400; Sat, 10 Mar 2012 06:54:37 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A6sb8s044396; Sat, 10 Mar 2012 06:54:37 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203100654.q2A6sb8s044396@svn.freebsd.org> From: Juli Mallett Date: Sat, 10 Mar 2012 06:54: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: r232770 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 06:54:37 -0000 Author: jmallett Date: Sat Mar 10 06:54:37 2012 New Revision: 232770 URL: http://svn.freebsd.org/changeset/base/232770 Log: o) Remove some CPU_CNMIPS-related magical thinking about the status register's contents for user programs. o) Conditionalize the installation of an XTLB handler on ABI, not CPU family. Modified: head/sys/mips/mips/machdep.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Sat Mar 10 06:45:21 2012 (r232769) +++ head/sys/mips/mips/machdep.c Sat Mar 10 06:54:37 2012 (r232770) @@ -347,8 +347,7 @@ mips_vector_init(void) bcopy(MipsTLBMiss, (void *)MIPS_UTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); -#if defined(CPU_CNMIPS) || defined(CPU_RMI) || defined(CPU_NLM) -/* Fake, but sufficient, for the 32-bit with 64-bit hardware addresses */ +#ifdef __mips_n64 bcopy(MipsTLBMiss, (void *)MIPS_XTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); #endif Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Sat Mar 10 06:45:21 2012 (r232769) +++ head/sys/mips/mips/pm_machdep.c Sat Mar 10 06:54:37 2012 (r232770) @@ -491,10 +491,6 @@ exec_setregs(struct thread *td, struct i #elif defined(__mips_n64) td->td_frame->sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; #endif -#ifdef CPU_CNMIPS - td->td_frame->sr |= MIPS_SR_PX | MIPS_SR_UX | - MIPS_SR_KX | MIPS_SR_SX; -#endif /* * FREEBSD_DEVELOPERS_FIXME: * Setup any other CPU-Specific registers (Not MIPS Standard) Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Sat Mar 10 06:45:21 2012 (r232769) +++ head/sys/mips/mips/vm_machdep.c Sat Mar 10 06:54:37 2012 (r232770) @@ -406,12 +406,7 @@ cpu_set_upcall(struct thread *td, struct pcb2->pcb_context[PCB_REG_S2] = (register_t)(intptr_t)td->td_frame; /* Dont set IE bit in SR. sched lock release will take care of it */ pcb2->pcb_context[PCB_REG_SR] = mips_rd_status() & - (MIPS_SR_KX | MIPS_SR_UX | MIPS_SR_INT_MASK); - -#ifdef CPU_CNMIPS - pcb2->pcb_context[PCB_REG_SR] |= MIPS_SR_COP_0_BIT | - MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX | MIPS_SR_SX; -#endif + (MIPS_SR_PX | MIPS_SR_KX | MIPS_SR_UX | MIPS_SR_INT_MASK); /* * FREEBSD_DEVELOPERS_FIXME: @@ -475,10 +470,6 @@ cpu_set_upcall_kse(struct thread *td, vo #elif defined(__mips_n64) td->td_frame->sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; #endif -#ifdef CPU_CNMIPS - tf->sr |= MIPS_SR_INT_IE | MIPS_SR_COP_0_BIT | MIPS_SR_PX | MIPS_SR_UX | - MIPS_SR_KX; -#endif /* tf->sr |= (ALL_INT_MASK & idle_mask) | SR_INT_ENAB; */ /**XXX the above may now be wrong -- mips2 implements this as panic */ /* From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 07:54:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38F02106566C; Sat, 10 Mar 2012 07:54:42 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 282648FC1A; Sat, 10 Mar 2012 07:54: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 q2A7sgZG046246; Sat, 10 Mar 2012 07:54:42 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A7sgHC046244; Sat, 10 Mar 2012 07:54:42 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203100754.q2A7sgHC046244@svn.freebsd.org> From: Juli Mallett Date: Sat, 10 Mar 2012 07:54: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: r232773 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 07:54:42 -0000 Author: jmallett Date: Sat Mar 10 07:54:41 2012 New Revision: 232773 URL: http://svn.freebsd.org/changeset/base/232773 Log: Use ABI to determine bus_addr_t for cnMIPS. Modified: head/sys/mips/include/_bus.h Modified: head/sys/mips/include/_bus.h ============================================================================== --- head/sys/mips/include/_bus.h Sat Mar 10 07:09:05 2012 (r232772) +++ head/sys/mips/include/_bus.h Sat Mar 10 07:54:41 2012 (r232773) @@ -35,7 +35,7 @@ * Bus address and size types */ #include "opt_cputype.h" -#if !(defined(CPU_CNMIPS) && defined(ISA_MIPS32)) +#if defined(CPU_CNMIPS) && !defined(__mips_n64) typedef uintptr_t bus_addr_t; #else typedef uint64_t bus_addr_t; From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 08:48:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC25106566C; Sat, 10 Mar 2012 08:48:52 +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 8F4398FC0C; Sat, 10 Mar 2012 08:48: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 q2A8mqwd048116; Sat, 10 Mar 2012 08:48:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A8mqLp048114; Sat, 10 Mar 2012 08:48:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203100848.q2A8mqLp048114@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Mar 2012 08:48: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: r232776 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 08:48:52 -0000 Author: kib Date: Sat Mar 10 08:48:52 2012 New Revision: 232776 URL: http://svn.freebsd.org/changeset/base/232776 Log: Add brackets around bare '-1' used as the macro body. Noted by: bde MFC after: 1 week Modified: head/sys/sys/unistd.h Modified: head/sys/sys/unistd.h ============================================================================== --- head/sys/sys/unistd.h Sat Mar 10 08:27:37 2012 (r232775) +++ head/sys/sys/unistd.h Sat Mar 10 08:48:52 2012 (r232776) @@ -52,34 +52,34 @@ #define _POSIX_ADVISORY_INFO 200112L #define _POSIX_ASYNCHRONOUS_IO 0 #define _POSIX_CHOWN_RESTRICTED 1 -#define _POSIX_CLOCK_SELECTION -1 -#define _POSIX_CPUTIME -1 +#define _POSIX_CLOCK_SELECTION (-1) +#define _POSIX_CPUTIME (-1) #define _POSIX_FSYNC 200112L #define _POSIX_IPV6 0 #define _POSIX_JOB_CONTROL 1 #define _POSIX_MAPPED_FILES 200112L -#define _POSIX_MEMLOCK -1 +#define _POSIX_MEMLOCK (-1) #define _POSIX_MEMLOCK_RANGE 200112L #define _POSIX_MEMORY_PROTECTION 200112L #define _POSIX_MESSAGE_PASSING 200112L #define _POSIX_MONOTONIC_CLOCK 200112L #define _POSIX_NO_TRUNC 1 -#define _POSIX_PRIORITIZED_IO -1 +#define _POSIX_PRIORITIZED_IO (-1) #define _POSIX_PRIORITY_SCHEDULING 200112L #define _POSIX_RAW_SOCKETS 200112L #define _POSIX_REALTIME_SIGNALS 200112L #define _POSIX_SEMAPHORES 200112L #define _POSIX_SHARED_MEMORY_OBJECTS 200112L -#define _POSIX_SPORADIC_SERVER -1 -#define _POSIX_SYNCHRONIZED_IO -1 +#define _POSIX_SPORADIC_SERVER (-1) +#define _POSIX_SYNCHRONIZED_IO (-1) #define _POSIX_TIMEOUTS 200112L #define _POSIX_TIMERS 200112L -#define _POSIX_TYPED_MEMORY_OBJECTS -1 +#define _POSIX_TYPED_MEMORY_OBJECTS (-1) #define _POSIX_VDISABLE 0xff #if __XSI_VISIBLE #define _XOPEN_SHM 1 -#define _XOPEN_STREAMS -1 +#define _XOPEN_STREAMS (-1) #endif /* From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 08:49:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EA25106566C; Sat, 10 Mar 2012 08:49:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 448378FC1A; Sat, 10 Mar 2012 08:49: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 q2A8njeC048176; Sat, 10 Mar 2012 08:49:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2A8njJb048174; Sat, 10 Mar 2012 08:49:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203100849.q2A8njJb048174@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Mar 2012 08:49: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: r232777 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 08:49:45 -0000 Author: kib Date: Sat Mar 10 08:49:44 2012 New Revision: 232777 URL: http://svn.freebsd.org/changeset/base/232777 Log: Optimize tls_get_addr_common(). The change provides around 30% speedup for TLS microbenchmark using global-dynamic TLS model on amd64 (which is default for PIC dso objects). Split the slow path into tls_get_addr_slow(), for which inlining is disabled. This prevents the registers spill on tls_get_addr_common() entry. Provide static branch hint to the compiler, indicating that slow path is not likely to be taken. While there, do some minimal style adjustments. Reported and tested by: davidxu MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Mar 10 08:48:52 2012 (r232776) +++ head/libexec/rtld-elf/rtld.c Sat Mar 10 08:49:44 2012 (r232777) @@ -3507,17 +3507,17 @@ unref_dag(Obj_Entry *root) /* * Common code for MD __tls_get_addr(). */ -void * -tls_get_addr_common(Elf_Addr** dtvp, int index, size_t offset) +static void *tls_get_addr_slow(Elf_Addr **, int, size_t) __noinline; +static void * +tls_get_addr_slow(Elf_Addr **dtvp, int index, size_t offset) { - Elf_Addr* dtv = *dtvp; + Elf_Addr *newdtv, *dtv; RtldLockState lockstate; + int to_copy; + dtv = *dtvp; /* Check dtv generation in case new modules have arrived */ if (dtv[0] != tls_dtv_generation) { - Elf_Addr* newdtv; - int to_copy; - wlock_acquire(rtld_bind_lock, &lockstate); newdtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr)); to_copy = dtv[1]; @@ -3532,14 +3532,27 @@ tls_get_addr_common(Elf_Addr** dtvp, int } /* Dynamically allocate module TLS if necessary */ - if (!dtv[index + 1]) { + if (dtv[index + 1] == 0) { /* Signal safe, wlock will block out signals. */ - wlock_acquire(rtld_bind_lock, &lockstate); + wlock_acquire(rtld_bind_lock, &lockstate); if (!dtv[index + 1]) dtv[index + 1] = (Elf_Addr)allocate_module_tls(index); lock_release(rtld_bind_lock, &lockstate); } - return (void*) (dtv[index + 1] + offset); + return ((void *)(dtv[index + 1] + offset)); +} + +void * +tls_get_addr_common(Elf_Addr **dtvp, int index, size_t offset) +{ + Elf_Addr *dtv; + + dtv = *dtvp; + /* Check dtv generation in case new modules have arrived */ + if (__predict_true(dtv[0] == tls_dtv_generation && + dtv[index + 1] != 0)) + return ((void *)(dtv[index + 1] + offset)); + return (tls_get_addr_slow(dtvp, index, offset)); } #if defined(__arm__) || defined(__ia64__) || defined(__mips__) || defined(__powerpc__) From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 09:09:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE158106566B; Sat, 10 Mar 2012 09:09:58 +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 BA3988FC0A; Sat, 10 Mar 2012 09:09:58 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 2E70646B3B; Sat, 10 Mar 2012 04:09:58 -0500 (EST) Date: Sat, 10 Mar 2012 09:09:57 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Juli Mallett In-Reply-To: <201203100654.q2A6sb8s044396@svn.freebsd.org> Message-ID: References: <201203100654.q2A6sb8s044396@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232770 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 09:09:59 -0000 On Sat, 10 Mar 2012, Juli Mallett wrote: > Log: > o) Remove some CPU_CNMIPS-related magical thinking about the status register's > contents for user programs. > o) Conditionalize the installation of an XTLB handler on ABI, not CPU family. This all makes the FreeBSD/CHERI port much more sensible, thanks for doing this cleanup! Robert From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 10:54:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADAD9106566B; Sat, 10 Mar 2012 10:54:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9438FC08; Sat, 10 Mar 2012 10:54: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 q2AAsqlp053369; Sat, 10 Mar 2012 10:54:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AAsqRV053366; Sat, 10 Mar 2012 10:54:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201203101054.q2AAsqRV053366@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 10 Mar 2012 10:54: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: r232778 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 10:54:52 -0000 Author: trasz Date: Sat Mar 10 10:54:52 2012 New Revision: 232778 URL: http://svn.freebsd.org/changeset/base/232778 Log: Cross-reference sigqueue(2) and kill(2). Modified: head/lib/libc/sys/kill.2 head/lib/libc/sys/sigqueue.2 Modified: head/lib/libc/sys/kill.2 ============================================================================== --- head/lib/libc/sys/kill.2 Sat Mar 10 08:49:44 2012 (r232777) +++ head/lib/libc/sys/kill.2 Sat Mar 10 10:54:52 2012 (r232778) @@ -28,7 +28,7 @@ .\" @(#)kill.2 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 19, 1994 +.Dd March 10, 2012 .Dt KILL 2 .Os .Sh NAME @@ -137,6 +137,7 @@ of the group could not be signaled. .Xr getpid 2 , .Xr killpg 2 , .Xr sigaction 2 , +.Xr sigqueue 2 , .Xr raise 3 , .Xr init 8 .Sh STANDARDS Modified: head/lib/libc/sys/sigqueue.2 ============================================================================== --- head/lib/libc/sys/sigqueue.2 Sat Mar 10 08:49:44 2012 (r232777) +++ head/lib/libc/sys/sigqueue.2 Sat Mar 10 10:54:52 2012 (r232778) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd March 10, 2012 .Dt SIGQUEUE 2 .Os .Sh NAME @@ -126,6 +126,7 @@ The process does not exist. .El .Sh SEE ALSO +.Xr kill 2 , .Xr sigaction 2 , .Xr sigpending 2 , .Xr sigqueue 2 , From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 11:25:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88B08106564A; Sat, 10 Mar 2012 11:25:54 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 777748FC13; Sat, 10 Mar 2012 11:25: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 q2ABPs1w054320; Sat, 10 Mar 2012 11:25:54 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ABPsX4054317; Sat, 10 Mar 2012 11:25:54 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201203101125.q2ABPsX4054317@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 10 Mar 2012 11:25: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: r232779 - head/contrib/tnftp/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 11:25:54 -0000 Author: gavin Date: Sat Mar 10 11:25:53 2012 New Revision: 232779 URL: http://svn.freebsd.org/changeset/base/232779 Log: Move determination of socket buffer sizes from startup to the first time a socket is used. The previous code structure assumed that AF_INET sockets were always available, which is an invalid assumption on IPv6-only systems. This merges the fololowing revisions from NetBSD: src/usr.bin/ftp/main.c 1.120 src/usr.bin/ftp/util.c 1.156 PR: bin/162661 Tested by: bz Obtained from: NetBSD MFC after: 1 week Modified: head/contrib/tnftp/src/main.c head/contrib/tnftp/src/util.c Modified: head/contrib/tnftp/src/main.c ============================================================================== --- head/contrib/tnftp/src/main.c Sat Mar 10 10:54:52 2012 (r232778) +++ head/contrib/tnftp/src/main.c Sat Mar 10 11:25:53 2012 (r232779) @@ -146,9 +146,8 @@ main(int volatile argc, char **volatile struct passwd *pw; char *cp, *ep, *anonpass, *upload_path, *src_addr; const char *anonuser; - int dumbterm, s, isupload; + int dumbterm, isupload; size_t len; - socklen_t slen; tzset(); #if 0 /* tnftp */ /* XXX */ @@ -213,35 +212,6 @@ main(int volatile argc, char **volatile if (cp != NULL && strlcpy(netrc, cp, sizeof(netrc)) >= sizeof(netrc)) errx(1, "$NETRC `%s': %s", cp, strerror(ENAMETOOLONG)); - /* - * Get the default socket buffer sizes if we don't already have them. - * It doesn't matter which socket we do this to, because on the first - * call no socket buffer sizes will have been modified, so we are - * guaranteed to get the system defaults. - */ - s = socket(AF_INET, SOCK_STREAM, 0); - if (s == -1) - err(1, "Can't create socket to determine default socket sizes"); - slen = sizeof(rcvbuf_size); - if (getsockopt(s, SOL_SOCKET, SO_RCVBUF, - (void *)&rcvbuf_size, &slen) == -1) - err(1, "Unable to get default rcvbuf size"); - slen = sizeof(sndbuf_size); - if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, - (void *)&sndbuf_size, &slen) == -1) - err(1, "Unable to get default sndbuf size"); - (void)close(s); - /* sanity check returned buffer sizes */ - if (rcvbuf_size <= 0) - rcvbuf_size = 8 * 1024; - if (sndbuf_size <= 0) - sndbuf_size = 8 * 1024; - - if (sndbuf_size > 8 * 1024 * 1024) - sndbuf_size = 8 * 1024 * 1024; - if (rcvbuf_size > 8 * 1024 * 1024) - rcvbuf_size = 8 * 1024 * 1024; - marg_sl = ftp_sl_init(); if ((tmpdir = getenv("TMPDIR")) == NULL) tmpdir = _PATH_TMP; Modified: head/contrib/tnftp/src/util.c ============================================================================== --- head/contrib/tnftp/src/util.c Sat Mar 10 10:54:52 2012 (r232778) +++ head/contrib/tnftp/src/util.c Sat Mar 10 11:25:53 2012 (r232779) @@ -1060,6 +1060,32 @@ strsuftoi(const char *arg) void setupsockbufsize(int sock) { + socklen_t slen; + + if (0 == rcvbuf_size) { + slen = sizeof(rcvbuf_size); + if (getsockopt(sock, SOL_SOCKET, SO_RCVBUF, + (void *)&rcvbuf_size, &slen) == -1) + err(1, "Unable to determine rcvbuf size"); + if (rcvbuf_size <= 0) + rcvbuf_size = 8 * 1024; + if (rcvbuf_size > 8 * 1024 * 1024) + rcvbuf_size = 8 * 1024 * 1024; + DPRINTF("setupsockbufsize: rcvbuf_size determined as %d\n", + rcvbuf_size); + } + if (0 == sndbuf_size) { + slen = sizeof(sndbuf_size); + if (getsockopt(sock, SOL_SOCKET, SO_SNDBUF, + (void *)&sndbuf_size, &slen) == -1) + err(1, "Unable to determine sndbuf size"); + if (sndbuf_size <= 0) + sndbuf_size = 8 * 1024; + if (sndbuf_size > 8 * 1024 * 1024) + sndbuf_size = 8 * 1024 * 1024; + DPRINTF("setupsockbufsize: sndbuf_size determined as %d\n", + sndbuf_size); + } if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (void *)&sndbuf_size, sizeof(sndbuf_size)) == -1) From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 14:35:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 461A5106564A; Sat, 10 Mar 2012 14:35:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 306E28FC12; Sat, 10 Mar 2012 14:35: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 q2AEZAVd060231; Sat, 10 Mar 2012 14:35:10 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AEZ9Em060229; Sat, 10 Mar 2012 14:35:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203101435.q2AEZ9Em060229@svn.freebsd.org> From: Ed Schouten Date: Sat, 10 Mar 2012 14:35: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: r232780 - head/usr.sbin/watch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 14:35:10 -0000 Author: ed Date: Sat Mar 10 14:35:09 2012 New Revision: 232780 URL: http://svn.freebsd.org/changeset/base/232780 Log: Fix whitespace. MFC after: 1 week Modified: head/usr.sbin/watch/watch.c Modified: head/usr.sbin/watch/watch.c ============================================================================== --- head/usr.sbin/watch/watch.c Sat Mar 10 11:25:53 2012 (r232779) +++ head/usr.sbin/watch/watch.c Sat Mar 10 14:35:09 2012 (r232780) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #define MSG_CHANGE "Snoop device change by user request." #define MSG_NOWRITE "Snoop device change due to write failure." - #define DEV_NAME_LEN 1024 /* for /dev/ttyXX++ */ #define MIN_SIZE 256 @@ -65,27 +64,26 @@ static void detach_snp(void); static void set_dev(const char *); static void ask_dev(char *, const char *); -int opt_reconn_close = 0; -int opt_reconn_oflow = 0; -int opt_interactive = 1; -int opt_timestamp = 0; +int opt_reconn_close = 0; +int opt_reconn_oflow = 0; +int opt_interactive = 1; +int opt_timestamp = 0; int opt_write = 0; int opt_no_switch = 0; const char *opt_snpdev; -char dev_name[DEV_NAME_LEN]; -int snp_io; -int std_in = 0, std_out = 1; - - -int clear_ok = 0; -struct termios otty; -char tbuf[1024], gbuf[1024]; - +char dev_name[DEV_NAME_LEN]; +int snp_io; +int std_in = 0, std_out = 1; + +int clear_ok = 0; +struct termios otty; +char tbuf[1024], gbuf[1024]; static void clear(void) { + if (clear_ok) tputs(gbuf, 1, putchar); fflush(stdout); @@ -94,8 +92,9 @@ clear(void) static void timestamp(const char *buf) { - time_t t; - char btmp[1024]; + time_t t; + char btmp[1024]; + clear(); printf("\n---------------------------------------------\n"); t = time(NULL); @@ -109,11 +108,11 @@ timestamp(const char *buf) static void set_tty(void) { - struct termios ntty; + struct termios ntty; tcgetattr (std_in, &otty); ntty = otty; - ntty.c_lflag &= ~ICANON; /* disable canonical operation */ + ntty.c_lflag &= ~ICANON; /* disable canonical operation */ ntty.c_lflag &= ~ECHO; #ifdef FLUSHO ntty.c_lflag &= ~FLUSHO; @@ -124,11 +123,11 @@ set_tty(void) #ifdef IEXTEN ntty.c_lflag &= ~IEXTEN; #endif - ntty.c_cc[VMIN] = 1; /* minimum of one character */ - ntty.c_cc[VTIME] = 0; /* timeout value */ + ntty.c_cc[VMIN] = 1; /* minimum of one character */ + ntty.c_cc[VTIME] = 0; /* timeout value */ - ntty.c_cc[VINTR] = 07; /* ^G */ - ntty.c_cc[VQUIT] = 07; /* ^G */ + ntty.c_cc[VINTR] = 07; /* ^G */ + ntty.c_cc[VQUIT] = 07; /* ^G */ tcsetattr (std_in, TCSANOW, &ntty); } @@ -138,7 +137,6 @@ unset_tty(void) tcsetattr (std_in, TCSANOW, &otty); } - static void fatal(int error, const char *buf) { @@ -169,7 +167,6 @@ open_snp(void) return (f); } - static void cleanup(int signo __unused) { @@ -180,7 +177,6 @@ cleanup(int signo __unused) exit(EX_OK); } - static void usage(void) { @@ -191,7 +187,8 @@ usage(void) static void setup_scr(void) { - char *cbuf = gbuf, *term; + char *cbuf = gbuf, *term; + if (!opt_interactive) return; if ((term = getenv("TERM"))) @@ -226,11 +223,10 @@ attach_snp(void) timestamp("Logging Started."); } - static void set_dev(const char *name) { - char buf[DEV_NAME_LEN]; + char buf[DEV_NAME_LEN]; struct stat sb; if (strlen(name) > 5 && !strncmp(name, _PATH_DEV, sizeof _PATH_DEV - 1)) { @@ -256,8 +252,8 @@ set_dev(const char *name) void ask_dev(char *dbuf, const char *msg) { - char buf[DEV_NAME_LEN]; - int len; + char buf[DEV_NAME_LEN]; + int len; clear(); unset_tty(); @@ -284,10 +280,10 @@ ask_dev(char *dbuf, const char *msg) int main(int ac, char *av[]) { - int ch, res, rv, nread; + int ch, res, rv, nread; size_t b_size = MIN_SIZE; - char *buf, chb[READB_LEN]; - fd_set fd_s; + char *buf, chb[READB_LEN]; + fd_set fd_s; (void) setlocale(LC_TIME, ""); @@ -296,7 +292,6 @@ main(int ac, char *av[]) else opt_interactive = 0; - while ((ch = getopt(ac, av, "Wciotnf:")) != -1) switch (ch) { case 'W': @@ -382,7 +377,7 @@ main(int ac, char *av[]) detach_snp(); if (opt_no_switch) fatal(EX_IOERR, - "write failed"); + "write failed"); ask_dev(dev_name, MSG_NOWRITE); set_dev(dev_name); } @@ -439,4 +434,3 @@ main(int ac, char *av[]) } /* While */ return(0); } - From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 14:38:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BFD31065670; Sat, 10 Mar 2012 14:38:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87E8F8FC12; Sat, 10 Mar 2012 14:38: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 q2AEcYdl060367; Sat, 10 Mar 2012 14:38:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AEcYDS060365; Sat, 10 Mar 2012 14:38:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201203101438.q2AEcYDS060365@svn.freebsd.org> From: Ed Schouten Date: Sat, 10 Mar 2012 14:38: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: r232781 - head/usr.sbin/watch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 14:38:34 -0000 Author: ed Date: Sat Mar 10 14:38:34 2012 New Revision: 232781 URL: http://svn.freebsd.org/changeset/base/232781 Log: Perform even more style changes. - Remove unneeded whitespace for function calls. - Add empty line at the top of functions without local variables. - Change while (1) to for (;;). MFC after: 1 week Modified: head/usr.sbin/watch/watch.c Modified: head/usr.sbin/watch/watch.c ============================================================================== --- head/usr.sbin/watch/watch.c Sat Mar 10 14:35:09 2012 (r232780) +++ head/usr.sbin/watch/watch.c Sat Mar 10 14:38:34 2012 (r232781) @@ -110,7 +110,7 @@ set_tty(void) { struct termios ntty; - tcgetattr (std_in, &otty); + tcgetattr(std_in, &otty); ntty = otty; ntty.c_lflag &= ~ICANON; /* disable canonical operation */ ntty.c_lflag &= ~ECHO; @@ -128,18 +128,20 @@ set_tty(void) ntty.c_cc[VINTR] = 07; /* ^G */ ntty.c_cc[VQUIT] = 07; /* ^G */ - tcsetattr (std_in, TCSANOW, &ntty); + tcsetattr(std_in, TCSANOW, &ntty); } static void unset_tty(void) { - tcsetattr (std_in, TCSANOW, &otty); + + tcsetattr(std_in, TCSANOW, &otty); } static void fatal(int error, const char *buf) { + unset_tty(); if (buf) errx(error, "fatal: %s", buf); @@ -170,6 +172,7 @@ open_snp(void) static void cleanup(int signo __unused) { + if (opt_timestamp) timestamp("Logging Exited."); close(snp_io); @@ -180,6 +183,7 @@ cleanup(int signo __unused) static void usage(void) { + fprintf(stderr, "usage: watch [-ciotnW] [tty name]\n"); exit(EX_USAGE); } @@ -344,7 +348,7 @@ main(int ac, char *av[]) FD_ZERO(&fd_s); - while (1) { + for (;;) { if (opt_interactive) FD_SET(std_in, &fd_s); FD_SET(snp_io, &fd_s); From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 14:38:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 983711065703; Sat, 10 Mar 2012 14:38:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8347B8FC15; Sat, 10 Mar 2012 14:38: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 q2AEcocr060409; Sat, 10 Mar 2012 14:38:50 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AEcobJ060407; Sat, 10 Mar 2012 14:38:50 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201203101438.q2AEcobJ060407@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 10 Mar 2012 14:38: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: r232782 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 14:38:50 -0000 Author: trasz Date: Sat Mar 10 14:38:49 2012 New Revision: 232782 URL: http://svn.freebsd.org/changeset/base/232782 Log: Remove useless thread_{lock,unlock}() in raccd. Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Sat Mar 10 14:38:34 2012 (r232781) +++ head/sys/kern/kern_racct.c Sat Mar 10 14:38:49 2012 (r232782) @@ -730,11 +730,8 @@ racctd(void) timevalsub(&wallclock, &p->p_stats->p_start); PROC_LOCK(p); PROC_SLOCK(p); - FOREACH_THREAD_IN_PROC(p, td) { + FOREACH_THREAD_IN_PROC(p, td) ruxagg(p, td); - thread_lock(td); - thread_unlock(td); - } runtime = cputick2usec(p->p_rux.rux_runtime); PROC_SUNLOCK(p); #ifdef notyet From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 14:57:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 72FB010656A8; Sat, 10 Mar 2012 14:57:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53B1E8FC13; Sat, 10 Mar 2012 14:57: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 q2AEvMwp061027; Sat, 10 Mar 2012 14:57:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AEvM81061023; Sat, 10 Mar 2012 14:57:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203101457.q2AEvM81061023@svn.freebsd.org> From: Alexander Motin Date: Sat, 10 Mar 2012 14:57: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: r232783 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 14:57:22 -0000 Author: mav Date: Sat Mar 10 14:57:21 2012 New Revision: 232783 URL: http://svn.freebsd.org/changeset/base/232783 Log: Idle ticks optimization: - Pass number of events to the statclock() and profclock() functions same as to hardclock() before to not call them many times in a loop. - Rename them into statclock_cnt() and profclock_cnt(). - Turn statclock() and profclock() into compatibility wrappers, still needed for arm. - Rename hardclock_anycpu() into hardclock_cnt() for unification. MFC after: 1 week Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/sys/systm.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sat Mar 10 14:38:49 2012 (r232782) +++ head/sys/kern/kern_clock.c Sat Mar 10 14:57:21 2012 (r232783) @@ -483,7 +483,7 @@ hardclock(int usermode, uintfptr_t pc) } void -hardclock_anycpu(int cnt, int usermode) +hardclock_cnt(int cnt, int usermode) { struct pstats *pstats; struct thread *td = curthread; @@ -688,6 +688,13 @@ stopprofclock(p) void statclock(int usermode) { + + statclock_cnt(1, usermode); +} + +void +statclock_cnt(int cnt, int usermode) +{ struct rusage *ru; struct vmspace *vm; struct thread *td; @@ -703,11 +710,11 @@ statclock(int usermode) /* * Charge the time as appropriate. */ - td->td_uticks++; + td->td_uticks += cnt; if (p->p_nice > NZERO) - cp_time[CP_NICE]++; + cp_time[CP_NICE] += cnt; else - cp_time[CP_USER]++; + cp_time[CP_USER] += cnt; } else { /* * Came from kernel mode, so we were: @@ -723,15 +730,15 @@ statclock(int usermode) */ if ((td->td_pflags & TDP_ITHREAD) || td->td_intr_nesting_level >= 2) { - td->td_iticks++; - cp_time[CP_INTR]++; + td->td_iticks += cnt; + cp_time[CP_INTR] += cnt; } else { - td->td_pticks++; - td->td_sticks++; + td->td_pticks += cnt; + td->td_sticks += cnt; if (!TD_IS_IDLETHREAD(td)) - cp_time[CP_SYS]++; + cp_time[CP_SYS] += cnt; else - cp_time[CP_IDLE]++; + cp_time[CP_IDLE] += cnt; } } @@ -739,22 +746,30 @@ statclock(int usermode) MPASS(p->p_vmspace != NULL); vm = p->p_vmspace; ru = &td->td_ru; - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); + ru->ru_ixrss += pgtok(vm->vm_tsize) * cnt; + ru->ru_idrss += pgtok(vm->vm_dsize) * cnt; + ru->ru_isrss += pgtok(vm->vm_ssize) * cnt; rss = pgtok(vmspace_resident_count(vm)); if (ru->ru_maxrss < rss) ru->ru_maxrss = rss; KTR_POINT2(KTR_SCHED, "thread", sched_tdname(td), "statclock", "prio:%d", td->td_priority, "stathz:%d", (stathz)?stathz:hz); thread_lock_flags(td, MTX_QUIET); - sched_clock(td); + for ( ; cnt > 0; cnt--) + sched_clock(td); thread_unlock(td); } void profclock(int usermode, uintfptr_t pc) { + + profclock_cnt(1, usermode, pc); +} + +void +profclock_cnt(int cnt, int usermode, uintfptr_t pc) +{ struct thread *td; #ifdef GPROF struct gmonparam *g; @@ -770,7 +785,7 @@ profclock(int usermode, uintfptr_t pc) * bother trying to count it. */ if (td->td_proc->p_flag & P_PROFIL) - addupc_intr(td, pc, 1); + addupc_intr(td, pc, cnt); } #ifdef GPROF else { @@ -781,7 +796,7 @@ profclock(int usermode, uintfptr_t pc) if (g->state == GMON_PROF_ON && pc >= g->lowpc) { i = PC_TO_I(g, pc); if (i < g->textsize) { - KCOUNT(g, i)++; + KCOUNT(g, i) += cnt; } } } Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Sat Mar 10 14:38:49 2012 (r232782) +++ head/sys/kern/kern_clocksource.c Sat Mar 10 14:57:21 2012 (r232783) @@ -195,28 +195,34 @@ handleevents(struct bintime *now, int fa pc = TRAPF_PC(frame); } - runs = 0; state = DPCPU_PTR(timerstate); + runs = 0; while (bintime_cmp(now, &state->nexthard, >=)) { bintime_add(&state->nexthard, &hardperiod); runs++; } if (runs && fake < 2) { - hardclock_anycpu(runs, usermode); + hardclock_cnt(runs, usermode); done = 1; } + runs = 0; while (bintime_cmp(now, &state->nextstat, >=)) { - if (fake < 2) - statclock(usermode); bintime_add(&state->nextstat, &statperiod); + runs++; + } + if (runs && fake < 2) { + statclock_cnt(runs, usermode); done = 1; } if (profiling) { + runs = 0; while (bintime_cmp(now, &state->nextprof, >=)) { - if (!fake) - profclock(usermode, pc); bintime_add(&state->nextprof, &profperiod); + runs++; + } + if (runs && !fake) { + profclock_cnt(runs, usermode, pc); done = 1; } } else Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Mar 10 14:38:49 2012 (r232782) +++ head/sys/sys/systm.h Sat Mar 10 14:57:21 2012 (r232783) @@ -247,12 +247,14 @@ void realitexpire(void *); int sysbeep(int hertz, int period); void hardclock(int usermode, uintfptr_t pc); -void hardclock_anycpu(int cnt, int usermode); +void hardclock_cnt(int cnt, int usermode); void hardclock_cpu(int usermode); void hardclock_sync(int cpu); void softclock(void *); void statclock(int usermode); +void statclock_cnt(int cnt, int usermode); void profclock(int usermode, uintfptr_t pc); +void profclock_cnt(int cnt, int usermode, uintfptr_t pc); int hardclockintr(void); From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 15:08:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BF4E106566C; Sat, 10 Mar 2012 15:08:38 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8B198FC12; Sat, 10 Mar 2012 15:08: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 q2AF8bKH061404; Sat, 10 Mar 2012 15:08:37 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AF8bo0061402; Sat, 10 Mar 2012 15:08:37 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201203101508.q2AF8bo0061402@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 10 Mar 2012 15:08: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: r232784 - head/sys/boot/pc98/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 15:08:38 -0000 Author: nyan Date: Sat Mar 10 15:08:37 2012 New Revision: 232784 URL: http://svn.freebsd.org/changeset/base/232784 Log: MFi386: revisions 232570 and 232754 Fix boot2 to handle boot config files that only contain a custom path to a loader or kernel. Modified: head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Sat Mar 10 14:57:21 2012 (r232783) +++ head/sys/boot/pc98/boot2/boot2.c Sat Mar 10 15:08:37 2012 (r232784) @@ -130,9 +130,9 @@ static struct dsk { unsigned part; unsigned start; } dsk; -static char cmd[512], cmddup[512]; +static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname = NULL; -static uint32_t opts; +static uint32_t opts = 0; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -352,6 +352,7 @@ main(void) #endif uint8_t autoboot; ino_t ino; + size_t nbyte; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -378,8 +379,10 @@ main(void) autoboot = 1; if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); @@ -396,9 +399,9 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !kname) { + if (!kname) { kname = PATH_BOOT3; - if (!keyhit(3*SECOND)) { + if (autoboot && !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; } @@ -595,7 +598,12 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } - kname = arg; + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } } arg = p; } From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 17:08:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 237CC106566C; Sat, 10 Mar 2012 17:08:58 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E6C08FC12; Sat, 10 Mar 2012 17:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2AH8vF5065242; Sat, 10 Mar 2012 17:08:57 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AH8vIJ065240; Sat, 10 Mar 2012 17:08:57 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201203101708.q2AH8vIJ065240@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sat, 10 Mar 2012 17: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: r232785 - head/sys/dev/iwi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 17:08:58 -0000 Author: iwasaki Date: Sat Mar 10 17:08:57 2012 New Revision: 232785 URL: http://svn.freebsd.org/changeset/base/232785 Log: Fix wrong asresp frame parsing in iwi_checkforqos(). After 8.0-RELEASE, iwi(4) doesn't send any data frames in infrastructure mode. Bacause of the condition `while (frm < efrm)', IEEE80211_VERIFY_LENGTH() was checking item length beyond the ieee80211_frame region, and returned from iwi_checkforqos() without setting flags, capinfo and associd. In infrastructure mode associd is required, so this problem causes discarding mbuf in ieee80211_start(). PR: kern/165819 Tested/Reviewed/Supported by: bschmidt and adrian MFC after: 1 week Modified: head/sys/dev/iwi/if_iwi.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Sat Mar 10 15:08:37 2012 (r232784) +++ head/sys/dev/iwi/if_iwi.c Sat Mar 10 17:08:57 2012 (r232785) @@ -1357,8 +1357,8 @@ iwi_checkforqos(struct ieee80211vap *vap frm += 2; wme = NULL; - while (frm < efrm) { - IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1], return); + while (efrm - frm > 1) { + IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); switch (*frm) { case IEEE80211_ELEMID_VENDOR: if (iswmeoui(frm)) From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 18:35:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80367106566C; Sat, 10 Mar 2012 18:35:39 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B1748FC0C; Sat, 10 Mar 2012 18:35: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 q2AIZdWq070658; Sat, 10 Mar 2012 18:35:39 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AIZdR5070656; Sat, 10 Mar 2012 18:35:39 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203101835.q2AIZdR5070656@svn.freebsd.org> From: Juli Mallett Date: Sat, 10 Mar 2012 18:35: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: r232789 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 18:35:39 -0000 Author: jmallett Date: Sat Mar 10 18:35:38 2012 New Revision: 232789 URL: http://svn.freebsd.org/changeset/base/232789 Log: Fix reversed logic in previous commit that broke build and earned me quite the pointy hat. Submitted by: bz Modified: head/sys/mips/include/_bus.h Modified: head/sys/mips/include/_bus.h ============================================================================== --- head/sys/mips/include/_bus.h Sat Mar 10 18:26:25 2012 (r232788) +++ head/sys/mips/include/_bus.h Sat Mar 10 18:35:38 2012 (r232789) @@ -36,9 +36,9 @@ */ #include "opt_cputype.h" #if defined(CPU_CNMIPS) && !defined(__mips_n64) -typedef uintptr_t bus_addr_t; -#else typedef uint64_t bus_addr_t; +#else +typedef uintptr_t bus_addr_t; #endif typedef uintptr_t bus_size_t; From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 18:52:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 584521065672; Sat, 10 Mar 2012 18:52: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 D5F438FC15; Sat, 10 Mar 2012 18:52:38 +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 950F925D39FF; Sat, 10 Mar 2012 18:52:36 +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 C3755BDD1CE; Sat, 10 Mar 2012 18:52:35 +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 82wZfzkpR1PI; Sat, 10 Mar 2012 18:52:34 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 96656BDD1CD; Sat, 10 Mar 2012 18:52:34 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201203101835.q2AIZdR5070656@svn.freebsd.org> Date: Sat, 10 Mar 2012 18:52:33 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <92D61AD7-B586-4523-B583-2F8945AD35FD@FreeBSD.org> References: <201203101835.q2AIZdR5070656@svn.freebsd.org> To: Juli Mallett X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232789 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 18:52:39 -0000 On 10. Mar 2012, at 18:35 , Juli Mallett wrote: > Author: jmallett > Date: Sat Mar 10 18:35:38 2012 > New Revision: 232789 > URL: http://svn.freebsd.org/changeset/base/232789 >=20 > Log: > Fix reversed logic in previous commit that broke build and earned me = quite the > pointy hat. >=20 > Submitted by: bz Just Reported by:, I didn't do the fix but thanks to you for doing so! > Modified: > head/sys/mips/include/_bus.h >=20 > Modified: head/sys/mips/include/_bus.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/mips/include/_bus.h Sat Mar 10 18:26:25 2012 = (r232788) > +++ head/sys/mips/include/_bus.h Sat Mar 10 18:35:38 2012 = (r232789) > @@ -36,9 +36,9 @@ > */ > #include "opt_cputype.h"=20 > #if defined(CPU_CNMIPS) && !defined(__mips_n64) > -typedef uintptr_t bus_addr_t; > -#else > typedef uint64_t bus_addr_t; > +#else > +typedef uintptr_t bus_addr_t; > #endif > typedef uintptr_t bus_size_t; >=20 --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 18:56:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20B85106564A; Sat, 10 Mar 2012 18:56:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0167A8FC20; Sat, 10 Mar 2012 18:56: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 q2AIuGXk072787; Sat, 10 Mar 2012 18:56:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AIuGt4072785; Sat, 10 Mar 2012 18:56:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203101856.q2AIuGt4072785@svn.freebsd.org> From: Alexander Motin Date: Sat, 10 Mar 2012 18:56: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: r232793 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 18:56:17 -0000 Author: mav Date: Sat Mar 10 18:56:16 2012 New Revision: 232793 URL: http://svn.freebsd.org/changeset/base/232793 Log: Revert r175376 and tune cpufreq(4) frequency comparison logic instead. Instead of using 25MHz equality threshold, look for the nearest value when handling dev.cpu.0.freq sysctl and for exact match when it is expected. ACPI may report extra level with frequency 1MHz above the nominal to control Intel Turbo Boost operation. It is not a bug, but feature: dev.cpu.0.freq_levels: 2934/106000 2933/95000 2800/82000 ... In this case value 2933 means 2.93GHz, but 2934 means 3.2-3.6GHz. I've found that my Core i7-870 based system has Intel Turbo Boost disabled by default and without this change it was absolutely invisible and hard to control. MFC after: 2 weeks Modified: head/sys/kern/kern_cpu.c Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Sat Mar 10 18:37:01 2012 (r232792) +++ head/sys/kern/kern_cpu.c Sat Mar 10 18:56:16 2012 (r232793) @@ -312,7 +312,7 @@ cf_set_method(device_t dev, const struct } /* If already at this level, just return. */ - if (CPUFREQ_CMP(sc->curr_level.total_set.freq, level->total_set.freq)) { + if (sc->curr_level.total_set.freq == level->total_set.freq) { CF_DEBUG("skipping freq %d, same as current level %d\n", level->total_set.freq, sc->curr_level.total_set.freq); goto skip; @@ -471,7 +471,7 @@ cf_get_method(device_t dev, struct cf_le if (CPUFREQ_DRV_GET(devs[n], &set) != 0) continue; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(set.freq, levels[i].total_set.freq)) { + if (set.freq == levels[i].total_set.freq) { sc->curr_level = levels[i]; break; } @@ -627,16 +627,6 @@ cf_levels_method(device_t dev, struct cf /* Finally, output the list of levels. */ i = 0; TAILQ_FOREACH(lev, &sc->all_levels, link) { - /* - * Skip levels that are too close in frequency to the - * previous levels. Some systems report bogus duplicate - * settings (i.e., for acpi_perf). - */ - if (i > 0 && CPUFREQ_CMP(lev->total_set.freq, - levels[i - 1].total_set.freq)) { - sc->all_count--; - continue; - } /* Skip levels that have a frequency that is too low. */ if (lev->total_set.freq < cf_lowest_freq) { @@ -870,7 +860,7 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS) { struct cpufreq_softc *sc; struct cf_level *levels; - int count, devcount, error, freq, i, n; + int best, count, diff, bdiff, devcount, error, freq, i, n; device_t *devs; devs = NULL; @@ -902,17 +892,16 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS) "cpufreq: need to increase CF_MAX_LEVELS\n"); break; } + best = 0; + bdiff = 1 << 30; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(levels[i].total_set.freq, freq)) { - error = CPUFREQ_SET(devs[n], &levels[i], - CPUFREQ_PRIO_USER); - break; + diff = abs(levels[i].total_set.freq - freq); + if (diff < bdiff) { + bdiff = diff; + best = i; } } - if (i == count) { - error = EINVAL; - break; - } + error = CPUFREQ_SET(devs[n], &levels[best], CPUFREQ_PRIO_USER); } out: From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 19:58:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A915106566C; Sat, 10 Mar 2012 19:58:24 +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 F070D8FC16; Sat, 10 Mar 2012 19:58: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 q2AJwNWj075899; Sat, 10 Mar 2012 19:58:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AJwN9M075897; Sat, 10 Mar 2012 19:58:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203101958.q2AJwN9M075897@svn.freebsd.org> From: Adrian Chadd Date: Sat, 10 Mar 2012 19:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232794 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 19:58:24 -0000 Author: adrian Date: Sat Mar 10 19:58:23 2012 New Revision: 232794 URL: http://svn.freebsd.org/changeset/base/232794 Log: Fix a panic introduced in a previous commit - non-beaconing modes (eg STA) don't setup the avp mcast queue. This is a bit annoying though - it turns out the mcast queue isn't initialised for STA mode but it's then touched to see whether anything is in it. That should be fixed in a subsequent commit. Noticed by: gperez@entel.upc.edu PR: kern/165895 Modified: head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Mar 10 18:56:16 2012 (r232793) +++ head/sys/dev/ath/if_ath_tx.c Sat Mar 10 19:58:23 2012 (r232794) @@ -1409,15 +1409,12 @@ ath_tx_start(struct ath_softc *sc, struc */ if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { ATH_TXQ_LOCK(sc->sc_cabq); - ATH_TXQ_LOCK(&avp->av_mcastq); - if ((sc->sc_cabq->axq_depth + avp->av_mcastq.axq_depth) > - sc->sc_txq_mcastq_maxdepth) { + if (sc->sc_cabq->axq_depth > sc->sc_txq_mcastq_maxdepth) { sc->sc_stats.ast_tx_mcastq_overflow++; r = ENOBUFS; } - ATH_TXQ_UNLOCK(&avp->av_mcastq); ATH_TXQ_UNLOCK(sc->sc_cabq); if (r != 0) { @@ -1759,8 +1756,6 @@ ath_raw_xmit(struct ieee80211_node *ni, struct ath_softc *sc = ifp->if_softc; struct ath_buf *bf; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); - struct ieee80211vap *vap = ni->ni_vap; - struct ath_vap *avp = ATH_VAP(vap); int error = 0; ATH_PCU_LOCK(sc); @@ -1790,15 +1785,12 @@ ath_raw_xmit(struct ieee80211_node *ni, */ if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { ATH_TXQ_LOCK(sc->sc_cabq); - ATH_TXQ_LOCK(&avp->av_mcastq); - if ((sc->sc_cabq->axq_depth + avp->av_mcastq.axq_depth) > - sc->sc_txq_mcastq_maxdepth) { + if (sc->sc_cabq->axq_depth > sc->sc_txq_mcastq_maxdepth) { sc->sc_stats.ast_tx_mcastq_overflow++; error = ENOBUFS; } - ATH_TXQ_UNLOCK(&avp->av_mcastq); ATH_TXQ_UNLOCK(sc->sc_cabq); if (error != 0) { Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Mar 10 18:56:16 2012 (r232793) +++ head/sys/dev/ath/if_athvar.h Sat Mar 10 19:58:23 2012 (r232794) @@ -547,10 +547,7 @@ struct ath_softc { * + data_minfree is the maximum number of free buffers * overall to successfully allow a data frame. * - * + mcastq_maxdepth is the maximum depth allowe dof the avp+cabq - * queue. The avp is included in each comparison just to be - * a little overly conservative and this may end up being - * unhelpful with multiple VAPs. + * + mcastq_maxdepth is the maximum depth allowed of the cabq. */ int sc_txq_data_minfree; int sc_txq_mcastq_maxdepth; From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 20:09:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95FE4106564A; Sat, 10 Mar 2012 20:09:03 +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 77C268FC08; Sat, 10 Mar 2012 20:09: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 q2AK938E076266; Sat, 10 Mar 2012 20:09:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AK933r076264; Sat, 10 Mar 2012 20:09:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203102009.q2AK933r076264@svn.freebsd.org> From: Adrian Chadd Date: Sat, 10 Mar 2012 20:09: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: r232795 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 20:09:03 -0000 Author: adrian Date: Sat Mar 10 20:09:02 2012 New Revision: 232795 URL: http://svn.freebsd.org/changeset/base/232795 Log: Stick the if_drv_flags access (check and modify) behind the ifq lock. Although access to the flags to check/set OACTIVE is racy due to how the default if_start() function works, this should remove any races with read/modify/write between threads. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Mar 10 19:58:23 2012 (r232794) +++ head/sys/dev/ath/if_ath.c Sat Mar 10 20:09:02 2012 (r232795) @@ -2160,8 +2160,9 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T * set this once it detected a concurrent TX was going on. * So, clear it. */ - /* XXX do this inside of IF_LOCK? */ + IF_LOCK(&ifp->if_snd); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); /* Handle any frames in the TX queue */ /* @@ -2293,15 +2294,16 @@ ath_getbuf(struct ath_softc *sc) ATH_TXBUF_LOCK(sc); bf = _ath_getbuf_locked(sc); + ATH_TXBUF_UNLOCK(sc); if (bf == NULL) { struct ifnet *ifp = sc->sc_ifp; DPRINTF(sc, ATH_DEBUG_XMIT, "%s: stop queue\n", __func__); sc->sc_stats.ast_tx_qstop++; - /* XXX do this inside of IF_LOCK? */ + IF_LOCK(&ifp->if_snd); ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); } - ATH_TXBUF_UNLOCK(sc); return bf; } @@ -2322,9 +2324,10 @@ ath_start(struct ifnet *ifp) if (sc->sc_inreset_cnt > 0) { device_printf(sc->sc_dev, "%s: sc_inreset_cnt > 0; bailing\n", __func__); - /* XXX do this inside of IF_LOCK? */ - ifp->if_drv_flags |= IFF_DRV_OACTIVE; ATH_PCU_UNLOCK(sc); + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); return; } sc->sc_txstart_cnt++; @@ -5008,8 +5011,9 @@ ath_tx_proc_q0(void *arg, int npending) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); if (TXQACTIVE(txqs, sc->sc_cabq->axq_qnum)) ath_tx_processq(sc, sc->sc_cabq, 1); - /* XXX check this inside of IF_LOCK? */ + IF_LOCK(&ifp->if_snd); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); sc->sc_wd_timer = 0; if (sc->sc_softled) @@ -5057,8 +5061,9 @@ ath_tx_proc_q0123(void *arg, int npendin if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); - /* XXX check this inside of IF_LOCK? */ + IF_LOCK(&ifp->if_snd); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); sc->sc_wd_timer = 0; if (sc->sc_softled) @@ -5099,7 +5104,9 @@ ath_tx_proc(void *arg, int npending) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); /* XXX check this inside of IF_LOCK? */ + IF_LOCK(&ifp->if_snd); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); sc->sc_wd_timer = 0; if (sc->sc_softled) @@ -5315,8 +5322,9 @@ ath_draintxq(struct ath_softc *sc, ATH_R } } #endif /* ATH_DEBUG */ - /* XXX check this inside of IF_LOCK? */ + IF_LOCK(&ifp->if_snd); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); sc->sc_wd_timer = 0; } @@ -5522,8 +5530,9 @@ finish: ath_hal_intrset(ah, sc->sc_imask); ATH_PCU_UNLOCK(sc); - /* XXX do this inside of IF_LOCK? */ + IF_LOCK(&ifp->if_snd); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); ath_txrx_start(sc); /* XXX ath_start? */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 21:08:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3CD1106564A; Sat, 10 Mar 2012 21:08:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE8218FC17; Sat, 10 Mar 2012 21:08: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 q2AL87OU078243; Sat, 10 Mar 2012 21:08:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2AL8734078240; Sat, 10 Mar 2012 21:08:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201203102108.q2AL8734078240@svn.freebsd.org> From: Alexander Motin Date: Sat, 10 Mar 2012 21:08: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: r232797 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 21:08:08 -0000 Author: mav Date: Sat Mar 10 21:08:07 2012 New Revision: 232797 URL: http://svn.freebsd.org/changeset/base/232797 Log: ServerWorks HT1000 HPET reported to have problems with IRQs >= 16. Lower (ISA) IRQs are working, but allowed mask is not set correctly. Block both by default to allow HP BL465c G6 blade system to boot. Reported by: Attila Nagy MFC after: 1 week Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Sat Mar 10 20:15:40 2012 (r232796) +++ head/sys/dev/acpica/acpi_hpet.c Sat Mar 10 21:08:07 2012 (r232797) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define HPET_VENDID_AMD 0x4353 #define HPET_VENDID_INTEL 0x8086 #define HPET_VENDID_NVIDIA 0x10de +#define HPET_VENDID_SW 0x1166 ACPI_SERIAL_DECL(hpet, "ACPI HPET support"); @@ -513,6 +514,13 @@ hpet_attach(device_t dev) if (vendor == HPET_VENDID_NVIDIA && rev <= 0x01) sc->allowed_irqs = 0x00000000; /* + * ServerWorks HT1000 reported to have problems with IRQs >= 16. + * Lower IRQs are working, but allowed mask is not set correctly. + * Legacy_route mode works fine. + */ + if (vendor == HPET_VENDID_SW && rev <= 0x01) + sc->allowed_irqs = 0x00000000; + /* * Neither QEMU nor VirtualBox report supported IRQs correctly. * The only way to use HPET there is to specify IRQs manually * and/or use legacy_route. Legacy_route mode works on both. From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 23:10:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21E571065675; Sat, 10 Mar 2012 23:10:19 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09DEF8FC1A; Sat, 10 Mar 2012 23:10: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 q2ANAIX5082719; Sat, 10 Mar 2012 23:10:18 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ANAI9U082714; Sat, 10 Mar 2012 23:10:18 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201203102310.q2ANAI9U082714@svn.freebsd.org> From: Alexander Leidinger Date: Sat, 10 Mar 2012 23:10: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: r232799 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 23:10:19 -0000 Author: netchild Date: Sat Mar 10 23:10:18 2012 New Revision: 232799 URL: http://svn.freebsd.org/changeset/base/232799 Log: - add comments to syscalls.master and linux(32)_dummy about which linux kernel version introduced the sysctl (based upon a linux man-page) - add comments to sscalls.master regarding some names of sysctls which are different than the linux-names (based upon the linux unistd.h) - add some dummy sysctls - name an unimplemented sysctl MFC after: 1 month Modified: head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/syscalls.master head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Sat Mar 10 21:58:08 2012 (r232798) +++ head/sys/amd64/linux32/linux32_dummy.c Sat Mar 10 23:10:18 2012 (r232799) @@ -82,22 +82,69 @@ DUMMY(mq_notify); DUMMY(mq_getsetattr); DUMMY(kexec_load); DUMMY(waitid); +/* linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); +/* linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); +/* linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(pselect6); DUMMY(ppoll); DUMMY(unshare); +/* linux 2.6.17: */ DUMMY(splice); DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); +/* linux 2.6.18: */ +DUMMY(move_pages); +/* linux 2.6.19: */ +DUMMY(getcpu); +DUMMY(epoll_pwait); +/* linux 2.6.22: */ +DUMMY(utimensat); +DUMMY(signalfd); +DUMMY(timerfd_create); +DUMMY(eventfd); +/* linux 2.6.23: */ +DUMMY(fallocate); +/* linux 2.6.25: */ +DUMMY(timerfd_settime); +DUMMY(timerfd_gettime); +/* linux 2.6.27: */ +DUMMY(signalfd4); +DUMMY(eventfd2); +DUMMY(epoll_create1); +DUMMY(dup3); +DUMMY(pipe2); +DUMMY(inotify_init1); +/* linux 2.6.30: */ +DUMMY(preadv); +DUMMY(pwritev); +/* linux 2.6.31: */ +DUMMY(rt_tsigqueueinfo); +DUMMY(perf_event_open); +/* linux 2.6.33: */ +DUMMY(recvmmsg); +DUMMY(fanotify_init); +DUMMY(fanotify_mark); +/* linux 2.6.36: */ +DUMMY(prlimit64); +/* later: */ +DUMMY(name_to_handle_at); +DUMMY(open_by_handle_at); +DUMMY(clock_adjtime); +DUMMY(syncfs); +DUMMY(sendmmsg); +DUMMY(setns); +DUMMY(process_vm_readv); +DUMMY(process_vm_writev); #define DUMMY_XATTR(s) \ int \ Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sat Mar 10 21:58:08 2012 (r232798) +++ head/sys/amd64/linux32/syscalls.master Sat Mar 10 23:10:18 2012 (r232799) @@ -157,6 +157,7 @@ 82 AUE_SELECT STD { int linux_old_select( \ struct l_old_select_argv *ptr); } 83 AUE_SYMLINK STD { int linux_symlink(char *path, char *to); } +; 84: oldlstat 84 AUE_LSTAT STD { int linux_lstat(char *path, struct linux_lstat *up); } 85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ l_int count); } @@ -164,8 +165,10 @@ 87 AUE_SWAPON NOPROTO { int swapon(char *name); } 88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ l_int magic2, l_uint cmd, void *arg); } +; 89: old_readdir 89 AUE_GETDIRENTRIES STD { int linux_readdir(l_uint fd, \ struct l_dirent *dent, l_uint count); } +; 90: old_mmap 90 AUE_MMAP STD { int linux_mmap(struct l_mmap_argv *ptr); } 91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } 92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ @@ -197,6 +200,7 @@ struct l_newstat *buf); } 108 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ struct l_newstat *buf); } +; 109: olduname 109 AUE_NULL STD { int linux_uname(void); } 110 AUE_NULL STD { int linux_iopl(l_ulong level); } 111 AUE_NULL STD { int linux_vhangup(void); } @@ -244,6 +248,7 @@ l_uint whence); } 141 AUE_GETDIRENTRIES STD { int linux_getdents(l_uint fd, void *dent, \ l_uint count); } +; 142: newselect 142 AUE_SELECT STD { int linux_select(l_int nfds, \ l_fd_set *readfds, l_fd_set *writefds, \ l_fd_set *exceptfds, \ @@ -336,6 +341,7 @@ 188 AUE_GETPMSG UNIMPL getpmsg 189 AUE_PUTPMSG UNIMPL putpmsg 190 AUE_VFORK STD { int linux_vfork(void); } +; 191: ugetrlimit 191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ struct l_rlimit *rlim); } 192 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ @@ -447,10 +453,11 @@ 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ l_loff_t offset, l_loff_t len, \ int advice); } -273 AUE_NULL UNIMPL +273 AUE_NULL UNIMPL vserver 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } 276 AUE_NULL STD { int linux_set_mempolicy(void); } +; linux 2.6.6: 277 AUE_NULL STD { int linux_mq_open(void); } 278 AUE_NULL STD { int linux_mq_unlink(void); } 279 AUE_NULL STD { int linux_mq_timedsend(void); } @@ -460,14 +467,17 @@ 283 AUE_NULL STD { int linux_kexec_load(void); } 284 AUE_NULL STD { int linux_waitid(void); } 285 AUE_NULL UNIMPL +; linux 2.6.11: 286 AUE_NULL STD { int linux_add_key(void); } 287 AUE_NULL STD { int linux_request_key(void); } 288 AUE_NULL STD { int linux_keyctl(void); } +; linux 2.6.13: 289 AUE_NULL STD { int linux_ioprio_set(void); } 290 AUE_NULL STD { int linux_ioprio_get(void); } 291 AUE_NULL STD { int linux_inotify_init(void); } 292 AUE_NULL STD { int linux_inotify_add_watch(void); } 293 AUE_NULL STD { int linux_inotify_rm_watch(void); } +; linux 2.6.16: 294 AUE_NULL STD { int linux_migrate_pages(void); } 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \ l_int flags, l_int mode); } @@ -497,6 +507,7 @@ 308 AUE_NULL STD { int linux_pselect6(void); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } +; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head *head, \ @@ -505,3 +516,46 @@ 314 AUE_NULL STD { int linux_sync_file_range(void); } 315 AUE_NULL STD { int linux_tee(void); } 316 AUE_NULL STD { int linux_vmsplice(void); } +; linux 2.6.18: +317 AUE_NULL STD { int linux_move_pages(void); } +; linux 2.6.19: +318 AUE_NULL STD { int linux_getcpu(void); } +319 AUE_NULL STD { int linux_epoll_pwait(void); } +; linux 2.6.22: +320 AUE_NULL STD { int linux_utimensat(void); } +321 AUE_NULL STD { int linux_signalfd(void); } +322 AUE_NULL STD { int linux_timerfd_create(void); } +323 AUE_NULL STD { int linux_eventfd(void); } +; linux 2.6.23: +324 AUE_NULL STD { int linux_fallocate(void); } +; linux 2.6.25: +325 AUE_NULL STD { int linux_timerfd_settime(void); } +326 AUE_NULL STD { int linux_timerfd_gettime(void); } +; linux 2.6.27: +327 AUE_NULL STD { int linux_signalfd4(void); } +328 AUE_NULL STD { int linux_eventfd2(void); } +329 AUE_NULL STD { int linux_epoll_create1(void); } +330 AUE_NULL STD { int linux_dup3(void); } +331 AUE_NULL STD { int linux_pipe2(void); } +332 AUE_NULL STD { int linux_inotify_init1(void); } +; linux 2.6.30: +333 AUE_NULL STD { int linux_preadv(void); } +334 AUE_NULL STD { int linux_pwritev(void); } +; linux 2.6.31: +335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } +336 AUE_NULL STD { int linux_perf_event_open(void); } +; linux 2.6.33: +337 AUE_NULL STD { int linux_recvmmsg(void); } +338 AUE_NULL STD { int linux_fanotify_init(void); } +339 AUE_NULL STD { int linux_fanotify_mark(void); } +; linux 2.6.36: +340 AUE_NULL STD { int linux_prlimit64(void); } +; later: +341 AUE_NULL STD { int linux_name_to_handle_at(void); } +342 AUE_NULL STD { int linux_open_by_handle_at(void); } +343 AUE_NULL STD { int linux_clock_adjtime(void); } +344 AUE_NULL STD { int linux_syncfs(void); } +345 AUE_NULL STD { int linux_sendmmsg(void); } +346 AUE_NULL STD { int linux_setns(void); } +347 AUE_NULL STD { int linux_process_vm_readv(void); } +348 AUE_NULL STD { int linux_process_vm_writev(void); } Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Sat Mar 10 21:58:08 2012 (r232798) +++ head/sys/i386/linux/linux_dummy.c Sat Mar 10 23:10:18 2012 (r232799) @@ -73,22 +73,69 @@ DUMMY(get_mempolicy); DUMMY(set_mempolicy); DUMMY(kexec_load); DUMMY(waitid); +/* linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); +/* linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); +/* linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(pselect6); DUMMY(ppoll); DUMMY(unshare); +/* linux 2.6.17: */ DUMMY(splice); DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); +/* linux 2.6.18: */ +DUMMY(move_pages); +/* linux 2.6.19: */ +DUMMY(getcpu); +DUMMY(epoll_pwait); +/* linux 2.6.22: */ +DUMMY(utimensat); +DUMMY(signalfd); +DUMMY(timerfd_create); +DUMMY(eventfd); +/* linux 2.6.23: */ +DUMMY(fallocate); +/* linux 2.6.25: */ +DUMMY(timerfd_settime); +DUMMY(timerfd_gettime); +/* linux 2.6.27: */ +DUMMY(signalfd4); +DUMMY(eventfd2); +DUMMY(epoll_create1); +DUMMY(dup3); +DUMMY(pipe2); +DUMMY(inotify_init1); +/* linux 2.6.30: */ +DUMMY(preadv); +DUMMY(pwritev); +/* linux 2.6.31 */ +DUMMY(rt_tsigqueueinfo); +DUMMY(perf_event_open); +/* linux 2.6.33: */ +DUMMY(recvmmsg); +DUMMY(fanotify_init); +DUMMY(fanotify_mark); +/* linux 2.6.36: */ +DUMMY(prlimit64); +/* later: */ +DUMMY(name_to_handle_at); +DUMMY(open_by_handle_at); +DUMMY(clock_adjtime); +DUMMY(syncfs); +DUMMY(sendmmsg); +DUMMY(setns); +DUMMY(process_vm_readv); +DUMMY(process_vm_writev); #define DUMMY_XATTR(s) \ int \ Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sat Mar 10 21:58:08 2012 (r232798) +++ head/sys/i386/linux/syscalls.master Sat Mar 10 23:10:18 2012 (r232799) @@ -157,6 +157,7 @@ 82 AUE_SELECT STD { int linux_old_select( \ struct l_old_select_argv *ptr); } 83 AUE_SYMLINK STD { int linux_symlink(char *path, char *to); } +; 84: oldlstat 84 AUE_LSTAT STD { int linux_lstat(char *path, struct ostat *up); } 85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ l_int count); } @@ -164,8 +165,10 @@ 87 AUE_SWAPON NOPROTO { int swapon(char *name); } 88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ l_int magic2, l_uint cmd, void *arg); } +; 89: old_readdir 89 AUE_GETDIRENTRIES STD { int linux_readdir(l_uint fd, \ struct l_dirent *dent, l_uint count); } +; 90: old_mmap 90 AUE_MMAP STD { int linux_mmap(struct l_mmap_argv *ptr); } 91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } 92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ @@ -198,6 +201,7 @@ struct l_newstat *buf); } 108 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ struct l_newstat *buf); } +; 109: olduname 109 AUE_NULL STD { int linux_uname(void); } 110 AUE_NULL STD { int linux_iopl(l_ulong level); } 111 AUE_NULL STD { int linux_vhangup(void); } @@ -246,6 +250,7 @@ l_uint whence); } 141 AUE_GETDIRENTRIES STD { int linux_getdents(l_uint fd, \ void *dent, l_uint count); } +; 142: newselect 142 AUE_SELECT STD { int linux_select(l_int nfds, \ l_fd_set *readfds, l_fd_set *writefds, \ l_fd_set *exceptfds, \ @@ -338,6 +343,7 @@ 188 AUE_GETPMSG UNIMPL getpmsg 189 AUE_PUTPMSG UNIMPL putpmsg 190 AUE_VFORK STD { int linux_vfork(void); } +; 191: ugetrlimit 191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ struct l_rlimit *rlim); } 192 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ @@ -451,10 +457,11 @@ 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ l_loff_t offset, l_loff_t len, \ int advice); } -273 AUE_NULL UNIMPL +273 AUE_NULL UNIMPL vserver 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } 276 AUE_NULL STD { int linux_set_mempolicy(void); } +; linux 2.6.6: 277 AUE_NULL STD { int linux_mq_open(const char *name, int oflag, mode_t mode, \ struct mq_attr *attr); } 278 AUE_NULL STD { int linux_mq_unlink(const char *name); } @@ -470,14 +477,17 @@ 283 AUE_NULL STD { int linux_kexec_load(void); } 284 AUE_NULL STD { int linux_waitid(void); } 285 AUE_NULL UNIMPL +; linux 2.6.11: 286 AUE_NULL STD { int linux_add_key(void); } 287 AUE_NULL STD { int linux_request_key(void); } 288 AUE_NULL STD { int linux_keyctl(void); } +; linux 2.6.13: 289 AUE_NULL STD { int linux_ioprio_set(void); } 290 AUE_NULL STD { int linux_ioprio_get(void); } 291 AUE_NULL STD { int linux_inotify_init(void); } 292 AUE_NULL STD { int linux_inotify_add_watch(void); } 293 AUE_NULL STD { int linux_inotify_rm_watch(void); } +; linux 2.6.16: 294 AUE_NULL STD { int linux_migrate_pages(void); } 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \ l_int flags, l_int mode); } @@ -507,6 +517,7 @@ 308 AUE_NULL STD { int linux_pselect6(void); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } +; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head **head, \ @@ -515,3 +526,46 @@ 314 AUE_NULL STD { int linux_sync_file_range(void); } 315 AUE_NULL STD { int linux_tee(void); } 316 AUE_NULL STD { int linux_vmsplice(void); } +; linux 2.6.18: +317 AUE_NULL STD { int linux_move_pages(void); } +; linux 2.6.19: +318 AUE_NULL STD { int linux_getcpu(void); } +319 AUE_NULL STD { int linux_epoll_pwait(void); } +; linux 2.6.22: +320 AUE_NULL STD { int linux_utimensat(void); } +321 AUE_NULL STD { int linux_signalfd(void); } +322 AUE_NULL STD { int linux_timerfd_create(void); } +323 AUE_NULL STD { int linux_eventfd(void); } +; linux 2.6.23: +324 AUE_NULL STD { int linux_fallocate(void); } +; linux 2.6.25: +325 AUE_NULL STD { int linux_timerfd_settime(void); } +326 AUE_NULL STD { int linux_timerfd_gettime(void); } +; linux 2.6.27: +327 AUE_NULL STD { int linux_signalfd4(void); } +328 AUE_NULL STD { int linux_eventfd2(void); } +329 AUE_NULL STD { int linux_epoll_create1(void); } +330 AUE_NULL STD { int linux_dup3(void); } +331 AUE_NULL STD { int linux_pipe2(void); } +332 AUE_NULL STD { int linux_inotify_init1(void); } +; linux 2.6.30: +333 AUE_NULL STD { int linux_preadv(void); } +334 AUE_NULL STD { int linux_pwritev(void); } +; linux 2.6.31: +335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } +336 AUE_NULL STD { int linux_perf_event_open(void); } +; linux 2.6.33: +337 AUE_NULL STD { int linux_recvmmsg(void); } +338 AUE_NULL STD { int linux_fanotify_init(void); } +339 AUE_NULL STD { int linux_fanotify_mark(void); } +; linux 2.6.36: +340 AUE_NULL STD { int linux_prlimit64(void); } +; later: +341 AUE_NULL STD { int linux_name_to_handle_at(void); } +342 AUE_NULL STD { int linux_open_by_handle_at(void); } +343 AUE_NULL STD { int linux_clock_adjtime(void); } +344 AUE_NULL STD { int linux_syncfs(void); } +345 AUE_NULL STD { int linux_sendmmsg(void); } +346 AUE_NULL STD { int linux_setns(void); } +347 AUE_NULL STD { int linux_process_vm_readv(void); } +348 AUE_NULL STD { int linux_process_vm_writev(void); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 23:11:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C805C1065674; Sat, 10 Mar 2012 23:11:21 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0DC88FC22; Sat, 10 Mar 2012 23:11: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 q2ANBLxw082805; Sat, 10 Mar 2012 23:11:21 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ANBLqF082794; Sat, 10 Mar 2012 23:11:21 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201203102311.q2ANBLqF082794@svn.freebsd.org> From: Alexander Leidinger Date: Sat, 10 Mar 2012 23:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232800 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 23:11:21 -0000 Author: netchild Date: Sat Mar 10 23:11:21 2012 New Revision: 232800 URL: http://svn.freebsd.org/changeset/base/232800 Log: regen Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/amd64/linux32/linux32_proto.h Sat Mar 10 23:11:21 2012 (r232800) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 228957 2011-12-29 15:34:59Z jhb + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 232799 2012-03-10 23:10:18Z netchild */ #ifndef _LINUX_SYSPROTO_H_ @@ -1003,6 +1003,102 @@ struct linux_tee_args { struct linux_vmsplice_args { register_t dummy; }; +struct linux_move_pages_args { + register_t dummy; +}; +struct linux_getcpu_args { + register_t dummy; +}; +struct linux_epoll_pwait_args { + register_t dummy; +}; +struct linux_utimensat_args { + register_t dummy; +}; +struct linux_signalfd_args { + register_t dummy; +}; +struct linux_timerfd_create_args { + register_t dummy; +}; +struct linux_eventfd_args { + register_t dummy; +}; +struct linux_fallocate_args { + register_t dummy; +}; +struct linux_timerfd_settime_args { + register_t dummy; +}; +struct linux_timerfd_gettime_args { + register_t dummy; +}; +struct linux_signalfd4_args { + register_t dummy; +}; +struct linux_eventfd2_args { + register_t dummy; +}; +struct linux_epoll_create1_args { + register_t dummy; +}; +struct linux_dup3_args { + register_t dummy; +}; +struct linux_pipe2_args { + register_t dummy; +}; +struct linux_inotify_init1_args { + register_t dummy; +}; +struct linux_preadv_args { + register_t dummy; +}; +struct linux_pwritev_args { + register_t dummy; +}; +struct linux_rt_tsigqueueinfo_args { + register_t dummy; +}; +struct linux_perf_event_open_args { + register_t dummy; +}; +struct linux_recvmmsg_args { + register_t dummy; +}; +struct linux_fanotify_init_args { + register_t dummy; +}; +struct linux_fanotify_mark_args { + register_t dummy; +}; +struct linux_prlimit64_args { + register_t dummy; +}; +struct linux_name_to_handle_at_args { + register_t dummy; +}; +struct linux_open_by_handle_at_args { + register_t dummy; +}; +struct linux_clock_adjtime_args { + register_t dummy; +}; +struct linux_syncfs_args { + register_t dummy; +}; +struct linux_sendmmsg_args { + register_t dummy; +}; +struct linux_setns_args { + register_t dummy; +}; +struct linux_process_vm_readv_args { + register_t dummy; +}; +struct linux_process_vm_writev_args { + register_t dummy; +}; #define nosys linux_nosys int linux_fork(struct thread *, struct linux_fork_args *); int linux_open(struct thread *, struct linux_open_args *); @@ -1246,6 +1342,38 @@ int linux_splice(struct thread *, struct int linux_sync_file_range(struct thread *, struct linux_sync_file_range_args *); int linux_tee(struct thread *, struct linux_tee_args *); int linux_vmsplice(struct thread *, struct linux_vmsplice_args *); +int linux_move_pages(struct thread *, struct linux_move_pages_args *); +int linux_getcpu(struct thread *, struct linux_getcpu_args *); +int linux_epoll_pwait(struct thread *, struct linux_epoll_pwait_args *); +int linux_utimensat(struct thread *, struct linux_utimensat_args *); +int linux_signalfd(struct thread *, struct linux_signalfd_args *); +int linux_timerfd_create(struct thread *, struct linux_timerfd_create_args *); +int linux_eventfd(struct thread *, struct linux_eventfd_args *); +int linux_fallocate(struct thread *, struct linux_fallocate_args *); +int linux_timerfd_settime(struct thread *, struct linux_timerfd_settime_args *); +int linux_timerfd_gettime(struct thread *, struct linux_timerfd_gettime_args *); +int linux_signalfd4(struct thread *, struct linux_signalfd4_args *); +int linux_eventfd2(struct thread *, struct linux_eventfd2_args *); +int linux_epoll_create1(struct thread *, struct linux_epoll_create1_args *); +int linux_dup3(struct thread *, struct linux_dup3_args *); +int linux_pipe2(struct thread *, struct linux_pipe2_args *); +int linux_inotify_init1(struct thread *, struct linux_inotify_init1_args *); +int linux_preadv(struct thread *, struct linux_preadv_args *); +int linux_pwritev(struct thread *, struct linux_pwritev_args *); +int linux_rt_tsigqueueinfo(struct thread *, struct linux_rt_tsigqueueinfo_args *); +int linux_perf_event_open(struct thread *, struct linux_perf_event_open_args *); +int linux_recvmmsg(struct thread *, struct linux_recvmmsg_args *); +int linux_fanotify_init(struct thread *, struct linux_fanotify_init_args *); +int linux_fanotify_mark(struct thread *, struct linux_fanotify_mark_args *); +int linux_prlimit64(struct thread *, struct linux_prlimit64_args *); +int linux_name_to_handle_at(struct thread *, struct linux_name_to_handle_at_args *); +int linux_open_by_handle_at(struct thread *, struct linux_open_by_handle_at_args *); +int linux_clock_adjtime(struct thread *, struct linux_clock_adjtime_args *); +int linux_syncfs(struct thread *, struct linux_syncfs_args *); +int linux_sendmmsg(struct thread *, struct linux_sendmmsg_args *); +int linux_setns(struct thread *, struct linux_setns_args *); +int linux_process_vm_readv(struct thread *, struct linux_process_vm_readv_args *); +int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args *); #ifdef COMPAT_43 @@ -1516,6 +1644,38 @@ int linux_vmsplice(struct thread *, stru #define LINUX_SYS_AUE_linux_sync_file_range AUE_NULL #define LINUX_SYS_AUE_linux_tee AUE_NULL #define LINUX_SYS_AUE_linux_vmsplice AUE_NULL +#define LINUX_SYS_AUE_linux_move_pages AUE_NULL +#define LINUX_SYS_AUE_linux_getcpu AUE_NULL +#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL +#define LINUX_SYS_AUE_linux_utimensat AUE_NULL +#define LINUX_SYS_AUE_linux_signalfd AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL +#define LINUX_SYS_AUE_linux_eventfd AUE_NULL +#define LINUX_SYS_AUE_linux_fallocate AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_gettime AUE_NULL +#define LINUX_SYS_AUE_linux_signalfd4 AUE_NULL +#define LINUX_SYS_AUE_linux_eventfd2 AUE_NULL +#define LINUX_SYS_AUE_linux_epoll_create1 AUE_NULL +#define LINUX_SYS_AUE_linux_dup3 AUE_NULL +#define LINUX_SYS_AUE_linux_pipe2 AUE_NULL +#define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL +#define LINUX_SYS_AUE_linux_preadv AUE_NULL +#define LINUX_SYS_AUE_linux_pwritev AUE_NULL +#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL +#define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL +#define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL +#define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL +#define LINUX_SYS_AUE_linux_fanotify_mark AUE_NULL +#define LINUX_SYS_AUE_linux_prlimit64 AUE_NULL +#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL +#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL +#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL +#define LINUX_SYS_AUE_linux_syncfs AUE_NULL +#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL +#define LINUX_SYS_AUE_linux_setns AUE_NULL +#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL +#define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL #undef PAD_ #undef PADL_ Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/amd64/linux32/linux32_syscall.h Sat Mar 10 23:11:21 2012 (r232800) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 228957 2011-12-29 15:34:59Z jhb + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 232799 2012-03-10 23:10:18Z netchild */ #define LINUX_SYS_exit 1 @@ -289,4 +289,36 @@ #define LINUX_SYS_linux_sync_file_range 314 #define LINUX_SYS_linux_tee 315 #define LINUX_SYS_linux_vmsplice 316 -#define LINUX_SYS_MAXSYSCALL 317 +#define LINUX_SYS_linux_move_pages 317 +#define LINUX_SYS_linux_getcpu 318 +#define LINUX_SYS_linux_epoll_pwait 319 +#define LINUX_SYS_linux_utimensat 320 +#define LINUX_SYS_linux_signalfd 321 +#define LINUX_SYS_linux_timerfd_create 322 +#define LINUX_SYS_linux_eventfd 323 +#define LINUX_SYS_linux_fallocate 324 +#define LINUX_SYS_linux_timerfd_settime 325 +#define LINUX_SYS_linux_timerfd_gettime 326 +#define LINUX_SYS_linux_signalfd4 327 +#define LINUX_SYS_linux_eventfd2 328 +#define LINUX_SYS_linux_epoll_create1 329 +#define LINUX_SYS_linux_dup3 330 +#define LINUX_SYS_linux_pipe2 331 +#define LINUX_SYS_linux_inotify_init1 332 +#define LINUX_SYS_linux_preadv 333 +#define LINUX_SYS_linux_pwritev 334 +#define LINUX_SYS_linux_rt_tsigqueueinfo 335 +#define LINUX_SYS_linux_perf_event_open 336 +#define LINUX_SYS_linux_recvmmsg 337 +#define LINUX_SYS_linux_fanotify_init 338 +#define LINUX_SYS_linux_fanotify_mark 339 +#define LINUX_SYS_linux_prlimit64 340 +#define LINUX_SYS_linux_name_to_handle_at 341 +#define LINUX_SYS_linux_open_by_handle_at 342 +#define LINUX_SYS_linux_clock_adjtime 343 +#define LINUX_SYS_linux_syncfs 344 +#define LINUX_SYS_linux_sendmmsg 345 +#define LINUX_SYS_linux_setns 346 +#define LINUX_SYS_linux_process_vm_readv 347 +#define LINUX_SYS_linux_process_vm_writev 348 +#define LINUX_SYS_MAXSYSCALL 349 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/amd64/linux32/linux32_syscalls.c Sat Mar 10 23:11:21 2012 (r232800) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 228957 2011-12-29 15:34:59Z jhb + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 232799 2012-03-10 23:10:18Z netchild */ const char *linux_syscallnames[] = { @@ -281,7 +281,7 @@ const char *linux_syscallnames[] = { "linux_tgkill", /* 270 = linux_tgkill */ "linux_utimes", /* 271 = linux_utimes */ "linux_fadvise64_64", /* 272 = linux_fadvise64_64 */ - "#273", /* 273 = */ + "#273", /* 273 = vserver */ "linux_mbind", /* 274 = linux_mbind */ "linux_get_mempolicy", /* 275 = linux_get_mempolicy */ "linux_set_mempolicy", /* 276 = linux_set_mempolicy */ @@ -325,4 +325,36 @@ const char *linux_syscallnames[] = { "linux_sync_file_range", /* 314 = linux_sync_file_range */ "linux_tee", /* 315 = linux_tee */ "linux_vmsplice", /* 316 = linux_vmsplice */ + "linux_move_pages", /* 317 = linux_move_pages */ + "linux_getcpu", /* 318 = linux_getcpu */ + "linux_epoll_pwait", /* 319 = linux_epoll_pwait */ + "linux_utimensat", /* 320 = linux_utimensat */ + "linux_signalfd", /* 321 = linux_signalfd */ + "linux_timerfd_create", /* 322 = linux_timerfd_create */ + "linux_eventfd", /* 323 = linux_eventfd */ + "linux_fallocate", /* 324 = linux_fallocate */ + "linux_timerfd_settime", /* 325 = linux_timerfd_settime */ + "linux_timerfd_gettime", /* 326 = linux_timerfd_gettime */ + "linux_signalfd4", /* 327 = linux_signalfd4 */ + "linux_eventfd2", /* 328 = linux_eventfd2 */ + "linux_epoll_create1", /* 329 = linux_epoll_create1 */ + "linux_dup3", /* 330 = linux_dup3 */ + "linux_pipe2", /* 331 = linux_pipe2 */ + "linux_inotify_init1", /* 332 = linux_inotify_init1 */ + "linux_preadv", /* 333 = linux_preadv */ + "linux_pwritev", /* 334 = linux_pwritev */ + "linux_rt_tsigqueueinfo", /* 335 = linux_rt_tsigqueueinfo */ + "linux_perf_event_open", /* 336 = linux_perf_event_open */ + "linux_recvmmsg", /* 337 = linux_recvmmsg */ + "linux_fanotify_init", /* 338 = linux_fanotify_init */ + "linux_fanotify_mark", /* 339 = linux_fanotify_mark */ + "linux_prlimit64", /* 340 = linux_prlimit64 */ + "linux_name_to_handle_at", /* 341 = linux_name_to_handle_at */ + "linux_open_by_handle_at", /* 342 = linux_open_by_handle_at */ + "linux_clock_adjtime", /* 343 = linux_clock_adjtime */ + "linux_syncfs", /* 344 = linux_syncfs */ + "linux_sendmmsg", /* 345 = linux_sendmmsg */ + "linux_setns", /* 346 = linux_setns */ + "linux_process_vm_readv", /* 347 = linux_process_vm_readv */ + "linux_process_vm_writev", /* 348 = linux_process_vm_writev */ }; Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/amd64/linux32/linux32_sysent.c Sat Mar 10 23:11:21 2012 (r232800) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 228957 2011-12-29 15:34:59Z jhb + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 232799 2012-03-10 23:10:18Z netchild */ #include "opt_compat.h" @@ -292,7 +292,7 @@ struct sysent linux_sysent[] = { { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = vserver */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_get_mempolicy */ { 0, (sy_call_t *)linux_set_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 276 = linux_set_mempolicy */ @@ -336,4 +336,36 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sync_file_range */ { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_tee */ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */ + { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ + { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */ + { 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ + { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ + { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ + { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ + { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ + { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ + { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ + { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ + { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ + { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ + { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ + { 0, (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ + { 0, (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ + { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */ + { 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */ + { 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */ + { 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tsigqueueinfo */ + { 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = linux_perf_event_open */ + { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ + { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */ + { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */ + { 0, (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ + { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */ + { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ + { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ + { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ + { 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ + { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ + { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ + { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */ }; Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/amd64/linux32/linux32_systrace_args.c Sat Mar 10 23:11:21 2012 (r232800) @@ -2100,6 +2100,166 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } + /* linux_move_pages */ + case 317: { + *n_args = 0; + break; + } + /* linux_getcpu */ + case 318: { + *n_args = 0; + break; + } + /* linux_epoll_pwait */ + case 319: { + *n_args = 0; + break; + } + /* linux_utimensat */ + case 320: { + *n_args = 0; + break; + } + /* linux_signalfd */ + case 321: { + *n_args = 0; + break; + } + /* linux_timerfd_create */ + case 322: { + *n_args = 0; + break; + } + /* linux_eventfd */ + case 323: { + *n_args = 0; + break; + } + /* linux_fallocate */ + case 324: { + *n_args = 0; + break; + } + /* linux_timerfd_settime */ + case 325: { + *n_args = 0; + break; + } + /* linux_timerfd_gettime */ + case 326: { + *n_args = 0; + break; + } + /* linux_signalfd4 */ + case 327: { + *n_args = 0; + break; + } + /* linux_eventfd2 */ + case 328: { + *n_args = 0; + break; + } + /* linux_epoll_create1 */ + case 329: { + *n_args = 0; + break; + } + /* linux_dup3 */ + case 330: { + *n_args = 0; + break; + } + /* linux_pipe2 */ + case 331: { + *n_args = 0; + break; + } + /* linux_inotify_init1 */ + case 332: { + *n_args = 0; + break; + } + /* linux_preadv */ + case 333: { + *n_args = 0; + break; + } + /* linux_pwritev */ + case 334: { + *n_args = 0; + break; + } + /* linux_rt_tsigqueueinfo */ + case 335: { + *n_args = 0; + break; + } + /* linux_perf_event_open */ + case 336: { + *n_args = 0; + break; + } + /* linux_recvmmsg */ + case 337: { + *n_args = 0; + break; + } + /* linux_fanotify_init */ + case 338: { + *n_args = 0; + break; + } + /* linux_fanotify_mark */ + case 339: { + *n_args = 0; + break; + } + /* linux_prlimit64 */ + case 340: { + *n_args = 0; + break; + } + /* linux_name_to_handle_at */ + case 341: { + *n_args = 0; + break; + } + /* linux_open_by_handle_at */ + case 342: { + *n_args = 0; + break; + } + /* linux_clock_adjtime */ + case 343: { + *n_args = 0; + break; + } + /* linux_syncfs */ + case 344: { + *n_args = 0; + break; + } + /* linux_sendmmsg */ + case 345: { + *n_args = 0; + break; + } + /* linux_setns */ + case 346: { + *n_args = 0; + break; + } + /* linux_process_vm_readv */ + case 347: { + *n_args = 0; + break; + } + /* linux_process_vm_writev */ + case 348: { + *n_args = 0; + break; + } default: *n_args = 0; break; @@ -5164,6 +5324,102 @@ systrace_entry_setargdesc(int sysnum, in /* linux_vmsplice */ case 316: break; + /* linux_move_pages */ + case 317: + break; + /* linux_getcpu */ + case 318: + break; + /* linux_epoll_pwait */ + case 319: + break; + /* linux_utimensat */ + case 320: + break; + /* linux_signalfd */ + case 321: + break; + /* linux_timerfd_create */ + case 322: + break; + /* linux_eventfd */ + case 323: + break; + /* linux_fallocate */ + case 324: + break; + /* linux_timerfd_settime */ + case 325: + break; + /* linux_timerfd_gettime */ + case 326: + break; + /* linux_signalfd4 */ + case 327: + break; + /* linux_eventfd2 */ + case 328: + break; + /* linux_epoll_create1 */ + case 329: + break; + /* linux_dup3 */ + case 330: + break; + /* linux_pipe2 */ + case 331: + break; + /* linux_inotify_init1 */ + case 332: + break; + /* linux_preadv */ + case 333: + break; + /* linux_pwritev */ + case 334: + break; + /* linux_rt_tsigqueueinfo */ + case 335: + break; + /* linux_perf_event_open */ + case 336: + break; + /* linux_recvmmsg */ + case 337: + break; + /* linux_fanotify_init */ + case 338: + break; + /* linux_fanotify_mark */ + case 339: + break; + /* linux_prlimit64 */ + case 340: + break; + /* linux_name_to_handle_at */ + case 341: + break; + /* linux_open_by_handle_at */ + case 342: + break; + /* linux_clock_adjtime */ + case 343: + break; + /* linux_syncfs */ + case 344: + break; + /* linux_sendmmsg */ + case 345: + break; + /* linux_setns */ + case 346: + break; + /* linux_process_vm_readv */ + case 347: + break; + /* linux_process_vm_writev */ + case 348: + break; default: break; }; @@ -6335,6 +6591,70 @@ systrace_return_setargdesc(int sysnum, i case 315: /* linux_vmsplice */ case 316: + /* linux_move_pages */ + case 317: + /* linux_getcpu */ + case 318: + /* linux_epoll_pwait */ + case 319: + /* linux_utimensat */ + case 320: + /* linux_signalfd */ + case 321: + /* linux_timerfd_create */ + case 322: + /* linux_eventfd */ + case 323: + /* linux_fallocate */ + case 324: + /* linux_timerfd_settime */ + case 325: + /* linux_timerfd_gettime */ + case 326: + /* linux_signalfd4 */ + case 327: + /* linux_eventfd2 */ + case 328: + /* linux_epoll_create1 */ + case 329: + /* linux_dup3 */ + case 330: + /* linux_pipe2 */ + case 331: + /* linux_inotify_init1 */ + case 332: + /* linux_preadv */ + case 333: + /* linux_pwritev */ + case 334: + /* linux_rt_tsigqueueinfo */ + case 335: + /* linux_perf_event_open */ + case 336: + /* linux_recvmmsg */ + case 337: + /* linux_fanotify_init */ + case 338: + /* linux_fanotify_mark */ + case 339: + /* linux_prlimit64 */ + case 340: + /* linux_name_to_handle_at */ + case 341: + /* linux_open_by_handle_at */ + case 342: + /* linux_clock_adjtime */ + case 343: + /* linux_syncfs */ + case 344: + /* linux_sendmmsg */ + case 345: + /* linux_setns */ + case 346: + /* linux_process_vm_readv */ + case 347: + /* linux_process_vm_writev */ + case 348: default: break; }; Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/i386/linux/linux_proto.h Sat Mar 10 23:11:21 2012 (r232800) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 228957 2011-12-29 15:34:59Z jhb + * created from FreeBSD: head/sys/i386/linux/syscalls.master 232799 2012-03-10 23:10:18Z netchild */ #ifndef _LINUX_SYSPROTO_H_ @@ -1022,6 +1022,102 @@ struct linux_tee_args { struct linux_vmsplice_args { register_t dummy; }; +struct linux_move_pages_args { + register_t dummy; +}; +struct linux_getcpu_args { + register_t dummy; +}; +struct linux_epoll_pwait_args { + register_t dummy; +}; +struct linux_utimensat_args { + register_t dummy; +}; +struct linux_signalfd_args { + register_t dummy; +}; +struct linux_timerfd_create_args { + register_t dummy; +}; +struct linux_eventfd_args { + register_t dummy; +}; +struct linux_fallocate_args { + register_t dummy; +}; +struct linux_timerfd_settime_args { + register_t dummy; +}; +struct linux_timerfd_gettime_args { + register_t dummy; +}; +struct linux_signalfd4_args { + register_t dummy; +}; +struct linux_eventfd2_args { + register_t dummy; +}; +struct linux_epoll_create1_args { + register_t dummy; +}; +struct linux_dup3_args { + register_t dummy; +}; +struct linux_pipe2_args { + register_t dummy; +}; +struct linux_inotify_init1_args { + register_t dummy; +}; +struct linux_preadv_args { + register_t dummy; +}; +struct linux_pwritev_args { + register_t dummy; +}; +struct linux_rt_tsigqueueinfo_args { + register_t dummy; +}; +struct linux_perf_event_open_args { + register_t dummy; +}; +struct linux_recvmmsg_args { + register_t dummy; +}; +struct linux_fanotify_init_args { + register_t dummy; +}; +struct linux_fanotify_mark_args { + register_t dummy; +}; +struct linux_prlimit64_args { + register_t dummy; +}; +struct linux_name_to_handle_at_args { + register_t dummy; +}; +struct linux_open_by_handle_at_args { + register_t dummy; +}; +struct linux_clock_adjtime_args { + register_t dummy; +}; +struct linux_syncfs_args { + register_t dummy; +}; +struct linux_sendmmsg_args { + register_t dummy; +}; +struct linux_setns_args { + register_t dummy; +}; +struct linux_process_vm_readv_args { + register_t dummy; +}; +struct linux_process_vm_writev_args { + register_t dummy; +}; #define nosys linux_nosys int linux_fork(struct thread *, struct linux_fork_args *); int linux_open(struct thread *, struct linux_open_args *); @@ -1266,6 +1362,38 @@ int linux_splice(struct thread *, struct int linux_sync_file_range(struct thread *, struct linux_sync_file_range_args *); int linux_tee(struct thread *, struct linux_tee_args *); int linux_vmsplice(struct thread *, struct linux_vmsplice_args *); +int linux_move_pages(struct thread *, struct linux_move_pages_args *); +int linux_getcpu(struct thread *, struct linux_getcpu_args *); +int linux_epoll_pwait(struct thread *, struct linux_epoll_pwait_args *); +int linux_utimensat(struct thread *, struct linux_utimensat_args *); +int linux_signalfd(struct thread *, struct linux_signalfd_args *); +int linux_timerfd_create(struct thread *, struct linux_timerfd_create_args *); +int linux_eventfd(struct thread *, struct linux_eventfd_args *); +int linux_fallocate(struct thread *, struct linux_fallocate_args *); +int linux_timerfd_settime(struct thread *, struct linux_timerfd_settime_args *); +int linux_timerfd_gettime(struct thread *, struct linux_timerfd_gettime_args *); +int linux_signalfd4(struct thread *, struct linux_signalfd4_args *); +int linux_eventfd2(struct thread *, struct linux_eventfd2_args *); +int linux_epoll_create1(struct thread *, struct linux_epoll_create1_args *); +int linux_dup3(struct thread *, struct linux_dup3_args *); +int linux_pipe2(struct thread *, struct linux_pipe2_args *); +int linux_inotify_init1(struct thread *, struct linux_inotify_init1_args *); +int linux_preadv(struct thread *, struct linux_preadv_args *); +int linux_pwritev(struct thread *, struct linux_pwritev_args *); +int linux_rt_tsigqueueinfo(struct thread *, struct linux_rt_tsigqueueinfo_args *); +int linux_perf_event_open(struct thread *, struct linux_perf_event_open_args *); +int linux_recvmmsg(struct thread *, struct linux_recvmmsg_args *); +int linux_fanotify_init(struct thread *, struct linux_fanotify_init_args *); +int linux_fanotify_mark(struct thread *, struct linux_fanotify_mark_args *); +int linux_prlimit64(struct thread *, struct linux_prlimit64_args *); +int linux_name_to_handle_at(struct thread *, struct linux_name_to_handle_at_args *); +int linux_open_by_handle_at(struct thread *, struct linux_open_by_handle_at_args *); +int linux_clock_adjtime(struct thread *, struct linux_clock_adjtime_args *); +int linux_syncfs(struct thread *, struct linux_syncfs_args *); +int linux_sendmmsg(struct thread *, struct linux_sendmmsg_args *); +int linux_setns(struct thread *, struct linux_setns_args *); +int linux_process_vm_readv(struct thread *, struct linux_process_vm_readv_args *); +int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args *); #ifdef COMPAT_43 @@ -1537,6 +1665,38 @@ int linux_vmsplice(struct thread *, stru #define LINUX_SYS_AUE_linux_sync_file_range AUE_NULL #define LINUX_SYS_AUE_linux_tee AUE_NULL #define LINUX_SYS_AUE_linux_vmsplice AUE_NULL +#define LINUX_SYS_AUE_linux_move_pages AUE_NULL +#define LINUX_SYS_AUE_linux_getcpu AUE_NULL +#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL +#define LINUX_SYS_AUE_linux_utimensat AUE_NULL +#define LINUX_SYS_AUE_linux_signalfd AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL +#define LINUX_SYS_AUE_linux_eventfd AUE_NULL +#define LINUX_SYS_AUE_linux_fallocate AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_gettime AUE_NULL +#define LINUX_SYS_AUE_linux_signalfd4 AUE_NULL +#define LINUX_SYS_AUE_linux_eventfd2 AUE_NULL +#define LINUX_SYS_AUE_linux_epoll_create1 AUE_NULL +#define LINUX_SYS_AUE_linux_dup3 AUE_NULL +#define LINUX_SYS_AUE_linux_pipe2 AUE_NULL +#define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL +#define LINUX_SYS_AUE_linux_preadv AUE_NULL +#define LINUX_SYS_AUE_linux_pwritev AUE_NULL +#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL +#define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL +#define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL +#define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL +#define LINUX_SYS_AUE_linux_fanotify_mark AUE_NULL +#define LINUX_SYS_AUE_linux_prlimit64 AUE_NULL +#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL +#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL +#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL +#define LINUX_SYS_AUE_linux_syncfs AUE_NULL +#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL +#define LINUX_SYS_AUE_linux_setns AUE_NULL +#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL +#define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL #undef PAD_ #undef PADL_ Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/i386/linux/linux_syscall.h Sat Mar 10 23:11:21 2012 (r232800) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 228957 2011-12-29 15:34:59Z jhb + * created from FreeBSD: head/sys/i386/linux/syscalls.master 232799 2012-03-10 23:10:18Z netchild */ #define LINUX_SYS_exit 1 @@ -296,4 +296,36 @@ #define LINUX_SYS_linux_sync_file_range 314 #define LINUX_SYS_linux_tee 315 #define LINUX_SYS_linux_vmsplice 316 -#define LINUX_SYS_MAXSYSCALL 317 +#define LINUX_SYS_linux_move_pages 317 +#define LINUX_SYS_linux_getcpu 318 +#define LINUX_SYS_linux_epoll_pwait 319 +#define LINUX_SYS_linux_utimensat 320 +#define LINUX_SYS_linux_signalfd 321 +#define LINUX_SYS_linux_timerfd_create 322 +#define LINUX_SYS_linux_eventfd 323 +#define LINUX_SYS_linux_fallocate 324 +#define LINUX_SYS_linux_timerfd_settime 325 +#define LINUX_SYS_linux_timerfd_gettime 326 +#define LINUX_SYS_linux_signalfd4 327 +#define LINUX_SYS_linux_eventfd2 328 +#define LINUX_SYS_linux_epoll_create1 329 +#define LINUX_SYS_linux_dup3 330 +#define LINUX_SYS_linux_pipe2 331 +#define LINUX_SYS_linux_inotify_init1 332 +#define LINUX_SYS_linux_preadv 333 +#define LINUX_SYS_linux_pwritev 334 +#define LINUX_SYS_linux_rt_tsigqueueinfo 335 +#define LINUX_SYS_linux_perf_event_open 336 +#define LINUX_SYS_linux_recvmmsg 337 +#define LINUX_SYS_linux_fanotify_init 338 +#define LINUX_SYS_linux_fanotify_mark 339 +#define LINUX_SYS_linux_prlimit64 340 +#define LINUX_SYS_linux_name_to_handle_at 341 +#define LINUX_SYS_linux_open_by_handle_at 342 +#define LINUX_SYS_linux_clock_adjtime 343 +#define LINUX_SYS_linux_syncfs 344 +#define LINUX_SYS_linux_sendmmsg 345 +#define LINUX_SYS_linux_setns 346 +#define LINUX_SYS_linux_process_vm_readv 347 +#define LINUX_SYS_linux_process_vm_writev 348 +#define LINUX_SYS_MAXSYSCALL 349 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/i386/linux/linux_syscalls.c Sat Mar 10 23:11:21 2012 (r232800) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 228957 2011-12-29 15:34:59Z jhb + * created from FreeBSD: head/sys/i386/linux/syscalls.master 232799 2012-03-10 23:10:18Z netchild */ const char *linux_syscallnames[] = { @@ -281,7 +281,7 @@ const char *linux_syscallnames[] = { "linux_tgkill", /* 270 = linux_tgkill */ "linux_utimes", /* 271 = linux_utimes */ "linux_fadvise64_64", /* 272 = linux_fadvise64_64 */ - "#273", /* 273 = */ + "#273", /* 273 = vserver */ "linux_mbind", /* 274 = linux_mbind */ "linux_get_mempolicy", /* 275 = linux_get_mempolicy */ "linux_set_mempolicy", /* 276 = linux_set_mempolicy */ @@ -325,4 +325,36 @@ const char *linux_syscallnames[] = { "linux_sync_file_range", /* 314 = linux_sync_file_range */ "linux_tee", /* 315 = linux_tee */ "linux_vmsplice", /* 316 = linux_vmsplice */ + "linux_move_pages", /* 317 = linux_move_pages */ + "linux_getcpu", /* 318 = linux_getcpu */ + "linux_epoll_pwait", /* 319 = linux_epoll_pwait */ + "linux_utimensat", /* 320 = linux_utimensat */ + "linux_signalfd", /* 321 = linux_signalfd */ + "linux_timerfd_create", /* 322 = linux_timerfd_create */ + "linux_eventfd", /* 323 = linux_eventfd */ + "linux_fallocate", /* 324 = linux_fallocate */ + "linux_timerfd_settime", /* 325 = linux_timerfd_settime */ + "linux_timerfd_gettime", /* 326 = linux_timerfd_gettime */ + "linux_signalfd4", /* 327 = linux_signalfd4 */ + "linux_eventfd2", /* 328 = linux_eventfd2 */ + "linux_epoll_create1", /* 329 = linux_epoll_create1 */ + "linux_dup3", /* 330 = linux_dup3 */ + "linux_pipe2", /* 331 = linux_pipe2 */ + "linux_inotify_init1", /* 332 = linux_inotify_init1 */ + "linux_preadv", /* 333 = linux_preadv */ + "linux_pwritev", /* 334 = linux_pwritev */ + "linux_rt_tsigqueueinfo", /* 335 = linux_rt_tsigqueueinfo */ + "linux_perf_event_open", /* 336 = linux_perf_event_open */ + "linux_recvmmsg", /* 337 = linux_recvmmsg */ + "linux_fanotify_init", /* 338 = linux_fanotify_init */ + "linux_fanotify_mark", /* 339 = linux_fanotify_mark */ + "linux_prlimit64", /* 340 = linux_prlimit64 */ + "linux_name_to_handle_at", /* 341 = linux_name_to_handle_at */ + "linux_open_by_handle_at", /* 342 = linux_open_by_handle_at */ + "linux_clock_adjtime", /* 343 = linux_clock_adjtime */ + "linux_syncfs", /* 344 = linux_syncfs */ + "linux_sendmmsg", /* 345 = linux_sendmmsg */ + "linux_setns", /* 346 = linux_setns */ + "linux_process_vm_readv", /* 347 = linux_process_vm_readv */ + "linux_process_vm_writev", /* 348 = linux_process_vm_writev */ }; Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sat Mar 10 23:10:18 2012 (r232799) +++ head/sys/i386/linux/linux_sysent.c Sat Mar 10 23:11:21 2012 (r232800) @@ -3,7 +3,7 @@ * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Mar 10 23:27:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 974991065672; Sat, 10 Mar 2012 23:27:04 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 696FF8FC08; Sat, 10 Mar 2012 23:27: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 q2ANR4J4083340; Sat, 10 Mar 2012 23:27:04 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2ANR4wv083339; Sat, 10 Mar 2012 23:27:04 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201203102327.q2ANR4wv083339@svn.freebsd.org> From: Juli Mallett Date: Sat, 10 Mar 2012 23:27: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: r232801 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2012 23:27:04 -0000 Author: jmallett Date: Sat Mar 10 23:27:03 2012 New Revision: 232801 URL: http://svn.freebsd.org/changeset/base/232801 Log: Remove some headers not used by kernel or world and which are not present in other ports. Deleted: head/sys/mips/include/bswap.h head/sys/mips/include/clockvar.h head/sys/mips/include/cputypes.h head/sys/mips/include/iodev.h head/sys/mips/include/mp_watchdog.h head/sys/mips/include/pci_cfgreg.h head/sys/mips/include/ppireg.h head/sys/mips/include/timerreg.h