Reading atomic variables in embedded C
Roland McGrath
roland@redhat.com
Tue Sep 25 14:59:00 GMT 2007
In every machine's asm/atomic.h, atomic_read(v) is actually just defined as
(v->counter) with no other magic. So, you can just use kread on that, or
use $foo->counter in script code. This encodes an assumption about the
kernel implementation, though the proper kernel API is to presume the
atomic_read macro might do some magic you need to use. But, there is no
way to use atomic_read and get the fault-protection of kread. So it's
improper by systemtap robustness rules to use atomic_read.
Thanks,
Roland
More information about the Systemtap
mailing list