Import changeset
[linux-flexiantxendom0-3.2.10.git] / include / asm-arm / proc-armo / cache.h
1 /*
2  *  linux/include/asm-arm/proc-armo/cache.h
3  *
4  *  Copyright (C) 1999-2000 Russell King
5  *
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.
9  *
10  *  Cache handling for 26-bit ARM processors.
11  */
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)
17
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)
24
25 #define flush_icache_range(start,end)           do { } while (0)
26 #define flush_icache_page(vma,page)             do { } while (0)
27
28 /* DAG: ARM3 will flush cache on MEMC updates anyway? so don't bother */
29 #define clean_cache_area(_start,_size) do { } while (0)
30
31 /*
32  * TLB flushing:
33  *
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
38  */
39 #define flush_tlb_all()                         memc_update_all()
40 #define flush_tlb_mm(mm)                        do { } while (0)
41 #define flush_tlb_range(mm, start, end)         do { (void)(start); (void)(end); } while (0)
42 #define flush_tlb_page(vma, vmaddr)             do { } while (0)
43
44 /*
45  * The following handle the weird MEMC chip
46  */
47 extern __inline__ void memc_update_all(void)
48 {
49         struct task_struct *p;
50
51         cpu_memc_update_all(init_mm.pgd);
52         for_each_task(p) {
53                 if (!p->mm)
54                         continue;
55                 cpu_memc_update_all(p->mm->pgd);
56         }
57         processor._set_pgd(current->active_mm->pgd);
58 }
59
60 extern __inline__ void memc_update_mm(struct mm_struct *mm)
61 {
62         cpu_memc_update_all(mm->pgd);
63
64         if (mm == current->active_mm)
65                 processor._set_pgd(mm->pgd);
66 }
67
68 extern __inline__ void
69 memc_update_addr(struct mm_struct *mm, pte_t pte, unsigned long vaddr)
70 {
71         cpu_memc_update_entry(mm->pgd, pte_val(pte), vaddr);
72
73         if (mm == current->active_mm)
74                 processor._set_pgd(mm->pgd);
75 }
76
77 extern __inline__ void
78 memc_clear(struct mm_struct *mm, struct page *page)
79 {
80         cpu_memc_update_entry(mm->pgd, (unsigned long) page_address(page), 0);
81
82         if (mm == current->active_mm)
83                 processor._set_pgd(mm->pgd);
84 }