1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2019 Google LLC.
10 #include <asm/barrier.h>
13 * Alpha is apparently daft enough to reorder address-dependent loads
14 * on some CPU implementations. Knock some common sense into it with
15 * a memory barrier in READ_ONCE().
17 * For the curious, more information about this unusual reordering is
18 * available in chapter 15 of the "perfbook":
20 * https://kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html
23 #define __READ_ONCE(x) \
25 __unqual_scalar_typeof(x) __x = \
26 (*(volatile typeof(__x) *)(&(x))); \
31 #endif /* CONFIG_SMP */
33 #include <asm-generic/rwonce.h>
35 #endif /* __ASM_RWONCE_H */