mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 09:16:43 +07:00
73f10281ea
read_barrie_depends has always been a noop (not a compiler barrier) on all architectures except SMP alpha. This brings UP alpha and frv into line with all other architectures, and fixes incorrect documentation. Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
34 lines
700 B
C
34 lines
700 B
C
#ifndef __BARRIER_H
|
|
#define __BARRIER_H
|
|
|
|
#include <asm/compiler.h>
|
|
|
|
#define mb() \
|
|
__asm__ __volatile__("mb": : :"memory")
|
|
|
|
#define rmb() \
|
|
__asm__ __volatile__("mb": : :"memory")
|
|
|
|
#define wmb() \
|
|
__asm__ __volatile__("wmb": : :"memory")
|
|
|
|
#define read_barrier_depends() \
|
|
__asm__ __volatile__("mb": : :"memory")
|
|
|
|
#ifdef CONFIG_SMP
|
|
#define smp_mb() mb()
|
|
#define smp_rmb() rmb()
|
|
#define smp_wmb() wmb()
|
|
#define smp_read_barrier_depends() read_barrier_depends()
|
|
#else
|
|
#define smp_mb() barrier()
|
|
#define smp_rmb() barrier()
|
|
#define smp_wmb() barrier()
|
|
#define smp_read_barrier_depends() do { } while (0)
|
|
#endif
|
|
|
|
#define set_mb(var, value) \
|
|
do { var = value; mb(); } while (0)
|
|
|
|
#endif /* __BARRIER_H */
|