Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copied from the kernel sources to tools/perf/:
0004  *
0005  * Generic barrier definitions.
0006  *
0007  * It should be possible to use these on really simple architectures,
0008  * but it serves more as a starting point for new ports.
0009  *
0010  * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
0011  * Written by David Howells (dhowells@redhat.com)
0012  */
0013 #ifndef __TOOLS_LINUX_ASM_GENERIC_BARRIER_H
0014 #define __TOOLS_LINUX_ASM_GENERIC_BARRIER_H
0015 
0016 #ifndef __ASSEMBLY__
0017 
0018 #include <linux/compiler.h>
0019 
0020 /*
0021  * Force strict CPU ordering. And yes, this is required on UP too when we're
0022  * talking to devices.
0023  *
0024  * Fall back to compiler barriers if nothing better is provided.
0025  */
0026 
0027 #ifndef mb
0028 #define mb()    barrier()
0029 #endif
0030 
0031 #ifndef rmb
0032 #define rmb()   mb()
0033 #endif
0034 
0035 #ifndef wmb
0036 #define wmb()   mb()
0037 #endif
0038 
0039 #endif /* !__ASSEMBLY__ */
0040 #endif /* __TOOLS_LINUX_ASM_GENERIC_BARRIER_H */