x86: unify pud_index
authorJeremy Fitzhardinge <jeremy@goop.org>
Thu, 5 Feb 2009 19:30:57 +0000 (11:30 -0800)
committerJeremy Fitzhardinge <jeremy@goop.org>
Fri, 6 Feb 2009 20:31:48 +0000 (12:31 -0800)
Impact: cleanup

Unify and demacro pud_index.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
arch/x86/include/asm/pgtable.h
arch/x86/include/asm/pgtable_64.h

index c1a36dd1e598c12dbcd95bdcbe08afe7beab025a..a51a97ade6367f7a65efd15d0db95ef9a626a1cf 100644 (file)
@@ -500,6 +500,12 @@ static inline struct page *pgd_page(pgd_t pgd)
 {
        return pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT);
 }
+
+/* to find an entry in a page-table-directory. */
+static inline unsigned pud_index(unsigned long address)
+{
+       return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
+}
 #endif /* PAGETABLE_LEVELS > 3 */
 
 #endif /* __ASSEMBLY__ */
index 02477ad40fcd05002576e909b5ebaae4f23838de..c17c30f5751ad6504e9a9a44553ed765a6e3fe69 100644 (file)
@@ -183,8 +183,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
 #define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE)
 
 /* PUD - Level3 access */
-/* to find an entry in a page-table-directory. */
-#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
 #define pud_offset(pgd, address)                                       \
        ((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address)))