diff options
author | Franck Bui-Huu <vagabon.xyz@gmail.com> | 2006-10-19 07:19:59 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-11-29 20:14:40 -0500 |
commit | 99e3b942c62f42c8d5added63305e12372b06daf (patch) | |
tree | 53878461941bf05a4c17653ddfc40362cfcb9738 /include/asm-mips/page.h | |
parent | 0215ffb08ce99e2bb59eca114a99499a4d06e704 (diff) |
[MIPS] page.h: remove __pa() usages.
__pa() was used by virt_to_page() and virt_addr_valid(). These
latter are used when kernel is initialised so __pa() is not
appropriate, we use virt_to_phys() instead.
Futhermore __pa() is going to take care of CKSEG0/XKPHYS
address mix for 64 bit kernels. This makes __pa() more complex
than virt_to_phys() and this extra work is not needed by
virt_to_page() and virt_addr_valid().
Eventually it consolidates virt_to_phys() prototype by making
its argument 'const'. this avoids some warnings that was due
to some virt_to_page() usages which pass const pointer.
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/page.h')
-rw-r--r-- | include/asm-mips/page.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 85b258ee7090..edb33a14ae9e 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -34,7 +34,9 @@ | |||
34 | 34 | ||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | 36 | ||
37 | #include <linux/pfn.h> | ||
37 | #include <asm/cpu-features.h> | 38 | #include <asm/cpu-features.h> |
39 | #include <asm/io.h> | ||
38 | 40 | ||
39 | extern void clear_page(void * page); | 41 | extern void clear_page(void * page); |
40 | extern void copy_page(void * to, void * from); | 42 | extern void copy_page(void * to, void * from); |
@@ -160,8 +162,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
160 | 162 | ||
161 | #endif | 163 | #endif |
162 | 164 | ||
163 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 165 | #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) |
164 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 166 | #define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr))) |
165 | 167 | ||
166 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 168 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
167 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 169 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |