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

Unify and demacro pmd_offset.

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

index 28ba09ac23083f91c96c8a87e81436958c187013..7ad9d05710b145f9bed008b93e0cadcefe14f96d 100644 (file)
@@ -115,10 +115,6 @@ static inline void pud_clear(pud_t *pudp)
                write_cr3(pgd);
 }
 
-/* Find an entry in the second-level page table.. */
-#define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) +    \
-                                 pmd_index(address))
-
 #ifdef CONFIG_SMP
 static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
 {
index 4ec24b6d0994a8f73c6a8c930796e8fd95e5ee74..a7dbb05075d2779d733399c0732883d73add5426 100644 (file)
@@ -504,6 +504,12 @@ static inline struct page *pud_page(pud_t pud)
 {
        return pfn_to_page(pud_val(pud) >> PAGE_SHIFT);
 }
+
+/* Find an entry in the second-level page table.. */
+static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
+{
+       return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
+}
 #endif /* PAGETABLE_LEVELS > 2 */
 
 #if PAGETABLE_LEVELS > 3
index 15f42d6ee2fdca1339d4c78cc00508cf625b8d20..78269656cf018852666ec46aa05669fb9744f4b1 100644 (file)
@@ -191,8 +191,6 @@ static inline int pud_large(pud_t pte)
 }
 
 /* PMD  - Level 2 access */
-#define pmd_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \
-                                 pmd_index(address))
 #define pfn_pmd(nr, prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val((prot))))
 #define pmd_pfn(x)  ((pmd_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT)