diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-07-22 01:59:56 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-22 04:43:45 -0400 |
commit | 77be1fabd024b37423d12f832b1fbdb95dbdf494 (patch) | |
tree | b1fa99ff9b1c0bcb63c7a602a425d72b24c1ede6 /include/asm-x86 | |
parent | 59438c9fc4f7a92c808c9049bc6b396f98bf954c (diff) |
x86: add PTE_FLAGS_MASK
PTE_PFN_MASK was getting lonely, so I made it a friend.
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/page.h | 5 | ||||
-rw-r--r-- | include/asm-x86/pgtable.h | 2 | ||||
-rw-r--r-- | include/asm-x86/pgtable_32.h | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h index e99fb9fe6f8a..6c846228948d 100644 --- a/include/asm-x86/page.h +++ b/include/asm-x86/page.h | |||
@@ -21,6 +21,9 @@ | |||
21 | /* PTE_PFN_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */ | 21 | /* PTE_PFN_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */ |
22 | #define PTE_PFN_MASK ((pteval_t)PHYSICAL_PAGE_MASK) | 22 | #define PTE_PFN_MASK ((pteval_t)PHYSICAL_PAGE_MASK) |
23 | 23 | ||
24 | /* PTE_FLAGS_MASK extracts the flags from a (pte|pmd|pud|pgd)val_t */ | ||
25 | #define PTE_FLAGS_MASK (~PTE_PFN_MASK) | ||
26 | |||
24 | #define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT) | 27 | #define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT) |
25 | #define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1)) | 28 | #define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1)) |
26 | 29 | ||
@@ -146,7 +149,7 @@ static inline pteval_t native_pte_val(pte_t pte) | |||
146 | 149 | ||
147 | static inline pteval_t native_pte_flags(pte_t pte) | 150 | static inline pteval_t native_pte_flags(pte_t pte) |
148 | { | 151 | { |
149 | return native_pte_val(pte) & ~PTE_PFN_MASK; | 152 | return native_pte_val(pte) & PTE_FLAGS_MASK; |
150 | } | 153 | } |
151 | 154 | ||
152 | #define pgprot_val(x) ((x).pgprot) | 155 | #define pgprot_val(x) ((x).pgprot) |
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index 2b1746c92370..3e5dbc4195f4 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h | |||
@@ -286,7 +286,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | |||
286 | return __pgprot(preservebits | addbits); | 286 | return __pgprot(preservebits | addbits); |
287 | } | 287 | } |
288 | 288 | ||
289 | #define pte_pgprot(x) __pgprot(pte_flags(x) & ~PTE_PFN_MASK) | 289 | #define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK) |
290 | 290 | ||
291 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) | 291 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) |
292 | 292 | ||
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h index 525b53e65b44..5c3b26567a95 100644 --- a/include/asm-x86/pgtable_32.h +++ b/include/asm-x86/pgtable_32.h | |||
@@ -88,7 +88,7 @@ extern unsigned long pg0[]; | |||
88 | /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ | 88 | /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ |
89 | #define pmd_none(x) (!(unsigned long)pmd_val((x))) | 89 | #define pmd_none(x) (!(unsigned long)pmd_val((x))) |
90 | #define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT) | 90 | #define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT) |
91 | #define pmd_bad(x) ((pmd_val(x) & (~PTE_PFN_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) | 91 | #define pmd_bad(x) ((pmd_val(x) & (PTE_FLAGS_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) |
92 | 92 | ||
93 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) | 93 | #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) |
94 | 94 | ||