Staging
v0.8.1
https://github.com/torvalds/linux
Raw File
Tip revision: 7c60610d476766e128cc4284bb6349732cbd6606 authored by Linus Torvalds on 15 August 2021, 23:40:53 UTC
Linux 5.14-rc6
Tip revision: 7c60610
cacheline.h
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_CACHELINE_H
#define PERF_CACHELINE_H

#include <linux/compiler.h>

int __pure cacheline_size(void);

static inline u64 cl_address(u64 address)
{
	/* return the cacheline of the address */
	return (address & ~(cacheline_size() - 1));
}

static inline u64 cl_offset(u64 address)
{
	/* return the cacheline of the address */
	return (address & (cacheline_size() - 1));
}

#endif // PERF_CACHELINE_H
back to top