powerpc: expose the multi-bit ops that underlie single-bit ops.
commit0d2d3e38f72e400f602dade3f0ddffe0b3b9d4df
authorGeoff Thorpe <geoff@geoffthorpe.net>
Tue, 7 Jul 2009 15:23:56 +0000 (7 15:23 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Aug 2009 00:12:23 +0000 (20 10:12 +1000)
tree3c5b6503f63e0d3ae9e56133633ffbc5eb27c630
parent11a6b292c1bc9cb39970e44edd6958250f23d3a8
powerpc: expose the multi-bit ops that underlie single-bit ops.

The bitops.h functions that operate on a single bit in a bitfield are
implemented by operating on the corresponding word location. In all
cases the inner logic is valid if the mask being applied has more than
one bit set, so this patch exposes those inner operations. Indeed,
set_bits() was already available, but it duplicated code from
set_bit() (rather than making the latter a wrapper) - it was also
missing the PPC405_ERR77() workaround and the "volatile" address
qualifier present in other APIs. This corrects that, and exposes the
other multi-bit equivalents.

One advantage of these multi-bit forms is that they allow word-sized
variables to essentially be their own spinlocks, eg. very useful for
state machines where an atomic "flags" variable can obviate the need
for any additional locking.

Signed-off-by: Geoff Thorpe <geoff@geoffthorpe.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/bitops.h