blob: abe08690a887d302324abcc8cf23bb5da60284f7 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
H. Peter Anvin1965aae2008-10-22 22:26:29 -07002#ifndef _ASM_X86_CACHE_H
3#define _ASM_X86_CACHE_H
Thomas Gleixner9bfa23d2007-10-15 23:28:20 +02004
Tim Abbottabe1ee32009-09-20 18:14:15 -04005#include <linux/linkage.h>
6
Thomas Gleixner9bfa23d2007-10-15 23:28:20 +02007/* L1 cache line size */
8#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
9#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
10
Denys Vlasenko54cb27a2010-02-20 01:03:44 +010011#define __read_mostly __attribute__((__section__(".data..read_mostly")))
Thomas Gleixner9bfa23d2007-10-15 23:28:20 +020012
Jan Beulich350f8f52009-11-13 11:54:40 +000013#define INTERNODE_CACHE_SHIFT CONFIG_X86_INTERNODE_CACHE_SHIFT
14#define INTERNODE_CACHE_BYTES (1 << INTERNODE_CACHE_SHIFT)
15
Thomas Gleixner9bfa23d2007-10-15 23:28:20 +020016#ifdef CONFIG_X86_VSMP
Thomas Gleixner9bfa23d2007-10-15 23:28:20 +020017#ifdef CONFIG_SMP
18#define __cacheline_aligned_in_smp \
Jan Beulich350f8f52009-11-13 11:54:40 +000019 __attribute__((__aligned__(INTERNODE_CACHE_BYTES))) \
Tim Abbottabe1ee32009-09-20 18:14:15 -040020 __page_aligned_data
Thomas Gleixner9bfa23d2007-10-15 23:28:20 +020021#endif
22#endif
23
H. Peter Anvin1965aae2008-10-22 22:26:29 -070024#endif /* _ASM_X86_CACHE_H */