]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: unify pmd_none
authorJeremy Fitzhardinge <jeremy@goop.org>
Thu, 5 Feb 2009 19:30:51 +0000 (11:30 -0800)
committerJeremy Fitzhardinge <jeremy@goop.org>
Fri, 6 Feb 2009 20:31:48 +0000 (12:31 -0800)
Impact: cleanup

Unify and demacro pmd_none.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
arch/x86/include/asm/pgtable.h
arch/x86/include/asm/pgtable_32.h
arch/x86/include/asm/pgtable_64.h

index 147d3f097ab044ed86ededb7e02e1d299ae348c9..2f38bbee77e7e8b0cc4647711ea1f9c354c030a4 100644 (file)
@@ -450,6 +450,13 @@ static inline int pmd_present(pmd_t pmd)
        return pmd_val(pmd) & _PAGE_PRESENT;
 }
 
+static inline int pmd_none(pmd_t pmd)
+{
+       /* Only check low word on 32-bit platforms, since it might be
+          out of sync with upper half. */
+       return !(unsigned long)native_pmd_val(pmd);
+}
+
 #if PAGETABLE_LEVELS > 2
 static inline int pud_present(pud_t pud)
 {
index f35160730b65ba627c513f4895925b1a554ce196..26e73569223ca2b211b401d0f5a1a2b464774bce 100644 (file)
@@ -85,8 +85,6 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
 /* The boot page tables (all created as a single array) */
 extern unsigned long pg0[];
 
-/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
-#define pmd_none(x)    (!(unsigned long)pmd_val((x)))
 #define pmd_bad(x) ((pmd_val(x) & (PTE_FLAGS_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
 
 #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
index 471b3058f3d7a0b8f65c0721fa4fe9bfb02833d1..f3ad894332469525482ef7a9784504bd045fff3a 100644 (file)
@@ -207,7 +207,6 @@ static inline int pud_large(pud_t pte)
 #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
 #define pmd_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \
                                  pmd_index(address))
-#define pmd_none(x)    (!pmd_val((x)))
 #define pfn_pmd(nr, prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val((prot))))
 #define pmd_pfn(x)  ((pmd_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT)