[PATCH] x86, pgtable.h: fix 2-level 32-bit build

From: Ingo Molnar
Date: Mon Feb 09 2009 - 05:57:45 EST


- pmd_flags() needs to be available on 2-levels too
- provide pud_large() wrapper as well
- include page.h - it provides basic types relied on by pgtable.h

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
arch/x86/include/asm/page.h | 9 +++++----
arch/x86/include/asm/pgtable.h | 9 +++++++++
2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index 0b16b64..823cc93 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -139,10 +139,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
return pmd.pmd;
}

-static inline pmdval_t pmd_flags(pmd_t pmd)
-{
- return native_pmd_val(pmd) & PTE_FLAGS_MASK;
-}
#else /* PAGETABLE_LEVELS == 2 */
#include <asm-generic/pgtable-nopmd.h>

@@ -152,6 +148,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
}
#endif /* PAGETABLE_LEVELS >= 3 */

+static inline pmdval_t pmd_flags(pmd_t pmd)
+{
+ return native_pmd_val(pmd) & PTE_FLAGS_MASK;
+}
+
static inline pte_t native_make_pte(pteval_t val)
{
return (pte_t) { .pte = val };
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 76696e9..1782053 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1,6 +1,8 @@
#ifndef _ASM_X86_PGTABLE_H
#define _ASM_X86_PGTABLE_H

+#include <asm/page.h>
+
#define FIRST_USER_ADDRESS 0

#define _PAGE_BIT_PRESENT 0 /* is present */
@@ -528,6 +530,13 @@ static inline unsigned long pages_to_mb(unsigned long npg)
#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
remap_pfn_range(vma, vaddr, pfn, size, prot)

+#if PAGETABLE_LEVELS == 2
+static inline int pud_large(pud_t pud)
+{
+ return 0;
+}
+#endif
+
#if PAGETABLE_LEVELS > 2
static inline int pud_none(pud_t pud)
{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/