From owner-svn-src-all@FreeBSD.ORG Fri Aug 30 07:43:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BC676B3D; Fri, 30 Aug 2013 07:43:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A91812DC6; Fri, 30 Aug 2013 07:43:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7U7hZBN053546; Fri, 30 Aug 2013 07:43:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7U7hZfW053544; Fri, 30 Aug 2013 07:43:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308300743.r7U7hZfW053544@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 30 Aug 2013 07:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255059 - head/sys/sys X-SVN-Group: head 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.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Aug 2013 07:43:35 -0000 Author: kib Date: Fri Aug 30 07:43:34 2013 New Revision: 255059 URL: http://svnweb.freebsd.org/changeset/base/255059 Log: Add BIT_AND_ATOMIC() and CPU_AND_ATOMIC(). Sponsored by: The FreeBSD Foundation Reviewed by: alc Tested by: pho, bf Modified: head/sys/sys/bitset.h head/sys/sys/cpuset.h Modified: head/sys/sys/bitset.h ============================================================================== --- head/sys/sys/bitset.h Fri Aug 30 07:42:38 2013 (r255058) +++ head/sys/sys/bitset.h Fri Aug 30 07:43:34 2013 (r255059) @@ -135,7 +135,14 @@ atomic_set_long(&(p)->__bits[__bitset_word(_s, n)], \ __bitset_mask((_s), n)) -/* Convenience functions catering special cases. */ +/* Convenience functions catering special cases. */ +#define BIT_AND_ATOMIC(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + atomic_clear_long(&(d)->__bits[__i], \ + ~(s)->__bits[__i]); \ +} while (0) + #define BIT_OR_ATOMIC(_s, d, s) do { \ __size_t __i; \ for (__i = 0; __i < __bitset_words((_s)); __i++) \ Modified: head/sys/sys/cpuset.h ============================================================================== --- head/sys/sys/cpuset.h Fri Aug 30 07:42:38 2013 (r255058) +++ head/sys/sys/cpuset.h Fri Aug 30 07:43:34 2013 (r255059) @@ -55,6 +55,7 @@ #define CPU_NAND(d, s) BIT_NAND(CPU_SETSIZE, d, s) #define CPU_CLR_ATOMIC(n, p) BIT_CLR_ATOMIC(CPU_SETSIZE, n, p) #define CPU_SET_ATOMIC(n, p) BIT_SET_ATOMIC(CPU_SETSIZE, n, p) +#define CPU_AND_ATOMIC(n, p) BIT_AND_ATOMIC(CPU_SETSIZE, n, p) #define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) #define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) #define CPU_FFS(p) BIT_FFS(CPU_SETSIZE, p)