diff options
Diffstat (limited to 'arch/sh/mm/cache-sh4.c')
-rw-r--r-- | arch/sh/mm/cache-sh4.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index e48cc22724d9..ae531affccbd 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
@@ -11,12 +11,8 @@ | |||
11 | */ | 11 | */ |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | #include <asm/addrspace.h> | 14 | #include <linux/io.h> |
15 | #include <asm/pgtable.h> | 15 | #include <linux/mutex.h> |
16 | #include <asm/processor.h> | ||
17 | #include <asm/cache.h> | ||
18 | #include <asm/io.h> | ||
19 | #include <asm/pgalloc.h> | ||
20 | #include <asm/mmu_context.h> | 16 | #include <asm/mmu_context.h> |
21 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
22 | 18 | ||
@@ -83,9 +79,9 @@ static void __init emit_cache_params(void) | |||
83 | */ | 79 | */ |
84 | 80 | ||
85 | /* Worst case assumed to be 64k cache, direct-mapped i.e. 4 synonym bits. */ | 81 | /* Worst case assumed to be 64k cache, direct-mapped i.e. 4 synonym bits. */ |
86 | #define MAX_P3_SEMAPHORES 16 | 82 | #define MAX_P3_MUTEXES 16 |
87 | 83 | ||
88 | struct semaphore p3map_sem[MAX_P3_SEMAPHORES]; | 84 | struct mutex p3map_mutex[MAX_P3_MUTEXES]; |
89 | 85 | ||
90 | void __init p3_cache_init(void) | 86 | void __init p3_cache_init(void) |
91 | { | 87 | { |
@@ -115,7 +111,7 @@ void __init p3_cache_init(void) | |||
115 | panic("%s failed.", __FUNCTION__); | 111 | panic("%s failed.", __FUNCTION__); |
116 | 112 | ||
117 | for (i = 0; i < cpu_data->dcache.n_aliases; i++) | 113 | for (i = 0; i < cpu_data->dcache.n_aliases; i++) |
118 | sema_init(&p3map_sem[i], 1); | 114 | mutex_init(&p3map_mutex[i]); |
119 | } | 115 | } |
120 | 116 | ||
121 | /* | 117 | /* |
@@ -229,7 +225,7 @@ static inline void flush_cache_4096(unsigned long start, | |||
229 | */ | 225 | */ |
230 | if ((cpu_data->flags & CPU_HAS_P2_FLUSH_BUG) || | 226 | if ((cpu_data->flags & CPU_HAS_P2_FLUSH_BUG) || |
231 | (start < CACHE_OC_ADDRESS_ARRAY)) | 227 | (start < CACHE_OC_ADDRESS_ARRAY)) |
232 | exec_offset = 0x20000000; | 228 | exec_offset = 0x20000000; |
233 | 229 | ||
234 | local_irq_save(flags); | 230 | local_irq_save(flags); |
235 | __flush_cache_4096(start | SH_CACHE_ASSOC, | 231 | __flush_cache_4096(start | SH_CACHE_ASSOC, |
@@ -250,7 +246,7 @@ void flush_dcache_page(struct page *page) | |||
250 | 246 | ||
251 | /* Loop all the D-cache */ | 247 | /* Loop all the D-cache */ |
252 | n = cpu_data->dcache.n_aliases; | 248 | n = cpu_data->dcache.n_aliases; |
253 | for (i = 0; i < n; i++, addr += PAGE_SIZE) | 249 | for (i = 0; i < n; i++, addr += 4096) |
254 | flush_cache_4096(addr, phys); | 250 | flush_cache_4096(addr, phys); |
255 | } | 251 | } |
256 | 252 | ||