From owner-freebsd-hackers Thu Jul 26 14:15:59 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by hub.freebsd.org (Postfix) with ESMTP id A2DF137B40A for ; Thu, 26 Jul 2001 14:15:52 -0700 (PDT) (envelope-from ticso@mail.cicely.de) Received: from mail.cicely.de (cicely20 [10.1.1.22]) by srv1.cosmo-project.de (8.11.0/8.11.0) with ESMTP id f6QLFoV82521; Thu, 26 Jul 2001 23:15:51 +0200 (CEST) Received: (from ticso@localhost) by mail.cicely.de (8.11.0/8.11.0) id f6QLFfq02354; Thu, 26 Jul 2001 23:15:41 +0200 (CEST) Date: Thu, 26 Jul 2001 23:15:40 +0200 From: Bernd Walter To: Arun Sharma Cc: hackers@FreeBSD.ORG Subject: Re: Need a clean room implementation of this function Message-ID: <20010726231540.A2249@cicely20.cicely.de> References: <20010726135913.A23052@sharmas.dhs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010726135913.A23052@sharmas.dhs.org>; from arun@sharmas.dhs.org on Thu, Jul 26, 2001 at 01:59:13PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jul 26, 2001 at 01:59:13PM -0700, Arun Sharma wrote: > /** > * test_and_set_bit - Set a bit and return its old value > * @nr: Bit to set > * @addr: Address to count from > * > * This operation is atomic and cannot be reordered. > * It also implies a memory barrier. > */ > static __inline__ int test_and_set_bit(int nr, volatile void * addr); -current has a lot of atomic functions in src/sys/i386/include/atomic.h. -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message