From owner-cvs-all Thu Oct 5 20:27:50 2000 Delivered-To: cvs-all@freebsd.org Received: from gidora.zeta.org.au (gidora.zeta.org.au [203.26.10.25]) by hub.freebsd.org (Postfix) with SMTP id D3FFF37B66C for ; Thu, 5 Oct 2000 20:27:45 -0700 (PDT) Received: (qmail 31405 invoked from network); 6 Oct 2000 03:27:42 -0000 Received: from unknown (HELO bde.zeta.org.au) (203.2.228.102) by gidora.zeta.org.au with SMTP; 6 Oct 2000 03:27:42 -0000 Date: Fri, 6 Oct 2000 14:27:37 +1100 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: John Baldwin Cc: Mike Smith , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/alpha/include atomic.h src/sys/i386/incl In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 5 Oct 2000, John Baldwin wrote: > On 05-Oct-00 Mike Smith wrote: > >> jhb 2000/10/05 15:19:50 PDT > >> > >> Modified files: > >> sys/alpha/include atomic.h > >> sys/i386/include atomic.h > >> Log: > >> Add atomic_readandclear_int and atomic_readandclear_long. > > > > Um, isn't this just exchange-with-zero? > > That's one way of implementing it, yes. That is not the method used by the > alpha, however. I chose the name due to prior existence. The alpha > already had an atomic_readandclear_int, albeit buried in the ipl code. > The x86 had a similar loadandclear() in cpufunc.h It should be named loadandclear(). "load" is more precise than "read". The instruction to do the load is even named "ld" on alphas. I will remove the suffixes on the atomic functions soon. It should go without saying that operations like load and clear, test and set, and compare and swap, etc., are atomic. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message