Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / lwk / cache.h
1 #ifndef _LWK_CACHE_H
2 #define _LWK_CACHE_H
3
4 #include <lwk/kernel.h>
5 #include <arch/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 #define ____cacheline_aligned_in_smp ____cacheline_aligned
25 #endif
26
27 #ifndef __cacheline_aligned
28 #define __cacheline_aligned                                     \
29   __attribute__((__aligned__(SMP_CACHE_BYTES),                  \
30                  __section__(".data.cacheline_aligned")))
31 #endif
32
33 #ifndef __cacheline_aligned_in_smp
34 #define __cacheline_aligned_in_smp __cacheline_aligned
35 #endif
36
37 /*
38  * The maximum alignment needed for some critical structures
39  * These could be inter-node cacheline sizes/L3 cacheline
40  * size etc.  Define this in asm/cache.h for your arch
41  */
42 #ifndef INTERNODE_CACHE_SHIFT
43 #define INTERNODE_CACHE_SHIFT L1_CACHE_SHIFT
44 #endif
45
46 #if !defined(____cacheline_internodealigned_in_smp)
47 #define ____cacheline_internodealigned_in_smp \
48         __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT))))
49 #endif
50
51 #endif /* _LWK_CACHE_H */