On 26-Jul-01 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.
Unfortunately that is very ia32 specific. The code would be more friendly on
alpha and ia64 at least if the algo was changed to use cmpset on a word instead
of test-and-set of a bit.
If you want, I can look at the code to see where it uses test_and_set() to
determine how hard that would be. (It might be very easy to do.)
--
John Baldwin <[EMAIL PROTECTED]> -- 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message