diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/pgtable.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable_32.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable_64.h | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 3789c05bf30a..38330d6288fc 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -473,6 +473,11 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd) | |||
473 | return (unsigned long)__va(pmd_val(pmd) & PTE_PFN_MASK); | 473 | return (unsigned long)__va(pmd_val(pmd) & PTE_PFN_MASK); |
474 | } | 474 | } |
475 | 475 | ||
476 | static inline struct page *pmd_page(pmd_t pmd) | ||
477 | { | ||
478 | return pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT); | ||
479 | } | ||
480 | |||
476 | #if PAGETABLE_LEVELS > 2 | 481 | #if PAGETABLE_LEVELS > 2 |
477 | static inline int pud_present(pud_t pud) | 482 | static inline int pud_present(pud_t pud) |
478 | { | 483 | { |
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h index f7f7e297a0a0..8714110b4a78 100644 --- a/arch/x86/include/asm/pgtable_32.h +++ b/arch/x86/include/asm/pgtable_32.h | |||
@@ -124,8 +124,6 @@ static inline int pud_large(pud_t pud) { return 0; } | |||
124 | #define pte_offset_kernel(dir, address) \ | 124 | #define pte_offset_kernel(dir, address) \ |
125 | ((pte_t *)pmd_page_vaddr(*(dir)) + pte_index((address))) | 125 | ((pte_t *)pmd_page_vaddr(*(dir)) + pte_index((address))) |
126 | 126 | ||
127 | #define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT)) | ||
128 | |||
129 | #if defined(CONFIG_HIGHPTE) | 127 | #if defined(CONFIG_HIGHPTE) |
130 | #define pte_offset_map(dir, address) \ | 128 | #define pte_offset_map(dir, address) \ |
131 | ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \ | 129 | ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \ |
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 7a510e8a8787..97f24d2d60d1 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h | |||
@@ -191,8 +191,6 @@ static inline int pud_large(pud_t pte) | |||
191 | } | 191 | } |
192 | 192 | ||
193 | /* PMD - Level 2 access */ | 193 | /* PMD - Level 2 access */ |
194 | #define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT)) | ||
195 | |||
196 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) | 194 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) |
197 | #define pmd_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \ | 195 | #define pmd_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \ |
198 | pmd_index(address)) | 196 | pmd_index(address)) |