aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390
diff options
context:
space:
mode:
authorDave McCracken <dmccr@us.ibm.com>2006-09-26 02:31:48 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:51 -0400
commit46a82b2d5591335277ed2930611f6acb4ce654ed (patch)
treee90bc1843701af2012bae92564f7109027a8244f /include/asm-s390
parentd2e7b7d0aa021847c59f882b066e7d3812902870 (diff)
[PATCH] Standardize pxx_page macros
One of the changes necessary for shared page tables is to standardize the pxx_page macros. pte_page and pmd_page have always returned the struct page associated with their entry, while pte_page_kernel and pmd_page_kernel have returned the kernel virtual address. pud_page and pgd_page, on the other hand, return the kernel virtual address. Shared page tables needs pud_page and pgd_page to return the actual page structures. There are very few actual users of these functions, so it is simple to standardize their usage. Since this is basic cleanup, I am submitting these changes as a standalone patch. Per Hugh Dickins' comments about it, I am also changing the pxx_page_kernel macros to pxx_page_vaddr to clarify their meaning. Signed-off-by: Dave McCracken <dmccr@us.ibm.com> Cc: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/pgtable.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 1a07028d575..e965309feda 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -664,11 +664,13 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
664#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) 664#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
665#define pte_page(x) pfn_to_page(pte_pfn(x)) 665#define pte_page(x) pfn_to_page(pte_pfn(x))
666 666
667#define pmd_page_kernel(pmd) (pmd_val(pmd) & PAGE_MASK) 667#define pmd_page_vaddr(pmd) (pmd_val(pmd) & PAGE_MASK)
668 668
669#define pmd_page(pmd) (mem_map+(pmd_val(pmd) >> PAGE_SHIFT)) 669#define pmd_page(pmd) (mem_map+(pmd_val(pmd) >> PAGE_SHIFT))
670 670
671#define pgd_page_kernel(pgd) (pgd_val(pgd) & PAGE_MASK) 671#define pgd_page_vaddr(pgd) (pgd_val(pgd) & PAGE_MASK)
672
673#define pgd_page(pgd) (mem_map+(pgd_val(pgd) >> PAGE_SHIFT))
672 674
673/* to find an entry in a page-table-directory */ 675/* to find an entry in a page-table-directory */
674#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 676#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
@@ -690,14 +692,14 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
690/* Find an entry in the second-level page table.. */ 692/* Find an entry in the second-level page table.. */
691#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) 693#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
692#define pmd_offset(dir,addr) \ 694#define pmd_offset(dir,addr) \
693 ((pmd_t *) pgd_page_kernel(*(dir)) + pmd_index(addr)) 695 ((pmd_t *) pgd_page_vaddr(*(dir)) + pmd_index(addr))
694 696
695#endif /* __s390x__ */ 697#endif /* __s390x__ */
696 698
697/* Find an entry in the third-level page table.. */ 699/* Find an entry in the third-level page table.. */
698#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1)) 700#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
699#define pte_offset_kernel(pmd, address) \ 701#define pte_offset_kernel(pmd, address) \
700 ((pte_t *) pmd_page_kernel(*(pmd)) + pte_index(address)) 702 ((pte_t *) pmd_page_vaddr(*(pmd)) + pte_index(address))
701#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address) 703#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
702#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address) 704#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
703#define pte_unmap(pte) do { } while (0) 705#define pte_unmap(pte) do { } while (0)