aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-05 14:30:50 -0500
committerJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 15:31:47 -0500
commit649e8ef60fac0a2f6960cdb090d73e78717ac065 (patch)
tree011b0ccd37851a13add701d87cfb74074e8df1b0
parent9f38d7e85e914f10a875f65d283432d55a12fc27 (diff)
x86: unify pmd_present
Impact: cleanup Unify and demacro pmd_present. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
-rw-r--r--arch/x86/include/asm/pgtable.h5
-rw-r--r--arch/x86/include/asm/pgtable_32.h1
-rw-r--r--arch/x86/include/asm/pgtable_64.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 339e49a9bb6..147d3f097ab 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -445,6 +445,11 @@ static inline int pte_present(pte_t a)
445 return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE); 445 return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE);
446} 446}
447 447
448static inline int pmd_present(pmd_t pmd)
449{
450 return pmd_val(pmd) & _PAGE_PRESENT;
451}
452
448#if PAGETABLE_LEVELS > 2 453#if PAGETABLE_LEVELS > 2
449static inline int pud_present(pud_t pud) 454static inline int pud_present(pud_t pud)
450{ 455{
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
index 188073713fe..f35160730b6 100644
--- a/arch/x86/include/asm/pgtable_32.h
+++ b/arch/x86/include/asm/pgtable_32.h
@@ -87,7 +87,6 @@ extern unsigned long pg0[];
87 87
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)
91#define pmd_bad(x) ((pmd_val(x) & (PTE_FLAGS_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) 90#define pmd_bad(x) ((pmd_val(x) & (PTE_FLAGS_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
92 91
93#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) 92#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 447634698f5..471b3058f3d 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -208,7 +208,6 @@ static inline int pud_large(pud_t pte)
208#define pmd_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \ 208#define pmd_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \
209 pmd_index(address)) 209 pmd_index(address))
210#define pmd_none(x) (!pmd_val((x))) 210#define pmd_none(x) (!pmd_val((x)))
211#define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT)
212#define pfn_pmd(nr, prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val((prot)))) 211#define pfn_pmd(nr, prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val((prot))))
213#define pmd_pfn(x) ((pmd_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT) 212#define pmd_pfn(x) ((pmd_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT)
214 213