Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef PERF_CACHELINE_H
0003 #define PERF_CACHELINE_H
0004 
0005 #include <linux/compiler.h>
0006 
0007 int __pure cacheline_size(void);
0008 
0009 static inline u64 cl_address(u64 address)
0010 {
0011     /* return the cacheline of the address */
0012     return (address & ~(cacheline_size() - 1));
0013 }
0014 
0015 static inline u64 cl_offset(u64 address)
0016 {
0017     /* return the cacheline of the address */
0018     return (address & (cacheline_size() - 1));
0019 }
0020 
0021 #endif // PERF_CACHELINE_H