From owner-freebsd-hackers Thu Jul 26 15:30:22 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 7FC2B37B401 for ; Thu, 26 Jul 2001 15:30:15 -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 f6QMUDV83186; Fri, 27 Jul 2001 00:30:13 +0200 (CEST) Received: (from ticso@localhost) by mail.cicely.de (8.11.0/8.11.0) id f6QMU6x02776; Fri, 27 Jul 2001 00:30:06 +0200 (CEST) Date: Fri, 27 Jul 2001 00:30:05 +0200 From: Bernd Walter To: Arun Sharma Cc: Bernd Walter , hackers@FreeBSD.ORG Subject: Re: Need a clean room implementation of this function Message-ID: <20010727003005.A2726@cicely20.cicely.de> References: <20010726135913.A23052@sharmas.dhs.org> <20010726231540.A2249@cicely20.cicely.de> <20010726142106.A23171@sharmas.dhs.org> <20010726235927.B2249@cicely20.cicely.de> <20010726151100.D23264@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: <20010726151100.D23264@sharmas.dhs.org>; from arun@sharmas.dhs.org on Thu, Jul 26, 2001 at 03:11:00PM -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 03:11:00PM -0700, Arun Sharma wrote: > On Thu, Jul 26, 2001 at 11:59:27PM +0200, Bernd Walter wrote: > > [...] > > ATOMIC_ASM(set, char, "orb %b2,%0", v) > > ATOMIC_ASM(clear, char, "andb %b2,%0", ~v) > > [...] > > That does set, not test-and-set. What I want is exactly what the Intel > BTS instruction does: atomically test and set a bit. Ops - but as John Baldwin already showed that cmpset/cmpclear are also part of atomic.h Using the atomic.h functions gives you the ability to port it to alpha and other FreeBSD architectures. -- 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