Commit 97e2817d authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge

x86: unify pmd_pfn

Impact: cleanup

Unify pmd_pfn.  Unfortunately it can't be demacroed because it has a
cyclic dependency on linux/mm.h:page_to_nid().
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
parent 3180fba0
...@@ -489,6 +489,15 @@ static inline unsigned pmd_index(unsigned long address) ...@@ -489,6 +489,15 @@ static inline unsigned pmd_index(unsigned long address)
return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
} }
/*
* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.
*
* (Currently stuck as a macro because of indirect forward reference
* to linux/mm.h:page_to_nid())
*/
#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
#if PAGETABLE_LEVELS > 2 #if PAGETABLE_LEVELS > 2
static inline int pud_present(pud_t pud) static inline int pud_present(pud_t pud)
{ {
......
...@@ -95,13 +95,6 @@ extern unsigned long pg0[]; ...@@ -95,13 +95,6 @@ extern unsigned long pg0[];
# include <asm/pgtable-2level.h> # include <asm/pgtable-2level.h>
#endif #endif
/*
* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.
*/
#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
static inline int pud_large(pud_t pud) { return 0; } static inline int pud_large(pud_t pud) { return 0; }
/* /*
......
...@@ -198,9 +198,6 @@ static inline int pud_large(pud_t pte) ...@@ -198,9 +198,6 @@ static inline int pud_large(pud_t pte)
/* PTE - Level 1 access. */ /* PTE - Level 1 access. */
/* page, protection -> pte */
#define mk_pte(page, pgprot) pfn_pte(page_to_pfn((page)), (pgprot))
#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) #define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_vaddr(*(dir)) + \ #define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_vaddr(*(dir)) + \
pte_index((address))) pte_index((address)))
......
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