diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-01-30 07:32:43 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:43 -0500 |
commit | 881d90d0daaeac018b0d5beb739dd825ccee0143 (patch) | |
tree | c2b2b24032d503938110d83e7d143bf2b980b455 /include/asm-x86/page_32.h | |
parent | 38f0f12793a490ac633dbba2418172b7abfa077e (diff) |
x86: page.h: move and unify types for pagetable entry
# HG changeset patch
# User Jeremy Fitzhardinge <jeremy@xensource.com>
# Date 1199319654 28800
# Node ID 3bd7db6e85e66e7f3362874802df26a82fcb2d92
# Parent f7e7db3facd9406545103164f9be8f9ba1a2b549
x86: page.h: move and unify types for pagetable entry definitions
This patch:
1. Defines arch-specific types for the contents of a pagetable entry.
That is, 32-bit entries for 32-bit non-PAE, and 64-bit entries for
32-bit PAE and 64-bit. However, even though the latter two are the
same size, they're defined with different types in order to retain
compatibility with printk format strings, etc.
2. Defines arch-specific pte_t. This is different because 32-bit PAE
defines it in two halves, whereas 32-bit PAE and 64-bit define it as a
single entry. All the other pagetable levels can be defined in a
common way. This also defines arch-specific pte_val/make_pte functions.
3. Define PAGETABLE_LEVELS for each architecture variation, for later use.
4. Define common pagetable entry accessors in a paravirt-compatible
way. (64-bit does not yet use paravirt-ops in any way).
5. Convert a few instances of using a *_val() as an lvalue where it is
no longer a macro. There are still places in the 64-bit code which
use pte_val() as an lvalue.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/page_32.h')
-rw-r--r-- | include/asm-x86/page_32.h | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h index b4750ef44920..2d60661ab340 100644 --- a/include/asm-x86/page_32.h +++ b/include/asm-x86/page_32.h | |||
@@ -9,89 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | extern int nx_enabled; | 10 | extern int nx_enabled; |
11 | 11 | ||
12 | #ifdef CONFIG_X86_PAE | ||
13 | typedef struct { unsigned long pte_low, pte_high; } pte_t; | ||
14 | typedef struct { unsigned long long pmd; } pmd_t; | ||
15 | typedef struct { unsigned long long pgd; } pgd_t; | ||
16 | typedef struct { unsigned long long pgprot; } pgprot_t; | ||
17 | |||
18 | static inline unsigned long long native_pgd_val(pgd_t pgd) | ||
19 | { | ||
20 | return pgd.pgd; | ||
21 | } | ||
22 | |||
23 | static inline unsigned long long native_pmd_val(pmd_t pmd) | ||
24 | { | ||
25 | return pmd.pmd; | ||
26 | } | ||
27 | |||
28 | static inline unsigned long long native_pte_val(pte_t pte) | ||
29 | { | ||
30 | return pte.pte_low | ((unsigned long long)pte.pte_high << 32); | ||
31 | } | ||
32 | |||
33 | static inline pgd_t native_make_pgd(unsigned long long val) | ||
34 | { | ||
35 | return (pgd_t) { val }; | ||
36 | } | ||
37 | |||
38 | static inline pmd_t native_make_pmd(unsigned long long val) | ||
39 | { | ||
40 | return (pmd_t) { val }; | ||
41 | } | ||
42 | |||
43 | static inline pte_t native_make_pte(unsigned long long val) | ||
44 | { | ||
45 | return (pte_t) { .pte_low = val, .pte_high = (val >> 32) } ; | ||
46 | } | ||
47 | |||
48 | #ifndef CONFIG_PARAVIRT | ||
49 | #define pmd_val(x) native_pmd_val(x) | ||
50 | #define __pmd(x) native_make_pmd(x) | ||
51 | #endif | ||
52 | |||
53 | #include <asm-generic/pgtable-nopud.h> | ||
54 | #else /* !CONFIG_X86_PAE */ | ||
55 | typedef struct { unsigned long pte_low; } pte_t; | ||
56 | typedef struct { unsigned long pgd; } pgd_t; | ||
57 | typedef struct { unsigned long pgprot; } pgprot_t; | ||
58 | #define boot_pte_t pte_t /* or would you rather have a typedef */ | ||
59 | |||
60 | static inline unsigned long native_pgd_val(pgd_t pgd) | ||
61 | { | ||
62 | return pgd.pgd; | ||
63 | } | ||
64 | |||
65 | static inline unsigned long native_pte_val(pte_t pte) | ||
66 | { | ||
67 | return pte.pte_low; | ||
68 | } | ||
69 | |||
70 | static inline pgd_t native_make_pgd(unsigned long val) | ||
71 | { | ||
72 | return (pgd_t) { val }; | ||
73 | } | ||
74 | |||
75 | static inline pte_t native_make_pte(unsigned long val) | ||
76 | { | ||
77 | return (pte_t) { .pte_low = val }; | ||
78 | } | ||
79 | |||
80 | #include <asm-generic/pgtable-nopmd.h> | ||
81 | #endif /* CONFIG_X86_PAE */ | ||
82 | |||
83 | #define PTE_MASK PAGE_MASK | ||
84 | |||
85 | #define pgprot_val(x) ((x).pgprot) | ||
86 | #define __pgprot(x) ((pgprot_t) { (x) } ) | ||
87 | |||
88 | #ifndef CONFIG_PARAVIRT | ||
89 | #define pgd_val(x) native_pgd_val(x) | ||
90 | #define __pgd(x) native_make_pgd(x) | ||
91 | #define pte_val(x) native_pte_val(x) | ||
92 | #define __pte(x) native_make_pte(x) | ||
93 | #endif | ||
94 | |||
95 | #endif /* !__ASSEMBLY__ */ | 12 | #endif /* !__ASSEMBLY__ */ |
96 | 13 | ||
97 | #ifndef __ASSEMBLY__ | 14 | #ifndef __ASSEMBLY__ |