asm/rwonce: Allow __READ_ONCE to be overridden by the architecture
The meat and potatoes of READ_ONCE() is defined by the __READ_ONCE() macro, which uses a volatile casts in an attempt to avoid tearing of byte, halfword, word and double-word accesses. Allow this to be overridden by the architecture code in the case that things like memory barriers are also required. Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
Родитель
e506ea4512
Коммит
b78b331a3f
|
@ -43,7 +43,9 @@
|
||||||
* atomicity or dependency ordering guarantees. Note that this may result
|
* atomicity or dependency ordering guarantees. Note that this may result
|
||||||
* in tears!
|
* in tears!
|
||||||
*/
|
*/
|
||||||
|
#ifndef __READ_ONCE
|
||||||
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
|
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
|
||||||
|
#endif
|
||||||
|
|
||||||
#define __READ_ONCE_SCALAR(x) \
|
#define __READ_ONCE_SCALAR(x) \
|
||||||
({ \
|
({ \
|
||||||
|
|
Загрузка…
Ссылка в новой задаче