Commit 3180fba0 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge

x86: unify pmd_pfn

Impact: cleanup

Unify and demacro pmd_pfn.
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
parent bd44d64d
...@@ -510,6 +510,11 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) ...@@ -510,6 +510,11 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
{ {
return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address); return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
} }
static inline unsigned long pmd_pfn(pmd_t pmd)
{
return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
}
#endif /* PAGETABLE_LEVELS > 2 */ #endif /* PAGETABLE_LEVELS > 2 */
#if PAGETABLE_LEVELS > 3 #if PAGETABLE_LEVELS > 3
......
...@@ -191,8 +191,6 @@ static inline int pud_large(pud_t pte) ...@@ -191,8 +191,6 @@ static inline int pud_large(pud_t pte)
} }
/* PMD - Level 2 access */ /* PMD - Level 2 access */
#define pmd_pfn(x) ((pmd_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT)
#define pte_to_pgoff(pte) ((pte_val((pte)) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT) #define pte_to_pgoff(pte) ((pte_val((pte)) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT)
#define pgoff_to_pte(off) ((pte_t) { .pte = ((off) << PAGE_SHIFT) | \ #define pgoff_to_pte(off) ((pte_t) { .pte = ((off) << PAGE_SHIFT) | \
_PAGE_FILE }) _PAGE_FILE })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment