diff options
author | Kyle McMartin <kyle@parisc-linux.org> | 2006-03-23 06:00:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 10:38:10 -0500 |
commit | 804f1594cc3deb161e531a43d90c501f0db2635a (patch) | |
tree | 81f7a7cea8dbf671c733df379c6582e36459e8da /include | |
parent | 6a2900b67652421b51fe25e4b86ecfec742b1f30 (diff) |
[PATCH] Move read_mostly definition to asm/cache.h
Seems like needless clutter having a bunch of #if defined(CONFIG_$ARCH) in
include/linux/cache.h. Move the per architecture section definition to
asm/cache.h, and keep the if-not-defined dummy case in linux/cache.h to
catch architectures which don't implement the section.
Verified that symbols still go in .data.read_mostly on parisc,
and the compile doesn't break.
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-i386/cache.h | 2 | ||||
-rw-r--r-- | include/asm-ia64/cache.h | 2 | ||||
-rw-r--r-- | include/asm-parisc/cache.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/cache.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/cache.h | 2 | ||||
-rw-r--r-- | include/linux/cache.h | 4 |
6 files changed, 11 insertions, 3 deletions
diff --git a/include/asm-i386/cache.h b/include/asm-i386/cache.h index 615911e5bd24..ca15c9c665cf 100644 --- a/include/asm-i386/cache.h +++ b/include/asm-i386/cache.h | |||
@@ -10,4 +10,6 @@ | |||
10 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) | 10 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) |
11 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 11 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
12 | 12 | ||
13 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
14 | |||
13 | #endif | 15 | #endif |
diff --git a/include/asm-ia64/cache.h b/include/asm-ia64/cache.h index 40dd25195d65..f0a104db8f20 100644 --- a/include/asm-ia64/cache.h +++ b/include/asm-ia64/cache.h | |||
@@ -25,4 +25,6 @@ | |||
25 | # define SMP_CACHE_BYTES (1 << 3) | 25 | # define SMP_CACHE_BYTES (1 << 3) |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
29 | |||
28 | #endif /* _ASM_IA64_CACHE_H */ | 30 | #endif /* _ASM_IA64_CACHE_H */ |
diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h index 93f179f13ce8..ae50f8e12eed 100644 --- a/include/asm-parisc/cache.h +++ b/include/asm-parisc/cache.h | |||
@@ -29,6 +29,8 @@ | |||
29 | 29 | ||
30 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 30 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
31 | 31 | ||
32 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
33 | |||
32 | extern void flush_data_cache_local(void *); /* flushes local data-cache only */ | 34 | extern void flush_data_cache_local(void *); /* flushes local data-cache only */ |
33 | extern void flush_instruction_cache_local(void *); /* flushes local code-cache only */ | 35 | extern void flush_instruction_cache_local(void *); /* flushes local code-cache only */ |
34 | #ifdef CONFIG_SMP | 36 | #ifdef CONFIG_SMP |
diff --git a/include/asm-sparc64/cache.h b/include/asm-sparc64/cache.h index f7d35a2ae9b8..e9df17acedde 100644 --- a/include/asm-sparc64/cache.h +++ b/include/asm-sparc64/cache.h | |||
@@ -13,4 +13,6 @@ | |||
13 | #define SMP_CACHE_BYTES_SHIFT 6 | 13 | #define SMP_CACHE_BYTES_SHIFT 6 |
14 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) /* L2 cache line size. */ | 14 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) /* L2 cache line size. */ |
15 | 15 | ||
16 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
17 | |||
16 | #endif | 18 | #endif |
diff --git a/include/asm-x86_64/cache.h b/include/asm-x86_64/cache.h index 263f0a211ed7..c8043a16152e 100644 --- a/include/asm-x86_64/cache.h +++ b/include/asm-x86_64/cache.h | |||
@@ -20,6 +20,8 @@ | |||
20 | __attribute__((__section__(".data.page_aligned"))) | 20 | __attribute__((__section__(".data.page_aligned"))) |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
24 | |||
23 | #endif | 25 | #endif |
24 | 26 | ||
25 | #endif | 27 | #endif |
diff --git a/include/linux/cache.h b/include/linux/cache.h index d22e632f41fb..cc4b3aafad9a 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
@@ -13,9 +13,7 @@ | |||
13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) || defined(CONFIG_PARISC) | 16 | #ifndef __read_mostly |
17 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
18 | #else | ||
19 | #define __read_mostly | 17 | #define __read_mostly |
20 | #endif | 18 | #endif |
21 | 19 | ||