12 #include <linux/kernel.h>
16 #include <asm/tlbflush.h>
23 static inline unsigned long leon_get_ctable_ptr(
void)
27 __asm__ __volatile__(
"lda [%1] %2, %0\n\t" :
39 unsigned int pgd,
pmd, ped;
41 unsigned int lvl,
pte, paddrbase;
43 unsigned int paddr_calc;
50 ctxtbl = leon_get_ctable_ptr();
59 "swprobe: !_pfn_valid(%x)=>0\n",
160 (vaddr & ~(-1 <<
LEON_PTE_SH)) | ((pte & ~0xff) << 4);
164 (vaddr & ~(-1 <<
LEON_PMD_SH)) | ((pte & ~0xff) << 4);
168 (vaddr & ~(-1 <<
LEON_PGD_SH)) | ((pte & ~0xff) << 4);
184 __asm__ __volatile__(
" flush ");
189 __asm__ __volatile__(
"sta %%g0, [%%g0] %0\n\t" : :
202 __asm__ __volatile__(
" flush ");
203 __asm__ __volatile__(
"sta %%g0, [%%g0] %0\n\t" : :
210 __asm__ __volatile__(
"sta %%g0, [%0] %1\n\t" : :
"r"(0x400),
217 unsigned long ccr, iccr, dccr;
222 __asm__ __volatile__(
"lda [%%g0] %3, %0\n\t"
224 "lda [%%g1] %3, %1\n\t"
226 "lda [%%g1] %3, %2\n\t"
227 :
"=r"(ccr),
"=r"(iccr),
"=r"(dccr)
245 int flush_needed = -1;
246 unsigned int ssize, sets;
248 {
"direct mapped",
"2-way associative",
"3-way associative",
259 sets > 3 ?
"unknown" : setStr[sets], ssize);
260 if ((ssize <= (
PAGE_SIZE / 1024)) && (sets == 0)) {
276 static void leon_flush_cache_mm(
struct mm_struct *mm)
293 static void leon_flush_tlb_mm(
struct mm_struct *mm)
311 static void leon_flush_page_to_ram(
unsigned long page)
316 static void leon_flush_sig_insns(
struct mm_struct *mm,
unsigned long page)
321 static void leon_flush_page_for_dma(
unsigned long page)
332 .cache_mm = leon_flush_cache_mm,
333 .cache_page = leon_flush_cache_page,
334 .cache_range = leon_flush_cache_range,
336 .tlb_mm = leon_flush_tlb_mm,
337 .tlb_page = leon_flush_tlb_page,
338 .tlb_range = leon_flush_tlb_range,
339 .page_to_ram = leon_flush_page_to_ram,
340 .sig_insns = leon_flush_sig_insns,
341 .page_for_dma = leon_flush_page_for_dma,