X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-linux.git;a=blobdiff_plain;f=Documentation%2Fatomic_ops.txt;h=c9d1cacb439590a02dbfb1282cbe0d3abe3a9b0d;hp=b19fc34efdb17921af43bda0000b13dc82640451;hb=d63a9788650fcd999b34584316afee6bd4378f19;hpb=de28a05ee28e36fa1fc68fcfc7c6cc1c6f7c270c 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: