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>
This commit is contained in:
parent
046581f962
commit
bb29c677b3
6 changed files with 124 additions and 176 deletions
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue