aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/pgtsrmmu.h50
-rw-r--r--arch/sparc/mm/leon_mm.c16
2 files changed, 14 insertions, 52 deletions
diff --git a/arch/sparc/include/asm/pgtsrmmu.h b/arch/sparc/include/asm/pgtsrmmu.h
index f6ae2b2b687..cb828703a63 100644
--- a/arch/sparc/include/asm/pgtsrmmu.h
+++ b/arch/sparc/include/asm/pgtsrmmu.h
@@ -173,17 +173,6 @@ static inline void srmmu_set_ctable_ptr(unsigned long paddr)
173 "memory"); 173 "memory");
174} 174}
175 175
176static inline unsigned long srmmu_get_ctable_ptr(void)
177{
178 unsigned int retval;
179
180 __asm__ __volatile__("lda [%1] %2, %0\n\t" :
181 "=r" (retval) :
182 "r" (SRMMU_CTXTBL_PTR),
183 "i" (ASI_M_MMUREGS));
184 return (retval & SRMMU_CTX_PMASK) << 4;
185}
186
187static inline void srmmu_set_context(int context) 176static inline void srmmu_set_context(int context)
188{ 177{
189 __asm__ __volatile__("sta %0, [%1] %2\n\t" : : 178 __asm__ __volatile__("sta %0, [%1] %2\n\t" : :
@@ -231,42 +220,6 @@ static inline void srmmu_flush_whole_tlb(void)
231} 220}
232 221
233/* These flush types are not available on all chips... */ 222/* These flush types are not available on all chips... */
234static inline void srmmu_flush_tlb_ctx(void)
235{
236 __asm__ __volatile__("sta %%g0, [%0] %1\n\t": :
237 "r" (0x300), /* Flush TLB ctx.. */
238 "i" (ASI_M_FLUSH_PROBE) : "memory");
239
240}
241
242static inline void srmmu_flush_tlb_region(unsigned long addr)
243{
244 addr &= SRMMU_PGDIR_MASK;
245 __asm__ __volatile__("sta %%g0, [%0] %1\n\t": :
246 "r" (addr | 0x200), /* Flush TLB region.. */
247 "i" (ASI_M_FLUSH_PROBE) : "memory");
248
249}
250
251
252static inline void srmmu_flush_tlb_segment(unsigned long addr)
253{
254 addr &= SRMMU_REAL_PMD_MASK;
255 __asm__ __volatile__("sta %%g0, [%0] %1\n\t": :
256 "r" (addr | 0x100), /* Flush TLB segment.. */
257 "i" (ASI_M_FLUSH_PROBE) : "memory");
258
259}
260
261static inline void srmmu_flush_tlb_page(unsigned long page)
262{
263 page &= PAGE_MASK;
264 __asm__ __volatile__("sta %%g0, [%0] %1\n\t": :
265 "r" (page), /* Flush TLB page.. */
266 "i" (ASI_M_FLUSH_PROBE) : "memory");
267
268}
269
270#ifndef CONFIG_SPARC_LEON 223#ifndef CONFIG_SPARC_LEON
271static inline unsigned long srmmu_hwprobe(unsigned long vaddr) 224static inline unsigned long srmmu_hwprobe(unsigned long vaddr)
272{ 225{
@@ -294,9 +247,6 @@ srmmu_get_pte (unsigned long addr)
294 return entry; 247 return entry;
295} 248}
296 249
297extern unsigned long (*srmmu_read_physical)(unsigned long paddr);
298extern void (*srmmu_write_physical)(unsigned long paddr, unsigned long word);
299
300#endif /* !(__ASSEMBLY__) */ 250#endif /* !(__ASSEMBLY__) */
301 251
302#endif /* !(_SPARC_PGTSRMMU_H) */ 252#endif /* !(_SPARC_PGTSRMMU_H) */
diff --git a/arch/sparc/mm/leon_mm.c b/arch/sparc/mm/leon_mm.c
index 7e2bed737ef..4c67ae6e502 100644
--- a/arch/sparc/mm/leon_mm.c
+++ b/arch/sparc/mm/leon_mm.c
@@ -20,6 +20,18 @@
20int leon_flush_during_switch = 1; 20int leon_flush_during_switch = 1;
21int srmmu_swprobe_trace; 21int srmmu_swprobe_trace;
22 22
23static inline unsigned long leon_get_ctable_ptr(void)
24{
25 unsigned int retval;
26
27 __asm__ __volatile__("lda [%1] %2, %0\n\t" :
28 "=r" (retval) :
29 "r" (SRMMU_CTXTBL_PTR),
30 "i" (ASI_LEON_MMUREGS));
31 return (retval & SRMMU_CTX_PMASK) << 4;
32}
33
34
23unsigned long srmmu_swprobe(unsigned long vaddr, unsigned long *paddr) 35unsigned long srmmu_swprobe(unsigned long vaddr, unsigned long *paddr)
24{ 36{
25 37
@@ -35,10 +47,10 @@ unsigned long srmmu_swprobe(unsigned long vaddr, unsigned long *paddr)
35 if (srmmu_swprobe_trace) 47 if (srmmu_swprobe_trace)
36 printk(KERN_INFO "swprobe: trace on\n"); 48 printk(KERN_INFO "swprobe: trace on\n");
37 49
38 ctxtbl = srmmu_get_ctable_ptr(); 50 ctxtbl = leon_get_ctable_ptr();
39 if (!(ctxtbl)) { 51 if (!(ctxtbl)) {
40 if (srmmu_swprobe_trace) 52 if (srmmu_swprobe_trace)
41 printk(KERN_INFO "swprobe: srmmu_get_ctable_ptr returned 0=>0\n"); 53 printk(KERN_INFO "swprobe: leon_get_ctable_ptr returned 0=>0\n");
42 return 0; 54 return 0;
43 } 55 }
44 if (!_pfn_valid(PFN(ctxtbl))) { 56 if (!_pfn_valid(PFN(ctxtbl))) {