From owner-svn-src-user@freebsd.org Sat Oct 17 22:20:09 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83844A18138 for ; Sat, 17 Oct 2015 22:20:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C6EA977; Sat, 17 Oct 2015 22:20:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9HMK8uD007585; Sat, 17 Oct 2015 22:20:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9HMK6e7007564; Sat, 17 Oct 2015 22:20:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510172220.t9HMK6e7007564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 17 Oct 2015 22:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r289472 - in user/ngie/more-tests2: . lib/clang lib/libc/string lib/libcam rescue/rescue sbin/mount share/man/man3 share/man/man9 share/mk share/zoneinfo sys/arm64/arm64 sys/dev/drm2/i9... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2015 22:20:09 -0000 Author: ngie Date: Sat Oct 17 22:20:06 2015 New Revision: 289472 URL: https://svnweb.freebsd.org/changeset/base/289472 Log: MFhead @ r289471 Added: user/ngie/more-tests2/share/man/man9/bitset.9 - copied unchanged from r289471, head/share/man/man9/bitset.9 Modified: user/ngie/more-tests2/Makefile user/ngie/more-tests2/Makefile.inc1 user/ngie/more-tests2/UPDATING user/ngie/more-tests2/lib/clang/clang.build.mk user/ngie/more-tests2/lib/libc/string/ffs.3 user/ngie/more-tests2/lib/libcam/camlib.c user/ngie/more-tests2/rescue/rescue/Makefile user/ngie/more-tests2/sbin/mount/mount.conf.8 user/ngie/more-tests2/share/man/man3/bitstring.3 user/ngie/more-tests2/share/man/man9/Makefile user/ngie/more-tests2/share/mk/bsd.sys.mk user/ngie/more-tests2/share/mk/sys.mk user/ngie/more-tests2/share/zoneinfo/Makefile user/ngie/more-tests2/sys/arm64/arm64/copyinout.S user/ngie/more-tests2/sys/arm64/arm64/genassym.c user/ngie/more-tests2/sys/arm64/arm64/locore.S user/ngie/more-tests2/sys/arm64/arm64/support.S user/ngie/more-tests2/sys/dev/drm2/i915/intel_dp.c user/ngie/more-tests2/sys/dev/drm2/i915/intel_iic.c user/ngie/more-tests2/sys/kern/vfs_mountroot.c user/ngie/more-tests2/sys/net/route.c user/ngie/more-tests2/sys/net/route.h user/ngie/more-tests2/sys/netinet/in_rmx.c user/ngie/more-tests2/sys/netinet/in_var.h user/ngie/more-tests2/sys/x86/x86/busdma_bounce.c user/ngie/more-tests2/usr.bin/iscsictl/iscsictl.8 user/ngie/more-tests2/usr.bin/iscsictl/iscsictl.c Directory Properties: user/ngie/more-tests2/ (props changed) user/ngie/more-tests2/lib/libc/ (props changed) user/ngie/more-tests2/sbin/ (props changed) user/ngie/more-tests2/share/ (props changed) user/ngie/more-tests2/share/zoneinfo/ (props changed) user/ngie/more-tests2/sys/ (props changed) Modified: user/ngie/more-tests2/Makefile ============================================================================== --- user/ngie/more-tests2/Makefile Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/Makefile Sat Oct 17 22:20:06 2015 (r289472) @@ -243,14 +243,8 @@ cleanworld: # Handle the user-driven targets, using the source relative mk files. # -.if !(!empty(.MAKEFLAGS:M-n) && ${.MAKEFLAGS:M-n} == "-n") -# skip this for -n to avoid changing previous behavior of -# 'make -n buildworld' etc. Using -n -n will run it. -${TGTS}: .MAKE tinderbox toolchains kernel-toolchains: .MAKE -.endif - -${TGTS}: .PHONY +${TGTS}: .PHONY .MAKE ${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET} # The historic default "all" target creates files which may cause stale Modified: user/ngie/more-tests2/Makefile.inc1 ============================================================================== --- user/ngie/more-tests2/Makefile.inc1 Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/Makefile.inc1 Sat Oct 17 22:20:06 2015 (r289472) @@ -325,10 +325,6 @@ HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MT HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT .endif -.if ${MK_CDDL} == "no" -WMAKEENV+= MK_CTF=no -.endif - .if defined(CROSS_TOOLCHAIN) LOCALBASE?= /usr/local .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" @@ -624,7 +620,8 @@ _includes: @echo "--------------------------------------------------------------" @echo ">>> stage 4.1: building includes" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes + ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks buildincludes + ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks installincludes _libraries: @echo @echo "--------------------------------------------------------------" @@ -2268,7 +2265,9 @@ _xi-cross-tools: .endfor _xi-includes: - ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \ + ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 buildincludes \ + DESTDIR=${XDDESTDIR} + ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 installincludes \ DESTDIR=${XDDESTDIR} _xi-libraries: Modified: user/ngie/more-tests2/UPDATING ============================================================================== --- user/ngie/more-tests2/UPDATING Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/UPDATING Sat Oct 17 22:20:06 2015 (r289472) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20151017: + The build previously allowed using 'make -n' to not recurse into + sub-directories while showing what commands would be executed, and + 'make -n -n' to recursively show commands. Now 'make -n' will recurse + and 'make -N' will not. + 20151012: If you specify SENDMAIL_MC or SENDMAIL_CF in make.conf, mergemaster and etcupdate will now use this file. A custom sendmail.cf is now Modified: user/ngie/more-tests2/lib/clang/clang.build.mk ============================================================================== --- user/ngie/more-tests2/lib/clang/clang.build.mk Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/lib/clang/clang.build.mk Sat Oct 17 22:20:06 2015 (r289472) @@ -39,6 +39,7 @@ CXXFLAGS.clang+= -stdlib=libc++ .PATH: ${LLVM_SRCS}/${SRCDIR} +.if ${MK_META_MODE} == "yes" .if empty(TOOLSDIR) || !exists(${TOOLSDIR}/usr/bin/clang-tblgen) .if ${MACHINE} == "host" && defined(BOOTSTRAPPING_TOOLS) .if !empty(LEGACY_TOOLS) && exists(${LEGACY_TOOLS}/usr/bin/tblgen) @@ -57,6 +58,7 @@ TOOLSDIR?= TBLGEN= ${TOOLSDIR}/usr/bin/tblgen CLANG_TBLGEN= ${TOOLSDIR}/usr/bin/clang-tblgen .endif +.endif # ${MK_META_MODE} == "yes" TBLGEN?= tblgen CLANG_TBLGEN?= clang-tblgen Modified: user/ngie/more-tests2/lib/libc/string/ffs.3 ============================================================================== --- user/ngie/more-tests2/lib/libc/string/ffs.3 Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/lib/libc/string/ffs.3 Sat Oct 17 22:20:06 2015 (r289472) @@ -30,7 +30,7 @@ .\" @(#)ffs.3 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd September 29, 2012 +.Dd October 17, 2015 .Dt FFS 3 .Os .Sh NAME @@ -81,7 +81,8 @@ Bits are numbered starting at 1, the lea A return value of zero from any of these functions means that the argument was zero. .Sh SEE ALSO -.Xr bitstring 3 +.Xr bitstring 3 , +.Xr bitset 9 .Sh HISTORY The .Fn ffs Modified: user/ngie/more-tests2/lib/libcam/camlib.c ============================================================================== --- user/ngie/more-tests2/lib/libcam/camlib.c Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/lib/libcam/camlib.c Sat Oct 17 22:20:06 2015 (r289472) @@ -676,8 +676,10 @@ cam_close_spec_device(struct cam_device if (dev == NULL) return; - if (dev->fd >= 0) + if (dev->fd >= 0) { close(dev->fd); + dev->fd = -1; + } } char * Modified: user/ngie/more-tests2/rescue/rescue/Makefile ============================================================================== --- user/ngie/more-tests2/rescue/rescue/Makefile Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/rescue/rescue/Makefile Sat Oct 17 22:20:06 2015 (r289472) @@ -221,5 +221,10 @@ CRUNCH_ALIAS_chown= chgrp ################################################################## CRUNCH_LIBS+= -lm +.if ${MK_ISCSI} != "no" +CRUNCH_PROGS_usr.bin+= iscsictl +CRUNCH_PROGS_usr.sbin+= iscsid +.endif + .include .include Modified: user/ngie/more-tests2/sbin/mount/mount.conf.8 ============================================================================== --- user/ngie/more-tests2/sbin/mount/mount.conf.8 Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/sbin/mount/mount.conf.8 Sat Oct 17 22:20:06 2015 (r289472) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .\" -.Dd July 7, 2013 +.Dd October 17, 2013 .Dt MOUNT.CONF 8 .Os .Sh NAME @@ -154,7 +154,7 @@ will direct the kernel to try mounting t first as an ISO CD9660 file system on .Pa /dev/cd0 , then if that does not work, as an ISO CD9660 file system on -.Pa /dev/acd0 , +.Pa /dev/cd1 , and then if that does not work, as a UFS file system on .Pa /dev/ada0s1a . If that does not work, a @@ -167,7 +167,7 @@ Finally if that does not work, the kerne .Li .timeout 3 cd9660:/dev/cd0 ro .Li .timeout 0 -cd9660:/dev/acd0 ro +cd9660:/dev/cd1 ro .Li .timeout 3 ufs:/dev/ada0s1a .Li .ask Modified: user/ngie/more-tests2/share/man/man3/bitstring.3 ============================================================================== --- user/ngie/more-tests2/share/man/man3/bitstring.3 Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/share/man/man3/bitstring.3 Sat Oct 17 22:20:06 2015 (r289472) @@ -30,7 +30,7 @@ .\" @(#)bitstring.3 8.1 (Berkeley) 7/19/93 .\" $FreeBSD$ .\" -.Dd July 19, 1993 +.Dd October 17, 2015 .Dt BITSTRING 3 .Os .Sh NAME @@ -178,7 +178,8 @@ make_lpr_available() } .Ed .Sh SEE ALSO -.Xr malloc 3 +.Xr malloc 3 , +.Xr bitset 9 .Sh HISTORY The .Nm bitstring Modified: user/ngie/more-tests2/share/man/man9/Makefile ============================================================================== --- user/ngie/more-tests2/share/man/man9/Makefile Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/share/man/man9/Makefile Sat Oct 17 22:20:06 2015 (r289472) @@ -11,6 +11,7 @@ MAN= accept_filter.9 \ altq.9 \ atomic.9 \ bios.9 \ + bitset.9 \ boot.9 \ bpf.9 \ buf.9 \ @@ -429,6 +430,32 @@ MLINKS+=atomic.9 atomic_add.9 \ atomic.9 atomic_subtract.9 \ atomic.9 atomic_swap.9 \ atomic.9 atomic_testandset.9 +MLINKS+=bitset.9 BITSET_DEFINE.9 \ + bitset.9 BITSET_T_INITIALIZER.9 \ + bitset.9 BITSET_FSET.9 \ + bitset.9 BIT_CLR.9 \ + bitset.9 BIT_COPY.9 \ + bitset.9 BIT_ISSET.9 \ + bitset.9 BIT_SET.9 \ + bitset.9 BIT_ZERO.9 \ + bitset.9 BIT_FILL.9 \ + bitset.9 BIT_SETOF.9 \ + bitset.9 BIT_EMPTY.9 \ + bitset.9 BIT_ISFULLSET.9 \ + bitset.9 BIT_FFS.9 \ + bitset.9 BIT_COUNT.9 \ + bitset.9 BIT_SUBSET.9 \ + bitset.9 BIT_OVERLAP.9 \ + bitset.9 BIT_CMP.9 \ + bitset.9 BIT_OR.9 \ + bitset.9 BIT_AND.9 \ + bitset.9 BIT_NAND.9 \ + bitset.9 BIT_CLR_ATOMIC.9 \ + bitset.9 BIT_SET_ATOMIC.9 \ + bitset.9 BIT_SET_ATOMIC_ACQ.9 \ + bitset.9 BIT_AND_ATOMIC.9 \ + bitset.9 BIT_OR_ATOMIC.9 \ + bitset.9 BIT_COPY_STORE_REL.9 MLINKS+=bpf.9 bpfattach.9 \ bpf.9 bpfattach2.9 \ bpf.9 bpfdetach.9 \ Copied: user/ngie/more-tests2/share/man/man9/bitset.9 (from r289471, head/share/man/man9/bitset.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/ngie/more-tests2/share/man/man9/bitset.9 Sat Oct 17 22:20:06 2015 (r289472, copy of r289471, head/share/man/man9/bitset.9) @@ -0,0 +1,400 @@ +.\" 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 17, 2015 +.Dt BITSET 9 +.Os +.Sh NAME +.Nm bitset(9) +\(em +.Nm BITSET_DEFINE , +.Nm BITSET_T_INITIALIZER , +.Nm BITSET_FSET , +.Nm BIT_CLR , +.Nm BIT_COPY , +.Nm BIT_ISSET , +.Nm BIT_SET , +.Nm BIT_ZERO , +.Nm BIT_FILL , +.Nm BIT_SETOF , +.Nm BIT_EMPTY , +.Nm BIT_ISFULLSET , +.Nm BIT_FFS , +.Nm BIT_COUNT , +.Nm BIT_SUBSET , +.Nm BIT_OVERLAP , +.Nm BIT_CMP , +.Nm BIT_OR , +.Nm BIT_AND , +.Nm BIT_NAND , +.Nm BIT_CLR_ATOMIC , +.Nm BIT_SET_ATOMIC , +.Nm BIT_SET_ATOMIC_ACQ , +.Nm BIT_AND_ATOMIC , +.Nm BIT_OR_ATOMIC , +.Nm BIT_COPY_STORE_REL +.Nd bitset manipulation macros +.Sh SYNOPSIS +.In sys/_bitset.h +.In sys/bitset.h +.\" +.Fn BITSET_DEFINE "STRUCTNAME" "const SETSIZE" +.Fn BITSET_T_INITIALIZER "ARRAY_CONTENTS" +.Fn BITSET_FSET "N_WORDS" +.\" +.Fn BIT_CLR "const SETSIZE" "size_t bit" "struct STRUCTNAME *bitset" +.Fn BIT_COPY "const SETSIZE" "struct STRUCTNAME *from" "struct STRUCTNAME *to" +.Ft bool +.Fn BIT_ISSET "const SETSIZE" "size_t bit" "struct STRUCTNAME *bitset" +.Fn BIT_SET "const SETSIZE" "size_t bit" "struct STRUCTNAME *bitset" +.Fn BIT_ZERO "const SETSIZE" "struct STRUCTNAME *bitset" +.Fn BIT_FILL "const SETSIZE" "struct STRUCTNAME *bitset" +.Fn BIT_SETOF "const SETSIZE" "size_t bit" "struct STRUCTNAME *bitset" +.Ft bool +.Fn BIT_EMPTY "const SETSIZE" "struct STRUCTNAME *bitset" +.Ft bool +.Fn BIT_ISFULLSET "const SETSIZE" "struct STRUCTNAME *bitset" +.Ft size_t +.Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset" +.Ft size_t +.Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset" +.\" +.Ft bool +.Fo BIT_SUBSET +.Fa "const SETSIZE" "struct STRUCTNAME *haystack" "struct STRUCTNAME *needle" +.Fc +.Ft bool +.Fo BIT_OVERLAP +.Fa "const SETSIZE" "struct STRUCTNAME *bitset1" "struct STRUCTNAME *bitset2" +.Fc +.Ft bool +.Fo BIT_CMP +.Fa "const SETSIZE" "struct STRUCTNAME *bitset1" "struct STRUCTNAME *bitset2" +.Fc +.Fn BIT_OR "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" +.Fn BIT_AND "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" +.Fn BIT_NAND "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" +.\" +.Fn BIT_CLR_ATOMIC "const SETSIZE" "size_t bit" "struct STRUCTNAME *bitset" +.Fn BIT_SET_ATOMIC "const SETSIZE" "size_t bit" "struct STRUCTNAME *bitset" +.Fn BIT_SET_ATOMIC_ACQ "const SETSIZE" "size_t bit" "struct STRUCTNAME *bitset" +.\" +.Fo BIT_AND_ATOMIC +.Fa "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" +.Fc +.Fo BIT_OR_ATOMIC +.Fa "const SETSIZE" "struct STRUCTNAME *dst" "struct STRUCTNAME *src" +.Fc +.Fo BIT_COPY_STORE_REL +.Fa "const SETSIZE" "struct STRUCTNAME *from" "struct STRUCTNAME *to" +.Fc +.Sh DESCRIPTION +The +.Nm +family of macros provide a flexible and efficient bitset implementation if the +maximum size of the set is known at compilation. +Throughout this manual page, the name +.Fa SETSIZE +refers to the size of the bitset in bits. +Individual bits in bitsets are referenced with indices zero through +.Fa SETSIZE - 1 . +One example use of +.In sys/bitset.h +is +.In sys/cpuset.h . +.Pp +The +.Fn BITSET_DEFINE +macro defines a bitset struct +.Fa STRUCTNAME +with room to represent +.Fa SETSIZE +bits. +.Pp +The +.Fn BITSET_T_INITIALIZER +macro allows one to initialize a bitset struct with a compile time literal +value. +.Pp +The +.Fn BITSET_FSET +macro generates a compile time literal, usable by +.Fn BITSET_T_INITIALIZER , +representing a full bitset (all bits set). +For examples of +.Fn BITSET_T_INITIALIZER +and +.Fn BITSET_FSET +usage, see the +.Sx BITSET_T_INITIALIZER EXAMPLE +section. +The +.Fa N_WORDS +parameter to +.Fn BITSET_FSET +should be: +.Bd -literal -offset indent +__bitset_words(SETSIZE) +.Ed +.Pp +The +.Fn BIT_CLR +macro clears bit +.Fa bit +in the bitset pointed to by +.Fa bitset . +The +.Fn BIT_CLR_ATOMIC +macro is identical, but the bit is cleared atomically. +.Pp +The +.Fn BIT_COPY +macro copies the contents of the bitset +.Fa from +to the bitset +.Fa to . +.Fn BIT_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 BIT_COPY_STORE_REL +performs multiple individually atomic operations.) +.Pp +The +.Fn BIT_SET +macro sets bit +.Fa bit +in the bitset pointed to by +.Fa bitset . +The +.Fn BIT_SET_ATOMIC +macro is identical, but the bit is set atomically. +The +.Fn BIT_SET_ATOMIC_ACQ +macro sets the bit with acquire semantics. +.Pp +The +.Fn BIT_ZERO +macro clears all bits in +.Fa bitset . +.Pp +The +.Fn BIT_FILL +macro sets all bits in +.Fa bitset . +.Pp +The +.Fn BIT_SETOF +macro clears all bits in +.Fa bitset +before setting only bit +.Fa bit . +.Pp +The +.Fn BIT_EMPTY +macro returns +.Dv true +if +.Fa bitset +is empty. +.Pp +The +.Fn BIT_ISFULLSET +macro returns +.Dv true +if +.Fa bitset +is full (all bits set). +.Pp +The +.Fn BIT_FFS +macro returns the 1-index of the first (lowest) set bit in +.Fa bitset , +or zero if +.Fa bitset +is empty. +Like with +.Xr ffs 3 , +to use the non-zero result of +.Fn BIT_FFS +as a +.Fa bit +index parameter to any other +.Nm +macro, you must subtract one from the result. +.Pp +The +.Fn BIT_COUNT +macro returns the total number of set bits in +.Fa bitset . +.Pp +The +.Fn BIT_SUBSET +macro returns +.Dv true +if +.Fa needle +is a subset of +.Fa haystack . +.Pp +The +.Fn BIT_OVERLAP +macro returns +.Dv true +if +.Fa bitset1 +and +.Fa bitset2 +have any common bits. +(That is, if +.Fa bitset1 +AND +.Fa bitset2 +is not the empty set.) +.Pp +The +.Fn BIT_CMP +macro returns +.Dv true +if +.Fa bitset1 +is NOT equal to +.Fa bitset2 . +.Pp +The +.Fn BIT_OR +macro sets bits present in +.Fa src +in +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst +|= +.Fa src . ) +.Fn BIT_OR_ATOMIC +is similar, but sets bits in the component machine words in +.Fa dst +atomically. +(That is, if +.Fa dst +is composed of multiple machine words, +.Fn BIT_OR_ATOMIC +performs multiple individually atomic operations.) +.Pp +The +.Fn BIT_AND +macro clears bits absent from +.Fa src +from +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst +&= +.Fa src . ) +.Fn BIT_AND_ATOMIC +is similar, with the same atomic semantics as +.Fn BIT_OR_ATOMIC . +.Pp +The +.Fn BIT_NAND +macro clears bits set in +.Fa src +from +.Fa dst . +(It is the +.Nm +equivalent of the scalar: +.Fa dst +&= +.Fa ~ src . ) +.Sh BITSET_T_INITIALIZER EXAMPLE +.Bd -literal +BITSET_DEFINE(_myset, MYSETSIZE); + +struct _myset myset; + +/* Initialize myset to filled (all bits set) */ +myset = BITSET_T_INITIALIZER(BITSET_FSET(__bitset_words(MYSETSIZE))); + +/* Initialize myset to only the lowest bit set */ +myset = BITSET_T_INITIALIZER(0x1); +.Ed +.Sh SEE ALSO +The older +.Xr bitstring 3 . +.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 +.Fx 10.0 +in January 2014. +They were MFCed to +.Fx 9.3 , +released in July 2014. +.Pp +This manual page first appeared in +.Fx 11.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +macros were written for +.In sys/cpuset.h +by +.An Jeff Roberson Aq Mt jeff@FreeBSD.org ; +they were generalized and pulled out as +.In sys/_bitset.h +and +.In sys/bitset.h +by +.An Attilio Rao Aq Mt attilio@FreeBSD.org . +This manual page was written by +.An Conrad Meyer Aq Mt cem@FreeBSD.org . +.Sh CAVEATS +The +.Fa SETSIZE +argument to all of these macros must match the value given to +.Fn BITSET_DEFINE . +.Pp +Unlike every other reference to individual set members, which are zero-indexed, +.Fn BIT_FFS +returns a one-indexed result (or zero if the set is empty). Modified: user/ngie/more-tests2/share/mk/bsd.sys.mk ============================================================================== --- user/ngie/more-tests2/share/mk/bsd.sys.mk Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/share/mk/bsd.sys.mk Sat Oct 17 22:20:06 2015 (r289472) @@ -148,9 +148,13 @@ CXXFLAGS.clang+= -Wno-c++11-extensions .if ${MK_SSP} != "no" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" +.if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30500) || \ + (${COMPILER_TYPE} == "gcc" && \ + (${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40800)) # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?= -fstack-protector-strong CFLAGS+= ${SSP_CFLAGS} +.endif .endif # SSP && !ARM && !MIPS # Allow user-specified additional warning flags, plus compiler specific flag overrides. Modified: user/ngie/more-tests2/share/mk/sys.mk ============================================================================== --- user/ngie/more-tests2/share/mk/sys.mk Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/share/mk/sys.mk Sat Oct 17 22:20:06 2015 (r289472) @@ -145,13 +145,12 @@ ECHODIR ?= true .endif .endif -.if defined(.PARSEDIR) -# _+_ appears to be a workaround for the special src .MAKE not working. -# setting it to + interferes with -N -_+_ ?= -.elif !empty(.MAKEFLAGS:M-n) && ${.MAKEFLAGS:M-n} == "-n" -# the check above matches only a single -n, so -n -n will result -# in _+_ = + +.if ${.MAKEFLAGS:M-N} +# bmake -N is supposed to skip executing anything but it does not skip +# exeucting '+' commands. The '+' feature is used where .MAKE +# is not safe for the entire target. -N is intended to skip building sub-makes +# so it executing '+' commands is not right. Work around the bug by not +# setting '+' when -N is used. _+_ ?= .else _+_ ?= + Modified: user/ngie/more-tests2/share/zoneinfo/Makefile ============================================================================== --- user/ngie/more-tests2/share/zoneinfo/Makefile Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/share/zoneinfo/Makefile Sat Oct 17 22:20:06 2015 (r289472) @@ -79,7 +79,7 @@ zoneinfo: yearistype ${TDATA} beforeinstall: cd ${TZBUILDDIR} && \ - find * -type f -print -exec ${INSTALL} \ + find -s * -type f -print -exec ${INSTALL} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ Modified: user/ngie/more-tests2/sys/arm64/arm64/copyinout.S ============================================================================== --- user/ngie/more-tests2/sys/arm64/arm64/copyinout.S Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/sys/arm64/arm64/copyinout.S Sat Oct 17 22:20:06 2015 (r289472) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); */ ENTRY(copyio_fault) SET_FAULT_HANDLER(xzr, x1) /* Clear the handler */ +copyio_fault_nopcb: mov x0, #EFAULT ret END(copyio_fault) @@ -51,6 +52,10 @@ END(copyio_fault) */ ENTRY(copyout) cbz x2, 2f /* If len == 0 then skip loop */ + add x3, x1, x2 + ldr x4, =VM_MAXUSER_ADDRESS + cmp x3, x4 + b.hi copyio_fault_nopcb adr x6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(x6, x7) /* Set the handler */ @@ -73,6 +78,10 @@ END(copyout) */ ENTRY(copyin) cbz x2, 2f /* If len == 0 then skip loop */ + add x3, x0, x2 + ldr x4, =VM_MAXUSER_ADDRESS + cmp x3, x4 + b.hi copyio_fault_nopcb adr x6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(x6, x7) /* Set the handler */ @@ -97,11 +106,14 @@ ENTRY(copyinstr) mov x5, xzr /* count = 0 */ mov w4, #1 /* If zero return faulure */ cbz x2, 3f /* If len == 0 then skip loop */ + ldr x7, =VM_MAXUSER_ADDRESS adr x6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(x6, x7) /* Set the handler */ -1: ldrb w4, [x0], #1 /* Load from uaddr */ +1: cmp x0, x7 + b.cs copyio_fault + ldrb w4, [x0], #1 /* Load from uaddr */ strb w4, [x1], #1 /* Store in kaddr */ add x5, x5, #1 /* count++ */ cbz w4, 2f /* Break when NUL-terminated */ Modified: user/ngie/more-tests2/sys/arm64/arm64/genassym.c ============================================================================== --- user/ngie/more-tests2/sys/arm64/arm64/genassym.c Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/sys/arm64/arm64/genassym.c Sat Oct 17 22:20:06 2015 (r289472) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include ASSYM(KERNBASE, KERNBASE); +ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); + ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); Modified: user/ngie/more-tests2/sys/arm64/arm64/locore.S ============================================================================== --- user/ngie/more-tests2/sys/arm64/arm64/locore.S Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/sys/arm64/arm64/locore.S Sat Oct 17 22:20:06 2015 (r289472) @@ -357,7 +357,7 @@ create_pagetables: mov x7, #NORMAL_MEM mov x8, #(KERNBASE & L2_BLOCK_MASK) mov x9, x28 - bl build_block_pagetable + bl build_l2_block_pagetable /* Move to the l1 table */ add x26, x26, #PAGE_SIZE @@ -379,7 +379,8 @@ create_pagetables: mov x7, #DEVICE_MEM mov x8, #(SOCDEV_VA) /* VA start */ mov x9, #(SOCDEV_PA) /* PA start */ - bl build_section_pagetable + mov x10, #1 + bl build_l1_block_pagetable #endif /* Create the VA = PA map */ @@ -387,36 +388,38 @@ create_pagetables: mov x7, #NORMAL_UNCACHED /* Uncached as it's only needed early on */ mov x9, x27 mov x8, x9 /* VA start (== PA start) */ - bl build_section_pagetable + mov x10, #1 + bl build_l1_block_pagetable /* Restore the Link register */ mov x30, x5 ret /* - * Builds a 1 GiB page table entry - * x6 = L1 table - * x7 = Type (0 = Device, 1 = Normal) - * x8 = VA start - * x9 = PA start (trashed) + * Builds an L1 -> L2 table descriptor + * + * This is a link for a 1GiB block of memory with up to 2MiB regions mapped + * within it by build_l2_block_pagetable. + * + * x6 = L1 table + * x8 = Virtual Address + * x9 = L2 PA (trashed) * x11, x12 and x13 are trashed */ -build_section_pagetable: +link_l1_pagetable: /* - * Build the L1 table entry. + * Link an L1 -> L2 table entry. */ /* Find the table index */ lsr x11, x8, #L1_SHIFT and x11, x11, #Ln_ADDR_MASK /* Build the L1 block entry */ - lsl x12, x7, #2 - orr x12, x12, #L1_BLOCK - orr x12, x12, #(ATTR_AF) + mov x12, #L1_TABLE /* Only use the output address bits */ - lsr x9, x9, #L1_SHIFT - orr x12, x12, x9, lsl #L1_SHIFT + lsr x9, x9, #12 + orr x12, x12, x9, lsl #12 /* Store the entry */ str x12, [x6, x11, lsl #3] @@ -424,35 +427,48 @@ build_section_pagetable: ret /* - * Builds an L1 -> L2 table descriptor - * - * This is a link for a 1GiB block of memory with up to 2MiB regions mapped - * within it by build_block_pagetable. - * + * Builds count 1 GiB page table entry * x6 = L1 table - * x8 = Virtual Address - * x9 = L2 PA (trashed) + * x7 = Type (0 = Device, 1 = Normal) + * x8 = VA start + * x9 = PA start (trashed) + * x10 = Entry count (TODO) * x11, x12 and x13 are trashed */ -link_l1_pagetable: +build_l1_block_pagetable: /* - * Link an L1 -> L2 table entry. + * Build the L1 table entry. */ /* Find the table index */ lsr x11, x8, #L1_SHIFT and x11, x11, #Ln_ADDR_MASK /* Build the L1 block entry */ - mov x12, #L1_TABLE + lsl x12, x7, #2 + orr x12, x12, #L1_BLOCK + orr x12, x12, #(ATTR_AF) +#ifdef SMP + orr x12, x12, ATTR_SH(ATTR_SH_IS) +#endif /* Only use the output address bits */ - lsr x9, x9, #12 - orr x12, x12, x9, lsl #12 + lsr x9, x9, #L1_SHIFT + + /* Set the physical address for this virtual address */ +1: orr x12, x12, x9, lsl #L1_SHIFT /* Store the entry */ str x12, [x6, x11, lsl #3] - ret + /* Clear the address bits */ + and x12, x12, #ATTR_MASK_L + + sub x10, x10, #1 + add x11, x11, #1 + add x9, x9, #1 + cbnz x10, 1b + +2: ret /* * Builds count 2 MiB page table entry @@ -463,7 +479,7 @@ link_l1_pagetable: * x10 = Entry count (TODO) * x11, x12 and x13 are trashed */ -build_block_pagetable: +build_l2_block_pagetable: /* * Build the L2 table entry. */ Modified: user/ngie/more-tests2/sys/arm64/arm64/support.S ============================================================================== --- user/ngie/more-tests2/sys/arm64/arm64/support.S Sat Oct 17 21:38:57 2015 (r289471) +++ user/ngie/more-tests2/sys/arm64/arm64/support.S Sat Oct 17 22:20:06 2015 (r289472) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); */ ENTRY(fsu_fault) SET_FAULT_HANDLER(xzr, x1) /* Reset the handler function */ +fsu_fault_nopcb: mov x0, #-1 ret END(fsu_fault) @@ -49,6 +50,9 @@ END(fsu_fault) * int casueword32(volatile uint32_t *, uint32_t, uint32_t *, uint32_t) */ ENTRY(casueword32) + ldr x4, =(VM_MAXUSER_ADDRESS-3) + cmp x0, x4 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x4) /* And set it */ 1: ldxr w4, [x0] /* Load-exclusive the data */ @@ -67,6 +71,9 @@ END(casueword32) * int casueword(volatile u_long *, u_long, u_long *, u_long) */ ENTRY(casueword) + ldr x4, =(VM_MAXUSER_ADDRESS-7) + cmp x0, x4 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x4) /* And set it */ 1: ldxr x4, [x0] /* Load-exclusive the data */ @@ -85,6 +92,9 @@ END(casueword) * int fubyte(volatile const void *) */ ENTRY(fubyte) + ldr x1, =VM_MAXUSER_ADDRESS + cmp x0, x1 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x1) /* And set it */ ldrb w0, [x0] /* Try loading the data */ @@ -96,6 +106,9 @@ END(fubyte) * int fuword(volatile const void *) */ ENTRY(fuword16) + ldr x1, =(VM_MAXUSER_ADDRESS-1) + cmp x0, x1 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x1) /* And set it */ ldrh w0, [x0] /* Try loading the data */ @@ -107,6 +120,9 @@ END(fuword16) * int32_t fueword32(volatile const void *, int32_t *) */ ENTRY(fueword32) + ldr x2, =(VM_MAXUSER_ADDRESS-3) + cmp x0, x2 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ ldr w0, [x0] /* Try loading the data */ @@ -122,6 +138,9 @@ END(fueword32) */ ENTRY(fueword) EENTRY(fueword64) + ldr x2, =(VM_MAXUSER_ADDRESS-7) + cmp x0, x2 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ ldr x0, [x0] /* Try loading the data */ @@ -136,6 +155,9 @@ END(fueword) * int subyte(volatile void *, int) */ ENTRY(subyte) + ldr x2, =VM_MAXUSER_ADDRESS + cmp x0, x2 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ strb w1, [x0] /* Try storing the data */ @@ -148,6 +170,9 @@ END(subyte) * int suword16(volatile void *, int) */ ENTRY(suword16) + ldr x2, =(VM_MAXUSER_ADDRESS-1) + cmp x0, x2 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ strh w1, [x0] /* Try storing the data */ @@ -160,6 +185,9 @@ END(suword16) * int suword32(volatile void *, int) */ ENTRY(suword32) + ldr x2, =(VM_MAXUSER_ADDRESS-3) + cmp x0, x2 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ str w1, [x0] /* Try storing the data */ @@ -173,6 +201,9 @@ END(suword32) */ ENTRY(suword) EENTRY(suword64) + ldr x2, =(VM_MAXUSER_ADDRESS-7) + cmp x0, x2 + b.cs fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ str x1, [x0] /* Try storing the data */ @@ -201,6 +232,9 @@ END(fsu_fault) * int fuswintr(void *) */ ENTRY(fuswintr) + ldr x1, =(VM_MAXUSER_ADDRESS-3) + cmp x0, x1 + b.cs fsu_fault_nopcb adr x6, fsu_intr_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x1) /* And set it */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***