Skip to content

Commit b78b331

Browse files
committed
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) <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent e506ea4 commit b78b331

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/asm-generic/rwonce.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
* atomicity or dependency ordering guarantees. Note that this may result
4444
* in tears!
4545
*/
46+
#ifndef __READ_ONCE
4647
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
48+
#endif
4749

4850
#define __READ_ONCE_SCALAR(x) \
4951
({ \

0 commit comments

Comments
 (0)