aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-05-08 17:18:38 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-19 00:30:42 -0400
commitd988f0e3f84cb8a4f85ccdbca6f6fefcc37bedcb (patch)
tree60feffdec36d0a484b0d8d7d8dbdf5baf73aea7e /arch/powerpc
parent37e0c21e9b5b6d6fd38a444762076c84c6170598 (diff)
powerpc: Simplify 4k/64k copy_page logic
To make it easier to add optimised versions of copy_page, remove the 4kB loop for 64kB pages and just do all the work in copy_page. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/page_64.h19
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c5
-rw-r--r--arch/powerpc/lib/copypage_64.S7
3 files changed, 6 insertions, 25 deletions
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index 488c52eb64cb..9356262fd3cc 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -59,24 +59,7 @@ static __inline__ void clear_page(void *addr)
59 : "ctr", "memory"); 59 : "ctr", "memory");
60} 60}
61 61
62extern void copy_4K_page(void *to, void *from); 62extern void copy_page(void *to, void *from);
63
64#ifdef CONFIG_PPC_64K_PAGES
65static inline void copy_page(void *to, void *from)
66{
67 unsigned int i;
68 for (i=0; i < (1 << (PAGE_SHIFT - 12)); i++) {
69 copy_4K_page(to, from);
70 to += 4096;
71 from += 4096;
72 }
73}
74#else /* CONFIG_PPC_64K_PAGES */
75static inline void copy_page(void *to, void *from)
76{
77 copy_4K_page(to, from);
78}
79#endif /* CONFIG_PPC_64K_PAGES */
80 63
81/* Log 2 of page table size */ 64/* Log 2 of page table size */
82extern u64 ppc64_pft_size; 65extern u64 ppc64_pft_size;
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index ef3ef566235e..7d28f540200c 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -54,7 +54,6 @@ extern void single_step_exception(struct pt_regs *regs);
54extern int sys_sigreturn(struct pt_regs *regs); 54extern int sys_sigreturn(struct pt_regs *regs);
55 55
56EXPORT_SYMBOL(clear_pages); 56EXPORT_SYMBOL(clear_pages);
57EXPORT_SYMBOL(copy_page);
58EXPORT_SYMBOL(ISA_DMA_THRESHOLD); 57EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
59EXPORT_SYMBOL(DMA_MODE_READ); 58EXPORT_SYMBOL(DMA_MODE_READ);
60EXPORT_SYMBOL(DMA_MODE_WRITE); 59EXPORT_SYMBOL(DMA_MODE_WRITE);
@@ -88,9 +87,7 @@ EXPORT_SYMBOL(__copy_tofrom_user);
88EXPORT_SYMBOL(__clear_user); 87EXPORT_SYMBOL(__clear_user);
89EXPORT_SYMBOL(__strncpy_from_user); 88EXPORT_SYMBOL(__strncpy_from_user);
90EXPORT_SYMBOL(__strnlen_user); 89EXPORT_SYMBOL(__strnlen_user);
91#ifdef CONFIG_PPC64 90EXPORT_SYMBOL(copy_page);
92EXPORT_SYMBOL(copy_4K_page);
93#endif
94 91
95#if defined(CONFIG_PCI) && defined(CONFIG_PPC32) 92#if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
96EXPORT_SYMBOL(isa_io_base); 93EXPORT_SYMBOL(isa_io_base);
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S
index 4d4eeb900486..53dcb6b1b708 100644
--- a/arch/powerpc/lib/copypage_64.S
+++ b/arch/powerpc/lib/copypage_64.S
@@ -6,6 +6,7 @@
6 * as published by the Free Software Foundation; either version 6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version. 7 * 2 of the License, or (at your option) any later version.
8 */ 8 */
9#include <asm/page.h>
9#include <asm/processor.h> 10#include <asm/processor.h>
10#include <asm/ppc_asm.h> 11#include <asm/ppc_asm.h>
11#include <asm/asm-offsets.h> 12#include <asm/asm-offsets.h>
@@ -15,9 +16,9 @@ PPC64_CACHES:
15 .tc ppc64_caches[TC],ppc64_caches 16 .tc ppc64_caches[TC],ppc64_caches
16 .section ".text" 17 .section ".text"
17 18
18 19_GLOBAL(copy_page)
19_GLOBAL(copy_4K_page) 20 lis r5,PAGE_SIZE@h
20 li r5,4096 /* 4K page size */ 21 ori r5,r5,PAGE_SIZE@l
21BEGIN_FTR_SECTION 22BEGIN_FTR_SECTION
22 ld r10,PPC64_CACHES@toc(r2) 23 ld r10,PPC64_CACHES@toc(r2)
23 lwz r11,DCACHEL1LOGLINESIZE(r10) /* log2 of cache line size */ 24 lwz r11,DCACHEL1LOGLINESIZE(r10) /* log2 of cache line size */