On Thu, 26 Oct 2023 14:59:13 -0400
Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote:
for a rough implementation of a 'xchg()' without SMP coherency, just
cpu-local one (ie atomic wrt being preempted by the kernel, but not
atomic wrt other CPU's accessing the same variable concurrently)
Actually Steven does not need a xchg to test-and-set a single bit which
is only accessed concurrently between kernel and userspace from the same
thread. Either "bts" or "andb" should work fine.
Hmm, how would bts work? Doesn't that just set a bit?
I need to clear one bit while seeing if another bit is set. I could also
use subl, as that would also atomically clear the bit.
-- Steve