5 template< unsigned long Flush_area = 0, bool Ram = false >
9 /* start address is include, end address is exclusive
10 * (end = start + size) */
11 static void clean_vdcache();
12 static void clean_vdcache(void const *start, void const *end);
13 static void flush_vcache();
14 static void flush_vcache(void const *start, void const *end);
15 static void flush_vdcache();
16 static void flush_vdcache(void const *start, void const *end);
17 static void inv_vdcache(void const *start, void const *end);
20 * Clean the entire dcache.
22 static void clean_dcache();
26 * Clean given D cache region.
28 static void clean_dcache(void const *va);
31 * Clean given D cache region.
33 static void clean_dcache(void const *start, void const *end);
35 * Clean and invalidate the entire cache.
36 * D and I cache is cleaned and invalidated and the write buffer is
39 static void flush_cache();
43 * Clean and invalidate the given cache region.
44 * D and I cache are affected.
46 static void flush_cache(void const *start, void const *end);
49 * Clean and invalidate the entire D cache.
51 static void flush_dcache();
54 * Clean and invalidate the given D cache region.
56 static void flush_dcache(void const *start, void const *end);
59 * Invalidate the given D cache region.
61 static void inv_dcache(void const *start, void const *end);
64 * Switch page table and do the necessary things.
66 static void switch_pdbr(Address base);
68 // static void write_back_data_cache(bool ram = false);
69 // static void write_back_data_cache(void *a);
72 //---------------------------------------------------------------------------
73 IMPLEMENTATION [!arm || arm_nocache]:
76 template< unsigned long Flush_area, bool Ram >
77 void Mmu<Flush_area, Ram>::flush_cache()
81 template< unsigned long Flush_area, bool Ram >
82 void Mmu<Flush_area, Ram>::flush_cache(void const *, void const *)
86 template< unsigned long Flush_area, bool Ram >
87 void Mmu<Flush_area, Ram>::clean_dcache()
91 template< unsigned long Flush_area, bool Ram >
92 void Mmu<Flush_area, Ram>::clean_dcache(void const *, void const *)
96 template< unsigned long Flush_area, bool Ram >
97 void Mmu<Flush_area, Ram>::flush_dcache()
101 template< unsigned long Flush_area, bool Ram >
102 void Mmu<Flush_area, Ram>::flush_dcache(void const *, void const *)
106 template< unsigned long Flush_area, bool Ram >
107 void Mmu<Flush_area, Ram>::inv_dcache(void const *, void const *)
110 //---------------------------------------------------------------------------
111 IMPLEMENTATION[!vcache]:
114 template< unsigned long Flush_area, bool Ram >
115 void Mmu<Flush_area, Ram>::flush_vcache(void const *, void const *)
119 template< unsigned long Flush_area , bool Ram >
120 void Mmu<Flush_area, Ram>::clean_vdcache(void const *, void const *)
124 template< unsigned long Flush_area, bool Ram >
125 void Mmu<Flush_area, Ram>::flush_vdcache(void const *, void const *)
129 template< unsigned long Flush_area, bool Ram >
130 void Mmu<Flush_area, Ram>::inv_vdcache(void const *, void const *)
134 template< unsigned long Flush_area, bool Ram >
135 void Mmu<Flush_area, Ram>::flush_vcache()
139 template< unsigned long Flush_area, bool Ram >
140 void Mmu<Flush_area, Ram>::clean_vdcache()
144 template< unsigned long Flush_area, bool Ram >
145 void Mmu<Flush_area, Ram>::flush_vdcache()
149 //---------------------------------------------------------------------------
150 IMPLEMENTATION[vcache]:
153 template< unsigned long Flush_area, bool Ram >
154 void Mmu<Flush_area, Ram>::flush_vcache(void const *start,
156 { flush_cache(start, end); }
159 template< unsigned long Flush_area , bool Ram >
160 void Mmu<Flush_area, Ram>::clean_vdcache(void const *start, void const *end)
161 { clean_dcache(start, end); }
164 template< unsigned long Flush_area, bool Ram >
165 void Mmu<Flush_area, Ram>::flush_vdcache(void const *start, void const *end)
166 { flush_dcache(start, end); }
169 template< unsigned long Flush_area, bool Ram >
170 void Mmu<Flush_area, Ram>::inv_vdcache(void const *start, void const *end)
171 { inv_dcache(start, end); }
174 template< unsigned long Flush_area, bool Ram >
175 void Mmu<Flush_area, Ram>::flush_vcache()
179 template< unsigned long Flush_area, bool Ram >
180 void Mmu<Flush_area, Ram>::clean_vdcache()
184 template< unsigned long Flush_area, bool Ram >
185 void Mmu<Flush_area, Ram>::flush_vdcache()