diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-01-30 07:32:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:57 -0500 |
commit | c8e5393ab38564d2f45b560a2f95bc8f9ff6f823 (patch) | |
tree | 2976d59bb412786712bddec0eedf82e1db58401d /include/xen | |
parent | b7fff536d0ad45c4810f9b99845c707ceadc3afc (diff) |
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 <jeremy@xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/xen')
-rw-r--r-- | include/xen/page.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/xen/page.h b/include/xen/page.h index c0c8fcb2789..031ef22a971 100644 --- a/include/xen/page.h +++ b/include/xen/page.h | |||
@@ -156,16 +156,16 @@ static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot) | |||
156 | 156 | ||
157 | static inline unsigned long long pte_val_ma(pte_t x) | 157 | static inline unsigned long long pte_val_ma(pte_t x) |
158 | { | 158 | { |
159 | return ((unsigned long long)x.pte_high << 32) | x.pte_low; | 159 | return x.pte; |
160 | } | 160 | } |
161 | #define pmd_val_ma(v) ((v).pmd) | 161 | #define pmd_val_ma(v) ((v).pmd) |
162 | #define pud_val_ma(v) ((v).pgd.pgd) | 162 | #define pud_val_ma(v) ((v).pgd.pgd) |
163 | #define __pte_ma(x) ((pte_t) { .pte_low = (x), .pte_high = (x)>>32 } ) | 163 | #define __pte_ma(x) ((pte_t) { .pte = (x) }) |
164 | #define __pmd_ma(x) ((pmd_t) { (x) } ) | 164 | #define __pmd_ma(x) ((pmd_t) { (x) } ) |
165 | #else /* !X86_PAE */ | 165 | #else /* !X86_PAE */ |
166 | #define pte_mfn(_pte) ((_pte).pte_low >> PAGE_SHIFT) | 166 | #define pte_mfn(_pte) ((_pte).pte_low >> PAGE_SHIFT) |
167 | #define mfn_pte(pfn, prot) __pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | 167 | #define mfn_pte(pfn, prot) __pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) |
168 | #define pte_val_ma(x) ((x).pte_low) | 168 | #define pte_val_ma(x) ((x).pte) |
169 | #define pmd_val_ma(v) ((v).pud.pgd.pgd) | 169 | #define pmd_val_ma(v) ((v).pud.pgd.pgd) |
170 | #define __pte_ma(x) ((pte_t) { (x) } ) | 170 | #define __pte_ma(x) ((pte_t) { (x) } ) |
171 | #endif /* CONFIG_X86_PAE */ | 171 | #endif /* CONFIG_X86_PAE */ |