diff options
Diffstat (limited to 'Documentation/atomic_ops.txt')
-rw-r--r-- | Documentation/atomic_ops.txt | 4 |
1 files changed, 4 insertions, 0 deletions
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 | |||
542 | memory-barrier semantics as the atomic and bit operations returning | 542 | memory-barrier semantics as the atomic and bit operations returning |
543 | values. | 543 | values. |
544 | 544 | ||
545 | Note: If someone wants to use xchg(), cmpxchg() and their variants, | ||
546 | linux/atomic.h should be included rather than asm/cmpxchg.h, unless | ||
547 | the code is in arch/* and can take care of itself. | ||
548 | |||
545 | Spinlocks and rwlocks have memory barrier expectations as well. | 549 | Spinlocks and rwlocks have memory barrier expectations as well. |
546 | The rule to follow is simple: | 550 | The rule to follow is simple: |
547 | 551 | ||