aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/tlb.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-19 15:20:35 +0900
committerPaul Mundt <lethal@linux-sh.org>2010-01-19 15:20:35 +0900
commitbb29c677b366fdf4f6522cd82228a32567aa98c7 (patch)
tree0235c7477ed635c8c21131b90094d151663ae889 /arch/sh/include/asm/tlb.h
parentsh: Provide a dummy _PAGE_WIRED flag for non-X2TLB parts. (diff)
downloadlinux-dev-bb29c677b366fdf4f6522cd82228a32567aa98c7.tar.xz
linux-dev-bb29c677b366fdf4f6522cd82228a32567aa98c7.zip
sh: Split out MMUCR.URB based entry wiring in to shared helper.
Presently this is duplicated between tlb-sh4 and tlb-pteaex. Split the helpers out in to a generic tlb-urb that can be used by any parts equipped with MMUCR.URB. At the same time, move the SH-5 code out-of-line, as we require single global state for DTLB entry wiring. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/tlb.h')
-rw-r--r--arch/sh/include/asm/tlb.h44
1 files changed, 2 insertions, 42 deletions
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h
index dfc8fcd8ee50..75abb38dffd5 100644
--- a/arch/sh/include/asm/tlb.h
+++ b/arch/sh/include/asm/tlb.h
@@ -98,49 +98,9 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
#define tlb_migrate_finish(mm) do { } while (0)
-#ifdef CONFIG_CPU_SH4
+#if defined(CONFIG_CPU_SH4) || defined(CONFIG_SUPERH64)
extern void tlb_wire_entry(struct vm_area_struct *, unsigned long, pte_t);
extern void tlb_unwire_entry(void);
-#elif defined(CONFIG_SUPERH64)
-static int dtlb_entry;
-static unsigned long long dtlb_entries[64];
-
-static inline void tlb_wire_entry(struct vm_area_struct *vma,
- unsigned long addr, pte_t pte)
-{
- unsigned long long entry;
- unsigned long paddr, flags;
-
- BUG_ON(dtlb_entry == 64);
-
- local_irq_save(flags);
-
- entry = sh64_get_wired_dtlb_entry();
- dtlb_entries[dtlb_entry++] = entry;
-
- paddr = pte_val(pte) & _PAGE_FLAGS_HARDWARE_MASK;
- paddr &= ~PAGE_MASK;
-
- sh64_setup_tlb_slot(entry, addr, get_asid(), paddr);
-
- local_irq_restore(flags);
-}
-
-static inline void tlb_unwire_entry(void)
-{
- unsigned long long entry;
- unsigned long flags;
-
- BUG_ON(!dtlb_entry);
-
- local_irq_save(flags);
- entry = dtlb_entries[dtlb_entry--];
-
- sh64_teardown_tlb_slot(entry);
- sh64_put_wired_dtlb_entry(entry);
-
- local_irq_restore(flags);
-}
#else
static inline void tlb_wire_entry(struct vm_area_struct *vma ,
unsigned long addr, pte_t pte)
@@ -152,7 +112,7 @@ static inline void tlb_unwire_entry(void)
{
BUG();
}
-#endif /* CONFIG_CPU_SH4 */
+#endif
#else /* CONFIG_MMU */