diff options
Diffstat (limited to 'include/asm-ppc64/mmu.h')
-rw-r--r-- | include/asm-ppc64/mmu.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h index 9d03a98a4fa3..f373de5e3dd9 100644 --- a/include/asm-ppc64/mmu.h +++ b/include/asm-ppc64/mmu.h | |||
@@ -181,6 +181,28 @@ static inline void tlbiel(unsigned long va) | |||
181 | asm volatile("ptesync": : :"memory"); | 181 | asm volatile("ptesync": : :"memory"); |
182 | } | 182 | } |
183 | 183 | ||
184 | static inline unsigned long slot2va(unsigned long avpn, unsigned long large, | ||
185 | unsigned long secondary, unsigned long slot) | ||
186 | { | ||
187 | unsigned long va; | ||
188 | |||
189 | va = avpn << 23; | ||
190 | |||
191 | if (!large) { | ||
192 | unsigned long vpi, pteg; | ||
193 | |||
194 | pteg = slot / HPTES_PER_GROUP; | ||
195 | if (secondary) | ||
196 | pteg = ~pteg; | ||
197 | |||
198 | vpi = ((va >> 28) ^ pteg) & htab_hash_mask; | ||
199 | |||
200 | va |= vpi << PAGE_SHIFT; | ||
201 | } | ||
202 | |||
203 | return va; | ||
204 | } | ||
205 | |||
184 | /* | 206 | /* |
185 | * Handle a fault by adding an HPTE. If the address can't be determined | 207 | * Handle a fault by adding an HPTE. If the address can't be determined |
186 | * to be valid via Linux page tables, return 1. If handled return 0 | 208 | * to be valid via Linux page tables, return 1. If handled return 0 |