162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copied from the kernel sources to tools/perf/: 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Generic barrier definitions. 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * It should be possible to use these on really simple architectures, 862306a36Sopenharmony_ci * but it serves more as a starting point for new ports. 962306a36Sopenharmony_ci * 1062306a36Sopenharmony_ci * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. 1162306a36Sopenharmony_ci * Written by David Howells (dhowells@redhat.com) 1262306a36Sopenharmony_ci */ 1362306a36Sopenharmony_ci#ifndef __TOOLS_LINUX_ASM_GENERIC_BARRIER_H 1462306a36Sopenharmony_ci#define __TOOLS_LINUX_ASM_GENERIC_BARRIER_H 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#ifndef __ASSEMBLY__ 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci#include <linux/compiler.h> 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci/* 2162306a36Sopenharmony_ci * Force strict CPU ordering. And yes, this is required on UP too when we're 2262306a36Sopenharmony_ci * talking to devices. 2362306a36Sopenharmony_ci * 2462306a36Sopenharmony_ci * Fall back to compiler barriers if nothing better is provided. 2562306a36Sopenharmony_ci */ 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#ifndef mb 2862306a36Sopenharmony_ci#define mb() barrier() 2962306a36Sopenharmony_ci#endif 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci#ifndef rmb 3262306a36Sopenharmony_ci#define rmb() mb() 3362306a36Sopenharmony_ci#endif 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci#ifndef wmb 3662306a36Sopenharmony_ci#define wmb() mb() 3762306a36Sopenharmony_ci#endif 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ci#endif /* !__ASSEMBLY__ */ 4062306a36Sopenharmony_ci#endif /* __TOOLS_LINUX_ASM_GENERIC_BARRIER_H */ 41