aboutsummaryrefslogtreecommitdiffstats
path: root/include/vdso/cache.h
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-03-03 12:11:03 +0100
committerThomas Gleixner <tglx@linutronix.de>2025-03-08 14:37:39 +0100
commit0704bf439655c1f82ff7e623b1124a3c1cb8c907 (patch)
tree7f189f597e818f66e51c941cc0651ac2831a15eb /include/vdso/cache.h
parentselftests: vDSO: vdso_standalone_test_x86: Switch to nolibc (diff)
downloadlinux-0704bf439655c1f82ff7e623b1124a3c1cb8c907.tar.gz
linux-0704bf439655c1f82ff7e623b1124a3c1cb8c907.zip
vdso: Introduce vdso/cache.h
The vDSO implementation can only include headers from the vdso/ namespace. To enable the usage of ____cacheline_aligned from the vDSO, move it and its dependencies into a new header vdso/cache.h. Keep compatibility by including vdso/cache.h from linux/cache.h. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250303-vdso-clock-v1-1-c1b5c69a166f@linutronix.de
Diffstat (limited to 'include/vdso/cache.h')
-rw-r--r--include/vdso/cache.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/vdso/cache.h b/include/vdso/cache.h
new file mode 100644
index 000000000000..f89d48304bf8
--- /dev/null
+++ b/include/vdso/cache.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __VDSO_CACHE_H
+#define __VDSO_CACHE_H
+
+#include <asm/cache.h>
+
+#ifndef SMP_CACHE_BYTES
+#define SMP_CACHE_BYTES L1_CACHE_BYTES
+#endif
+
+#ifndef ____cacheline_aligned
+#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
+#endif
+
+#endif /* __VDSO_ALIGN_H */