diff options
Diffstat (limited to 'arch/x86/include/asm/pgtable.h')
| -rw-r--r-- | arch/x86/include/asm/pgtable.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 16748077559a..4c5b51fdc788 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
| @@ -135,6 +135,11 @@ static inline unsigned long pte_pfn(pte_t pte) | |||
| 135 | return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT; | 135 | return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | static inline unsigned long pmd_pfn(pmd_t pmd) | ||
| 139 | { | ||
| 140 | return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT; | ||
| 141 | } | ||
| 142 | |||
| 138 | #define pte_page(pte) pfn_to_page(pte_pfn(pte)) | 143 | #define pte_page(pte) pfn_to_page(pte_pfn(pte)) |
| 139 | 144 | ||
| 140 | static inline int pmd_large(pmd_t pte) | 145 | static inline int pmd_large(pmd_t pte) |
| @@ -359,7 +364,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd) | |||
| 359 | * this macro returns the index of the entry in the pmd page which would | 364 | * this macro returns the index of the entry in the pmd page which would |
| 360 | * control the given virtual address | 365 | * control the given virtual address |
| 361 | */ | 366 | */ |
| 362 | static inline unsigned pmd_index(unsigned long address) | 367 | static inline unsigned long pmd_index(unsigned long address) |
| 363 | { | 368 | { |
| 364 | return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); | 369 | return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); |
| 365 | } | 370 | } |
| @@ -379,7 +384,7 @@ static inline unsigned pmd_index(unsigned long address) | |||
| 379 | * this function returns the index of the entry in the pte page which would | 384 | * this function returns the index of the entry in the pte page which would |
| 380 | * control the given virtual address | 385 | * control the given virtual address |
| 381 | */ | 386 | */ |
| 382 | static inline unsigned pte_index(unsigned long address) | 387 | static inline unsigned long pte_index(unsigned long address) |
| 383 | { | 388 | { |
| 384 | return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); | 389 | return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); |
| 385 | } | 390 | } |
| @@ -430,11 +435,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) | |||
| 430 | return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address); | 435 | return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address); |
| 431 | } | 436 | } |
| 432 | 437 | ||
| 433 | static inline unsigned long pmd_pfn(pmd_t pmd) | ||
| 434 | { | ||
| 435 | return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT; | ||
| 436 | } | ||
| 437 | |||
| 438 | static inline int pud_large(pud_t pud) | 438 | static inline int pud_large(pud_t pud) |
| 439 | { | 439 | { |
| 440 | return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) == | 440 | return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) == |
| @@ -470,7 +470,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd) | |||
| 470 | #define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT) | 470 | #define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT) |
| 471 | 471 | ||
| 472 | /* to find an entry in a page-table-directory. */ | 472 | /* to find an entry in a page-table-directory. */ |
| 473 | static inline unsigned pud_index(unsigned long address) | 473 | static inline unsigned long pud_index(unsigned long address) |
| 474 | { | 474 | { |
| 475 | return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1); | 475 | return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1); |
| 476 | } | 476 | } |
