powerpc: Rename copyuser_power7_vmx.c to vmx-helper.c
[linux-2.6-block.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
MN
12#include <asm/asm-offsets.h>
13
14 .section ".toc","aw"
15PPC64_CACHES:
16 .tc ppc64_caches[TC],ppc64_caches
17 .section ".text"
18
d988f0e3
AB
19_GLOBAL(copy_page)
20 lis r5,PAGE_SIZE@h
21 ori r5,r5,PAGE_SIZE@l
57dda6ef
MN
22BEGIN_FTR_SECTION
23 ld r10,PPC64_CACHES@toc(r2)
24 lwz r11,DCACHEL1LOGLINESIZE(r10) /* log2 of cache line size */
25 lwz r12,DCACHEL1LINESIZE(r10) /* get cache line size */
26 li r9,0
27 srd r8,r5,r11
28
29 mtctr r8
3cd980db 30.Lsetup:
57dda6ef
MN
31 dcbt r9,r4
32 dcbz r9,r3
33 add r9,r9,r12
3cd980db 34 bdnz .Lsetup
57dda6ef 35END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ)
14cf11af 36 addi r3,r3,-8
57dda6ef
MN
37 srdi r8,r5,7 /* page is copied in 128 byte strides */
38 addi r8,r8,-1 /* one stride copied outside loop */
39
40 mtctr r8
41
42 ld r5,0(r4)
43 ld r6,8(r4)
44 ld r7,16(r4)
45 ldu r8,24(r4)
461: std r5,8(r3)
57dda6ef 47 std r6,16(r3)
63e6c5b8 48 ld r9,8(r4)
57dda6ef
MN
49 ld r10,16(r4)
50 std r7,24(r3)
57dda6ef 51 std r8,32(r3)
63e6c5b8 52 ld r11,24(r4)
57dda6ef
MN
53 ld r12,32(r4)
54 std r9,40(r3)
57dda6ef 55 std r10,48(r3)
63e6c5b8 56 ld r5,40(r4)
57dda6ef
MN
57 ld r6,48(r4)
58 std r11,56(r3)
57dda6ef 59 std r12,64(r3)
63e6c5b8 60 ld r7,56(r4)
57dda6ef
MN
61 ld r8,64(r4)
62 std r5,72(r3)
57dda6ef 63 std r6,80(r3)
63e6c5b8 64 ld r9,72(r4)
57dda6ef
MN
65 ld r10,80(r4)
66 std r7,88(r3)
57dda6ef 67 std r8,96(r3)
63e6c5b8 68 ld r11,88(r4)
57dda6ef
MN
69 ld r12,96(r4)
70 std r9,104(r3)
57dda6ef 71 std r10,112(r3)
63e6c5b8 72 ld r5,104(r4)
57dda6ef
MN
73 ld r6,112(r4)
74 std r11,120(r3)
57dda6ef 75 stdu r12,128(r3)
63e6c5b8 76 ld r7,120(r4)
57dda6ef 77 ldu r8,128(r4)
14cf11af 78 bdnz 1b
57dda6ef
MN
79
80 std r5,8(r3)
57dda6ef 81 std r6,16(r3)
63e6c5b8 82 ld r9,8(r4)
57dda6ef
MN
83 ld r10,16(r4)
84 std r7,24(r3)
57dda6ef 85 std r8,32(r3)
63e6c5b8 86 ld r11,24(r4)
57dda6ef
MN
87 ld r12,32(r4)
88 std r9,40(r3)
57dda6ef 89 std r10,48(r3)
63e6c5b8 90 ld r5,40(r4)
57dda6ef
MN
91 ld r6,48(r4)
92 std r11,56(r3)
57dda6ef 93 std r12,64(r3)
63e6c5b8 94 ld r7,56(r4)
57dda6ef
MN
95 ld r8,64(r4)
96 std r5,72(r3)
57dda6ef 97 std r6,80(r3)
63e6c5b8 98 ld r9,72(r4)
57dda6ef
MN
99 ld r10,80(r4)
100 std r7,88(r3)
57dda6ef 101 std r8,96(r3)
63e6c5b8 102 ld r11,88(r4)
57dda6ef
MN
103 ld r12,96(r4)
104 std r9,104(r3)
105 std r10,112(r3)
106 std r11,120(r3)
107 std r12,128(r3)
14cf11af 108 blr