~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/cache.h

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef __LINUX_CACHE_H
  2 #define __LINUX_CACHE_H
  3 
  4 #include <linux/kernel.h>
  5 #include <asm/cache.h>
  6 
  7 #ifndef L1_CACHE_ALIGN
  8 #define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES)
  9 #endif
 10 
 11 #ifndef SMP_CACHE_BYTES
 12 #define SMP_CACHE_BYTES L1_CACHE_BYTES
 13 #endif
 14 
 15 #ifndef __read_mostly
 16 #define __read_mostly
 17 #endif
 18 
 19 #ifndef ____cacheline_aligned
 20 #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
 21 #endif
 22 
 23 #ifndef ____cacheline_aligned_in_smp
 24 #ifdef CONFIG_SMP
 25 #define ____cacheline_aligned_in_smp ____cacheline_aligned
 26 #else
 27 #define ____cacheline_aligned_in_smp
 28 #endif /* CONFIG_SMP */
 29 #endif
 30 
 31 #ifndef __cacheline_aligned
 32 #define __cacheline_aligned                                     \
 33   __attribute__((__aligned__(SMP_CACHE_BYTES),                  \
 34                  __section__(".data..cacheline_aligned")))
 35 #endif /* __cacheline_aligned */
 36 
 37 #ifndef __cacheline_aligned_in_smp
 38 #ifdef CONFIG_SMP
 39 #define __cacheline_aligned_in_smp __cacheline_aligned
 40 #else
 41 #define __cacheline_aligned_in_smp
 42 #endif /* CONFIG_SMP */
 43 #endif
 44 
 45 /*
 46  * The maximum alignment needed for some critical structures
 47  * These could be inter-node cacheline sizes/L3 cacheline
 48  * size etc.  Define this in asm/cache.h for your arch
 49  */
 50 #ifndef INTERNODE_CACHE_SHIFT
 51 #define INTERNODE_CACHE_SHIFT L1_CACHE_SHIFT
 52 #endif
 53 
 54 #if !defined(____cacheline_internodealigned_in_smp)
 55 #if defined(CONFIG_SMP)
 56 #define ____cacheline_internodealigned_in_smp \
 57         __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT))))
 58 #else
 59 #define ____cacheline_internodealigned_in_smp
 60 #endif
 61 #endif
 62 
 63 #ifndef CONFIG_ARCH_HAS_CACHE_LINE_SIZE
 64 #define cache_line_size()       L1_CACHE_BYTES
 65 #endif
 66 
 67 #endif /* __LINUX_CACHE_H */
 68 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp