1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) IBM Corporation, 2012
6 * Author: Anton Blanchard <anton@au.ibm.com>
9 #include <asm/ppc_asm.h>
11 _GLOBAL(copypage_power7)
13 * We prefetch both the source and destination using enhanced touch
14 * instructions. We use a stream ID of 0 for the load side and
15 * 1 for the store side. Since source and destination are page
16 * aligned we don't need to clear the bottom 7 bits of either
19 ori r9,r3,1 /* stream=1 => to */
21 #ifdef CONFIG_PPC_64K_PAGES
22 lis r7,0x0E01 /* depth=7
23 * units/cachelines=512 */
25 lis r7,0x0E00 /* depth=7 */
26 ori r7,r7,0x1000 /* units/cachelines=32 */
28 ori r10,r7,1 /* stream=1 */
30 lis r8,0x8000 /* GO=1 */
33 /* setup read stream 0 */
34 dcbt 0,r4,0b01000 /* addr from */
35 dcbt 0,r7,0b01010 /* length and depth from */
36 /* setup write stream 1 */
37 dcbtst 0,r9,0b01000 /* addr to */
38 dcbtst 0,r10,0b01010 /* length and depth to */
40 dcbt 0,r8,0b01010 /* all streams GO */
44 std r3,-STACKFRAMESIZE+STK_REG(R31)(r1)
45 std r4,-STACKFRAMESIZE+STK_REG(R30)(r1)
47 stdu r1,-STACKFRAMESIZE(r1)
50 ld r0,STACKFRAMESIZE+16(r1)
51 ld r3,STK_REG(R31)(r1)
52 ld r4,STK_REG(R30)(r1)
60 addi r1,r1,STACKFRAMESIZE
91 b exit_vmx_ops /* tail call optimise */
97 stdu r1,-STACKFRAMESIZE(r1)
101 std r14,STK_REG(R14)(r1)
102 std r15,STK_REG(R15)(r1)
103 std r16,STK_REG(R16)(r1)
104 std r17,STK_REG(R17)(r1)
105 std r18,STK_REG(R18)(r1)
106 std r19,STK_REG(R19)(r1)
107 std r20,STK_REG(R20)(r1)
145 ld r14,STK_REG(R14)(r1)
146 ld r15,STK_REG(R15)(r1)
147 ld r16,STK_REG(R16)(r1)
148 ld r17,STK_REG(R17)(r1)
149 ld r18,STK_REG(R18)(r1)
150 ld r19,STK_REG(R19)(r1)
151 ld r20,STK_REG(R20)(r1)
152 addi r1,r1,STACKFRAMESIZE