|
Last change
on this file was
2,
checked in by jglee, 11 years ago
|
|
first commit
|
-
Property svn:executable set to
*
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 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 ____cacheline_aligned |
|---|
| 16 | #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) |
|---|
| 17 | #endif |
|---|
| 18 | |
|---|
| 19 | #ifndef ____cacheline_aligned_in_smp |
|---|
| 20 | #ifdef CONFIG_SMP |
|---|
| 21 | #define ____cacheline_aligned_in_smp ____cacheline_aligned |
|---|
| 22 | #else |
|---|
| 23 | #define ____cacheline_aligned_in_smp |
|---|
| 24 | #endif /* CONFIG_SMP */ |
|---|
| 25 | #endif |
|---|
| 26 | |
|---|
| 27 | #ifndef __cacheline_aligned |
|---|
| 28 | #define __cacheline_aligned \ |
|---|
| 29 | __attribute__((__aligned__(SMP_CACHE_BYTES), \ |
|---|
| 30 | __section__(".data.cacheline_aligned"))) |
|---|
| 31 | #endif /* __cacheline_aligned */ |
|---|
| 32 | |
|---|
| 33 | #ifndef __cacheline_aligned_in_smp |
|---|
| 34 | #ifdef CONFIG_SMP |
|---|
| 35 | #define __cacheline_aligned_in_smp __cacheline_aligned |
|---|
| 36 | #else |
|---|
| 37 | #define __cacheline_aligned_in_smp |
|---|
| 38 | #endif /* CONFIG_SMP */ |
|---|
| 39 | #endif |
|---|
| 40 | |
|---|
| 41 | #if !defined(____cacheline_maxaligned_in_smp) |
|---|
| 42 | #if defined(CONFIG_SMP) |
|---|
| 43 | #define ____cacheline_maxaligned_in_smp \ |
|---|
| 44 | __attribute__((__aligned__(1 << (L1_CACHE_SHIFT_MAX)))) |
|---|
| 45 | #else |
|---|
| 46 | #define ____cacheline_maxaligned_in_smp |
|---|
| 47 | #endif |
|---|
| 48 | #endif |
|---|
| 49 | |
|---|
| 50 | #endif /* __LINUX_CACHE_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.