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

Unify and demacro pte_present.

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

index e929d43753c5bb26f48c99c4022a7466a371b547..17fcc17d6b4f2a6d895a7d0decf2ca30eb44439c 100644 (file)
@@ -440,6 +440,11 @@ static inline int pte_same(pte_t a, pte_t b)
        return a.pte == b.pte;
 }
 
+static inline int pte_present(pte_t a)
+{
+       return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE);
+}
+
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_X86_32
index 72b020deb46b9352a5365410b2011e55b4c56021..188073713fed881414288a677aa5b011af3ccfeb 100644 (file)
@@ -85,8 +85,6 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
 /* The boot page tables (all created as a single array) */
 extern unsigned long pg0[];
 
-#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
-
 /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
 #define pmd_none(x)    (!(unsigned long)pmd_val((x)))
 #define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT)
index ff2571865bf714d930b7c034261413348ee9c30d..35b8dbc068e0ea37896883c28791cbbde7850cac 100644 (file)
@@ -169,8 +169,6 @@ static inline int pmd_bad(pmd_t pmd)
        return (pmd_val(pmd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE;
 }
 
-#define pte_present(x) (pte_val((x)) & (_PAGE_PRESENT | _PAGE_PROTNONE))
-
 #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT))   /* FIXME: is this right? */
 
 /*