From c8e5393ab38564d2f45b560a2f95bc8f9ff6f823 Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Wed, 30 Jan 2008 13:32:57 +0100 Subject: x86: page.h: make pte_t a union to always include Make sure pte_t, whatever its definition, has a pte element with type pteval_t. This allows common code to access it without needing to be specifically parameterised on what pagetable mode we're compiling for. For 32-bit, this means that pte_t becomes a union with "pte" and "{ pte_low, pte_high }" (PAE) or just "pte_low" (non-PAE). Signed-off-by: Jeremy Fitzhardinge Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/page.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/asm-x86/page.h') diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h index 91920565a575..a6495eb5c605 100644 --- a/include/asm-x86/page.h +++ b/include/asm-x86/page.h @@ -108,6 +108,16 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) #include #endif /* PAGETABLE_LEVELS >= 3 */ +static inline pte_t native_make_pte(pteval_t val) +{ + return (pte_t) { .pte = val }; +} + +static inline pteval_t native_pte_val(pte_t pte) +{ + return pte.pte; +} + #define pgprot_val(x) ((x).pgprot) #define __pgprot(x) ((pgprot_t) { (x) } ) -- cgit v1.2.3