]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/atomic.h
net: Fix build failure due to lockdep_sock_is_held().
[karo-tx-linux.git] / include / linux / atomic.h
index 6c502cb13c95aa2f93466687c16d23b950b231d6..df4f369254c0305174f6be6a6caca6b296c692c5 100644 (file)
  * The idea here is to build acquire/release variants by adding explicit
  * barriers on top of the relaxed variant. In the case where the relaxed
  * variant is already fully ordered, no additional barriers are needed.
+ *
+ * Besides, if an arch has a special barrier for acquire/release, it could
+ * implement its own __atomic_op_* and use the same framework for building
+ * variants
  */
+#ifndef __atomic_op_acquire
 #define __atomic_op_acquire(op, args...)                               \
 ({                                                                     \
        typeof(op##_relaxed(args)) __ret  = op##_relaxed(args);         \
        smp_mb__after_atomic();                                         \
        __ret;                                                          \
 })
+#endif
 
+#ifndef __atomic_op_release
 #define __atomic_op_release(op, args...)                               \
 ({                                                                     \
        smp_mb__before_atomic();                                        \
        op##_relaxed(args);                                             \
 })
+#endif
 
+#ifndef __atomic_op_fence
 #define __atomic_op_fence(op, args...)                                 \
 ({                                                                     \
        typeof(op##_relaxed(args)) __ret;                               \
@@ -56,6 +65,7 @@
        smp_mb__after_atomic();                                         \
        __ret;                                                          \
 })
+#endif
 
 /* atomic_add_return_relaxed */
 #ifndef atomic_add_return_relaxed