aboutsummaryrefslogtreecommitdiff
path: root/include/asm-x86/page.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-07-21 22:59:56 -0700
committerIngo Molnar <mingo@elte.hu>2008-07-22 10:43:45 +0200
commit77be1fabd024b37423d12f832b1fbdb95dbdf494 (patch)
treeb1fa99ff9b1c0bcb63c7a602a425d72b24c1ede6 /include/asm-x86/page.h
parent59438c9fc4f7a92c808c9049bc6b396f98bf954c (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/page.h')
-rw-r--r--include/asm-x86/page.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h
index e99fb9fe6f8..6c846228948 100644
--- a/include/asm-x86/page.h
+++ b/include/asm-x86/page.h
@@ -21,6 +21,9 @@
/* PTE_PFN_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */
#define PTE_PFN_MASK ((pteval_t)PHYSICAL_PAGE_MASK)
+/* PTE_FLAGS_MASK extracts the flags from a (pte|pmd|pud|pgd)val_t */
+#define PTE_FLAGS_MASK (~PTE_PFN_MASK)
+
#define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT)
#define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1))
@@ -146,7 +149,7 @@ static inline pteval_t native_pte_val(pte_t pte)
static inline pteval_t native_pte_flags(pte_t pte)
{
- return native_pte_val(pte) & ~PTE_PFN_MASK;
+ return native_pte_val(pte) & PTE_FLAGS_MASK;
}
#define pgprot_val(x) ((x).pgprot)