GNU Linux-libre 5.4.274-gnu1
[releases.git] / arch / unicore32 / lib / copy_page.S
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * linux/arch/unicore32/lib/copy_page.S
4  *
5  * Code specific to PKUnity SoC and UniCore ISA
6  *
7  * Copyright (C) 2001-2010 GUAN Xue-tao
8  *
9  *  ASM optimised string functions
10  */
11 #include <linux/linkage.h>
12 #include <asm/assembler.h>
13 #include <generated/asm-offsets.h>
14 #include <asm/cache.h>
15
16 #define COPY_COUNT (PAGE_SZ/256)
17
18                 .text
19                 .align  5
20 /*
21  * UniCore optimised copy_page routine
22  */
23 ENTRY(copy_page)
24                 stm.w   (r17 - r19, lr), [sp-]
25                 mov     r17, r0
26                 mov     r18, r1
27                 mov     r19, #COPY_COUNT
28 1:
29         .rept   4
30                 ldm.w   (r0 - r15), [r18]+
31                 stm.w   (r0 - r15), [r17]+
32         .endr
33                 sub.a   r19, r19, #1
34                 bne     1b
35                 ldm.w   (r17 - r19, pc), [sp]+
36 ENDPROC(copy_page)