X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=Documentation%2Fatomic_ops.txt;h=c9d1cacb439590a02dbfb1282cbe0d3abe3a9b0d;hb=ece272e439d600008a9dd2329bd0ad4862b511d1;hp=b19fc34efdb17921af43bda0000b13dc82640451;hpb=9e17f9070280bd58af9aead415544387a7a61427;p=karo-tx-linux.git diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index b19fc34efdb1..c9d1cacb4395 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt @@ -542,6 +542,10 @@ The routines xchg() and cmpxchg() must provide the same exact memory-barrier semantics as the atomic and bit operations returning values. +Note: If someone wants to use xchg(), cmpxchg() and their variants, +linux/atomic.h should be included rather than asm/cmpxchg.h, unless +the code is in arch/* and can take care of itself. + Spinlocks and rwlocks have memory barrier expectations as well. The rule to follow is simple: