aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86_64/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86_64/pgtable.h')
-rw-r--r--include/asm-x86_64/pgtable.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index a31ab4e68a9b..51eba2395171 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -101,9 +101,6 @@ static inline void pgd_clear (pgd_t * pgd)
101 set_pgd(pgd, __pgd(0)); 101 set_pgd(pgd, __pgd(0));
102} 102}
103 103
104#define pud_page(pud) \
105((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK))
106
107#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0)) 104#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0))
108 105
109struct mm_struct; 106struct mm_struct;
@@ -326,7 +323,8 @@ static inline int pmd_large(pmd_t pte) {
326/* 323/*
327 * Level 4 access. 324 * Level 4 access.
328 */ 325 */
329#define pgd_page(pgd) ((unsigned long) __va((unsigned long)pgd_val(pgd) & PTE_MASK)) 326#define pgd_page_vaddr(pgd) ((unsigned long) __va((unsigned long)pgd_val(pgd) & PTE_MASK))
327#define pgd_page(pgd) (pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT))
330#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 328#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
331#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr)) 329#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
332#define pgd_offset_k(address) (init_level4_pgt + pgd_index(address)) 330#define pgd_offset_k(address) (init_level4_pgt + pgd_index(address))
@@ -335,16 +333,18 @@ static inline int pmd_large(pmd_t pte) {
335 333
336/* PUD - Level3 access */ 334/* PUD - Level3 access */
337/* to find an entry in a page-table-directory. */ 335/* to find an entry in a page-table-directory. */
336#define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK))
337#define pud_page(pud) (pfn_to_page(pud_val(pud) >> PAGE_SHIFT))
338#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) 338#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
339#define pud_offset(pgd, address) ((pud_t *) pgd_page(*(pgd)) + pud_index(address)) 339#define pud_offset(pgd, address) ((pud_t *) pgd_page_vaddr(*(pgd)) + pud_index(address))
340#define pud_present(pud) (pud_val(pud) & _PAGE_PRESENT) 340#define pud_present(pud) (pud_val(pud) & _PAGE_PRESENT)
341 341
342/* PMD - Level 2 access */ 342/* PMD - Level 2 access */
343#define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK)) 343#define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK))
344#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) 344#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
345 345
346#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) 346#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
347#define pmd_offset(dir, address) ((pmd_t *) pud_page(*(dir)) + \ 347#define pmd_offset(dir, address) ((pmd_t *) pud_page_vaddr(*(dir)) + \
348 pmd_index(address)) 348 pmd_index(address))
349#define pmd_none(x) (!pmd_val(x)) 349#define pmd_none(x) (!pmd_val(x))
350#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) 350#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
@@ -382,7 +382,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
382 382
383#define pte_index(address) \ 383#define pte_index(address) \
384 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) 384 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
385#define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_kernel(*(dir)) + \ 385#define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_vaddr(*(dir)) + \
386 pte_index(address)) 386 pte_index(address))
387 387
388/* x86-64 always has all page tables mapped. */ 388/* x86-64 always has all page tables mapped. */