aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/cache-sh7705.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-08-14 23:53:39 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-08-14 23:53:39 -0400
commit0d051d90bb08b516b9d6c30d25f83d3c6b5b1c1d (patch)
treeeb4a84153cf9b7f3b6d7814e7ad61644fff75097 /arch/sh/mm/cache-sh7705.c
parent79f1c9da5e5fc5f4705836d8c1cee2213fc80640 (diff)
sh: Convert SH7705 extended mode to new cacheflush interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/cache-sh7705.c')
-rw-r--r--arch/sh/mm/cache-sh7705.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c
index fa37bff306b..f1d5c803c04 100644
--- a/arch/sh/mm/cache-sh7705.c
+++ b/arch/sh/mm/cache-sh7705.c
@@ -64,7 +64,7 @@ static inline void cache_wback_all(void)
64 * 64 *
65 * Called from kernel/module.c:sys_init_module and routine for a.out format. 65 * Called from kernel/module.c:sys_init_module and routine for a.out format.
66 */ 66 */
67void flush_icache_range(unsigned long start, unsigned long end) 67static void sh7705_flush_icache_range(unsigned long start, unsigned long end)
68{ 68{
69 __flush_wback_region((void *)start, end - start); 69 __flush_wback_region((void *)start, end - start);
70} 70}
@@ -72,7 +72,7 @@ void flush_icache_range(unsigned long start, unsigned long end)
72/* 72/*
73 * Writeback&Invalidate the D-cache of the page 73 * Writeback&Invalidate the D-cache of the page
74 */ 74 */
75static void __uses_jump_to_uncached __flush_dcache_page(unsigned long phys) 75static void __flush_dcache_page(unsigned long phys)
76{ 76{
77 unsigned long ways, waysize, addrstart; 77 unsigned long ways, waysize, addrstart;
78 unsigned long flags; 78 unsigned long flags;
@@ -127,7 +127,7 @@ static void __uses_jump_to_uncached __flush_dcache_page(unsigned long phys)
127 * Write back & invalidate the D-cache of the page. 127 * Write back & invalidate the D-cache of the page.
128 * (To avoid "alias" issues) 128 * (To avoid "alias" issues)
129 */ 129 */
130void flush_dcache_page(struct page *page) 130static void sh7705_flush_dcache_page(struct page *page)
131{ 131{
132 struct address_space *mapping = page_mapping(page); 132 struct address_space *mapping = page_mapping(page);
133 133
@@ -137,7 +137,7 @@ void flush_dcache_page(struct page *page)
137 __flush_dcache_page(PHYSADDR(page_address(page))); 137 __flush_dcache_page(PHYSADDR(page_address(page)));
138} 138}
139 139
140void __uses_jump_to_uncached flush_cache_all(void) 140static void sh7705_flush_cache_all(void)
141{ 141{
142 unsigned long flags; 142 unsigned long flags;
143 143
@@ -149,7 +149,7 @@ void __uses_jump_to_uncached flush_cache_all(void)
149 local_irq_restore(flags); 149 local_irq_restore(flags);
150} 150}
151 151
152void flush_cache_mm(struct mm_struct *mm) 152static void sh7705_flush_cache_mm(struct mm_struct *mm)
153{ 153{
154 /* Is there any good way? */ 154 /* Is there any good way? */
155 /* XXX: possibly call flush_cache_range for each vm area */ 155 /* XXX: possibly call flush_cache_range for each vm area */
@@ -165,8 +165,8 @@ void flush_cache_mm(struct mm_struct *mm)
165 * Flushing the cache lines for U0 only isn't enough. 165 * Flushing the cache lines for U0 only isn't enough.
166 * We need to flush for P1 too, which may contain aliases. 166 * We need to flush for P1 too, which may contain aliases.
167 */ 167 */
168void flush_cache_range(struct vm_area_struct *vma, unsigned long start, 168static void sh7705_flush_cache_range(struct vm_area_struct *vma,
169 unsigned long end) 169 unsigned long start, unsigned long end)
170{ 170{
171 171
172 /* 172 /*
@@ -184,8 +184,8 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
184 * 184 *
185 * ADDRESS: Virtual Address (U0 address) 185 * ADDRESS: Virtual Address (U0 address)
186 */ 186 */
187void flush_cache_page(struct vm_area_struct *vma, unsigned long address, 187static void sh7705_flush_cache_page(struct vm_area_struct *vma,
188 unsigned long pfn) 188 unsigned long address, unsigned long pfn)
189{ 189{
190 __flush_dcache_page(pfn << PAGE_SHIFT); 190 __flush_dcache_page(pfn << PAGE_SHIFT);
191} 191}
@@ -198,7 +198,20 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long address,
198 * Not entirely sure why this is necessary on SH3 with 32K cache but 198 * Not entirely sure why this is necessary on SH3 with 32K cache but
199 * without it we get occasional "Memory fault" when loading a program. 199 * without it we get occasional "Memory fault" when loading a program.
200 */ 200 */
201void flush_icache_page(struct vm_area_struct *vma, struct page *page) 201static void sh7705_flush_icache_page(struct vm_area_struct *vma,
202 struct page *page)
202{ 203{
203 __flush_purge_region(page_address(page), PAGE_SIZE); 204 __flush_purge_region(page_address(page), PAGE_SIZE);
204} 205}
206
207void __init sh7705_cache_init(void)
208{
209 flush_icache_range = sh7705_flush_icache_range;
210 flush_dcache_page = sh7705_flush_dcache_page;
211 flush_cache_all = sh7705_flush_cache_all;
212 flush_cache_mm = sh7705_flush_cache_mm;
213 flush_cache_dup_mm = sh7705_flush_cache_mm;
214 flush_cache_range = sh7705_flush_cache_range;
215 flush_cache_page = sh7705_flush_cache_page;
216 flush_icache_page = sh7705_flush_icache_page;
217}