From owner-cvs-all Mon Oct 8 22:14:38 2001 Delivered-To: cvs-all@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id BD7EC37B40C for ; Mon, 8 Oct 2001 22:14:27 -0700 (PDT) Received: (qmail 8527 invoked from network); 9 Oct 2001 05:14:27 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 9 Oct 2001 05:14:27 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011009143716.N22621-100000@delplex.bde.org> Date: Mon, 08 Oct 2001 22:13:55 -0700 (PDT) From: John Baldwin To: Bruce Evans Subject: Re: cvs commit: src/sys/i386/include atomic.h Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 09-Oct-01 Bruce Evans wrote: > On Mon, 8 Oct 2001, John Baldwin wrote: > >> jhb 2001/10/08 13:58:25 PDT >> >> Modified files: >> sys/i386/include atomic.h >> Log: >> Allow atomic ops to be somewhat safely used in userland. We always use >> lock prefixes in the userland case so that the binaries will work on both >> SMP and UP systems. >> >> Revision Changes Path >> 1.21 +8 -4 src/sys/i386/include/atomic.h > > I don't want the current bad interface exported to userland where it is > harder to fix. The interface should by type-generic. E.g., > atomic_add(lvalue, rvalue) instead of: So use the gcc-specific typeof()? :) The code calling atomic_* knows what type it is using. Why make the compiler guess what that type is so it can call the proper primitive? Just like at the x86 PCPU macros to see how gross this can get. Now repeat that for each atomic operation with variations for the acquire and release memory barriers. Ugh. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message