x86: define pud_flags and pud_large properly to allow non-PAE builds
authorJeremy Fitzhardinge <jeremy@goop.org>
Mon, 9 Feb 2009 08:09:52 +0000 (00:09 -0800)
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Wed, 11 Feb 2009 22:54:10 +0000 (14:54 -0800)
arch/x86/include/asm/page_types.h
arch/x86/include/asm/pgtable.h

index c41e3e8f22710dee8017fe2e09e4f1da19f775bc..0733853e7c87640ba189a91c54c9905138b7c3dd 100644 (file)
@@ -90,11 +90,6 @@ static inline pudval_t native_pud_val(pud_t pud)
 #if PAGETABLE_LEVELS > 2
 typedef struct { pmdval_t pmd; } pmd_t;
 
-static inline pudval_t pud_flags(pud_t pud)
-{
-       return native_pud_val(pud) & PTE_FLAGS_MASK;
-}
-
 static inline pmd_t native_make_pmd(pmdval_t val)
 {
        return (pmd_t) { val };
@@ -113,6 +108,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
 }
 #endif
 
+static inline pudval_t pud_flags(pud_t pud)
+{
+       return native_pud_val(pud) & PTE_FLAGS_MASK;
+}
+
 static inline pmdval_t pmd_flags(pmd_t pmd)
 {
        return native_pmd_val(pmd) & PTE_FLAGS_MASK;
index 10404e7bf32d560af7b227fea1e880a7000ab08f..9f508509797760dcb7920b6d07acfe6a2d999017 100644 (file)
@@ -398,7 +398,7 @@ static inline unsigned long pmd_pfn(pmd_t pmd)
 
 static inline int pud_large(pud_t pud)
 {
-       return (pud_flags(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
+       return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
                (_PAGE_PSE | _PAGE_PRESENT);
 }
 
@@ -406,6 +406,11 @@ static inline int pud_bad(pud_t pud)
 {
        return (pud_flags(pud) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0;
 }
+#else
+static inline int pud_large(pud_t pud)
+{
+       return 0;
+}
 #endif /* PAGETABLE_LEVELS > 2 */
 
 #if PAGETABLE_LEVELS > 3