2 * linux/include/asm-arm/proc-armo/cache.h
4 * Copyright (C) 1999-2001 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Cache handling for 26-bit ARM processors.
12 #define flush_cache_all() do { } while (0)
13 #define flush_cache_mm(mm) do { } while (0)
14 #define flush_cache_range(mm,start,end) do { } while (0)
15 #define flush_cache_page(vma,vmaddr) do { } while (0)
16 #define flush_page_to_ram(page) do { } while (0)
18 #define invalidate_dcache_range(start,end) do { } while (0)
19 #define clean_dcache_range(start,end) do { } while (0)
20 #define flush_dcache_range(start,end) do { } while (0)
21 #define flush_dcache_page(page) do { } while (0)
22 #define clean_dcache_entry(_s) do { } while (0)
23 #define clean_cache_entry(_start) do { } while (0)
25 #define flush_icache_range(start,end) do { } while (0)
26 #define flush_icache_page(vma,page) do { } while (0)
28 /* DAG: ARM3 will flush cache on MEMC updates anyway? so don't bother */
29 #define clean_cache_area(_start,_size) do { } while (0)
34 * - flush_tlb_all() flushes all processes TLBs
35 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
36 * - flush_tlb_page(vma, vmaddr) flushes one page
37 * - flush_tlb_range(mm, start, end) flushes a range of pages
39 #define flush_tlb_all() memc_update_all()
40 #define flush_tlb_mm(mm) memc_update_mm(mm)
41 #define flush_tlb_range(mm,start,end) \
42 do { memc_update_mm(mm); (void)(start); (void)(end); } while (0)
43 #define flush_tlb_page(vma, vmaddr) do { } while (0)
46 * The following handle the weird MEMC chip
48 static inline void memc_update_all(void)
50 struct task_struct *p;
52 cpu_memc_update_all(init_mm.pgd);
56 cpu_memc_update_all(p->mm->pgd);
58 processor._set_pgd(current->active_mm->pgd);
61 static inline void memc_update_mm(struct mm_struct *mm)
63 cpu_memc_update_all(mm->pgd);
65 if (mm == current->active_mm)
66 processor._set_pgd(mm->pgd);
70 memc_clear(struct mm_struct *mm, struct page *page)
72 cpu_memc_update_entry(mm->pgd, (unsigned long) page_address(page), 0);
74 if (mm == current->active_mm)
75 processor._set_pgd(mm->pgd);
79 memc_update_addr(struct mm_struct *mm, pte_t pte, unsigned long vaddr)
81 cpu_memc_update_entry(mm->pgd, pte_val(pte), vaddr);
83 if (mm == current->active_mm)
84 processor._set_pgd(mm->pgd);
88 update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
90 struct mm_struct *mm = vma->vm_mm;
91 memc_update_addr(mm, pte, addr);