18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copied from the kernel sources to tools/perf/: 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Generic barrier definitions. 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * It should be possible to use these on really simple architectures, 88c2ecf20Sopenharmony_ci * but it serves more as a starting point for new ports. 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. 118c2ecf20Sopenharmony_ci * Written by David Howells (dhowells@redhat.com) 128c2ecf20Sopenharmony_ci */ 138c2ecf20Sopenharmony_ci#ifndef __TOOLS_LINUX_ASM_GENERIC_BARRIER_H 148c2ecf20Sopenharmony_ci#define __TOOLS_LINUX_ASM_GENERIC_BARRIER_H 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#include <linux/compiler.h> 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* 218c2ecf20Sopenharmony_ci * Force strict CPU ordering. And yes, this is required on UP too when we're 228c2ecf20Sopenharmony_ci * talking to devices. 238c2ecf20Sopenharmony_ci * 248c2ecf20Sopenharmony_ci * Fall back to compiler barriers if nothing better is provided. 258c2ecf20Sopenharmony_ci */ 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#ifndef mb 288c2ecf20Sopenharmony_ci#define mb() barrier() 298c2ecf20Sopenharmony_ci#endif 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci#ifndef rmb 328c2ecf20Sopenharmony_ci#define rmb() mb() 338c2ecf20Sopenharmony_ci#endif 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#ifndef wmb 368c2ecf20Sopenharmony_ci#define wmb() mb() 378c2ecf20Sopenharmony_ci#endif 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci#endif /* !__ASSEMBLY__ */ 408c2ecf20Sopenharmony_ci#endif /* __TOOLS_LINUX_ASM_GENERIC_BARRIER_H */ 41