diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2009-02-05 14:30:57 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy@goop.org> | 2009-02-06 15:31:48 -0500 |
commit | 7cfb81024bc1dbe8ad2bf5affd58a6a7ad4172ba (patch) | |
tree | c223fd9057d3ec87b4990f94e4d04bb0e97c0134 /arch/x86/include/asm | |
parent | 777cba16aac5a1096db0b936912eb7fd06fb0cc5 (diff) |
x86: unify pud_index
Impact: cleanup
Unify and demacro pud_index.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/pgtable.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable_64.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index c1a36dd1e598..a51a97ade636 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -500,6 +500,12 @@ static inline struct page *pgd_page(pgd_t pgd) | |||
500 | { | 500 | { |
501 | return pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT); | 501 | return pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT); |
502 | } | 502 | } |
503 | |||
504 | /* to find an entry in a page-table-directory. */ | ||
505 | static inline unsigned pud_index(unsigned long address) | ||
506 | { | ||
507 | return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1); | ||
508 | } | ||
503 | #endif /* PAGETABLE_LEVELS > 3 */ | 509 | #endif /* PAGETABLE_LEVELS > 3 */ |
504 | 510 | ||
505 | #endif /* __ASSEMBLY__ */ | 511 | #endif /* __ASSEMBLY__ */ |
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 02477ad40fcd..c17c30f5751a 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h | |||
@@ -183,8 +183,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; } | |||
183 | #define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE) | 183 | #define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE) |
184 | 184 | ||
185 | /* PUD - Level3 access */ | 185 | /* PUD - Level3 access */ |
186 | /* to find an entry in a page-table-directory. */ | ||
187 | #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)) | ||
188 | #define pud_offset(pgd, address) \ | 186 | #define pud_offset(pgd, address) \ |
189 | ((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address))) | 187 | ((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address))) |
190 | 188 | ||