From dd315e14c555b0b686ca29b5cd709d0069b45c31 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Mon, 19 Oct 2015 22:27:32 +0000 Subject: Add missing .PHONY for parallel subdir target. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 037a7fe..9624a11 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -102,7 +102,7 @@ __deps= .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${__dep} .endfor -${__target}_subdir_${__dir}: .MAKE ${__deps} +${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) @${_+_}if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \ -- cgit v1.1 From 7e742cf0a04e3fcc4ff79b8baad8964671acfd63 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Mon, 19 Oct 2015 23:34:35 +0000 Subject: Replace all of the duplicated logic for recursing into a subdir with one implementation. It is duplicated at run-time but is more easily maintainable now. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 47 +++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 30 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 9624a11..10a3016 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -63,30 +63,25 @@ distribute: .MAKE .endfor .endif +# Subdir code shared among 'make ', 'make ' and SUBDIR_PARALLEL. +_SUBDIR_SH= \ + if test -d ${.CURDIR}/$${dir}.${MACHINE_ARCH}; then \ + dir=$${dir}.${MACHINE_ARCH}; \ + fi; \ + ${ECHODIR} "===> ${DIRPRFX}$${dir} ($${target})"; \ + cd ${.CURDIR}/$${dir}; \ + ${MAKE} $${target} DIRPRFX=${DIRPRFX}$${dir}/ + _SUBDIR: .USE .MAKE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}for entry in ${SUBDIR:N.WAIT}; do \ - if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ - ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ - edir=$${entry}.${MACHINE_ARCH}; \ - cd ${.CURDIR}/$${edir}; \ - else \ - ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ - edir=$${entry}; \ - cd ${.CURDIR}/$${edir}; \ - fi; \ - ${MAKE} ${.TARGET:S,realinstall,install,:S,^_sub.,,} \ - DIRPRFX=${DIRPRFX}$$edir/; \ - done + @${_+_}target=${.TARGET:S,realinstall,install,:S,^_sub.,,}; \ + for dir in ${SUBDIR:N.WAIT}; do ${_SUBDIR_SH}; done .endif ${SUBDIR:N.WAIT}: .PHONY .MAKE - ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ - cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ - else \ - cd ${.CURDIR}/${.TARGET}; \ - fi; \ - ${MAKE} all + ${_+_}@target=all; \ + dir=${.TARGET}; \ + ${_SUBDIR_SH}; # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT @@ -104,17 +99,9 @@ __deps+= ${__target}_subdir_${__dep} .endfor ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) - @${_+_}if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ - ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \ - edir=${__dir}.${MACHINE_ARCH}; \ - cd ${.CURDIR}/$${edir}; \ - else \ - ${ECHODIR} "===> ${DIRPRFX}${__dir} (${__target:realinstall=install})"; \ - edir=${__dir}; \ - cd ${.CURDIR}/$${edir}; \ - fi; \ - ${MAKE} ${__target:realinstall=install} \ - DIRPRFX=${DIRPRFX}$$edir/ + @${_+_}target=${__target:realinstall=install}; \ + dir=${__dir}; \ + ${_SUBDIR_SH}; .endif .endif .endfor -- cgit v1.1 From 1173dc89748881ea7d9180f640d78f082d7e7898 Mon Sep 17 00:00:00 2001 From: pluknet Date: Tue, 20 Oct 2015 11:37:16 +0000 Subject: o NetBSD 7.0, OpenBSD 5.8, FreeBSD 10.2, OS X 10.11 added. --- share/misc/bsd-family-tree | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'share') diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 4ff700d..ad954d1 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -320,17 +320,21 @@ FreeBSD 5.2 | | | | | | | | OpenBSD 5.6 | | FreeBSD | | | | | 10.1 | | | DragonFly 4.0.1 - | | | | | - | | | | DragonFly 4.0.2 - | | | | | - | | | | DragonFly 4.0.3 - | | | | | - | | | | DragonFly 4.0.4 - | | | | | - | | | | DragonFly 4.0.5 - | | | | | - | | | OpenBSD 5.7 | - | | | | DragonFly 4.2.0 + | | | | | | + | | | | | DragonFly 4.0.2 + | | | | | | + | | | | | DragonFly 4.0.3 + | | | | | | + | | | | | DragonFly 4.0.4 + | | | | | | + | | | | | DragonFly 4.0.5 + | | | | | | + | | | | OpenBSD 5.7 | + | | | | | DragonFly 4.2.0 + | FreeBSD | | | | + | 10.2 | | | | + | OS X NetBSD 7.0 | | + | 10.11 | OpenBSD 5.8 | | | | | | FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -673,6 +677,10 @@ DragonFly 4.0.4 2015-03-09 [DFB] DragonFly 4.0.5 2015-03-23 [DFB] OpenBSD 5.7 2015-05-01 [OBD] DragonFly 4.2.0 2015-06-29 [DFB] +FreeBSD 10.2 2015-08-13 [FBD] +NetBSD 7.0 2015-09-25 [NBD] +OS X 10.11 2015-09-30 [APL] +OpenBSD 5.8 2015-10-18 [OBD] Bibliography ------------------------ -- cgit v1.1 From c197d1a9f750051ae14c18eccbe64db5d75a1d03 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 20 Oct 2015 20:15:25 +0000 Subject: Pass COMPILER_TYPE and COMPILER_VERSION to sub-makes to avoid redundant lookups. This uses a special variable name based on a hash of ${CC}, ${PATH}, and ${MACHINE} to ensure that a cached value is not used if any of these values changes to use a new compiler. Before this there were 34,620 fork/exec from bsd.compiler.mk during a buildworld. After this there are 608. More improvement is needed to cache a value from the top-level before descending into subdirs in the various build phases. Reviewed by: brooks (earlier version) MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3898 --- share/mk/bsd.compiler.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'share') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index dcdf598..46cc8c3 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -25,6 +25,18 @@ .if !target(____) ____: +# Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. +# The value is only used/exported for the same environment that impacts +# CC and COMPILER_* settings here. +_exported_vars= COMPILER_TYPE COMPILER_VERSION +_cc_hash= ${CC}${MACHINE}${PATH} +_cc_hash:= ${_cc_hash:hash} +.for var in ${_exported_vars} +.if defined(${var}.${_cc_hash}) +${var}= ${${var}.${_cc_hash}} +.endif +.endfor + .if ${MACHINE} == "common" # common is a pseudo machine for architecture independent # generated files - thus there is no compiler. @@ -54,6 +66,14 @@ COMPILER_VERSION!=echo ${_v:M[1-9].[0-9]*} | awk -F. '{print $$1 * 10000 + $$2 * .undef _v .endif +# Export the values so sub-makes don't have to look them up again, using the +# hash key computed above. +.for var in ${_exported_vars} +${var}.${_cc_hash}:= ${${var}} +.export-env ${var}.${_cc_hash} +.undef ${var}.${_cc_hash} +.endfor + .if ${COMPILER_TYPE} == "clang" || \ (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800) COMPILER_FEATURES= c++11 -- cgit v1.1 From 235f7c0a8ee73d53f7839a231553d209705c70e3 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 20 Oct 2015 20:37:00 +0000 Subject: Improve safety of caching from r289659 by only importing of none of the variables are already set. This should cover odd cases such as the COMPILER_TYPE override in lib/csu/powerpc64. X-MFC-With: r289659 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.compiler.mk | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'share') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 46cc8c3..3ba5130 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -31,11 +31,20 @@ ____: _exported_vars= COMPILER_TYPE COMPILER_VERSION _cc_hash= ${CC}${MACHINE}${PATH} _cc_hash:= ${_cc_hash:hash} +# Only import if none of the vars are set somehow else. +_can_export= yes +.for var in ${_exported_vars} +.if defined(${var}) +_can_export= no +.endif +.endfor +.if ${_can_export} == yes .for var in ${_exported_vars} .if defined(${var}.${_cc_hash}) ${var}= ${${var}.${_cc_hash}} .endif .endfor +.endif .if ${MACHINE} == "common" # common is a pseudo machine for architecture independent -- cgit v1.1 From b7af74b7e73add663b8b790f8b1bc03b22310884 Mon Sep 17 00:00:00 2001 From: cem Date: Tue, 20 Oct 2015 23:48:14 +0000 Subject: Document cpuset(9) A follow-up to r289467. Coerced by: jhb Sponsored by: EMC / Isilon Storage Division --- share/man/man9/Makefile | 26 ++++ share/man/man9/bitset.9 | 19 +-- share/man/man9/cpuset.9 | 350 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 381 insertions(+), 14 deletions(-) create mode 100644 share/man/man9/cpuset.9 (limited to 'share') diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index a529366..1ef9f4c 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -57,6 +57,7 @@ MAN= accept_filter.9 \ contigmalloc.9 \ copy.9 \ counter.9 \ + cpuset.9 \ cr_cansee.9 \ critical_enter.9 \ cr_seeothergids.9 \ @@ -636,6 +637,31 @@ MLINKS+=counter.9 counter_u64_alloc.9 \ counter.9 counter_u64_add_protected.9 \ counter.9 counter_u64_fetch.9 \ counter.9 counter_u64_zero.9 +MLINKS+=cpuset.9 CPUSET_T_INITIALIZER.9 \ + cpuset.9 CPUSET_FSET.9 \ + cpuset.9 CPU_CLR.9 \ + cpuset.9 CPU_COPY.9 \ + cpuset.9 CPU_ISSET.9 \ + cpuset.9 CPU_SET.9 \ + cpuset.9 CPU_ZERO.9 \ + cpuset.9 CPU_FILL.9 \ + cpuset.9 CPU_SETOF.9 \ + cpuset.9 CPU_EMPTY.9 \ + cpuset.9 CPU_ISFULLSET.9 \ + cpuset.9 CPU_FFS.9 \ + cpuset.9 CPU_COUNT.9 \ + cpuset.9 CPU_SUBSET.9 \ + cpuset.9 CPU_OVERLAP.9 \ + cpuset.9 CPU_CMP.9 \ + cpuset.9 CPU_OR.9 \ + cpuset.9 CPU_AND.9 \ + cpuset.9 CPU_NAND.9 \ + cpuset.9 CPU_CLR_ATOMIC.9 \ + cpuset.9 CPU_SET_ATOMIC.9 \ + cpuset.9 CPU_SET_ATOMIC_ACQ.9 \ + cpuset.9 CPU_AND_ATOMIC.9 \ + cpuset.9 CPU_OR_ATOMIC.9 \ + cpuset.9 CPU_COPY_STORE_REL.9 MLINKS+=critical_enter.9 critical.9 \ critical_enter.9 critical_exit.9 MLINKS+=crypto.9 crypto_dispatch.9 \ diff --git a/share/man/man9/bitset.9 b/share/man/man9/bitset.9 index 361b0e5..19f53a2 100644 --- a/share/man/man9/bitset.9 +++ b/share/man/man9/bitset.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2015 +.Dd October 20, 2015 .Dt BITSET 9 .Os .Sh NAME @@ -352,16 +352,9 @@ myset = BITSET_T_INITIALIZER(BITSET_FSET(__bitset_words(MYSETSIZE))); myset = BITSET_T_INITIALIZER(0x1); .Ed .Sh SEE ALSO -The older -.Xr bitstring 3 . +.Xr bitstring 3 , +.Xr cpuset 9 .Sh HISTORY -.In sys/cpuset.h -first appeared in -.Fx 7.1 , -released in January 2009, and in -.Fx 8.0 , -released in November 2009 . -.Pp The .Nm macros first appeared in @@ -377,11 +370,9 @@ This manual page first appeared in .An -nosplit The .Nm -macros were written for +macros were generalized and pulled out of .In sys/cpuset.h -by -.An Jeff Roberson Aq Mt jeff@FreeBSD.org ; -they were generalized and pulled out as +as .In sys/_bitset.h and .In sys/bitset.h diff --git a/share/man/man9/cpuset.9 b/share/man/man9/cpuset.9 new file mode 100644 index 0000000..2104a090 --- /dev/null +++ b/share/man/man9/cpuset.9 @@ -0,0 +1,350 @@ +.\" Copyright (c) 2015 Conrad Meyer +.\" 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 October 20, 2015 +.Dt CPUSET 9 +.Os +.Sh NAME +.Nm cpuset(9) +\(em +.Nm CPUSET_T_INITIALIZER , +.Nm CPUSET_FSET , +.Nm CPU_CLR , +.Nm CPU_COPY , +.Nm CPU_ISSET , +.Nm CPU_SET , +.Nm CPU_ZERO , +.Nm CPU_FILL , +.Nm CPU_SETOF , +.Nm CPU_EMPTY , +.Nm CPU_ISFULLSET , +.Nm CPU_FFS , +.Nm CPU_COUNT , +.Nm CPU_SUBSET , +.Nm CPU_OVERLAP , +.Nm CPU_CMP , +.Nm CPU_OR , +.Nm CPU_AND , +.Nm CPU_NAND , +.Nm CPU_CLR_ATOMIC , +.Nm CPU_SET_ATOMIC , +.Nm CPU_SET_ATOMIC_ACQ , +.Nm CPU_AND_ATOMIC , +.Nm CPU_OR_ATOMIC , +.Nm CPU_COPY_STORE_REL +.Nd cpuset manipulation macros +.Sh SYNOPSIS +.In sys/_cpuset.h +.In sys/cpuset.h +.\" +.Fn CPUSET_T_INITIALIZER "ARRAY_CONTENTS" +.Vt CPUSET_FSET +.\" +.Fn CPU_CLR "size_t cpu_idx" "cpuset_t *cpuset" +.Fn CPU_COPY "cpuset_t *from" "cpuset_t *to" +.Ft bool +.Fn CPU_ISSET "size_t cpu_idx" "cpuset_t *cpuset" +.Fn CPU_SET "size_t cpu_idx" "cpuset_t *cpuset" +.Fn CPU_ZERO "cpuset_t *cpuset" +.Fn CPU_FILL "cpuset_t *cpuset" +.Fn CPU_SETOF "size_t cpu_idx" "cpuset_t *cpuset" +.Ft bool +.Fn CPU_EMPTY "cpuset_t *cpuset" +.Ft bool +.Fn CPU_ISFULLSET "cpuset_t *cpuset" +.Ft size_t +.Fn CPU_FFS "cpuset_t *cpuset" +.Ft size_t +.Fn CPU_COUNT "cpuset_t *cpuset" +.\" +.Ft bool +.Fn CPU_SUBSET "cpuset_t *haystack" "cpuset_t *needle" +.Ft bool +.Fn CPU_OVERLAP "cpuset_t *cpuset1" "cpuset_t *cpuset2" +.Ft bool +.Fn CPU_CMP "cpuset_t *cpuset1" "cpuset_t *cpuset2" +.Fn CPU_OR "cpuset_t *dst" "cpuset_t *src" +.Fn CPU_AND "cpuset_t *dst" "cpuset_t *src" +.Fn CPU_NAND "cpuset_t *dst" "cpuset_t *src" +.\" +.Fn CPU_CLR_ATOMIC "size_t cpu_idx" "cpuset_t *cpuset" +.Fn CPU_SET_ATOMIC "size_t cpu_idx" "cpuset_t *cpuset" +.Fn CPU_SET_ATOMIC_ACQ "size_t cpu_idx" "cpuset_t *cpuset" +.\" +.Fn CPU_AND_ATOMIC "cpuset_t *dst" "cpuset_t *src" +.Fn CPU_OR_ATOMIC "cpuset_t *dst" "cpuset_t *src" +.Fn CPU_COPY_STORE_REL "cpuset_t *from" "cpuset_t *to" +.Sh DESCRIPTION +The +.Nm +family of macros provide a flexible and efficient CPU set implementation, +backed by the +.Xr bitset 9 +macros. +Each CPU is represented by a single bit. +The maximum number of CPUs representable by +.Vt cpuset_t +is +.Va MAXCPU . +Individual CPUs in cpusets are referenced with indices zero through +.Fa MAXCPU - 1 . +.Pp +The +.Fn CPUSET_T_INITIALIZER +macro allows one to initialize a +.Vt cpuset_t +with a compile time literal value. +.Pp +The +.Fn CPUSET_FSET +macro defines a compile time literal, usable by +.Fn CPUSET_T_INITIALIZER , +representing a full cpuset (all CPUs present). +For examples of +.Fn CPUSET_T_INITIALIZER +and +.Fn CPUSET_FSET +usage, see the +.Sx CPUSET_T_INITIALIZER EXAMPLE +section. +.Pp +The +.Fn CPU_CLR +macro removes CPU +.Fa cpu_idx +from the cpuset pointed to by +.Fa cpuset . +The +.Fn CPU_CLR_ATOMIC +macro is identical, but the bit representing the CPU is cleared with atomic +machine instructions. +.Pp +The +.Fn CPU_COPY +macro copies the contents of the cpuset +.Fa from +to the cpuset +.Fa to . +.Fn CPU_COPY_STORE_REL +is similar, but copies component machine words from +.Fa from +and writes them to +.Fa to +with atomic store with release semantics. +(That is, if +.Fa to +is composed of multiple machine words, +.Fn CPU_COPY_STORE_REL +performs multiple individually atomic operations.) +.Pp +The +.Fn CPU_SET +macro adds CPU +.Fa cpu_idx +to the cpuset pointed to by +.Fa cpuset , +if it is not already present. +The +.Fn CPU_SET_ATOMIC +macro is identical, but the bit representing the CPU is set with atomic +machine instructions. +The +.Fn CPU_SET_ATOMIC_ACQ +macro sets the bit representing the CPU with atomic acquire semantics. +.Pp +The +.Fn CPU_ZERO +macro removes all CPUs from +.Fa cpuset . +.Pp +The +.Fn CPU_FILL +macro adds all CPUs to +.Fa cpuset . +.Pp +The +.Fn CPU_SETOF +macro removes all CPUs in +.Fa cpuset +before adding only CPU +.Fa cpu_idx . +.Pp +The +.Fn CPU_EMPTY +macro returns +.Dv true +if +.Fa cpuset +is empty. +.Pp +The +.Fn CPU_ISFULLSET +macro returns +.Dv true +if +.Fa cpuset +is full (the set of all CPUs). +.Pp +The +.Fn CPU_FFS +macro returns the 1-index of the first (lowest) CPU in +.Fa cpuset , +or zero if +.Fa cpuset +is empty. +Like with +.Xr ffs 3 , +to use the non-zero result of +.Fn CPU_FFS +as a +.Fa cpu_idx +index parameter to any other +.Nm +macro, you must subtract one from the result. +.Pp +The +.Fn CPU_COUNT +macro returns the total number of CPUs in +.Fa cpuset . +.Pp +The +.Fn CPU_SUBSET +macro returns +.Dv true +if +.Fa needle +is a subset of +.Fa haystack . +.Pp +The +.Fn CPU_OVERLAP +macro returns +.Dv true +if +.Fa cpuset1 +and +.Fa cpuset2 +have any common CPUs. +(That is, if +.Fa cpuset1 +AND +.Fa cpuset2 +is not the empty set.) +.Pp +The +.Fn CPU_CMP +macro returns +.Dv true +if +.Fa cpuset1 +is NOT equal to +.Fa cpuset2 . +.Pp +The +.Fn CPU_OR +macro adds CPUs present in +.Fa src +to +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst +|= +.Fa src . ) +.Fn CPU_OR_ATOMIC +is similar, but sets the bits representing CPUs in the component machine words +in +.Fa dst +with atomic machine instructions. +(That is, if +.Fa dst +is composed of multiple machine words, +.Fn CPU_OR_ATOMIC +performs multiple individually atomic operations.) +.Pp +The +.Fn CPU_AND +macro removes CPUs absent from +.Fa src +from +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst +&= +.Fa src . ) +.Fn CPU_AND_ATOMIC +is similar, with the same atomic semantics as +.Fn CPU_OR_ATOMIC . +.Pp +The +.Fn CPU_NAND +macro removes CPUs in +.Fa src +from +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst +&= +.Fa ~ src . ) +.Sh CPUSET_T_INITIALIZER EXAMPLE +.Bd -literal +cpuset_t myset; + +/* Initialize myset to filled (all CPUs) */ +myset = CPUSET_T_INITIALIZER(CPUSET_FSET); + +/* Initialize myset to only the lowest CPU */ +myset = CPUSET_T_INITIALIZER(0x1); +.Ed +.Sh SEE ALSO +.Xr bitset 9 +.Sh HISTORY +.In sys/cpuset.h +first appeared in +.Fx 7.1 , +released in January 2009, and in +.Fx 8.0 , +released in November 2009. +.Pp +This manual page first appeared in +.Fx 11.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +macros were written by +.An Jeff Roberson Aq Mt jeff@FreeBSD.org . +This manual page was written by +.An Conrad Meyer Aq Mt cem@FreeBSD.org . +.Sh CAVEATS +Unlike every other reference to individual set members, which are zero-indexed, +.Fn CPU_FFS +returns a one-indexed result (or zero if the cpuset is empty). -- cgit v1.1 From f7c12e6bb77645841c7e35b76a82a7a51fe73afc Mon Sep 17 00:00:00 2001 From: cem Date: Tue, 20 Oct 2015 23:52:37 +0000 Subject: cpuset.9: Link to/from the new page A follow-up to r289667. Sponsored by: EMC / Isilon Storage Division --- share/man/man9/cpuset.9 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/man/man9/cpuset.9 b/share/man/man9/cpuset.9 index 2104a090..fb0a9fc 100644 --- a/share/man/man9/cpuset.9 +++ b/share/man/man9/cpuset.9 @@ -325,6 +325,8 @@ myset = CPUSET_T_INITIALIZER(CPUSET_FSET); myset = CPUSET_T_INITIALIZER(0x1); .Ed .Sh SEE ALSO +.Xr cpuset 1 , +.Xr cpuset 2 , .Xr bitset 9 .Sh HISTORY .In sys/cpuset.h -- cgit v1.1 From 9bff9cbf0cbe48b8d626b26743dd0e559c17bda3 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Wed, 21 Oct 2015 00:25:18 +0000 Subject: Fix building in a directory with SUBDIRs and SUBDIR_PARALLEL. The SUBDIR_PARALLEL feature uses a .for dir in ${SUBDIR} loop. The old code here for recursing was setting SUBDIR= as a make *argument*. The SUBDIR= replacement was not actually handled until after the .for loop was unrolled. This could be seen with a '.info ${SUBDIR} ${dir}' inside of the loop which showed an empty ${SUBDIR} and a set ${dir}. Setting NO_SUBIDR= before calling ${MAKE} as an *environment* variable handles the case fine and is a more proper mechanism for disabling subdir handling. This could be seen with 'make -C tests/sys/kern -j15 SUBDIR_PARALLEL=yes'. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.progs.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index 2da30c7..dce05c7 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -116,16 +116,16 @@ x.$p= PROG_CXX=$p $p ${p}_p: .PHONY .MAKE (cd ${.CURDIR} && \ DEPENDFILE=.depend.$p \ - ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= PROG=$p ${x.$p}) + NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + PROG=$p ${x.$p}) # Pseudo targets for PROG, such as 'install'. .for t in ${PROGS_TARGETS:O:u} $p.$t: .PHONY .MAKE (cd ${.CURDIR} && \ DEPENDFILE=.depend.$p \ - ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= PROG=$p ${x.$p} ${@:E}) + NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + PROG=$p ${x.$p} ${@:E}) .endfor .endfor -- cgit v1.1 From 82833332a30ab56c7ba095814998887eaac4c26c Mon Sep 17 00:00:00 2001 From: bdrewery Date: Wed, 21 Oct 2015 16:24:44 +0000 Subject: Remove indirection of _sub target for using _SUBDIR. This reverts r266473 as the need for it, working around .MAKE and '+' issues, is no longer needed after r289460. This avoids extra log output in -j builds of '-- _sub.TARGET --' that are redundant with the '-- TARGET --' and '-- TARGET_subdir_DIR --' entries already showing. r266473 also made a subtle change in the ordering of _SUBDIR handling. Before the change, SUBDIRS were recursed into after building the TARGET due to the .USE of _SUBDIR *appending* the commands onto the TARGET. After the change though the indirection caused TARGET to depend on _sub.TARGET which had the _SUBDIR handling in it. This TARGET would run after recursing. However, the SUBDIR_PARALLEL handling from r263778 has this ordering as well. Since this has so far not been a problem, for now make this behavior for non-SUBDIR_PARALLEL use of _SUBDIR explicit by using .USEBEFORE. Further research may change this back to .USE as well as the SUBDIR_PARALLEL handling and bsd.progs.mk recursing. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 10a3016..a6eb98c 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -72,9 +72,9 @@ _SUBDIR_SH= \ cd ${.CURDIR}/$${dir}; \ ${MAKE} $${target} DIRPRFX=${DIRPRFX}$${dir}/ -_SUBDIR: .USE .MAKE +_SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}target=${.TARGET:S,realinstall,install,:S,^_sub.,,}; \ + @${_+_}target=${.TARGET:S,realinstall,install,}; \ for dir in ${SUBDIR:N.WAIT}; do ${_SUBDIR_SH}; done .endif @@ -107,8 +107,7 @@ ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .endfor ${__target}: ${__subdir_targets} .else -${__target}: _sub.${__target} -_sub.${__target}: _SUBDIR +${__target}: _SUBDIR .endif .endfor @@ -119,8 +118,7 @@ _sub.${__target}: _SUBDIR .for __stage in build install ${__stage}${__target}: .if make(${__stage}${__target}) -${__stage}${__target}: _sub.${__stage}${__target} -_sub.${__stage}${__target}: _SUBDIR +${__stage}${__target}: _SUBDIR .endif .endfor .if !target(${__target}) -- cgit v1.1 From 31af650a83130c3d473de5791df903d6f2705b8d Mon Sep 17 00:00:00 2001 From: avos Date: Wed, 21 Oct 2015 22:31:17 +0000 Subject: Add myself (avos) to committers-src.dot Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3941 --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 1ebf420..caf8cca 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -119,6 +119,7 @@ art [label="Artem Belevich\nart@FreeBSD.org\n2011/03/29"] arybchik [label="Andrew Rybchenko\narybchik@FreeBSD.org\n2014/10/12"] asomers [label="Alan Somers\nasomers@FreeBSD.org\n2013/04/24"] avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] +avos [label="Andriy Voskoboinyk\navos@FreeBSD.org\n2015/09/24"] bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] bdrewery [label="Bryan Drewery\nbdrewery@FreeBSD.org\n2013/12/14"] benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] @@ -332,6 +333,7 @@ day1 -> rgrimes day1 -> alm day1 -> dg +adrian -> avos adrian -> loos adrian -> monthadar adrian -> ray -- cgit v1.1 From f976589d2b889663c8f83ae23e86abe7a512721d Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 22 Oct 2015 00:07:48 +0000 Subject: Let SUBDIR_OVERRIDE with 'make buildworld' be more useful. Now it can be used to effectively "build in a subdir". It will use the 'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly setup a WORLDTMP to use. Then it will build 'everything' only in the listed SUBDIR_OVERRIDE directories. It is still required to list custom library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something that contains libraries outside of the normal area (such as SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib) Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit obscure failures due to missing libraries, includes, or cross compiler. SUBDIR_OVERRIDE with 'make ' will continue to work as it did before although its usefulness is questionable. With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with -DNO_CLEAN only takes a few minutes to start building the target directories. This is still much better than building unneeded things via 'everything' when testing small subset changes. A BUILDFAST or SKIPWORLDTMP might make sense for this as well. - Add in '_worldtmp' as we still need to create WORLDTMP as later targets, such as '_libraries' and '_includes' use it. This probably was avoiding calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but -DNO_CLEAN can be used for that. - '_legacy' must be included since '_build-tools' uses -legacy. The SUBDIR_OVERRIDE change came in r95509, while -legacy being part of build-tools came in r113136. - 'bootstrap-tools' is still skipped as this feature is not for upgrades. - Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes. The original change for SUBDIR_OVERRIDE in r95509 kept '_includes' and '_libraries' as building everything possible as the SUBDIR_OVERRIDE could need anything from them. However in r96462 the real 'includes' target was changed from manual sub-makes to just recursing 'includes' on SUBDIR, thus not all includes have been installed into WORLDTMP since then when combined with 'buildworld'. This is not done unless calling 'make buildworld' as it would be unexpected to have it go into all directories when doing 'make SUBDIR_OVERRIDE=mydir includes'. - Also need to build the cross-compiler so it is used with --sysroot. If this is burdensome then telling the build to use the local compiler as an external compiler (thus using a proper --sysroot to WORLDTMP) is possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc. - Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld since it won't contain anything related to SUBDIR_OVERRIDE. Testing of the lib32 build can be done with 'make build32'. - Document these changes in build.7 Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks --- share/man/man7/build.7 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 6980dc2..be6fe09 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2014 +.Dd October 21, 2015 .Dt BUILD 7 .Os .Sh NAME @@ -463,7 +463,19 @@ for more details. .It Va SUBDIR_OVERRIDE Override the default list of sub-directories and only build the sub-directory named in this variable. -This variable is useful when debugging failed builds. +If combined with +.Cm buildworld +then all libraries and includes, and some of the build tools will still build +as well. +When combined with +.Cm buildworld +it is necesarry to override +.Va LOCAL_LIB_DIRS +with any custom directories containing libraries. +This allows building a subset of the system in the same way as +.Cm buildworld +does using its sysroot handling. +This variable can also be useful when debugging failed builds. .Bd -literal -offset indent make some-target SUBDIR_OVERRIDE=foo/bar .Ed -- cgit v1.1 From a2ebfeb0ad449566876285dcdfd0b45554a6ecdf Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 22 Oct 2015 04:28:22 +0000 Subject: Clean up some bsd.crunchgen.mk issues. - Remove handling of 'make -P' since that is for fmake only. - Add '+' where appropriate for sub-make calls. - Pass MK_TESTS=no to all of the sub-makes to prevent recursing into test directories for targets such as 'obj', 'clean', 'depend', etc. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index 0f0edd3..acef93b 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -107,26 +107,27 @@ $(CONF): Makefile .endfor CRUNCHGEN?= crunchgen -# XXX Make sure we don't pass -P to crunchgen(1). -.MAKEFLAGS:= ${.MAKEFLAGS:N-P} +CRUNCHENV?= MK_TESTS=no .ORDER: $(OUTPUTS) objs $(OUTPUTS): $(CONF) .META MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${CRUNCHGEN} -fq -m $(OUTMK) \ -c $(OUTC) $(CONF) +# These 2 targets cannot use .MAKE since they depend on the generated +# ${OUTMK} above. $(PROG): $(OUTPUTS) objs - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe objs: $(OUTMK) - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. build-tools: .for _tool in $(CRUNCH_BUILDTOOLS) - cd $(.CURDIR)/../../${_tool}; \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools + ${_+_}cd $(.CURDIR)/../../${_tool}; \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools .endfor # Use a separate build tree to hold files compiled for this crunchgen binary @@ -137,12 +138,12 @@ cleandepend cleandir obj objlink: .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} - cd ${CRUNCH_SRCDIR_$(P)} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .else - cd $(.CURDIR)/../../${D}/${P} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .endif .endfor @@ -150,18 +151,18 @@ cleandepend cleandir obj objlink: clean: rm -f ${CLEANFILES} - if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ + ${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ fi .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} - cd ${CRUNCH_SRCDIR_$(P)} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .else - cd $(.CURDIR)/../../${D}/${P} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .endif .endfor -- cgit v1.1 From 9a27f362075390957411f7bea5c9a45877d95e7e Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 22 Oct 2015 04:42:17 +0000 Subject: Rewrite crunchgen target handling for progs so that it can be parallelized. This covers 'clean', 'cleandepend', 'cleandir', 'obj', 'objlink' and 'build-tools'. This uses the same method as bsd.subdir.mk. MFC after: 2 weeks X-MFC-With: r289731 Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index acef93b..d6a32ef 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -123,29 +123,32 @@ objs: $(OUTMK) # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. -build-tools: .for _tool in $(CRUNCH_BUILDTOOLS) +build-tools-${_tool}: ${_+_}cd $(.CURDIR)/../../${_tool}; \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools +build-tools: build-tools-${_tool} .endfor # Use a separate build tree to hold files compiled for this crunchgen binary # Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't # get that to cooperate with bsd.prog.mk. Besides, many of the standard # targets should NOT be propagated into the components. -cleandepend cleandir obj objlink: +.for __target in clean cleandepend cleandir obj objlink .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} - ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +__dir= ${CRUNCH_SRCDIR_$(P)} .else - ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +__dir= ${.CURDIR}/../../${D}/${P} .endif +${__target}_crunchdir_${P}: .PHONY .MAKE + ${_+_}cd ${__dir} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} +${__target}: ${__target}_crunchdir_${P} +.endfor .endfor .endfor @@ -154,16 +157,3 @@ clean: ${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ fi -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) -.ifdef CRUNCH_SRCDIR_${P} - ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.else - ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.endif -.endfor -.endfor -- cgit v1.1 From ee93b5fb919b1c3a291aa29f4563ae1cd9ae5d1c Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 22 Oct 2015 04:47:52 +0000 Subject: Fix style. Namely use {} rather than (). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 107 +++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 53 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index d6a32ef..e8beaeb 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -13,14 +13,14 @@ # local architecture. # # Special options can be specified for individual programs -# CRUNCH_SRCDIR_$(P): base source directory for program $(P) -# CRUNCH_BUILDOPTS_$(P): additional build options for $(P) -# CRUNCH_ALIAS_$(P): additional names to be used for $(P) +# CRUNCH_SRCDIR_${P}: base source directory for program ${P} +# CRUNCH_BUILDOPTS_${P}: additional build options for ${P} +# CRUNCH_ALIAS_${P}: additional names to be used for ${P} # # By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} # will be used to generate a hard link to the resulting binary. # Specific links can be suppressed by setting -# CRUNCH_SUPPRESS_LINK_$(NAME) to 1. +# CRUNCH_SUPPRESS_LINK_${NAME} to 1. # # If CRUNCH_GENERATE_LINKS is set to no, no links will be generated. # @@ -31,101 +31,101 @@ # The following is pretty nearly a generic crunchgen-handling makefile # -CONF= $(PROG).conf -OUTMK= $(PROG).mk -OUTC= $(PROG).c -OUTPUTS=$(OUTMK) $(OUTC) $(PROG).cache +CONF= ${PROG}.conf +OUTMK= ${PROG}.mk +OUTC= ${PROG}.c +OUTPUTS=${OUTMK} ${OUTC} ${PROG}.cache CRUNCHOBJS= ${.OBJDIR} -.if defined(MAKEOBJDIRPREFIX) +.if defined{MAKEOBJDIRPREFIX} CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} -.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" -CANONICALOBJDIR:=${MAKEOBJDIR} +.elif defined{MAKEOBJDIR} && ${MAKEOBJDIR:M/*} != "" +CANONICALOBJDIR:= ${MAKEOBJDIR} .else CANONICALOBJDIR:= /usr/obj${.CURDIR} .endif -CRUNCH_GENERATE_LINKS?= yes +CRUNCH_GENERATE_LINKS?= yes -CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h +CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h # Don't try to extract debug info from ${PROG}. -MK_DEBUG_FILES=no +MK_DEBUG_FILES= no # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} .ifdef CRUNCH_SRCDIR_${P} -$(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefile +${OUTPUTS}: ${CRUNCH_SRCDIR_${P}}/Makefile .else -$(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile +${OUTPUTS}: ${.CURDIR}/../../${D}/${P}/Makefile .endif .if ${CRUNCH_GENERATE_LINKS} == "yes" .ifndef CRUNCH_SUPPRESS_LINK_${P} -LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) +LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${P} .endif -.for A in $(CRUNCH_ALIAS_$(P)) +.for A in ${CRUNCH_ALIAS_${P}} .ifndef CRUNCH_SUPPRESS_LINK_${A} -LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) +LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${A} .endif .endfor .endif .endfor .endfor -all: $(PROG) -exe: $(PROG) +all: ${PROG} +exe: ${PROG} -$(CONF): Makefile - echo \# Auto-generated, do not edit >$(.TARGET) +${CONF}: Makefile + echo \# Auto-generated, do not edit >${.TARGET} .ifdef CRUNCH_BUILDOPTS - echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET) + echo buildopts ${CRUNCH_BUILDOPTS} >>${.TARGET} .endif .ifdef CRUNCH_LIBS - echo libs $(CRUNCH_LIBS) >>$(.TARGET) + echo libs ${CRUNCH_LIBS} >>${.TARGET} .endif .ifdef CRUNCH_SHLIBS - echo libs_so $(CRUNCH_SHLIBS) >>$(.TARGET) + echo libs_so ${CRUNCH_SHLIBS} >>${.TARGET} .endif -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) - echo progs $(P) >>$(.TARGET) +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} + echo progs ${P} >>${.TARGET} .ifdef CRUNCH_SRCDIR_${P} - echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET) + echo special ${P} srcdir ${CRUNCH_SRCDIR_${P}} >>${.TARGET} .else - echo special $(P) srcdir $(.CURDIR)/../../$(D)/$(P) >>$(.TARGET) + echo special ${P} srcdir ${.CURDIR}/../../${D}/${P} >>${.TARGET} .endif .ifdef CRUNCH_BUILDOPTS_${P} - echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ \ - $(CRUNCH_BUILDOPTS_${P}) >>$(.TARGET) + echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ \ + ${CRUNCH_BUILDOPTS_${P}} >>${.TARGET} .else - echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ >>$(.TARGET) + echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ >>${.TARGET} .endif -.for A in $(CRUNCH_ALIAS_$(P)) - echo ln $(P) $(A) >>$(.TARGET) +.for A in ${CRUNCH_ALIAS_${P}} + echo ln ${P} ${A} >>${.TARGET} .endfor .endfor .endfor CRUNCHGEN?= crunchgen CRUNCHENV?= MK_TESTS=no -.ORDER: $(OUTPUTS) objs -$(OUTPUTS): $(CONF) .META - MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${CRUNCHGEN} -fq -m $(OUTMK) \ - -c $(OUTC) $(CONF) +.ORDER: ${OUTPUTS} objs +${OUTPUTS}: ${CONF} .META + MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${CRUNCHGEN} -fq \ + -m ${OUTMK} -c ${OUTC} ${CONF} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. -$(PROG): $(OUTPUTS) objs - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe +${PROG}: ${OUTPUTS} objs + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f ${OUTMK} exe -objs: $(OUTMK) - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs +objs: ${OUTMK} + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f ${OUTMK} objs # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. -.for _tool in $(CRUNCH_BUILDTOOLS) +.for _tool in ${CRUNCH_BUILDTOOLS} build-tools-${_tool}: - ${_+_}cd $(.CURDIR)/../../${_tool}; \ + ${_+_}cd ${.CURDIR}/../../${_tool}; \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools build-tools: build-tools-${_tool} @@ -136,10 +136,10 @@ build-tools: build-tools-${_tool} # get that to cooperate with bsd.prog.mk. Besides, many of the standard # targets should NOT be propagated into the components. .for __target in clean cleandepend cleandir obj objlink -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} .ifdef CRUNCH_SRCDIR_${P} -__dir= ${CRUNCH_SRCDIR_$(P)} +__dir= ${CRUNCH_SRCDIR_${P}} .else __dir= ${.CURDIR}/../../${D}/${P} .endif @@ -154,6 +154,7 @@ ${__target}: ${__target}_crunchdir_${P} clean: rm -f ${CLEANFILES} - ${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ + ${_+_}if [ -e ${.OBJDIR}/${OUTMK} ]; then \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} \ + -f ${OUTMK} clean; \ fi -- cgit v1.1 From 9a92f9cb475deeaa9143795887133742a8437851 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 22 Oct 2015 04:50:52 +0000 Subject: Document that we use {} for variable expansion. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- share/man/man5/style.Makefile.5 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index c3a3288..5e34b96 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2005 +.Dd October 21, 2015 .Dt STYLE.MAKEFILE 5 .Os .Sh NAME @@ -117,6 +117,13 @@ i.e., no space between the variable name and the .Ic = . Keep values sorted alphabetically, if possible. .It +Variables are expanded with +.Sy {} , +not +.Sy () . +Such as +.Va ${VARIABLE} . +.It Do not use .Ic += to set variables that are only set once -- cgit v1.1 From a1c60621aa662f88b1a5a5995a9b959a33c39b1f Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 22 Oct 2015 04:52:37 +0000 Subject: Fix incorrect defined() usage from style clean up in r289735. Submitted by: ngie MFC after: 2 weeks X-MFC-With: r289735 Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index e8beaeb..f61dc68 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -36,9 +36,9 @@ OUTMK= ${PROG}.mk OUTC= ${PROG}.c OUTPUTS=${OUTMK} ${OUTC} ${PROG}.cache CRUNCHOBJS= ${.OBJDIR} -.if defined{MAKEOBJDIRPREFIX} +.if defined(MAKEOBJDIRPREFIX) CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} -.elif defined{MAKEOBJDIR} && ${MAKEOBJDIR:M/*} != "" +.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" CANONICALOBJDIR:= ${MAKEOBJDIR} .else CANONICALOBJDIR:= /usr/obj${.CURDIR} -- cgit v1.1 From e0d7cb1063787a81e3d3f2747f9f17b30d9144d5 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 22 Oct 2015 11:09:25 +0000 Subject: Add support for CloudABI on ARM64. It turns out that it is pretty easy to make CloudABI work on ARM64. We essentially only need to copy over the sysvec from AMD64 and ensure that we use ARM64 specific registers. As there is an overlap between function argument and return registers, we do need to extend cloudabi64_schedtail() to only set its values if we're actually forking. Not when we're creating a new thread. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D3917 --- share/man/man4/cloudabi.4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man4/cloudabi.4 b/share/man/man4/cloudabi.4 index 1986735..e7a5653 100644 --- a/share/man/man4/cloudabi.4 +++ b/share/man/man4/cloudabi.4 @@ -22,7 +22,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd July 31, 2015 +.Dd October 22, 2015 .Dt CLOUDABI 4 .Os .Sh NAME @@ -73,7 +73,7 @@ module can be loaded on any architecture supported by .Fx , the .Nm cloudabi64 -module is only available for amd64. +module is only available for amd64 and arm64. .Pp A full cross compilation toolchain for CloudABI is available in the .Pa devel/cloudabi-toolchain @@ -95,6 +95,9 @@ restricted set of resources. .Pp cloudlibc on GitHub: .Pa https://github.com/NuxiNL/cloudlibc . +.Pp +The CloudABI Ports Collection on GitHub: +.Pa https://github.com/NuxiNL/cloudabi-ports . .Sh HISTORY CloudABI support first appeared in .Fx 11.0 . -- cgit v1.1 From e7b0d632512d9d47cda7fb808874b6759c396f53 Mon Sep 17 00:00:00 2001 From: cem Date: Thu, 22 Oct 2015 16:46:30 +0000 Subject: getenv.9: Document behavior of freeenv(NULL) Fix a couple igor(1)-indicated spelling issues while here. Suggested by: jhb Sponsored by: EMC / Isilon Storage Division --- share/man/man9/getenv.9 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/man/man9/getenv.9 b/share/man/man9/getenv.9 index a530ca4..cf5d889 100644 --- a/share/man/man9/getenv.9 +++ b/share/man/man9/getenv.9 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2013 +.Dd October 22, 2015 .Dt GETENV 9 .Os .Sh NAME @@ -78,7 +78,6 @@ function obtains the current value of the kernel environment variable .Fa name and returns a pointer to the string value. The caller should not modify the string pointed to by the return value. -.Pp The .Fn getenv function may allocate temporary storage, @@ -88,12 +87,24 @@ function must be called to release any allocated resources when the value returned by .Fn getenv is no longer needed. +.Pp +The +.Fn freeenv +function is used to release the resources allocated by a previous call to +.Fn getenv . The .Fa env argument passed to .Fn freeenv is the pointer returned by the earlier call to .Fn getenv . +Like +.Xr free 3 , +the +.Fa env +argument can be +.Va NULL , +in which case no action occurs. .Pp The .Fn setenv @@ -156,7 +167,8 @@ Otherwise, the value is interpreted as decimal. The value may contain a single character suffix specifying a unit for the value. -The interpreted value is multipled by the unit's magnitude before being returned. +The interpreted value is multiplied by the unit's magnitude before being +returned. The following unit suffixes are supported: .Bl -column -offset indent ".Sy Unit" ".Sy Magnitude" .It Sy Unit Ta Sy Magnitude @@ -179,7 +191,7 @@ zero is returned. If the variable exists, up to .Fa size - 1 -characters of it's value are copied to the buffer pointed to by +characters of its value are copied to the buffer pointed to by .Fa data followed by a null character and a non-zero value is returned. .Sh RETURN VALUES -- cgit v1.1 From a305a56ce15f5a95267a1851fd17239df4ee70a3 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 22 Oct 2015 22:29:25 +0000 Subject: Fix installation of manpages with WITHOUT_COMPRESS broken since r284685. This partially reverts r284685. An attempt was made in r285295 to fix this but was not enough. There were still $${} vars in the code that should have been using the ${_page} and ${_sect} vars, but the bigger problem was that .for cannot be used on .ALLSRC as it is not defined when the .for is evaluated. Using ${MAN} here in a .for loop doesn't work either as the paths are not expanded right for lib/libc/ subdirs despite having a .PATH set for all of them. Add some comments around long .else and .endif as well. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.man.mk | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 72aedfb..d0992b6 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -104,8 +104,8 @@ ${__target}: ${__page} .endfor .endif .endfor -.endif -.else +.endif # !empty(MAN) +.else # !defined(MANFILTER) .if defined(MAN) && !empty(MAN) CLEANFILES+= ${MAN:T:S/$/${CATEXT}/g} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) @@ -120,9 +120,9 @@ ${__target}: ${__page} _manpages: ${MAN} .endif .endif -.endif +.endif # defined(MANFILTER) -.else +.else # ${MK_MANCOMPRESS} == "yes" ZEXT= ${MCOMPRESS_EXT} @@ -169,7 +169,7 @@ ${__target}: ${__page} .endfor .endif -.endif +.endif # ${MK_MANCOMPRESS} == "no" maninstall: _maninstall _maninstall: @@ -185,20 +185,26 @@ _maninstall: ${MAN} ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page} .endif .endfor -.else -.for _page _sect in ${.ALLSRC:C/\.([^.]*)$/.\1 \1/} - @d=${DESTDIR}${MANDIR}${_sect}${MANSUBDIR}/; \ - ${ECHO} ${MINSTALL} ${_page} $${d}; \ - ${MINSTALL} $${page} $${d}; -.endfor +.else # !defined(MANFILTER) + @set ${.ALLSRC:C/\.([^.]*)$/.\1 \1/}; \ + while : ; do \ + case $$# in \ + 0) break;; \ + 1) echo "warn: missing extension: $$1"; break;; \ + esac; \ + page=$$1; shift; sect=$$1; shift; \ + d=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}; \ + ${ECHO} ${MINSTALL} $${page} $${d}; \ + ${MINSTALL} $${page} $${d}; \ + done .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __page in ${MAN} ${MINSTALL} ${__page:T:S/$/${CATEXT}/} \ ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T} .endfor .endif -.endif -.else +.endif # defined(MANFILTER) +.else # ${MK_MANCOMPRESS} == "yes" .for __page in ${MAN} ${MINSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \ ${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/ @@ -207,7 +213,7 @@ _maninstall: ${MAN} ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T:S/$/${MCOMPRESS_EXT}/} .endif .endfor -.endif +.endif # ${MK_MANCOMPRESS} == "no" .endif .if !defined(NO_MLINKS) && defined(MLINKS) && !empty(MLINKS) -- cgit v1.1 From 7761ab52bc8e13748cf8341eed2f9ef611b631c9 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 22 Oct 2015 23:41:56 +0000 Subject: For SUBDIR_PARALLEL, when doing 'make clean*' or 'make obj' there is no need to respect SUBDIR_DEPEND_* or .WAIT. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'share') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index a6eb98c..8275afd 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -83,6 +83,15 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE dir=${.TARGET}; \ ${_SUBDIR_SH}; +# .WAIT and dependencies can be skipped for some targets. +.if defined(SUBDIR_PARALLEL) +.if make(obj) || make(clean*) +_skip_subdir_ordering= 1 +SUBDIR:= ${SUBDIR:N.WAIT} +.else +_skip_subdir_ordering= 0 +.endif +.endif # defined(SUBDIR_PARALLEL) # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT .for __target in ${ALL_SUBDIR_TARGETS} @@ -94,9 +103,11 @@ __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} __deps= +.if ${_skip_subdir_ordering} == 0 .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${__dep} .endfor +.endif ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) @${_+_}target=${__target:realinstall=install}; \ -- cgit v1.1 From f317ccd8a16b8eefe2eca67004a972515dcfa229 Mon Sep 17 00:00:00 2001 From: cem Date: Fri, 23 Oct 2015 15:08:16 +0000 Subject: sysctl(9): Document U8/U16 types from r289773 Suggested by: ngie Sponsored by: EMC / Isilon Storage Division --- share/man/man9/Makefile | 4 ++++ share/man/man9/sysctl.9 | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 1ef9f4c..516d6c3 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1629,6 +1629,8 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_ADD_ROOT_NODE.9 \ sysctl.9 SYSCTL_ADD_STRING.9 \ sysctl.9 SYSCTL_ADD_STRUCT.9 \ + sysctl.9 SYSCTL_ADD_U8.9 \ + sysctl.9 SYSCTL_ADD_U16.9 \ sysctl.9 SYSCTL_ADD_UAUTO.9 \ sysctl.9 SYSCTL_ADD_UINT.9 \ sysctl.9 SYSCTL_ADD_ULONG.9 \ @@ -1646,6 +1648,8 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_ROOT_NODE.9 \ sysctl.9 SYSCTL_STRING.9 \ sysctl.9 SYSCTL_STRUCT.9 \ + sysctl.9 SYSCTL_U8.9 \ + sysctl.9 SYSCTL_U16.9 \ sysctl.9 SYSCTL_UINT.9 \ sysctl.9 SYSCTL_ULONG.9 \ sysctl.9 SYSCTL_UQUAD.9 diff --git a/share/man/man9/sysctl.9 b/share/man/man9/sysctl.9 index 51ab5d7..c0f8363 100644 --- a/share/man/man9/sysctl.9 +++ b/share/man/man9/sysctl.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2014 +.Dd October 23, 2015 .Dt SYSCTL 9 .Os .Sh NAME @@ -39,6 +39,8 @@ .Nm SYSCTL_ADD_ROOT_NODE , .Nm SYSCTL_ADD_STRING , .Nm SYSCTL_ADD_STRUCT , +.Nm SYSCTL_ADD_U8 , +.Nm SYSCTL_ADD_U16 , .Nm SYSCTL_ADD_UAUTO , .Nm SYSCTL_ADD_UINT , .Nm SYSCTL_ADD_ULONG , @@ -56,6 +58,8 @@ .Nm SYSCTL_ROOT_NODE , .Nm SYSCTL_STRING , .Nm SYSCTL_STRUCT , +.Nm SYSCTL_U8 , +.Nm SYSCTL_U16 , .Nm SYSCTL_UINT , .Nm SYSCTL_ULONG , .Nm SYSCTL_UQUAD @@ -162,6 +166,28 @@ .Fa "const char *descr" .Fc .Ft struct sysctl_oid * +.Fo SYSCTL_ADD_U8 +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "unsigned int *ptr" +.Fa "intptr_t val" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * +.Fo SYSCTL_ADD_U16 +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "unsigned int *ptr" +.Fa "intptr_t val" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * .Fo SYSCTL_ADD_UINT .Fa "struct sysctl_ctx_list *ctx" .Fa "struct sysctl_oid_list *parent" @@ -228,6 +254,8 @@ .Fn SYSCTL_STRING parent number name ctlflags arg len descr .Fn SYSCTL_STRUCT parent number name ctlflags ptr struct_type descr .Fn SYSCTL_ROOT_NODE number name ctlflags handler descr +.Fn SYSCTL_U8 parent number name ctlflags ptr val descr +.Fn SYSCTL_U16 parent number name ctlflags ptr val descr .Fn SYSCTL_UINT parent number name ctlflags ptr val descr .Fn SYSCTL_ULONG parent number name ctlflags ptr val descr .Fn SYSCTL_UQUAD parent number name ctlflags ptr val descr @@ -413,6 +441,8 @@ Static sysctls are declared using one of the .Fn SYSCTL_ROOT_NODE , .Fn SYSCTL_STRING , .Fn SYSCTL_STRUCT , +.Fn SYSCTL_U8 , +.Fn SYSCTL_U16 , .Fn SYSCTL_UINT , .Fn SYSCTL_ULONG or @@ -429,6 +459,8 @@ Dynamic nodes are created using one of the .Fn SYSCTL_ADD_ROOT_NODE , .Fn SYSCTL_ADD_STRING , .Fn SYSCTL_ADD_STRUCT , +.Fn SYSCTL_ADD_U8 , +.Fn SYSCTL_ADD_U16 , .Fn SYSCTL_ADD_UAUTO , .Fn SYSCTL_ADD_UINT , .Fn SYSCTL_ADD_ULONG , @@ -459,6 +491,10 @@ This is an opaque data structure. .It Dv CTLTYPE_STRUCT Alias for .Dv CTLTYPE_OPAQUE . +.It Dv CTLTYPE_U8 +This is an 8-bit unsigned integer. +.It Dv CTLTYPE_U16 +This is a 16-bit unsigned integer. .It Dv CTLTYPE_UINT This is an unsigned integer. .It Dv CTLTYPE_LONG -- cgit v1.1 From fab547dc0c9b8e00dc2430e44e9c5758a027abe6 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Fri, 23 Oct 2015 19:41:58 +0000 Subject: Fix regression from r289734 that caused crunchgen "subdirs" to not be properly recursed. The .for loop was defining a ${__dir} variable that was being set at a different evaluation time than the target itself, so every 'cd ${__dir}' became the last value that was in ${__dir}. This resulted in 'make obj' not properly being ran in the tree that would leave .depend files scattered around when 'make all' was ran in rescue/. To fix this, define a CRUNCH_SRCDIR_* for every prog if it does not already have one and then use that variable in every relevant place. This allows simplifying some logic as well. Reported by: emaste X-MFC-With: r289734 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index f61dc68..e84e507 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -50,15 +50,18 @@ CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h # Don't try to extract debug info from ${PROG}. MK_DEBUG_FILES= no +# Set a default SRCDIR for each for simpler handling below. +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} +CRUNCH_SRCDIR_${P}?= ${.CURDIR}/../../${D}/${P} +.endfor +.endfor + # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} -.ifdef CRUNCH_SRCDIR_${P} ${OUTPUTS}: ${CRUNCH_SRCDIR_${P}}/Makefile -.else -${OUTPUTS}: ${.CURDIR}/../../${D}/${P}/Makefile -.endif .if ${CRUNCH_GENERATE_LINKS} == "yes" .ifndef CRUNCH_SUPPRESS_LINK_${P} LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${P} @@ -89,11 +92,7 @@ ${CONF}: Makefile .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} echo progs ${P} >>${.TARGET} -.ifdef CRUNCH_SRCDIR_${P} echo special ${P} srcdir ${CRUNCH_SRCDIR_${P}} >>${.TARGET} -.else - echo special ${P} srcdir ${.CURDIR}/../../${D}/${P} >>${.TARGET} -.endif .ifdef CRUNCH_BUILDOPTS_${P} echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ \ ${CRUNCH_BUILDOPTS_${P}} >>${.TARGET} @@ -138,13 +137,8 @@ build-tools: build-tools-${_tool} .for __target in clean cleandepend cleandir obj objlink .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} -.ifdef CRUNCH_SRCDIR_${P} -__dir= ${CRUNCH_SRCDIR_${P}} -.else -__dir= ${.CURDIR}/../../${D}/${P} -.endif ${__target}_crunchdir_${P}: .PHONY .MAKE - ${_+_}cd ${__dir} && \ + ${_+_}cd ${CRUNCH_SRCDIR_${P}} && \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} ${__target}: ${__target}_crunchdir_${P} -- cgit v1.1 From 493f9f8597336a38541583d5113b2500f6256b94 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Fri, 23 Oct 2015 21:30:27 +0000 Subject: Rework r289778 to always parallelize known targets, without ordering. - Rather than allow 'make clean*' to ignore dependencies, make a static list of targets in STANDALONE_SUBDIR_TARGETS that are known to be safe. This allows a user to override them if needed and avoids adding this feature to user-defined targets that are in ${SUBDIR_TARGETS}. [1] - This now also allows to force SUBDIR_PARALLEL when calling these targets, since no dependencies are needed. Reported by: ian [1] Sponsored by: EMC / Isilon Storage Division MFC after: 3 weeks X-MFC-With: r289778 --- share/mk/bsd.subdir.mk | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 8275afd..0a22fbe 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -28,6 +28,10 @@ # See ALL_SUBDIR_TARGETS for list of targets that will recurse. # Custom targets can be added to SUBDIR_TARGETS in src.conf. # +# Targets defined in STANDALONE_SUBDIR_TARGETS will always be ran +# with SUBDIR_PARALLEL and will not respect .WAIT or SUBDIR_DEPEND_ +# values. +# .if !target(____) ____: @@ -38,6 +42,10 @@ ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \ realinstall regress tags \ ${SUBDIR_TARGETS} +# Described above. +STANDALONE_SUBDIR_TARGETS?= obj checkdpadd clean cleandepend cleandir \ + cleanilinks cleanobj + .include .if !defined(NEED_SUBDIR) @@ -83,19 +91,17 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE dir=${.TARGET}; \ ${_SUBDIR_SH}; -# .WAIT and dependencies can be skipped for some targets. -.if defined(SUBDIR_PARALLEL) -.if make(obj) || make(clean*) -_skip_subdir_ordering= 1 -SUBDIR:= ${SUBDIR:N.WAIT} -.else -_skip_subdir_ordering= 0 -.endif -.endif # defined(SUBDIR_PARALLEL) # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT .for __target in ${ALL_SUBDIR_TARGETS} -.ifdef SUBDIR_PARALLEL +# Can ordering be skipped for this and SUBDIR_PARALLEL forced? +.if make(${__target}) && ${STANDALONE_SUBDIR_TARGETS:M${__target}} +_is_standalone_target= 1 +SUBDIR:= ${SUBDIR:N.WAIT} +.else +_is_standalone_target= 0 +.endif +.if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} .if ${__wait} == ${__dir} @@ -103,7 +109,7 @@ __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} __deps= -.if ${_skip_subdir_ordering} == 0 +.if ${_is_standalone_target} == 0 .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${__dep} .endfor @@ -115,12 +121,12 @@ ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} ${_SUBDIR_SH}; .endif .endif -.endfor +.endfor # __dir in ${SUBDIR} ${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR -.endif -.endfor +.endif # SUBDIR_PARALLEL || _is_standalone_target +.endfor # __target in ${ALL_SUBDIR_TARGETS} # This is to support 'make includes' calling 'make buildincludes' and # 'make installincludes' in the proper order, and to support these -- cgit v1.1 From 706949f11e5340cfa991452419cfb1db799e9b04 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Sat, 24 Oct 2015 04:03:29 +0000 Subject: Configs should not be under MK_INCLUDES control. 'buildconfig' is connected to 'all', but 'installconfig' is only called manually. There is not much need to conditionalize this file right now due to how it is hooked up and its impact on various build phases. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.confs.mk | 3 --- 1 file changed, 3 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 36298d7..533ba71e 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -4,7 +4,6 @@ .error bsd.conf.mk cannot be included directly. .endif -.if ${MK_INCLUDES} != "no" CONFGROUPS?= CONFS .if !target(buildconfig) @@ -83,5 +82,3 @@ _${group}INS: ${_${group}CONFS} STAGE_TARGETS+= stage_config .endif .endif - -.endif # ${MK_INCLUDES} != "no" -- cgit v1.1 From b08c9eb3adeae6c2a901192ec4e384d32ef91f24 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Sat, 24 Oct 2015 04:03:32 +0000 Subject: Slightly rework the comments and logic for default Clang/GCC. This is because the previous version was very obscure about the fact that despite having Clang "on by default" for architectures such as powerpc, it does not actually build due to the GCC it uses not having C++11 support. Using an external compiler that supports C++11 does allow this to work. This whole block should be rethought more given "on by default" is not really default without extra work which could actually be surprising for why Clang is showing up when using a newer GCC. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.opts.mk | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'share') diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index a5e78a3..7aca914 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -210,21 +210,22 @@ __TT=${MACHINE} .endif .include -.if !${COMPILER_FEATURES:Mc++11} -# If the compiler is not C++11 capable, disable clang and use gcc instead. -__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX -__DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC -.elif ${__T} == "aarch64" || ${__T} == "amd64" || ${__TT} == "arm" || \ - ${__T} == "i386" -# On x86 and arm, clang is enabled, and will be installed as the default cc. +# If the compiler is not C++11 capable, disable Clang and use GCC instead. +# This means that architectures that have GCC 4.2 as default can not +# build Clang without using an external compiler. + +.if ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \ + ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") +# Clang is enabled, and will be installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX -.elif ${__T:Mpowerpc*} -# On powerpc, clang is enabled, but gcc is installed as the default cc. +.elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mpowerpc*} +# On powerpc, if an external compiler that supports C++11 is used as ${CC}, +# then Clang is enabled, but GCC is installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC .else -# Everything else disables clang, and uses gcc instead. +# Everything else disables Clang, and uses GCC instead. __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC .endif -- cgit v1.1 From ebba16d4b8f9d504330ba92e2944c2f5d4058a42 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Sat, 24 Oct 2015 04:55:17 +0000 Subject: Add bsd.crunchgen.mk to bsd.README. MFC after: 1 week --- share/mk/bsd.README | 1 + share/mk/bsd.crunchgen.mk | 2 ++ 2 files changed, 3 insertions(+) (limited to 'share') diff --git a/share/mk/bsd.README b/share/mk/bsd.README index cb6e41f..173a677 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -17,6 +17,7 @@ files. In most cases it is only interesting to include bsd.prog.mk or bsd.lib.mk. bsd.arch.inc.mk - includes arch-specific Makefile.$arch +bsd.crunchgen.mk - building crunched binaries using crunchgen(1) bsd.compiler.mk - defined based on current compiler bsd.confs.mk - install of configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index e84e507..9618f5e 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -1,5 +1,7 @@ ################################################################# # +# Generate crunched binaries using crunchgen(1). +# # General notes: # # A number of Make variables are used to generate the crunchgen config file. -- cgit v1.1 From cc5e0234919b3361a0b80d2ebad57d3e0e6e6395 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Sat, 24 Oct 2015 05:00:20 +0000 Subject: Sort properly. MFC after: 1 week X-MFC-With: r289870 --- share/mk/bsd.README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 173a677..5aa1949 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -17,10 +17,10 @@ files. In most cases it is only interesting to include bsd.prog.mk or bsd.lib.mk. bsd.arch.inc.mk - includes arch-specific Makefile.$arch -bsd.crunchgen.mk - building crunched binaries using crunchgen(1) bsd.compiler.mk - defined based on current compiler bsd.confs.mk - install of configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) +bsd.crunchgen.mk - building crunched binaries using crunchgen(1) bsd.dep.mk - handle Makefile dependencies bsd.doc.mk - building troff system documents bsd.endian.mk - TARGET_ENDIAN=1234(little) or 4321 (big) for target -- cgit v1.1 From 17ee6105dd14a170328a3f9bfda0d0bb2402e23f Mon Sep 17 00:00:00 2001 From: ngie Date: Sun, 25 Oct 2015 03:16:08 +0000 Subject: Use 't' (bits) not 'i' (bytes) for describing MRIE (aka "Method of Reporting Informational Exceptions") in the SCSI mode database as the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is 4 bits wide, not 4 bytes wide 1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf Bug 200619 MFC after: 1 week Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division --- share/misc/scsi_modes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/misc/scsi_modes b/share/misc/scsi_modes index 781b8f1..80752e7 100644 --- a/share/misc/scsi_modes +++ b/share/misc/scsi_modes @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} b4 + {MRIE} t4 {Interval Timer} i4 {Report Count} i4 } -- cgit v1.1 From 4a6b9fe21357d5505ce4dbe1ce21195c806b003f Mon Sep 17 00:00:00 2001 From: ngie Date: Sun, 25 Oct 2015 03:22:21 +0000 Subject: Revert r289913 -- I botched up the commit message by accident Will redo the commit shortly --- share/misc/scsi_modes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/misc/scsi_modes b/share/misc/scsi_modes index 80752e7..781b8f1 100644 --- a/share/misc/scsi_modes +++ b/share/misc/scsi_modes @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} t4 + {MRIE} b4 {Interval Timer} i4 {Report Count} i4 } -- cgit v1.1 From c3b2fc1a17134a82c9af92b29e06104271f9df71 Mon Sep 17 00:00:00 2001 From: ngie Date: Sun, 25 Oct 2015 04:04:25 +0000 Subject: Use 't' (bit-field) not 'b' (bit-sized integral type) for describing MRIE (aka "Method of Reporting Informational Exceptions") in the SCSI mode database. T10/04-371 revision 2 (revision 4; page 2, table 1) describes it as a bit-field of 4 bits wide. 1. http://www.t10.org/ftp/t10/document.04/04-371r2.pdf This a recommit of head@r289913 to fix the original commit message, in particular: - I incorrectly claimed that unit change was 'i' -> 't'. - The spec I reference in this commit is 2 decades newer than the one noted in r289913. The fields in the SCSI mode database are more complete in the newer spec, so it'll be easier for someone to decipher this commit if need be later. - I screwed up the bug entry in the previous commit message Pointyhat to: ngie (for botching up r289913) PR: 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Divisionf --- share/misc/scsi_modes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/misc/scsi_modes b/share/misc/scsi_modes index 781b8f1..80752e7 100644 --- a/share/misc/scsi_modes +++ b/share/misc/scsi_modes @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} b4 + {MRIE} t4 {Interval Timer} i4 {Report Count} i4 } -- cgit v1.1 From 1629bdfbd5567cc3d69f7361bd085d825954a2de Mon Sep 17 00:00:00 2001 From: bdrewery Date: Mon, 26 Oct 2015 22:31:57 +0000 Subject: META MODE: bsd.files.mk and bsd.confs.mk don't handle symlinks so there is no need to set STAGE_SYMLINKS_DIR.${STAGE_SET}. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.confs.mk | 1 - share/mk/bsd.files.mk | 1 - 2 files changed, 2 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 533ba71e..310fe52 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -24,7 +24,6 @@ ${group}MODE?= ${CONFMODE} ${group}DIR?= ${CONFIGDIR}/ STAGE_SETS+= ${group} STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} _${group}CONFS= .for cnf in ${${group}} diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk index 6a6c66a..ff620d0 100644 --- a/share/mk/bsd.files.mk +++ b/share/mk/bsd.files.mk @@ -30,7 +30,6 @@ ${group}DIR?= ${BINDIR} STAGE_SETS+= ${group} .endif STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} _${group}FILES= .for file in ${${group}} -- cgit v1.1 From 603987badef4368d8e3674eac851370345d56533 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Mon, 26 Oct 2015 23:28:35 +0000 Subject: META MODE: Fix FILESNAME not being respected sans other FILES_group overrides. This was fixed in bsd.incs.mk in r242801 already. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.files.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk index ff620d0..17a99d2 100644 --- a/share/mk/bsd.files.mk +++ b/share/mk/bsd.files.mk @@ -35,7 +35,7 @@ _${group}FILES= .for file in ${${group}} .if defined(${group}OWN_${file:T}) || defined(${group}GRP_${file:T}) || \ defined(${group}MODE_${file:T}) || defined(${group}DIR_${file:T}) || \ - defined(${group}NAME_${file:T}) + defined(${group}NAME_${file:T}) || defined(${group}NAME) ${group}OWN_${file:T}?= ${${group}OWN} ${group}GRP_${file:T}?= ${${group}GRP} ${group}MODE_${file:T}?= ${${group}MODE} -- cgit v1.1 From a4a0534f00e8a7e9982b25ec8ce112e8d47696f7 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 27 Oct 2015 01:29:38 +0000 Subject: META MODE: Fix after addition of bsd.confs.mk: Stage in "files" set. The "files" staging name is not the same as "bsd.files.mk" but seems to just be a group of extra files that are not the essential includes or libraries, which include . Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.confs.mk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 310fe52..c3e9980 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -44,7 +44,6 @@ STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}} # XXX {group}OWN,GRP,MODE STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}} stage_as.${cnf:T}: ${cnf} -stage_config: stage_as.${cnf:T} installconfig: _${group}INS_${cnf:T} _${group}INS_${cnf:T}: ${cnf} @@ -58,7 +57,6 @@ _${group}CONFS+= ${cnf} .endfor .if !empty(_${group}CONFS) stage_files.${group}: ${_${group}CONFS} -stage_config: stage_files.${group} installconfig: _${group}INS _${group}INS: ${_${group}CONFS} @@ -76,8 +74,12 @@ _${group}INS: ${_${group}CONFS} .endif # !target(installconfig) -.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD) -.if !defined(NO_STAGE_CONFIG) -STAGE_TARGETS+= stage_config +.if ${MK_STAGING} != "no" +.if !empty(STAGE_SETS) +buildconfig: stage_files +.if !empty(STAGE_AS_SETS) +buildconfig: stage_as .endif .endif +.endif + -- cgit v1.1 From 3c82a7278acf8635bf4e87382f51a92ea0dcd24b Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 27 Oct 2015 02:04:21 +0000 Subject: Spell CONFGROUPS properly. --- share/mk/bsd.confs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index c3e9980..172f516 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -7,7 +7,7 @@ CONFGROUPS?= CONFS .if !target(buildconfig) -.for group in ${CONFSGROUPS} +.for group in ${CONFGROUPS} buildconfig: ${${group}} .endfor .endif -- cgit v1.1 From d4ec702283514690b00165ef16c7b869df033f96 Mon Sep 17 00:00:00 2001 From: lidl Date: Tue, 27 Oct 2015 03:48:42 +0000 Subject: Add myself and my mentors to the committers-src.dot file. Approved by: rpaulo (mentor) Differential Revision: https://reviews.freebsd.org/D4006 --- share/misc/committers-src.dot | 3 +++ 1 file changed, 3 insertions(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index caf8cca..c7f8c9c 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -217,6 +217,7 @@ kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] kp [label="Kristof Provost\nkp@FreeBSD.org\n2015/03/22"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] +lidl [label="Kurt Lidl\nlidl@FreeBSD.org\n2015/10/21"] loos [label="Luiz Otavio O Souza\nloos@FreeBSD.org\n2013/07/03"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] @@ -334,6 +335,7 @@ day1 -> alm day1 -> dg adrian -> avos +adrian -> lidl adrian -> loos adrian -> monthadar adrian -> ray @@ -660,6 +662,7 @@ rpaulo -> avg rpaulo -> bschmidt rpaulo -> dim rpaulo -> jmmv +rpaulo -> lidl rpaulo -> ngie rrs -> brucec -- cgit v1.1 From 9d3e0245b758d8331d329301421f2d1a1e67e5ae Mon Sep 17 00:00:00 2001 From: hiren Date: Tue, 27 Oct 2015 09:43:05 +0000 Subject: Add sysctl tunable net.inet.tcp.initcwnd_segments to specify initial congestion window in number of segments on fly. It is set to 10 segments by default. Remove net.inet.tcp.experimental.initcwnd10 which is now redundant. Also remove the parent node net.inet.tcp.experimental as it's not needed anymore and also because it was not well thought out. Differential Revision: https://reviews.freebsd.org/D3858 In collaboration with: lstewart Reviewed by: gnn (prev version), rwatson, allanjude, wblock (man page) MFC after: 2 weeks Relnotes: yes Sponsored by: Limelight Networks --- share/man/man4/tcp.4 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 351e4b4..8c5887f 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 13, 2014 +.Dd October 27, 2015 .Dt TCP 4 .Os .Sh NAME @@ -454,6 +454,17 @@ code. For this reason, we use 200ms of slop and a near-0 minimum, which gives us an effective minimum of 200ms (similar to .Tn Linux ) . +.It Va initcwnd_segments +Enable the ability to specify initial congestion window in number of segments. +The default value is 10 as suggested by RFC 6928. +Changing the value on fly would not affect connections using congestion window +from the hostcache. +Caution: +This regulates the burst of packets allowed to be sent in the first RTT. +The value should be relative to the link capacity. +Start with small values for lower-capacity links. +Large bursts can cause buffer overruns and packet drops if routers have small +buffers or the link is experiencing congestion. .It Va rfc3042 Enable the Limited Transmit algorithm as described in RFC 3042. It helps avoid timeouts on lossy links and also when the congestion window -- cgit v1.1 From b5aa20998322096519d613d8dc1dcd0a545925b5 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 27 Oct 2015 23:35:02 +0000 Subject: Use more appropriate ${SHAREDIR} rather than /usr/share. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/colldef/Makefile | 2 +- share/examples/smbfs/Makefile | 2 +- share/examples/smbfs/print/Makefile | 2 +- share/keys/pkg/trusted/Makefile | 2 +- share/mklocale/Makefile | 2 +- share/monetdef/Makefile | 2 +- share/msgdef/Makefile | 2 +- share/numericdef/Makefile | 2 +- share/sendmail/Makefile | 2 +- share/skel/Makefile | 4 ++-- share/timedef/Makefile | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) (limited to 'share') diff --git a/share/colldef/Makefile b/share/colldef/Makefile index ab44994..554ca93 100644 --- a/share/colldef/Makefile +++ b/share/colldef/Makefile @@ -42,7 +42,7 @@ LOCALES= bg_BG.CP1251 \ uk_UA.ISO8859-5 \ uk_UA.KOI8-U -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out diff --git a/share/examples/smbfs/Makefile b/share/examples/smbfs/Makefile index 9e5b99a..3867b80 100644 --- a/share/examples/smbfs/Makefile +++ b/share/examples/smbfs/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ NO_OBJ= -BINDIR= /usr/share/examples/smbfs +FILESDIR= ${SHAREDIR}/examples/smbfs FILES= dot.nsmbrc .PATH: ${.CURDIR}/../../../contrib/smbfs/examples diff --git a/share/examples/smbfs/print/Makefile b/share/examples/smbfs/print/Makefile index eb66815..67f4823 100644 --- a/share/examples/smbfs/print/Makefile +++ b/share/examples/smbfs/print/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ NO_OBJ= -BINDIR= /usr/share/examples/smbfs/print +FILESDIR= ${SHAREDIR}/examples/smbfs/print FILES= lj6l ljspool printcap.sample tolj .PATH: ${.CURDIR}/../../../../contrib/smbfs/examples/print diff --git a/share/keys/pkg/trusted/Makefile b/share/keys/pkg/trusted/Makefile index ee0d4c9..bc8d13a 100644 --- a/share/keys/pkg/trusted/Makefile +++ b/share/keys/pkg/trusted/Makefile @@ -4,7 +4,7 @@ NO_OBJ= FILES= pkg.freebsd.org.2013102301 -FILESDIR= /usr/share/keys/pkg/trusted +FILESDIR= ${SHAREDIR}/keys/pkg/trusted FILESMODE= 644 .include diff --git a/share/mklocale/Makefile b/share/mklocale/Makefile index 172d4d0..fa87394 100644 --- a/share/mklocale/Makefile +++ b/share/mklocale/Makefile @@ -30,7 +30,7 @@ LOCALES= UTF-8 \ zh_HK.Big5HKSCS \ zh_TW.Big5 -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out diff --git a/share/monetdef/Makefile b/share/monetdef/Makefile index 165e879..4d6513b 100644 --- a/share/monetdef/Makefile +++ b/share/monetdef/Makefile @@ -90,7 +90,7 @@ LOCALES= af_ZA.ISO8859-1 \ zh_HK.UTF-8 \ zh_TW.Big5 -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out diff --git a/share/msgdef/Makefile b/share/msgdef/Makefile index 21e7776..3069b42 100644 --- a/share/msgdef/Makefile +++ b/share/msgdef/Makefile @@ -70,7 +70,7 @@ LOCALES= af_ZA.ISO8859-1 \ zh_TW.Big5 \ zh_TW.UTF-8 -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out diff --git a/share/numericdef/Makefile b/share/numericdef/Makefile index f7f97c0..086f05c 100644 --- a/share/numericdef/Makefile +++ b/share/numericdef/Makefile @@ -44,7 +44,7 @@ LOCALES= af_ZA.ISO8859-1 \ uk_UA.KOI8-U \ zh_CN.eucCN -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out diff --git a/share/sendmail/Makefile b/share/sendmail/Makefile index 8153d49..a548b63 100644 --- a/share/sendmail/Makefile +++ b/share/sendmail/Makefile @@ -7,7 +7,7 @@ CFDIR= cf CFDIRS!= (cd ${SENDMAIL_DIR}; find -L ${CFDIR} \( \( -name CVS -o -name .svn \) -prune \) -o -type d -print) CFFILES!= (cd ${SENDMAIL_DIR}; find -L ${CFDIR} \( \( -name CVS -o -name .svn \) -prune \) -o -type f -print) -DDIR= ${DESTDIR}/usr/share/sendmail +DDIR= ${DESTDIR}${SHAREDIR}/sendmail # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies'') diff --git a/share/skel/Makefile b/share/skel/Makefile index 305a455..6b67d2b 100644 --- a/share/skel/Makefile +++ b/share/skel/Makefile @@ -5,8 +5,8 @@ FILESGROUPS= FILES1 FILES2 FILES1= dot.cshrc dot.login dot.login_conf dot.mailrc dot.profile \ dot.shrc FILES2= dot.mail_aliases dot.rhosts -FILES1DIR= /usr/share/skel -FILES2DIR= /usr/share/skel +FILES1DIR= ${SHAREDIR}/skel +FILES2DIR= ${SHAREDIR}/skel FILES1MODE= 0644 FILES2MODE= 0600 diff --git a/share/timedef/Makefile b/share/timedef/Makefile index 1e589d8..2b7fca6 100644 --- a/share/timedef/Makefile +++ b/share/timedef/Makefile @@ -96,7 +96,7 @@ LOCALES= am_ET.UTF-8 \ zh_TW.Big5 \ zh_TW.UTF-8 -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out -- cgit v1.1 From 4377399627ac58c21ca3182877ec770a557436b4 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 27 Oct 2015 23:49:32 +0000 Subject: Use proper CONFDIR after r289148 --- share/mk/bsd.confs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 172f516..aa5191f 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -21,7 +21,7 @@ all: buildconfig ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${CONFMODE} -${group}DIR?= ${CONFIGDIR}/ +${group}DIR?= ${CONFDIR} STAGE_SETS+= ${group} STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -- cgit v1.1 From 35a45e42cd28171e10e6652d8122d00bfcd77bef Mon Sep 17 00:00:00 2001 From: imp Date: Wed, 28 Oct 2015 19:11:06 +0000 Subject: BUS_ADD_CHILD calls device_add_child. device_add_child does not call BUS_ADD_CHILD. Make it explicit since it follows the command paradigm rather than the callback paradigm. Add other clarifying notes as well. --- share/man/man9/BUS_ADD_CHILD.9 | 21 ++++++++++++++++++--- share/man/man9/device_add_child.9 | 16 ++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) (limited to 'share') diff --git a/share/man/man9/BUS_ADD_CHILD.9 b/share/man/man9/BUS_ADD_CHILD.9 index 8b69d5a..1e98ffe 100644 --- a/share/man/man9/BUS_ADD_CHILD.9 +++ b/share/man/man9/BUS_ADD_CHILD.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2004 +.Dd October 28, 2015 .Dt BUS_ADD_CHILD 9 .Os .Sh NAME @@ -44,6 +44,8 @@ The .Fn BUS_ADD_CHILD method is used by the driver identify routine to add devices to the tree. +It can also be used to add children to buses that implement this +routine in other contexts, although the behavior is bus specific. Please see .Xr device_add_child 9 for more details. @@ -53,18 +55,31 @@ however, the bus' .Fn BUS_ADD_CHILD is called. .Pp -Busses implementing +Buses implementing .Fn BUS_ADD_CHILD should insert the device into the tree using .Xr device_add_child 9 before adding things such as their own ivars and resource lists to the device. +.Fn BUS_ADD_CHILD +is not called by +.Xr device_add_child 9 . +.Fn BUS_ADD_CHILD +instead calls +.Xr device_add_child 9 . +.Pp +A panic will result when called for a bus that does not implement +.Fn BUS_ADD_CHILD . +Some buses require a special bus-specific routine to be called instead +of +.Fn BUS_ADD_CHILD . .Sh RETURN VALUES The .Fn BUS_ADD_CHILD method returns .Vt device_t added to the tree, or -.Dv NULL . +.Dv NULL +to indicate failure. .Sh SEE ALSO .Xr device 9 , .Xr device_add_child 9 , diff --git a/share/man/man9/device_add_child.9 b/share/man/man9/device_add_child.9 index 7ddd19a..052db92 100644 --- a/share/man/man9/device_add_child.9 +++ b/share/man/man9/device_add_child.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 2006 +.Dd October 28, 2015 .Dt DEVICE_ADD_CHILD 9 .Os .Sh NAME @@ -74,14 +74,14 @@ Normally unit numbers will be chosen automatically by the system and a unit number of .Dv -1 should be given. -When a specific unit number is desired (e.g.\& for wiring a particular +When a specific unit number is desired (e.g.,\& for wiring a particular piece of hardware to a pre-configured unit number), that unit should be passed. If the specified unit number is already allocated, a new unit will be allocated and a diagnostic message printed. .Pp If the devices attached to a bus must be probed in a specific order -(e.g.\& for the ISA bus some devices are sensitive to failed probe attempts +(e.g.,\& for the ISA bus some devices are sensitive to failed probe attempts of unrelated drivers and therefore must be probed first), the .Fa order @@ -109,10 +109,18 @@ Authors of bus drivers must likewise be careful when adding children when they are loaded and unloaded to avoid duplication of children devices. .Pp -Identify routines should use +When adding a child to another device node, such as in an identify +routine, use .Xr BUS_ADD_CHILD 9 instead of .Xr device_add_child 9 . +.Xr BUS_ADD_CHILD 9 +will call +.Xr device_add_child 9 +and add the proper bus-specific data to the new child. +.Fn device_add_child +does not call +.Xr BUS_ADD_CHILD 9 . .Sh RETURN VALUES The new device if successful, NULL otherwise. .Sh SEE ALSO -- cgit v1.1 From 394a144c005690c0352c114780339ce45e865072 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Thu, 29 Oct 2015 00:41:03 +0000 Subject: Fix regression from using .USEBEFORE in _SUBDIR in r289705. Using .USEBEFORE had the unintended side-effect of changing the directory for the real target ran in the current directory. For example this meant that the 'make clean' would run in one of the SUBDIR. Sponsored by: EMC / Isilon Storage Division Pointyhat to: bdrewery --- share/mk/bsd.subdir.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 0a22fbe..f9b9e97 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -83,7 +83,7 @@ _SUBDIR_SH= \ _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) @${_+_}target=${.TARGET:S,realinstall,install,}; \ - for dir in ${SUBDIR:N.WAIT}; do ${_SUBDIR_SH}; done + for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done .endif ${SUBDIR:N.WAIT}: .PHONY .MAKE -- cgit v1.1 From af3d6f47ce62e8e6260ceb37c8f42faae6710827 Mon Sep 17 00:00:00 2001 From: kevlo Date: Thu, 29 Oct 2015 03:22:27 +0000 Subject: Xref otus(4). --- share/man/man4/wlan.4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/man/man4/wlan.4 b/share/man/man4/wlan.4 index 9bfbb4a..747e040 100644 --- a/share/man/man4/wlan.4 +++ b/share/man/man4/wlan.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2015 +.Dd October 29, 2015 .Dt WLAN 4 .Os .Sh NAME @@ -182,6 +182,7 @@ may not interoperate. .Xr malo 4 , .Xr mwl 4 , .Xr netintro 4 , +.Xr otus 4 , .Xr ral 4 , .Xr rsu 4 , .Xr rum 4 , -- cgit v1.1 From 6862e5ea8e97e4ed1eda14db00ef245a919ac499 Mon Sep 17 00:00:00 2001 From: kevlo Date: Thu, 29 Oct 2015 03:28:28 +0000 Subject: Add MLINKS for if_otus(4), if_rsu(4) and if_urtwn(4). --- share/man/man4/Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'share') diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 94c2ad3..cfb6646 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -672,6 +672,7 @@ MLINKS+=nge.4 if_nge.4 MLINKS+=${_ntb.4} ${_if_ntb.4} \ ${_ntb.4} ${_ntb_hw.4} MLINKS+=${_nxge.4} ${_if_nxge.4} +MLINKS+=otus.4 if_otus.4 MLINKS+=ow.4 onewire.4 MLINKS+=patm.4 if_patm.4 MLINKS+=pccbb.4 cbb.4 @@ -685,6 +686,7 @@ MLINKS+=rl.4 if_rl.4 MLINKS+=rue.4 if_rue.4 MLINKS+=rum.4 if_rum.4 MLINKS+=run.4 if_run.4 +MLINKS+=rsu.4 if_rsu.4 MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ scsi.4 scbus.4 \ @@ -713,6 +715,7 @@ MLINKS+=tl.4 if_tl.4 MLINKS+=tun.4 if_tun.4 MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 +MLINKS+=urtwn.4 if_urtwn.4 MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vxlan.4 if_vxlan.4 -- cgit v1.1 From 3ac7a1ed119364ba58390fce282c8bd50ac27696 Mon Sep 17 00:00:00 2001 From: mav Date: Thu, 29 Oct 2015 09:50:48 +0000 Subject: Some updates to isp(4) manual page. --- share/man/man4/isp.4 | 54 ++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) (limited to 'share') diff --git a/share/man/man4/isp.4 b/share/man/man4/isp.4 index 6d3a49a..500eade 100644 --- a/share/man/man4/isp.4 +++ b/share/man/man4/isp.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2014 +.Dd October 29, 2015 .Dt ISP 4 .Os .Sh NAME @@ -60,8 +60,7 @@ devices. SCSI features include support for Ultra SCSI and wide mode transactions for .Tn SCSI , -Ultra2 LVD (for the ISP1080 and ISP1280), and Ultra3 LVD (for the -ISP12160). +Ultra2 LVD (ISP1080, ISP1280), and Ultra3 LVD (ISP12160). .Pp Fibre Channel support uses FCP SCSI profile for .Tn FibreChannel , @@ -69,15 +68,13 @@ and utilizes Class 3 and Class 2 connections (Qlogic 2100 is Class 3 only, minor patches to the Qlogic 2200 to force Class 2 mode). Support is available for Public and Private loops, and for point-to-point connections (Qlogic 2200 only). -The newer 2-Gigabit cards (2300, 2312, 2322) and 4-Gigabit (2422, 2432) -are also supported. -Command tagging is -supported for all (in fact, +The newer 2-Gigabit cards (2300, 2312, 2322), 4-Gigabit (2422, 2432) +and 8-Gigabit (2532) are also supported. +Command tagging is supported for all (in fact, .Tn FibreChannel requires tagging). Fabric support is enabled by default for other than 2100 cards. -Fabric -support for 2100 cards has been so problematic and these cards are so +Fabric support for 2100 cards has been so problematic and these cards are so old now that it is just not worth your time to try it. .Sh FIRMWARE Firmware is available if the @@ -103,15 +100,16 @@ Qlogic 1020 Fast Wide and Differential Fast Wide PCI cards. .It ISP1040 Qlogic 1040 Ultra Wide and Differential Ultra Wide PCI cards. Also known as the DEC KZPBA-CA (single ended) and KZPBA-CB (HVD differential). -.It Qlogic 1240 -Qlogic 1240 Dual Bus Ultra Wide and Differential Ultra Wide PCI -cards. .It Qlogic 1020 Qlogic 1020 SCSI cards. .It Qlogic 1040 Qlogic 1040 Ultra SCSI cards. .It Qlogic 1080 -Qlogic 1280 LVD Ultra2 Wide PCI cards. +Qlogic 1080 LVD Ultra2 Wide SCSI cards. +.It Qlogic 10160 +Qlogic 10160 LVD Ultra3 Wide PCI cards. +.It Qlogic 1240 +Qlogic 1240 Dual Bus Ultra Wide and Differential Ultra Wide PCI cards. .It Qlogic 1280 Qlogic 1280 Dual Bus LVD Ultra2 Wide PCI cards. .It Qlogic 12160 @@ -123,21 +121,21 @@ Loop (single, dual). Qlogic 2200 Copper and Optical Fibre Channel Arbitrated Loop PCI cards (single, dual, quad). .It Qlogic 2300 -Qlogic 2300 Optical Fibre Channel PCI cards. +Qlogic 2300 Optical 2Gb Fibre Channel PCI cards. .It Qlogic 2312 -Qlogic 2312 Optical Fibre Channel PCI cards. +Qlogic 2312 Optical 2Gb Fibre Channel PCI cards. .It Qlogic 234X -Qlogic 234X Optical Fibre Channel PCI cards (2312 chipset, single and dual attach). +Qlogic 234X Optical 2Gb Fibre Channel PCI cards (2312 chipset, single and dual attach). .It Qlogic 2322 -Qlogic 2322 Optical Fibre Channel PCIe cards. +Qlogic 2322 Optical 2Gb Fibre Channel PCIe cards. .It Qlogic 200 -Dell Branded version of the QLogic 2312 Fibre Channel PCI cards. +Dell branded version of the QLogic 2312. .It Qlogic 2422 -Qlogic 2422 Optical Fibre Channel PCI cards (4 Gigabit) -.It Qlogic 2432 -Qlogic 2432 Optical Fibre Channel PCIe cards (4 Gigabit) +Qlogic 2422 Optical 4Gb Fibre Channel PCI cards. .It Qlogic 2432 -Qlogic 2532 Optical Fibre Channel PCIe cards (8 Gigabit) +Qlogic 2432 Optical 4Gb Fibre Channel PCIe cards. +.It Qlogic 2532 +Qlogic 2532 Optical 8Gb Fibre Channel PCIe cards. .El .Sh CONFIGURATION OPTIONS Target mode support may be enabled with the @@ -232,13 +230,11 @@ The .Nm driver was written by .An Matthew Jacob -originally for NetBSD at -NASA/Ames Research Center. +originally for NetBSD at NASA/Ames Research Center. +Some later improvement was done by +.An Alexander Motin Aq Mt mav@FreeBSD.org .Sh BUGS The driver currently ignores some NVRAM settings. .Pp -Target mode support is not completely reliable yet. -It works reasonably -well for Fibre Channel, somewhat well for Qlogic 1040 cards, but -does not yet work for the other cards (due to last minute unannounced -changes in firmware interfaces). +Target mode support works reasonably well for 23xx and above Fibre Channel +cars, but not really tested on older ones. -- cgit v1.1 From 603bc9566a76827287a17e9826bb4136ee5b6c11 Mon Sep 17 00:00:00 2001 From: mav Date: Thu, 29 Oct 2015 10:31:44 +0000 Subject: Some minor additions to r290138, --- share/man/man4/isp.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/man/man4/isp.4 b/share/man/man4/isp.4 index 500eade..767db68 100644 --- a/share/man/man4/isp.4 +++ b/share/man/man4/isp.4 @@ -232,9 +232,9 @@ driver was written by .An Matthew Jacob originally for NetBSD at NASA/Ames Research Center. Some later improvement was done by -.An Alexander Motin Aq Mt mav@FreeBSD.org +.An Alexander Motin Aq Mt mav@FreeBSD.org . .Sh BUGS The driver currently ignores some NVRAM settings. .Pp Target mode support works reasonably well for 23xx and above Fibre Channel -cars, but not really tested on older ones. +cards, but not really tested on older ones. -- cgit v1.1 From 9a078d19e197998baa468938bca8661357b95a38 Mon Sep 17 00:00:00 2001 From: jtl Date: Thu, 29 Oct 2015 21:00:11 +0000 Subject: Add myself (jtl) and my mentor to the committers-src.dot file. Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D4029 --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index c7f8c9c..42aedaa 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -206,6 +206,7 @@ joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1993/11/14"] jon [label="Jonathan Chen\njon@FreeBSD.org\n2000/10/17"] jonathan [label="Jonathan Anderson\njonathan@FreeBSD.org\n2010/10/07"] jpaetzel [label="Josh Paetzel\njpaetzel@FreeBSD.org\n2011/01/21"] +jtl [label="Jonathan T. Looney\njtl@FreeBSD.org\n2015/10/26"] julian [label="Julian Elischer\njulian@FreeBSD.org\n1993/04/19"] jwd [label="John De Boskey\njwd@FreeBSD.org\n2000/05/19"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] @@ -460,6 +461,7 @@ gnn -> davide gnn -> arybchik gnn -> erj gnn -> kp +gnn -> jtl grehan -> bryanv -- cgit v1.1 From 9278a0880b0cf18e808f99a2a582b3a2f6971a7b Mon Sep 17 00:00:00 2001 From: skra Date: Thu, 29 Oct 2015 21:40:32 +0000 Subject: Install myself as src committer. Approved by: kib (mentor) --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 42aedaa..acd3dd9 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -286,6 +286,7 @@ sephe [label="Sepherosa Ziehau\nsephe@FreeBSD.org\n2007/03/28"] sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] +skra [label="Svatopluk Kraus\nslm@FreeBSD.org\n2015/10/28"] slm [label="Stephen McConnell\nslm@FreeBSD.org\n2014/05/07"] smh [label="Steven Hartland\nsmh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] @@ -576,6 +577,7 @@ kib -> pluknet kib -> rdivacky kib -> rmacklem kib -> rmh +kib -> skra kib -> stas kib -> tijl kib -> trociny -- cgit v1.1 From ee7c1670a84eacc753378948392e62b87c5d178f Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 30 Oct 2015 06:07:41 +0000 Subject: Unbreak bsd.progs.mk with PROGS (but not PROGS_CXX) and when invoking the "one of many" targets, e.g. `make hello_world`, where hello_world is a C program Tested with: PROGS and PROGS_CXX MFC after: 1 week X-MFC with: r289289 Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.progs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index dce05c7..c84e94b 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -31,7 +31,7 @@ UPDATE_DEPENDFILE_PROG = ${PROGS:[1]} # They may have asked us to build just one .for t in ${PROGS} .if make($t) -.if ${PROGS_CXX:M${t}} +.if ${PROGS_CXX:U:M${t}} PROG_CXX ?= $t .endif PROG ?= $t -- cgit v1.1 From 19ffb62cab0f170b2075da0815304de7c1d90ef3 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Sat, 31 Oct 2015 02:07:30 +0000 Subject: Don't hide stderr when checking ${CC} --version. This can have important debugging information such as 'cc: not found' or 'ccache: error: Could not find compiler "cc" in PATH'. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.compiler.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 3ba5130..9ad4bae 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -52,7 +52,7 @@ ${var}= ${${var}.${_cc_hash}} COMPILER_TYPE= none COMPILER_VERSION= 0 .elif !defined(COMPILER_TYPE) || !defined(COMPILER_VERSION) -_v!= ${CC} --version 2>/dev/null || echo 0.0.0 +_v!= ${CC} --version || echo 0.0.0 .if !defined(COMPILER_TYPE) . if ${CC:T:M*gcc*} -- cgit v1.1 From 39d22b9678b8c571aab6902620c95907d5bef2db Mon Sep 17 00:00:00 2001 From: cem Date: Sat, 31 Oct 2015 20:38:06 +0000 Subject: ioat: Handle channel-fatal HW errors safely Certain invalid operations trigger hardware error conditions. Error conditions that only halt one channel can be detected and recovered by resetting the channel. Error conditions that halt the whole device are generally not recoverable. Add a sysctl to inject channel-fatal HW errors, 'dev.ioat..force_hw_error=1'. When a halt due to a channel error is detected, ioat(4) blocks new operations from being queued on the channel, completes any outstanding operations with an error status, and resets the channel before allowing new operations to be queued again. Update ioat.4 to document error recovery; document blockfill introduced in r290021 while we are here; document ioat_put_dmaengine() added in r289907; document DMA_NO_WAIT added in r289982. Sponsored by: EMC / Isilon Storage Division --- share/man/man4/ioat.4 | 79 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 71 insertions(+), 8 deletions(-) (limited to 'share') diff --git a/share/man/man4/ioat.4 b/share/man/man4/ioat.4 index 301ab4f..62d85f1 100644 --- a/share/man/man4/ioat.4 +++ b/share/man/man4/ioat.4 @@ -24,14 +24,25 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2015 +.Dd October 31, 2015 .Dt IOAT 4 .Os .Sh NAME .Nm I/OAT .Nd Intel I/O Acceleration Technology .Sh SYNOPSIS +To compile this driver into your kernel, +place the following line in your kernel configuration file: +.Bd -ragged -offset indent .Cd "device ioat" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ioat_load="YES" +.Ed +.Pp In .Xr loader.conf 5 : .Pp @@ -46,11 +57,13 @@ In (only critical errors; maximum of 3) .Pp .Ft typedef void -.Fn (*bus_dmaengine_callback_t) "void *arg" +.Fn (*bus_dmaengine_callback_t) "void *arg" "int error" .Pp .Ft bus_dmaengine_t .Fn ioat_get_dmaengine "uint32_t channel_index" .Ft void +.Fn ioat_put_dmaengine "bus_dmaengine_t dmaengine" +.Ft void .Fn ioat_acquire "bus_dmaengine_t dmaengine" .Ft void .Fn ioat_release "bus_dmaengine_t dmaengine" @@ -65,6 +78,16 @@ In .Fa "uint32_t flags" .Fc .Ft struct bus_dmadesc * +.Fo ioat_blockfill +.Fa "bus_dmaengine_t dmaengine" +.Fa "bus_addr_t dst" +.Fa "uint64_t fillpattern" +.Fa "bus_size_t len" +.Fa "bus_dmaengine_callback_t callback_fn" +.Fa "void *callback_arg" +.Fa "uint32_t flags" +.Fc +.Ft struct bus_dmadesc * .Fo ioat_null .Fa "bus_dmaengine_t dmaengine" .Fa "bus_dmaengine_callback_t callback_fn" @@ -82,7 +105,9 @@ There is a number of DMA channels per CPU package. Each may be used independently. Operations on a single channel proceed sequentially. .Pp -Copy operations may be used to offload memory copies to the DMA engines. +Blockfill operations can be used to write a 64-bit pattern to memory. +.Pp +Copy operations can be used to offload memory copies to the DMA engines. .Pp Null operations do nothing, but may be used to test the interrupt and callback mechanism. @@ -92,6 +117,26 @@ All operations can optionally trigger an interrupt at completion with the flag. For example, a user might submit multiple operations to the same channel and only enable an interrupt and callback for the last operation. +.Pp +All operations are safe to use in a non-blocking context with the +.Ar DMA_NO_WAIT +flag. +(Of course, allocations may fail and operations requested with +.Ar DMA_NO_WAIT +may return NULL.) +.Pp +All operations, as well as +.Fn ioat_get_dmaengine , +can return NULL in special circumstances. +For example, if the +.Nm +driver is being unloaded, or the administrator has induced a hardware reset, or +a usage error has resulted in a hardware error state that needs to be recovered +from. +.Pp +It is invalid to attempt to submit new DMA operations in a +.Fa bus_dmaengine_callback_t +context. .Sh USAGE A typical user will lookup the DMA engine object for a given channel with .Fn ioat_get_dmaengine . @@ -101,10 +146,11 @@ the .Ar bus_dmaengine_t object for exclusive access to enqueue operations on that channel. Then, they will submit one or more operations using -.Fn ioat_copy +.Fn ioat_blockfill , +.Fn ioat_copy , or .Fn ioat_null . -Finally, they will +After queueing one or more individual DMA operations, they will .Fn ioat_release the .Ar bus_dmaengine_t @@ -114,6 +160,19 @@ The routine they provided for the argument will be invoked with the provided .Fa callback_arg when the operation is complete. +When they are finished with the +.Ar bus_dmaengine_t , +the user should +.Fn ioat_put_dmaengine . +.Pp +Users MUST NOT block between +.Fn ioat_acquire +and +.Fn ioat_release . +Users SHOULD NOT hold +.Ar bus_dmaengine_t +references for a very long time to enable fault recovery and kernel module +unload. .Pp For an example of usage, see .Pa src/sys/dev/ioat/ioat_test.c . @@ -135,19 +194,23 @@ The .Nm driver was developed by .An \&Jim Harris Aq Mt jimharris@FreeBSD.org , +.An \&Carl Delsey Aq Mt carl.r.delsey@intel.com , and -.An \&Carl Delsey Aq Mt carl.r.delsey@intel.com . +.An \&Conrad Meyer Aq Mt cem@FreeBSD.org . This manual page was written by .An \&Conrad Meyer Aq Mt cem@FreeBSD.org . .Sh CAVEATS Copy operation takes bus addresses as parameters, not virtual addresses. .Pp -Copies larger than max transfer size (1MB) are not supported. +Buffers for individual copy operations must be physically contiguous. +.Pp +Copies larger than max transfer size (1MB, but may vary by hardware) are not +supported. Future versions will likely support this by breaking up the transfer into smaller sizes. .Sh BUGS The .Nm -driver only supports copy and null operations at this time. +driver only supports blockfill, copy, and null operations at this time. The driver does not yet support advanced DMA modes, such as XOR, that some I/OAT devices support. -- cgit v1.1 From 02dfa34a88fe21460dbef06a8547c14433a26b13 Mon Sep 17 00:00:00 2001 From: mmel Date: Sun, 1 Nov 2015 16:54:55 +0000 Subject: Install myself as src committer. Approved by: kib (mentor) > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. M share/misc/committers-src.dot --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index acd3dd9..2b8866f 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -235,6 +235,7 @@ melifaro [label="Alexander V. Chernikov\nmelifaro@FreeBSD.org\n2011/10/04"] mjacob [label="Matt Jacob\nmjacob@FreeBSD.org\n1997/08/13"] mjg [label="Mateusz Guzik\nmjg@FreeBSD.org\n2012/06/04"] mlaier [label="Max Laier\nmlaier@FreeBSD.org\n2004/02/10"] +mmel [label="Michal Meloun\nmmel@FreeBSD.org\n2015/11/01"] monthadar [label="Monthadar Al Jaberi\nmonthadar@FreeBSD.org\n2012/04/02"] mp [label="Mark Peek\nmp@FreeBSD.org\n2001/07/27"] mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] @@ -572,6 +573,7 @@ kib -> jlh kib -> jpaetzel kib -> lulf kib -> melifaro +kib -> mmel kib -> pho kib -> pluknet kib -> rdivacky -- cgit v1.1