diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2009-02-05 14:31:16 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy@goop.org> | 2009-02-06 15:31:51 -0500 |
commit | 18a7a199f97a7509fb987722e543f1aac3d7ada5 (patch) | |
tree | 7b4d733899a124f543072932a023261383c634db /arch/x86/include/asm/page.h | |
parent | 6cf7150084500962b8e225e2409ec01ed06a2c71 (diff) |
x86: add and use pgd/pud/pmd_flags
Add pgd/pud/pmd_flags which are analogous to pte_flags, and use them
where-ever we only care about testing the flags portions of the
respective entries.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include/asm/page.h')
-rw-r--r-- | arch/x86/include/asm/page.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h index e9873a2e8695..0b16b64a8fe7 100644 --- a/arch/x86/include/asm/page.h +++ b/arch/x86/include/asm/page.h | |||
@@ -95,6 +95,11 @@ static inline pgdval_t native_pgd_val(pgd_t pgd) | |||
95 | return pgd.pgd; | 95 | return pgd.pgd; |
96 | } | 96 | } |
97 | 97 | ||
98 | static inline pgdval_t pgd_flags(pgd_t pgd) | ||
99 | { | ||
100 | return native_pgd_val(pgd) & PTE_FLAGS_MASK; | ||
101 | } | ||
102 | |||
98 | #if PAGETABLE_LEVELS >= 3 | 103 | #if PAGETABLE_LEVELS >= 3 |
99 | #if PAGETABLE_LEVELS == 4 | 104 | #if PAGETABLE_LEVELS == 4 |
100 | typedef struct { pudval_t pud; } pud_t; | 105 | typedef struct { pudval_t pud; } pud_t; |
@@ -117,6 +122,11 @@ static inline pudval_t native_pud_val(pud_t pud) | |||
117 | } | 122 | } |
118 | #endif /* PAGETABLE_LEVELS == 4 */ | 123 | #endif /* PAGETABLE_LEVELS == 4 */ |
119 | 124 | ||
125 | static inline pudval_t pud_flags(pud_t pud) | ||
126 | { | ||
127 | return native_pud_val(pud) & PTE_FLAGS_MASK; | ||
128 | } | ||
129 | |||
120 | typedef struct { pmdval_t pmd; } pmd_t; | 130 | typedef struct { pmdval_t pmd; } pmd_t; |
121 | 131 | ||
122 | static inline pmd_t native_make_pmd(pmdval_t val) | 132 | static inline pmd_t native_make_pmd(pmdval_t val) |
@@ -128,6 +138,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) | |||
128 | { | 138 | { |
129 | return pmd.pmd; | 139 | return pmd.pmd; |
130 | } | 140 | } |
141 | |||
142 | static inline pmdval_t pmd_flags(pmd_t pmd) | ||
143 | { | ||
144 | return native_pmd_val(pmd) & PTE_FLAGS_MASK; | ||
145 | } | ||
131 | #else /* PAGETABLE_LEVELS == 2 */ | 146 | #else /* PAGETABLE_LEVELS == 2 */ |
132 | #include <asm-generic/pgtable-nopmd.h> | 147 | #include <asm-generic/pgtable-nopmd.h> |
133 | 148 | ||