diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-05-19 16:02:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-20 02:27:38 -0400 |
commit | accf032cfa582ed95da130b06241637659210edb (patch) | |
tree | c00308c452c4d680f15cd922d591b815b24f6fe8 /arch/sparc/mm/leon_mm.c | |
parent | f6678d3b4107c2ea254f4f4c78dfd4e5dfe04d6a (diff) |
sparc32,leon: move leon mmu functions to leon_mm.c
We already have a leaon specific file - so
keep all the laon stuff in one place.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Konrad Eisele <konrad@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/leon_mm.c')
-rw-r--r-- | arch/sparc/mm/leon_mm.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/arch/sparc/mm/leon_mm.c b/arch/sparc/mm/leon_mm.c index 13c2169822a..7e2bed737ef 100644 --- a/arch/sparc/mm/leon_mm.c +++ b/arch/sparc/mm/leon_mm.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <asm/leon.h> | 15 | #include <asm/leon.h> |
16 | #include <asm/tlbflush.h> | 16 | #include <asm/tlbflush.h> |
17 | 17 | ||
18 | #include "srmmu.h" | ||
19 | |||
18 | int leon_flush_during_switch = 1; | 20 | int leon_flush_during_switch = 1; |
19 | int srmmu_swprobe_trace; | 21 | int srmmu_swprobe_trace; |
20 | 22 | ||
@@ -258,3 +260,80 @@ void leon_switch_mm(void) | |||
258 | if (leon_flush_during_switch) | 260 | if (leon_flush_during_switch) |
259 | leon_flush_cache_all(); | 261 | leon_flush_cache_all(); |
260 | } | 262 | } |
263 | |||
264 | static void leon_flush_cache_mm(struct mm_struct *mm) | ||
265 | { | ||
266 | leon_flush_cache_all(); | ||
267 | } | ||
268 | |||
269 | static void leon_flush_cache_page(struct vm_area_struct *vma, unsigned long page) | ||
270 | { | ||
271 | leon_flush_pcache_all(vma, page); | ||
272 | } | ||
273 | |||
274 | static void leon_flush_cache_range(struct vm_area_struct *vma, | ||
275 | unsigned long start, | ||
276 | unsigned long end) | ||
277 | { | ||
278 | leon_flush_cache_all(); | ||
279 | } | ||
280 | |||
281 | static void leon_flush_tlb_mm(struct mm_struct *mm) | ||
282 | { | ||
283 | leon_flush_tlb_all(); | ||
284 | } | ||
285 | |||
286 | static void leon_flush_tlb_page(struct vm_area_struct *vma, | ||
287 | unsigned long page) | ||
288 | { | ||
289 | leon_flush_tlb_all(); | ||
290 | } | ||
291 | |||
292 | static void leon_flush_tlb_range(struct vm_area_struct *vma, | ||
293 | unsigned long start, | ||
294 | unsigned long end) | ||
295 | { | ||
296 | leon_flush_tlb_all(); | ||
297 | } | ||
298 | |||
299 | static void leon_flush_page_to_ram(unsigned long page) | ||
300 | { | ||
301 | leon_flush_cache_all(); | ||
302 | } | ||
303 | |||
304 | static void leon_flush_sig_insns(struct mm_struct *mm, unsigned long page) | ||
305 | { | ||
306 | leon_flush_cache_all(); | ||
307 | } | ||
308 | |||
309 | static void leon_flush_page_for_dma(unsigned long page) | ||
310 | { | ||
311 | leon_flush_dcache_all(); | ||
312 | } | ||
313 | |||
314 | void __init poke_leonsparc(void) | ||
315 | { | ||
316 | } | ||
317 | |||
318 | static const struct sparc32_cachetlb_ops leon_ops = { | ||
319 | .cache_all = leon_flush_cache_all, | ||
320 | .cache_mm = leon_flush_cache_mm, | ||
321 | .cache_page = leon_flush_cache_page, | ||
322 | .cache_range = leon_flush_cache_range, | ||
323 | .tlb_all = leon_flush_tlb_all, | ||
324 | .tlb_mm = leon_flush_tlb_mm, | ||
325 | .tlb_page = leon_flush_tlb_page, | ||
326 | .tlb_range = leon_flush_tlb_range, | ||
327 | .page_to_ram = leon_flush_page_to_ram, | ||
328 | .sig_insns = leon_flush_sig_insns, | ||
329 | .page_for_dma = leon_flush_page_for_dma, | ||
330 | }; | ||
331 | |||
332 | void __init init_leon(void) | ||
333 | { | ||
334 | srmmu_name = "LEON"; | ||
335 | sparc32_cachetlb_ops = &leon_ops; | ||
336 | poke_srmmu = poke_leonsparc; | ||
337 | |||
338 | leon_flush_during_switch = leon_flush_needed(); | ||
339 | } | ||