Path: blob/master/tools/arch/s390/include/asm/barrier.h
29271 views
/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copied from the kernel sources:3*4* Copyright IBM Corp. 1999, 20095*6* Author(s): Martin Schwidefsky <[email protected]>7*/89#ifndef __TOOLS_LINUX_ASM_BARRIER_H10#define __TOOLS_LINUX_ASM_BARRIER_H1112/*13* Force strict CPU ordering.14* And yes, this is required on UP too when we're talking15* to devices.16*/1718#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES19/* Fast-BCR without checkpoint synchronization */20#define __ASM_BARRIER "bcr 14,0\n"21#else22#define __ASM_BARRIER "bcr 15,0\n"23#endif2425#define mb() do { asm volatile(__ASM_BARRIER : : : "memory"); } while (0)2627#define rmb() mb()28#define wmb() mb()2930#define smp_store_release(p, v) \31do { \32barrier(); \33WRITE_ONCE(*p, v); \34} while (0)3536#define smp_load_acquire(p) \37({ \38typeof(*p) ___p1 = READ_ONCE(*p); \39barrier(); \40___p1; \41})4243#endif /* __TOOLS_LIB_ASM_BARRIER_H */444546