2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 * Copyright (C) IBM Corporation, 2012
18 * Author: Anton Blanchard <anton@au.ibm.com>
21 #include <asm/ppc_asm.h>
23 #define STACKFRAMESIZE 256
24 #define STK_REG(i) (112 + ((i)-14)*8)
26 _GLOBAL(copypage_power7)
28 * We prefetch both the source and destination using enhanced touch
29 * instructions. We use a stream ID of 0 for the load side and
30 * 1 for the store side. Since source and destination are page
31 * aligned we don't need to clear the bottom 7 bits of either
34 ori r9,r3,1 /* stream=1 */
36 #ifdef CONFIG_PPC_64K_PAGES
37 lis r7,0x0E01 /* depth=7, units=512 */
39 lis r7,0x0E00 /* depth=7 */
40 ori r7,r7,0x1000 /* units=32 */
42 ori r10,r7,1 /* stream=1 */
44 lis r8,0x8000 /* GO=1 */
54 dcbt r0,r8,0b01010 /* GO */
62 stdu r1,-STACKFRAMESIZE(r1)
65 ld r0,STACKFRAMESIZE+16(r1)
66 ld r3,STACKFRAMESIZE+48(r1)
67 ld r4,STACKFRAMESIZE+56(r1)
75 addi r1,r1,STACKFRAMESIZE
106 b .exit_vmx_copy /* tail call optimise */
109 li r0,(PAGE_SIZE/128)
112 stdu r1,-STACKFRAMESIZE(r1)
116 std r14,STK_REG(R14)(r1)
117 std r15,STK_REG(R15)(r1)
118 std r16,STK_REG(R16)(r1)
119 std r17,STK_REG(R17)(r1)
120 std r18,STK_REG(R18)(r1)
121 std r19,STK_REG(R19)(r1)
122 std r20,STK_REG(R20)(r1)
160 ld r14,STK_REG(R14)(r1)
161 ld r15,STK_REG(R15)(r1)
162 ld r16,STK_REG(R16)(r1)
163 ld r17,STK_REG(R17)(r1)
164 ld r18,STK_REG(R18)(r1)
165 ld r19,STK_REG(R19)(r1)
166 ld r20,STK_REG(R20)(r1)
167 addi r1,r1,STACKFRAMESIZE