diff options
author | Dave McCracken <dmccr@us.ibm.com> | 2006-09-26 02:31:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:51 -0400 |
commit | 46a82b2d5591335277ed2930611f6acb4ce654ed (patch) | |
tree | e90bc1843701af2012bae92564f7109027a8244f /include/asm-ppc/pgtable.h | |
parent | d2e7b7d0aa021847c59f882b066e7d3812902870 (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-ppc/pgtable.h')
-rw-r--r-- | include/asm-ppc/pgtable.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 51fa7c662917..b1fdbf40dba2 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -526,7 +526,7 @@ static inline int pgd_bad(pgd_t pgd) { return 0; } | |||
526 | static inline int pgd_present(pgd_t pgd) { return 1; } | 526 | static inline int pgd_present(pgd_t pgd) { return 1; } |
527 | #define pgd_clear(xp) do { } while (0) | 527 | #define pgd_clear(xp) do { } while (0) |
528 | 528 | ||
529 | #define pgd_page(pgd) \ | 529 | #define pgd_page_vaddr(pgd) \ |
530 | ((unsigned long) __va(pgd_val(pgd) & PAGE_MASK)) | 530 | ((unsigned long) __va(pgd_val(pgd) & PAGE_MASK)) |
531 | 531 | ||
532 | /* | 532 | /* |
@@ -720,12 +720,12 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | |||
720 | * of the pte page. -- paulus | 720 | * of the pte page. -- paulus |
721 | */ | 721 | */ |
722 | #ifndef CONFIG_BOOKE | 722 | #ifndef CONFIG_BOOKE |
723 | #define pmd_page_kernel(pmd) \ | 723 | #define pmd_page_vaddr(pmd) \ |
724 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | 724 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) |
725 | #define pmd_page(pmd) \ | 725 | #define pmd_page(pmd) \ |
726 | (mem_map + (pmd_val(pmd) >> PAGE_SHIFT)) | 726 | (mem_map + (pmd_val(pmd) >> PAGE_SHIFT)) |
727 | #else | 727 | #else |
728 | #define pmd_page_kernel(pmd) \ | 728 | #define pmd_page_vaddr(pmd) \ |
729 | ((unsigned long) (pmd_val(pmd) & PAGE_MASK)) | 729 | ((unsigned long) (pmd_val(pmd) & PAGE_MASK)) |
730 | #define pmd_page(pmd) \ | 730 | #define pmd_page(pmd) \ |
731 | (mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT)) | 731 | (mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT)) |
@@ -748,7 +748,7 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) | |||
748 | #define pte_index(address) \ | 748 | #define pte_index(address) \ |
749 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | 749 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) |
750 | #define pte_offset_kernel(dir, addr) \ | 750 | #define pte_offset_kernel(dir, addr) \ |
751 | ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(addr)) | 751 | ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr)) |
752 | #define pte_offset_map(dir, addr) \ | 752 | #define pte_offset_map(dir, addr) \ |
753 | ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr)) | 753 | ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr)) |
754 | #define pte_offset_map_nested(dir, addr) \ | 754 | #define pte_offset_map_nested(dir, addr) \ |