1 #ifndef __LINUX_CACHE_H
2 #define __LINUX_CACHE_H
4 #include <linux/kernel.h>
5 #include <linux/config.h>
9 #define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES)
12 #ifndef SMP_CACHE_BYTES
13 #define SMP_CACHE_BYTES L1_CACHE_BYTES
16 #ifndef ____cacheline_aligned
17 #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
20 #ifndef ____cacheline_aligned_in_smp
22 #define ____cacheline_aligned_in_smp ____cacheline_aligned
24 #define ____cacheline_aligned_in_smp
25 #endif /* CONFIG_SMP */
28 #ifndef __cacheline_aligned
29 #define __cacheline_aligned \
30 __attribute__((__aligned__(SMP_CACHE_BYTES), \
31 __section__(".data.cacheline_aligned")))
32 #endif /* __cacheline_aligned */
34 #ifndef __cacheline_aligned_in_smp
36 #define __cacheline_aligned_in_smp __cacheline_aligned
38 #define __cacheline_aligned_in_smp
39 #endif /* CONFIG_SMP */
42 #if !defined(____cacheline_maxaligned_in_smp)
43 #if defined(CONFIG_SMP)
44 #define ____cacheline_maxaligned_in_smp \
45 __attribute__((__aligned__(1 << (L1_CACHE_SHIFT_MAX))))
47 #define ____cacheline_maxaligned_in_smp
51 #endif /* __LINUX_CACHE_H */