barrier.h (ec0c464cdbf38bf6ddabec8bfa595bd421cab203) barrier.h (179ab1cbf883575c3a585bcfc0f2160f1d22a149)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
4 */
5#ifndef _ASM_POWERPC_BARRIER_H
6#define _ASM_POWERPC_BARRIER_H
7
8#include <asm/asm-const.h>

--- 64 unchanged lines hidden (view full) ---

73#define __smp_load_acquire(p) \
74({ \
75 typeof(*p) ___p1 = READ_ONCE(*p); \
76 compiletime_assert_atomic_type(*p); \
77 __smp_lwsync(); \
78 ___p1; \
79})
80
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
4 */
5#ifndef _ASM_POWERPC_BARRIER_H
6#define _ASM_POWERPC_BARRIER_H
7
8#include <asm/asm-const.h>

--- 64 unchanged lines hidden (view full) ---

73#define __smp_load_acquire(p) \
74({ \
75 typeof(*p) ___p1 = READ_ONCE(*p); \
76 compiletime_assert_atomic_type(*p); \
77 __smp_lwsync(); \
78 ___p1; \
79})
80
81#ifdef CONFIG_PPC_BOOK3S_64
81#ifdef CONFIG_PPC_BARRIER_NOSPEC
82/*
83 * Prevent execution of subsequent instructions until preceding branches have
84 * been fully resolved and are no longer executing speculatively.
85 */
86#define barrier_nospec_asm NOSPEC_BARRIER_FIXUP_SECTION; nop
87
88// This also acts as a compiler barrier due to the memory clobber.
89#define barrier_nospec() asm (stringify_in_c(barrier_nospec_asm) ::: "memory")
90
82/*
83 * Prevent execution of subsequent instructions until preceding branches have
84 * been fully resolved and are no longer executing speculatively.
85 */
86#define barrier_nospec_asm NOSPEC_BARRIER_FIXUP_SECTION; nop
87
88// This also acts as a compiler barrier due to the memory clobber.
89#define barrier_nospec() asm (stringify_in_c(barrier_nospec_asm) ::: "memory")
90
91#else /* !CONFIG_PPC_BOOK3S_64 */
91#else /* !CONFIG_PPC_BARRIER_NOSPEC */
92#define barrier_nospec_asm
93#define barrier_nospec()
92#define barrier_nospec_asm
93#define barrier_nospec()
94#endif
94#endif /* CONFIG_PPC_BARRIER_NOSPEC */
95
96#include <asm-generic/barrier.h>
97
98#endif /* _ASM_POWERPC_BARRIER_H */
95
96#include <asm-generic/barrier.h>
97
98#endif /* _ASM_POWERPC_BARRIER_H */