Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Oct 2001 22:13:55 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   Re: cvs commit: src/sys/i386/include atomic.h
Message-ID:  <XFMail.011008221355.jhb@FreeBSD.org>
In-Reply-To: <20011009143716.N22621-100000@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org> -- 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.011008221355.jhb>