diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2012-09-09 22:52:50 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-17 02:31:49 -0400 |
commit | 5524a27d39b68770f203d8d42eb5a95dde4933bc (patch) | |
tree | a238d67d29bce6fd893cd4c5545b5daf058ba5fd /arch/powerpc/include/asm/pte-hash64-64k.h | |
parent | dcda287a9b26309ae43a091d0ecde16f8f61b4c0 (diff) |
powerpc/mm: Convert virtual address to vpn
This patch convert different functions to take virtual page number
instead of virtual address. Virtual page number is virtual address
shifted right by VPN_SHIFT (12) bits. This enable us to have an
address range of upto 76 bits.
Reviewed-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/pte-hash64-64k.h')
-rw-r--r-- | arch/powerpc/include/asm/pte-hash64-64k.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/powerpc/include/asm/pte-hash64-64k.h b/arch/powerpc/include/asm/pte-hash64-64k.h index 59247e816ac5..eedf427c9124 100644 --- a/arch/powerpc/include/asm/pte-hash64-64k.h +++ b/arch/powerpc/include/asm/pte-hash64-64k.h | |||
@@ -58,14 +58,16 @@ | |||
58 | /* Trick: we set __end to va + 64k, which happens works for | 58 | /* Trick: we set __end to va + 64k, which happens works for |
59 | * a 16M page as well as we want only one iteration | 59 | * a 16M page as well as we want only one iteration |
60 | */ | 60 | */ |
61 | #define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \ | 61 | #define pte_iterate_hashed_subpages(rpte, psize, vpn, index, shift) \ |
62 | do { \ | 62 | do { \ |
63 | unsigned long __end = va + PAGE_SIZE; \ | 63 | unsigned long __end = vpn + (1UL << (PAGE_SHIFT - VPN_SHIFT)); \ |
64 | unsigned __split = (psize == MMU_PAGE_4K || \ | 64 | unsigned __split = (psize == MMU_PAGE_4K || \ |
65 | psize == MMU_PAGE_64K_AP); \ | 65 | psize == MMU_PAGE_64K_AP); \ |
66 | shift = mmu_psize_defs[psize].shift; \ | 66 | shift = mmu_psize_defs[psize].shift; \ |
67 | for (index = 0; va < __end; index++, va += (1L << shift)) { \ | 67 | for (index = 0; vpn < __end; index++, \ |
68 | if (!__split || __rpte_sub_valid(rpte, index)) do { \ | 68 | vpn += (1L << (shift - VPN_SHIFT))) { \ |
69 | if (!__split || __rpte_sub_valid(rpte, index)) \ | ||
70 | do { | ||
69 | 71 | ||
70 | #define pte_iterate_hashed_end() } while(0); } } while(0) | 72 | #define pte_iterate_hashed_end() } while(0); } } while(0) |
71 | 73 | ||