diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-01-19 01:20:35 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-01-19 01:20:35 -0500 |
commit | bb29c677b366fdf4f6522cd82228a32567aa98c7 (patch) | |
tree | 0235c7477ed635c8c21131b90094d151663ae889 /arch/sh/include/asm | |
parent | 046581f9623b53f551a93864bb74e15ad2514f0c (diff) |
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')
-rw-r--r-- | arch/sh/include/asm/tlb.h | 44 |
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) | |||
98 | 98 | ||
99 | #define tlb_migrate_finish(mm) do { } while (0) | 99 | #define tlb_migrate_finish(mm) do { } while (0) |
100 | 100 | ||
101 | #ifdef CONFIG_CPU_SH4 | 101 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_SUPERH64) |
102 | extern void tlb_wire_entry(struct vm_area_struct *, unsigned long, pte_t); | 102 | extern void tlb_wire_entry(struct vm_area_struct *, unsigned long, pte_t); |
103 | extern void tlb_unwire_entry(void); | 103 | extern void tlb_unwire_entry(void); |
104 | #elif defined(CONFIG_SUPERH64) | ||
105 | static int dtlb_entry; | ||
106 | static unsigned long long dtlb_entries[64]; | ||
107 | |||
108 | static inline void tlb_wire_entry(struct vm_area_struct *vma, | ||
109 | unsigned long addr, pte_t pte) | ||
110 | { | ||
111 | unsigned long long entry; | ||
112 | unsigned long paddr, flags; | ||
113 | |||
114 | BUG_ON(dtlb_entry == 64); | ||
115 | |||
116 | local_irq_save(flags); | ||
117 | |||
118 | entry = sh64_get_wired_dtlb_entry(); | ||
119 | dtlb_entries[dtlb_entry++] = entry; | ||
120 | |||
121 | paddr = pte_val(pte) & _PAGE_FLAGS_HARDWARE_MASK; | ||
122 | paddr &= ~PAGE_MASK; | ||
123 | |||
124 | sh64_setup_tlb_slot(entry, addr, get_asid(), paddr); | ||
125 | |||
126 | local_irq_restore(flags); | ||
127 | } | ||
128 | |||
129 | static inline void tlb_unwire_entry(void) | ||
130 | { | ||
131 | unsigned long long entry; | ||
132 | unsigned long flags; | ||
133 | |||
134 | BUG_ON(!dtlb_entry); | ||
135 | |||
136 | local_irq_save(flags); | ||
137 | entry = dtlb_entries[dtlb_entry--]; | ||
138 | |||
139 | sh64_teardown_tlb_slot(entry); | ||
140 | sh64_put_wired_dtlb_entry(entry); | ||
141 | |||
142 | local_irq_restore(flags); | ||
143 | } | ||
144 | #else | 104 | #else |
145 | static inline void tlb_wire_entry(struct vm_area_struct *vma , | 105 | static inline void tlb_wire_entry(struct vm_area_struct *vma , |
146 | unsigned long addr, pte_t pte) | 106 | unsigned long addr, pte_t pte) |
@@ -152,7 +112,7 @@ static inline void tlb_unwire_entry(void) | |||
152 | { | 112 | { |
153 | BUG(); | 113 | BUG(); |
154 | } | 114 | } |
155 | #endif /* CONFIG_CPU_SH4 */ | 115 | #endif |
156 | 116 | ||
157 | #else /* CONFIG_MMU */ | 117 | #else /* CONFIG_MMU */ |
158 | 118 | ||