diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2009-02-05 14:31:02 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy@goop.org> | 2009-02-06 15:31:49 -0500 |
commit | 01ade20d5a22e6ef002cbb751dddc3a01a78f998 (patch) | |
tree | 28fefbc83299d5924bc3d9fd6d3448e014417762 | |
parent | e24d7eee0beda24504bf6a4aa03be68328557475 (diff) |
x86: unify pmd_offset
Impact: cleanup
Unify and demacro pmd_offset.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
-rw-r--r-- | arch/x86/include/asm/pgtable-3level.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable_64.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index 28ba09ac2308..7ad9d05710b1 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h | |||
@@ -115,10 +115,6 @@ static inline void pud_clear(pud_t *pudp) | |||
115 | write_cr3(pgd); | 115 | write_cr3(pgd); |
116 | } | 116 | } |
117 | 117 | ||
118 | /* Find an entry in the second-level page table.. */ | ||
119 | #define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) + \ | ||
120 | pmd_index(address)) | ||
121 | |||
122 | #ifdef CONFIG_SMP | 118 | #ifdef CONFIG_SMP |
123 | static inline pte_t native_ptep_get_and_clear(pte_t *ptep) | 119 | static inline pte_t native_ptep_get_and_clear(pte_t *ptep) |
124 | { | 120 | { |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 4ec24b6d0994..a7dbb05075d2 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -504,6 +504,12 @@ static inline struct page *pud_page(pud_t pud) | |||
504 | { | 504 | { |
505 | return pfn_to_page(pud_val(pud) >> PAGE_SHIFT); | 505 | return pfn_to_page(pud_val(pud) >> PAGE_SHIFT); |
506 | } | 506 | } |
507 | |||
508 | /* Find an entry in the second-level page table.. */ | ||
509 | static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) | ||
510 | { | ||
511 | return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address); | ||
512 | } | ||
507 | #endif /* PAGETABLE_LEVELS > 2 */ | 513 | #endif /* PAGETABLE_LEVELS > 2 */ |
508 | 514 | ||
509 | #if PAGETABLE_LEVELS > 3 | 515 | #if PAGETABLE_LEVELS > 3 |
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 15f42d6ee2fd..78269656cf01 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_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \ | ||
195 | pmd_index(address)) | ||
196 | #define pfn_pmd(nr, prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val((prot)))) | 194 | #define pfn_pmd(nr, prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val((prot)))) |
197 | #define pmd_pfn(x) ((pmd_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT) | 195 | #define pmd_pfn(x) ((pmd_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT) |
198 | 196 | ||