]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/powerpc/lib/copypage_64.S
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[mirror_ubuntu-bionic-kernel.git] / arch / powerpc / lib / copypage_64.S
CommitLineData
14cf11af 1/*
57dda6ef 2 * Copyright (C) 2008 Mark Nelson, IBM Corp.
14cf11af
PM
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
d988f0e3 9#include <asm/page.h>
14cf11af
PM
10#include <asm/processor.h>
11#include <asm/ppc_asm.h>
57dda6ef 12#include <asm/asm-offsets.h>
9445aa1a 13#include <asm/export.h>
57dda6ef
MN
14
15 .section ".toc","aw"
16PPC64_CACHES:
17 .tc ppc64_caches[TC],ppc64_caches
18 .section ".text"
19
2ac7b016 20_GLOBAL_TOC(copy_page)
fde69282 21BEGIN_FTR_SECTION
d988f0e3 22 lis r5,PAGE_SIZE@h
fde69282 23FTR_SECTION_ELSE
b1576fec 24 b copypage_power7
fde69282 25ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY)
d988f0e3 26 ori r5,r5,PAGE_SIZE@l
57dda6ef
MN
27BEGIN_FTR_SECTION
28 ld r10,PPC64_CACHES@toc(r2)
bd067f83
BH
29 lwz r11,DCACHEL1LOGBLOCKSIZE(r10) /* log2 of cache block size */
30 lwz r12,DCACHEL1BLOCKSIZE(r10) /* get cache block size */
57dda6ef
MN
31 li r9,0
32 srd r8,r5,r11
33
34 mtctr r8
3cd980db 35.Lsetup:
57dda6ef
MN
36 dcbt r9,r4
37 dcbz r9,r3
38 add r9,r9,r12
3cd980db 39 bdnz .Lsetup
57dda6ef 40END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ)
14cf11af 41 addi r3,r3,-8
57dda6ef
MN
42 srdi r8,r5,7 /* page is copied in 128 byte strides */
43 addi r8,r8,-1 /* one stride copied outside loop */
44
45 mtctr r8
46
47 ld r5,0(r4)
48 ld r6,8(r4)
49 ld r7,16(r4)
50 ldu r8,24(r4)
511: std r5,8(r3)
57dda6ef 52 std r6,16(r3)
63e6c5b8 53 ld r9,8(r4)
57dda6ef
MN
54 ld r10,16(r4)
55 std r7,24(r3)
57dda6ef 56 std r8,32(r3)
63e6c5b8 57 ld r11,24(r4)
57dda6ef
MN
58 ld r12,32(r4)
59 std r9,40(r3)
57dda6ef 60 std r10,48(r3)
63e6c5b8 61 ld r5,40(r4)
57dda6ef
MN
62 ld r6,48(r4)
63 std r11,56(r3)
57dda6ef 64 std r12,64(r3)
63e6c5b8 65 ld r7,56(r4)
57dda6ef
MN
66 ld r8,64(r4)
67 std r5,72(r3)
57dda6ef 68 std r6,80(r3)
63e6c5b8 69 ld r9,72(r4)
57dda6ef
MN
70 ld r10,80(r4)
71 std r7,88(r3)
57dda6ef 72 std r8,96(r3)
63e6c5b8 73 ld r11,88(r4)
57dda6ef
MN
74 ld r12,96(r4)
75 std r9,104(r3)
57dda6ef 76 std r10,112(r3)
63e6c5b8 77 ld r5,104(r4)
57dda6ef
MN
78 ld r6,112(r4)
79 std r11,120(r3)
57dda6ef 80 stdu r12,128(r3)
63e6c5b8 81 ld r7,120(r4)
57dda6ef 82 ldu r8,128(r4)
14cf11af 83 bdnz 1b
57dda6ef
MN
84
85 std r5,8(r3)
57dda6ef 86 std r6,16(r3)
63e6c5b8 87 ld r9,8(r4)
57dda6ef
MN
88 ld r10,16(r4)
89 std r7,24(r3)
57dda6ef 90 std r8,32(r3)
63e6c5b8 91 ld r11,24(r4)
57dda6ef
MN
92 ld r12,32(r4)
93 std r9,40(r3)
57dda6ef 94 std r10,48(r3)
63e6c5b8 95 ld r5,40(r4)
57dda6ef
MN
96 ld r6,48(r4)
97 std r11,56(r3)
57dda6ef 98 std r12,64(r3)
63e6c5b8 99 ld r7,56(r4)
57dda6ef
MN
100 ld r8,64(r4)
101 std r5,72(r3)
57dda6ef 102 std r6,80(r3)
63e6c5b8 103 ld r9,72(r4)
57dda6ef
MN
104 ld r10,80(r4)
105 std r7,88(r3)
57dda6ef 106 std r8,96(r3)
63e6c5b8 107 ld r11,88(r4)
57dda6ef
MN
108 ld r12,96(r4)
109 std r9,104(r3)
110 std r10,112(r3)
111 std r11,120(r3)
112 std r12,128(r3)
14cf11af 113 blr
9445aa1a 114EXPORT_SYMBOL(copy_page)