projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
asm-generic: guard smp_store_release/load_acquire
[cascardo/linux.git]
/
include
/
asm-generic
/
barrier.h
diff --git
a/include/asm-generic/barrier.h
b/include/asm-generic/barrier.h
index
b42afad
..
987b2e0
100644
(file)
--- a/
include/asm-generic/barrier.h
+++ b/
include/asm-generic/barrier.h
@@
-93,7
+93,7
@@
#endif /* CONFIG_SMP */
#ifndef smp_store_mb
#endif /* CONFIG_SMP */
#ifndef smp_store_mb
-#define smp_store_mb(var, value) do { WRITE_ONCE(var, value); mb(); } while (0)
+#define smp_store_mb(var, value) do { WRITE_ONCE(var, value);
smp_
mb(); } while (0)
#endif
#ifndef smp_mb__before_atomic
#endif
#ifndef smp_mb__before_atomic
@@
-104,13
+104,16
@@
#define smp_mb__after_atomic() smp_mb()
#endif
#define smp_mb__after_atomic() smp_mb()
#endif
+#ifndef smp_store_release
#define smp_store_release(p, v) \
do { \
compiletime_assert_atomic_type(*p); \
smp_mb(); \
WRITE_ONCE(*p, v); \
} while (0)
#define smp_store_release(p, v) \
do { \
compiletime_assert_atomic_type(*p); \
smp_mb(); \
WRITE_ONCE(*p, v); \
} while (0)
+#endif
+#ifndef smp_load_acquire
#define smp_load_acquire(p) \
({ \
typeof(*p) ___p1 = READ_ONCE(*p); \
#define smp_load_acquire(p) \
({ \
typeof(*p) ___p1 = READ_ONCE(*p); \
@@
-118,6
+121,7
@@
do { \
smp_mb(); \
___p1; \
})
smp_mb(); \
___p1; \
})
+#endif
#endif /* !__ASSEMBLY__ */
#endif /* __ASM_GENERIC_BARRIER_H */
#endif /* !__ASSEMBLY__ */
#endif /* __ASM_GENERIC_BARRIER_H */