aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-04-22 01:28:48 -0400
committerMichal Simek <monstr@monstr.eu>2010-05-06 05:21:58 -0400
commit43f2a6e8b122378b9ad20cd8ea449cdb38f5d829 (patch)
tree4dc5783b8c59f45d783db6fee994282bbe9b6b0d /arch
parent21e1c93631e027136ea4070e7bca600c4ad4f391 (diff)
microblaze: Remove "cache" optimized copy_page function
Current implementation doesn't handle dcache_line_length correctly that's why is better to use generic memcpy. Cache optimized function could be good way howto improve performance but must be based on benchmarking not blind function like this. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/include/asm/page.h4
-rw-r--r--arch/microblaze/kernel/asm-offsets.c1
-rw-r--r--arch/microblaze/kernel/misc.S36
3 files changed, 2 insertions, 39 deletions
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
index 2dd1d04129e0..7b9ba8f145ea 100644
--- a/arch/microblaze/include/asm/page.h
+++ b/arch/microblaze/include/asm/page.h
@@ -71,13 +71,11 @@ typedef unsigned long pte_basic_t;
71#endif /* CONFIG_MMU */ 71#endif /* CONFIG_MMU */
72 72
73# ifndef CONFIG_MMU 73# ifndef CONFIG_MMU
74# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
75# define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 74# define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
76# define free_user_page(page, addr) free_page(addr) 75# define free_user_page(page, addr) free_page(addr)
77# else /* CONFIG_MMU */
78extern void copy_page(void *to, void *from);
79# endif /* CONFIG_MMU */ 76# endif /* CONFIG_MMU */
80 77
78# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
81# define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE) 79# define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE)
82 80
83# define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE) 81# define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE)
diff --git a/arch/microblaze/kernel/asm-offsets.c b/arch/microblaze/kernel/asm-offsets.c
index 0071260a672c..c1b459c97571 100644
--- a/arch/microblaze/kernel/asm-offsets.c
+++ b/arch/microblaze/kernel/asm-offsets.c
@@ -16,6 +16,7 @@
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/thread_info.h> 17#include <linux/thread_info.h>
18#include <linux/kbuild.h> 18#include <linux/kbuild.h>
19#include <asm/cpuinfo.h>
19 20
20int main(int argc, char *argv[]) 21int main(int argc, char *argv[])
21{ 22{
diff --git a/arch/microblaze/kernel/misc.S b/arch/microblaze/kernel/misc.S
index 7cf86498326c..0fb5fc6c1fc2 100644
--- a/arch/microblaze/kernel/misc.S
+++ b/arch/microblaze/kernel/misc.S
@@ -93,39 +93,3 @@ early_console_reg_tlb_alloc:
93 nop 93 nop
94 94
95 .size early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc 95 .size early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc
96
97/*
98 * Copy a whole page (4096 bytes).
99 */
100#define COPY_16_BYTES \
101 lwi r7, r6, 0; \
102 lwi r8, r6, 4; \
103 lwi r9, r6, 8; \
104 lwi r10, r6, 12; \
105 swi r7, r5, 0; \
106 swi r8, r5, 4; \
107 swi r9, r5, 8; \
108 swi r10, r5, 12
109
110
111/* FIXME DCACHE_LINE_BYTES (CONFIG_XILINX_MICROBLAZE0_DCACHE_LINE_LEN * 4)*/
112#define DCACHE_LINE_BYTES (4 * 4)
113
114.globl copy_page;
115.type copy_page, @function
116.align 4;
117copy_page:
118 ori r11, r0, (PAGE_SIZE/DCACHE_LINE_BYTES) - 1
119_copy_page_loop:
120 COPY_16_BYTES
121#if DCACHE_LINE_BYTES >= 32
122 COPY_16_BYTES
123#endif
124 addik r6, r6, DCACHE_LINE_BYTES
125 addik r5, r5, DCACHE_LINE_BYTES
126 bneid r11, _copy_page_loop
127 addik r11, r11, -1
128 rtsd r15, 8
129 nop
130
131 .size copy_page, . - copy_page