提交 43f2a6e8 编写于 作者: M Michal Simek

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: NMichal Simek <monstr@monstr.eu>
上级 21e1c936
...@@ -71,13 +71,11 @@ typedef unsigned long pte_basic_t; ...@@ -71,13 +71,11 @@ typedef unsigned long pte_basic_t;
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
# ifndef CONFIG_MMU # ifndef CONFIG_MMU
# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
# define get_user_page(vaddr) __get_free_page(GFP_KERNEL) # define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
# define free_user_page(page, addr) free_page(addr) # define free_user_page(page, addr) free_page(addr)
# else /* CONFIG_MMU */
extern void copy_page(void *to, void *from);
# endif /* CONFIG_MMU */ # endif /* CONFIG_MMU */
# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
# define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE) # define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE)
# define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE) # define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/hardirq.h> #include <linux/hardirq.h>
#include <linux/thread_info.h> #include <linux/thread_info.h>
#include <linux/kbuild.h> #include <linux/kbuild.h>
#include <asm/cpuinfo.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
......
...@@ -93,39 +93,3 @@ early_console_reg_tlb_alloc: ...@@ -93,39 +93,3 @@ early_console_reg_tlb_alloc:
nop nop
.size early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc .size early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc
/*
* Copy a whole page (4096 bytes).
*/
#define COPY_16_BYTES \
lwi r7, r6, 0; \
lwi r8, r6, 4; \
lwi r9, r6, 8; \
lwi r10, r6, 12; \
swi r7, r5, 0; \
swi r8, r5, 4; \
swi r9, r5, 8; \
swi r10, r5, 12
/* FIXME DCACHE_LINE_BYTES (CONFIG_XILINX_MICROBLAZE0_DCACHE_LINE_LEN * 4)*/
#define DCACHE_LINE_BYTES (4 * 4)
.globl copy_page;
.type copy_page, @function
.align 4;
copy_page:
ori r11, r0, (PAGE_SIZE/DCACHE_LINE_BYTES) - 1
_copy_page_loop:
COPY_16_BYTES
#if DCACHE_LINE_BYTES >= 32
COPY_16_BYTES
#endif
addik r6, r6, DCACHE_LINE_BYTES
addik r5, r5, DCACHE_LINE_BYTES
bneid r11, _copy_page_loop
addik r11, r11, -1
rtsd r15, 8
nop
.size copy_page, . - copy_page
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册