diff options
Diffstat (limited to 'arch/sh/mm/cache.c')
-rw-r--r-- | arch/sh/mm/cache.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index a2dc7f9ecc51..e9415d3ea94a 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c | |||
@@ -27,8 +27,11 @@ void (*local_flush_icache_page)(void *args) = cache_noop; | |||
27 | void (*local_flush_cache_sigtramp)(void *args) = cache_noop; | 27 | void (*local_flush_cache_sigtramp)(void *args) = cache_noop; |
28 | 28 | ||
29 | void (*__flush_wback_region)(void *start, int size); | 29 | void (*__flush_wback_region)(void *start, int size); |
30 | EXPORT_SYMBOL(__flush_wback_region); | ||
30 | void (*__flush_purge_region)(void *start, int size); | 31 | void (*__flush_purge_region)(void *start, int size); |
32 | EXPORT_SYMBOL(__flush_purge_region); | ||
31 | void (*__flush_invalidate_region)(void *start, int size); | 33 | void (*__flush_invalidate_region)(void *start, int size); |
34 | EXPORT_SYMBOL(__flush_invalidate_region); | ||
32 | 35 | ||
33 | static inline void noop__flush_region(void *start, int size) | 36 | static inline void noop__flush_region(void *start, int size) |
34 | { | 37 | { |
@@ -161,14 +164,21 @@ void flush_cache_all(void) | |||
161 | { | 164 | { |
162 | cacheop_on_each_cpu(local_flush_cache_all, NULL, 1); | 165 | cacheop_on_each_cpu(local_flush_cache_all, NULL, 1); |
163 | } | 166 | } |
167 | EXPORT_SYMBOL(flush_cache_all); | ||
164 | 168 | ||
165 | void flush_cache_mm(struct mm_struct *mm) | 169 | void flush_cache_mm(struct mm_struct *mm) |
166 | { | 170 | { |
171 | if (boot_cpu_data.dcache.n_aliases == 0) | ||
172 | return; | ||
173 | |||
167 | cacheop_on_each_cpu(local_flush_cache_mm, mm, 1); | 174 | cacheop_on_each_cpu(local_flush_cache_mm, mm, 1); |
168 | } | 175 | } |
169 | 176 | ||
170 | void flush_cache_dup_mm(struct mm_struct *mm) | 177 | void flush_cache_dup_mm(struct mm_struct *mm) |
171 | { | 178 | { |
179 | if (boot_cpu_data.dcache.n_aliases == 0) | ||
180 | return; | ||
181 | |||
172 | cacheop_on_each_cpu(local_flush_cache_dup_mm, mm, 1); | 182 | cacheop_on_each_cpu(local_flush_cache_dup_mm, mm, 1); |
173 | } | 183 | } |
174 | 184 | ||
@@ -195,11 +205,13 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start, | |||
195 | 205 | ||
196 | cacheop_on_each_cpu(local_flush_cache_range, (void *)&data, 1); | 206 | cacheop_on_each_cpu(local_flush_cache_range, (void *)&data, 1); |
197 | } | 207 | } |
208 | EXPORT_SYMBOL(flush_cache_range); | ||
198 | 209 | ||
199 | void flush_dcache_page(struct page *page) | 210 | void flush_dcache_page(struct page *page) |
200 | { | 211 | { |
201 | cacheop_on_each_cpu(local_flush_dcache_page, page, 1); | 212 | cacheop_on_each_cpu(local_flush_dcache_page, page, 1); |
202 | } | 213 | } |
214 | EXPORT_SYMBOL(flush_dcache_page); | ||
203 | 215 | ||
204 | void flush_icache_range(unsigned long start, unsigned long end) | 216 | void flush_icache_range(unsigned long start, unsigned long end) |
205 | { | 217 | { |
@@ -265,7 +277,11 @@ static void __init emit_cache_params(void) | |||
265 | 277 | ||
266 | void __init cpu_cache_init(void) | 278 | void __init cpu_cache_init(void) |
267 | { | 279 | { |
268 | unsigned int cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE); | 280 | unsigned int cache_disabled = 0; |
281 | |||
282 | #ifdef CCR | ||
283 | cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE); | ||
284 | #endif | ||
269 | 285 | ||
270 | compute_alias(&boot_cpu_data.icache); | 286 | compute_alias(&boot_cpu_data.icache); |
271 | compute_alias(&boot_cpu_data.dcache); | 287 | compute_alias(&boot_cpu_data.dcache); |