atomic test_and_set

atomic test_and_set

Post by BTallapr » Mon, 13 Nov 2000 04:00:00



Hello all,
What is the equivalent atomic test_and_set instruction in unixware 7 for DDI8
compliant drivers.Openserver oddi have this equivalents like "qbt"
instructions. For DDI8, <sys/ksynch.h> defines some atomic reads, writes,
additions, subtractions, etc, etc. Is there anythiing that is equivalent of a
atomic  test_and_set ? Any help in this matter is greatly appreciated.

Regards,
Mohan

 
 
 

atomic test_and_set

Post by Robert Lip » Tue, 14 Nov 2000 14:55:05


[ Follup-to set to c.u.s.programmer ]


>What is the equivalent atomic test_and_set instruction in unixware 7 for DDI8
>compliant drivers.Openserver oddi have this equivalents like "qbt"
>instructions. For DDI8, <sys/ksynch.h> defines some atomic reads, writes,
>additions, subtractions, etc, etc. Is there anythiing that is equivalent of a
>atomic  test_and_set ? Any help in this matter is greatly appreciated.

Huh.  Never missed them before.  I've roamed around the headers and
kernel source in UW7 and don't see them.  If you have bitfields that
you can't do in ints (ATOMIC_INT_WRITE, etc.) it looks like you have to
explictly grab and release a lock.  

I suspect, but cannot easily confirm, that that macros for OpenServer
are doing exactly that becuase the underlying opcode support for doing
them sensibly was added only on relatively late value of "X" in "X86" if
I recall.  So in order to this at runtime on P5 or less, it's probably
doing a lock, generating two bus cycles, and then dropping the lock...

RJL