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

Unify and demacro pud_present.

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

index 51832fa0474310f03bea04910a02b50649cf1610..524bd91b99522a737aba68d76447f83840bceea6 100644 (file)
@@ -28,11 +28,6 @@ static inline int pud_bad(pud_t pud)
        return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0;
 }
 
-static inline int pud_present(pud_t pud)
-{
-       return pud_val(pud) & _PAGE_PRESENT;
-}
-
 /* Rules for using set_pte: the pte being assigned *must* be
  * either not present or in a state where the hardware will
  * not attempt to update the pte.  In places where this is
index 17fcc17d6b4f2a6d895a7d0decf2ca30eb44439c..c117b28df1512c210e26057b1a7ef3d92fc9d269 100644 (file)
@@ -445,6 +445,13 @@ static inline int pte_present(pte_t a)
        return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE);
 }
 
+#if PAGETABLE_LEVELS > 2
+static inline int pud_present(pud_t pud)
+{
+       return pud_val(pud) & _PAGE_PRESENT;
+}
+#endif /* PAGETABLE_LEVELS > 2 */
+
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_X86_32
index 35b8dbc068e0ea37896883c28791cbbde7850cac..acdc27b202c88b659b539af45a372cbc13ae1d66 100644 (file)
@@ -194,7 +194,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
 #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)))
-#define pud_present(pud) (pud_val((pud)) & _PAGE_PRESENT)
 
 static inline int pud_large(pud_t pte)
 {