diff options
| author | Anton Blanchard <anton@samba.org> | 2011-05-08 17:18:38 -0400 |
|---|---|---|
| committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-05-19 00:30:42 -0400 |
| commit | d988f0e3f84cb8a4f85ccdbca6f6fefcc37bedcb (patch) | |
| tree | 60feffdec36d0a484b0d8d7d8dbdf5baf73aea7e | |
| parent | 37e0c21e9b5b6d6fd38a444762076c84c6170598 (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>
| -rw-r--r-- | arch/powerpc/include/asm/page_64.h | 19 | ||||
| -rw-r--r-- | arch/powerpc/kernel/ppc_ksyms.c | 5 | ||||
| -rw-r--r-- | arch/powerpc/lib/copypage_64.S | 7 |
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 | ||
| 62 | extern void copy_4K_page(void *to, void *from); | 62 | extern void copy_page(void *to, void *from); |
| 63 | |||
| 64 | #ifdef CONFIG_PPC_64K_PAGES | ||
| 65 | static 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 */ | ||
| 75 | static 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 */ |
| 82 | extern u64 ppc64_pft_size; | 65 | extern 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); | |||
| 54 | extern int sys_sigreturn(struct pt_regs *regs); | 54 | extern int sys_sigreturn(struct pt_regs *regs); |
| 55 | 55 | ||
| 56 | EXPORT_SYMBOL(clear_pages); | 56 | EXPORT_SYMBOL(clear_pages); |
| 57 | EXPORT_SYMBOL(copy_page); | ||
| 58 | EXPORT_SYMBOL(ISA_DMA_THRESHOLD); | 57 | EXPORT_SYMBOL(ISA_DMA_THRESHOLD); |
| 59 | EXPORT_SYMBOL(DMA_MODE_READ); | 58 | EXPORT_SYMBOL(DMA_MODE_READ); |
| 60 | EXPORT_SYMBOL(DMA_MODE_WRITE); | 59 | EXPORT_SYMBOL(DMA_MODE_WRITE); |
| @@ -88,9 +87,7 @@ EXPORT_SYMBOL(__copy_tofrom_user); | |||
| 88 | EXPORT_SYMBOL(__clear_user); | 87 | EXPORT_SYMBOL(__clear_user); |
| 89 | EXPORT_SYMBOL(__strncpy_from_user); | 88 | EXPORT_SYMBOL(__strncpy_from_user); |
| 90 | EXPORT_SYMBOL(__strnlen_user); | 89 | EXPORT_SYMBOL(__strnlen_user); |
| 91 | #ifdef CONFIG_PPC64 | 90 | EXPORT_SYMBOL(copy_page); |
| 92 | EXPORT_SYMBOL(copy_4K_page); | ||
| 93 | #endif | ||
| 94 | 91 | ||
| 95 | #if defined(CONFIG_PCI) && defined(CONFIG_PPC32) | 92 | #if defined(CONFIG_PCI) && defined(CONFIG_PPC32) |
| 96 | EXPORT_SYMBOL(isa_io_base); | 93 | EXPORT_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 |
| 21 | BEGIN_FTR_SECTION | 22 | BEGIN_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 */ |
