summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/pgtable.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-05 22:30:57 +0300
committerJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 23:31:48 +0300
commit7cfb81024bc1dbe8ad2bf5affd58a6a7ad4172ba (patch)
treec223fd9057d3ec87b4990f94e4d04bb0e97c0134 /arch/x86/include/asm/pgtable.h
parent777cba16aac5a1096db0b936912eb7fd06fb0cc5 (diff)
downloadlinux-7cfb81024bc1dbe8ad2bf5affd58a6a7ad4172ba.tar.xz
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/pgtable.h')
-rw-r--r--arch/x86/include/asm/pgtable.h6
1 files changed, 6 insertions, 0 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)
{
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__ */