From owner-svn-src-all@freebsd.org Thu Jul 13 08:33:04 2017 Return-Path: Delivered-To: svn-src-all@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 15A82D9BB24; Thu, 13 Jul 2017 08:33:04 +0000 (UTC) (envelope-from kib@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 D720C6EF96; Thu, 13 Jul 2017 08:33:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6D8X2jn063555; Thu, 13 Jul 2017 08:33:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6D8X2F2063554; Thu, 13 Jul 2017 08:33:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707130833.v6D8X2F2063554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 13 Jul 2017 08:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r320940 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 320940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 08:33:04 -0000 Author: kib Date: Thu Jul 13 08:33:02 2017 New Revision: 320940 URL: https://svnweb.freebsd.org/changeset/base/320940 Log: MFC r320755,r320762,r320893: BIT_FLS(9). Modified: stable/10/sys/sys/bitset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/bitset.h ============================================================================== --- stable/10/sys/sys/bitset.h Thu Jul 13 08:29:01 2017 (r320939) +++ stable/10/sys/sys/bitset.h Thu Jul 13 08:33:02 2017 (r320940) @@ -206,6 +206,21 @@ __bit; \ }) +#define BIT_FLS(_s, p) __extension__ ({ \ + __size_t __i; \ + int __bit; \ + \ + __bit = 0; \ + for (__i = __bitset_words((_s)); __i > 0; __i--) { \ + if ((p)->__bits[__i - 1] != 0) { \ + __bit = flsl((p)->__bits[__i - 1]); \ + __bit += (__i - 1) * _BITSET_BITS; \ + break; \ + } \ + } \ + __bit; \ +}) + #define BIT_COUNT(_s, p) __extension__ ({ \ __size_t __i; \ int __count; \