
Dear Graeme Russ,
In message 4DF9E409.1060600@gmail.com you wrote:
is equivalent except that, as already pointed out, clrsetbits and friends:
a) Are not portable because only ARM and PPC define them which makes them, by definition, non-standard
They should be added to _any_ arch/<arch>/include/asm/io.h that doesn't use them yet.
b) Each invocation results in a read barrier plus a write barrier
...which is intentionally (actually mandatory) when accessing I/O memory, and negligable overhead on plain memory.
c) If the hardware register is sensitive to partial updates (i.e. requires all bit-fields to be updated in on operation) this requires a read into a local variable, calls to clrsetbits against that variable and finally a write-back - Lots of memory barriers
Wrong. The macro does this automatically. There is only a single read and a single write per call.
Best regards,
Wolfgang Denk