Cc: Andrew Jones <drjones@xxxxxxxxxx> Cc: Thomas Huth <thuth@xxxxxxxxxx> Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx> Cc: Radim Krčmář <rkrcmar@xxxxxxxxxx> Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx> --- lib/asm-generic/barrier.h | 21 +++++++++++++++++++++ lib/asm-generic/io.h | 10 ---------- lib/ppc64/asm/barrier.h | 4 ++++ 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 lib/asm-generic/barrier.h create mode 100644 lib/ppc64/asm/barrier.h diff --git a/lib/asm-generic/barrier.h b/lib/asm-generic/barrier.h new file mode 100644 index 000000000000..21c88e9184c5 --- /dev/null +++ b/lib/asm-generic/barrier.h @@ -0,0 +1,21 @@ +#ifndef _ASM_BARRIER_H_ +#define _ASM_BARRIER_H_ +/* + * asm-generic/barrier.h + * + * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <agordeev@xxxxxxxxxx> + * + * This work is licensed under the terms of the GNU LGPL, version 2. + */ + +#ifndef mb +#define mb() asm volatile("":::"memory") +#endif +#ifndef rmb +#define rmb() asm volatile("":::"memory") +#endif +#ifndef wmb +#define wmb() asm volatile("":::"memory") +#endif + +#endif /* _ASM_BARRIER_H_ */ diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index 41756dbf01bb..842868ab9d58 100644 --- a/lib/asm-generic/io.h +++ b/lib/asm-generic/io.h @@ -127,16 +127,6 @@ static inline u64 __bswap64(u64 x) ({ u64 __r = !__cpu_is_be() ? __bswap64(x) : ((u64)x); __r; }) #define cpu_to_be64 be64_to_cpu -#ifndef mb -#define mb() asm volatile("":::"memory") -#endif -#ifndef rmb -#define rmb() asm volatile("":::"memory") -#endif -#ifndef wmb -#define wmb() asm volatile("":::"memory") -#endif - #define readb(addr) \ ({ u8 __r = __raw_readb(addr); rmb(); __r; }) #define readw(addr) \ diff --git a/lib/ppc64/asm/barrier.h b/lib/ppc64/asm/barrier.h new file mode 100644 index 000000000000..5c772ded52e2 --- /dev/null +++ b/lib/ppc64/asm/barrier.h @@ -0,0 +1,4 @@ +#ifndef _ASMPPC64_BARRIER_H_ +#define _ASMPPC64_BARRIER_H_ +#include <asm-generic/barrier.h> +#endif -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html